From 583df0c7fa9dd90d02e083f607c2893de153f838 Mon Sep 17 00:00:00 2001 From: claudio Date: Sun, 7 May 2017 22:47:08 -0400 Subject: [PATCH] Fixed bug: RCL on var name from menu in alg mode. Fixed bug: Implicit multiplication w/invalid ident was accepted. Added list support to HIDEVAR/LOCKVAR/UNHIDEVAR/UNLOCKVAR --- firmware/hal_keyboard.c | 8 +++----- newrpl-comp.pro | 3 ++- newrpl/lib-28-dirs.c | 30 +++++++++++++++++++++++++++++- newrpl/lib-two-ident.c | 5 ++++- 4 files changed, 38 insertions(+), 8 deletions(-) diff --git a/firmware/hal_keyboard.c b/firmware/hal_keyboard.c index 8723eb7..1c7a7e7 100644 --- a/firmware/hal_keyboard.c +++ b/firmware/hal_keyboard.c @@ -1299,12 +1299,10 @@ void varsKeyHandler(BINT keymsg,BINT menunum,BINT varnum) } - uiSeparateToken(); - uiInsertCharacters((BYTEPTR)"'"); + + // JUST INSERT THE NAME IN ALGEBRAIC MODE + uiInsertCharactersN((BYTEPTR)(action+1),(BYTEPTR)(action+1)+rplGetIdentLength(action)); - uiInsertCharacters((BYTEPTR)"' RCL"); - uiSeparateToken(); - uiAutocompleteUpdate(); break; case 'P': diff --git a/newrpl-comp.pro b/newrpl-comp.pro index 9f268c4..36cd991 100644 --- a/newrpl-comp.pro +++ b/newrpl-comp.pro @@ -215,7 +215,8 @@ SOURCES += firmware/ggl/ggl/ggl_bitblt.c \ firmware/ui_render.c \ newrpl/lib-88-plot.c \ newrpl/fastmath.c \ - newrpl/render.c + newrpl/render.c \ + newrpl/lib-96-composites.c diff --git a/newrpl/lib-28-dirs.c b/newrpl/lib-28-dirs.c index c21a084..df0e7b0 100644 --- a/newrpl/lib-28-dirs.c +++ b/newrpl/lib-28-dirs.c @@ -1020,6 +1020,14 @@ void LIB_HANDLER() rplError(ERR_BADARGCOUNT); return; } + + + if(ISLIST(*rplPeekData(1))) { + rplListUnaryDoCmd(); + return; + } + + // ONLY ACCEPT IDENTS AS KEYS if(!ISIDENT(*rplPeekData(1))) { @@ -1054,6 +1062,13 @@ void LIB_HANDLER() rplError(ERR_BADARGCOUNT); return; } + if(ISLIST(*rplPeekData(1))) { + rplListUnaryDoCmd(); + return; + } + + + // ONLY ACCEPT IDENTS AS KEYS if(!ISIDENT(*rplPeekData(1))) { @@ -1110,6 +1125,12 @@ void LIB_HANDLER() rplError(ERR_BADARGCOUNT); return; } + + if(ISLIST(*rplPeekData(1))) { + rplListUnaryDoCmd(); + return; + } + // ONLY ACCEPT IDENTS AS KEYS if(!ISIDENT(*rplPeekData(1))) { @@ -1142,6 +1163,13 @@ case UNLOCKVAR: rplError(ERR_BADARGCOUNT); return; } + + + if(ISLIST(*rplPeekData(1))) { + rplListUnaryDoCmd(); + return; + } + // ONLY ACCEPT IDENTS AS KEYS if(!ISIDENT(*rplPeekData(1))) { @@ -1483,7 +1511,7 @@ case UNLOCKVAR: if(ISPROLOG(*DecompileObject)) { rplDecompAppendString2((BYTEPTR)"DIRObject",9); - + RetNum=OK_CONTINUE; return; } diff --git a/newrpl/lib-two-ident.c b/newrpl/lib-two-ident.c index 2902649..ab0ecf8 100644 --- a/newrpl/lib-two-ident.c +++ b/newrpl/lib-two-ident.c @@ -298,7 +298,10 @@ void LIB_HANDLER() } else rplCompileReal(&RReg[0]); tok=((BYTEPTR)TokenStart)+splitoff; - } + } else { + RetNum=ERR_SYNTAX; + return; + } } else {