diff options
author | mongo <andmarti@gmail.com> | 2023-06-01 09:42:53 -0300 |
---|---|---|
committer | mongo <andmarti@gmail.com> | 2023-06-01 09:42:53 -0300 |
commit | 1b31cabf28b3955fa6a127cff0a150c088e8afff (patch) | |
tree | 42cf89fbf8b917bb92ee086f67a240de51eaa34d | |
parent | 0d47acd9d9a70980359cd692f86f6728571da9db (diff) | |
parent | 9da214a7a36393c0342258679690a83f6405a30a (diff) |
Merge branch 'pr-789' into dev
-rwxr-xr-x | src/gram.y | 11 | ||||
-rw-r--r-- | src/lex.c | 26 |
2 files changed, 20 insertions, 17 deletions
@@ -1240,12 +1240,15 @@ command: | // nothing | error { sc_error("syntax error: %s", line); - line[0]='\0'; + YYABORT; + //linelim = 0; //yyparse(); - linelim = -1; - yyclearin; - yyerrok; + + //line[0]='\0'; + //linelim = -1; + //yyclearin; + //yyerrok; }; term: var { @@ -157,23 +157,23 @@ int yylex() { ret = WORD; if (!linelim || isfunc) { if (isfunc) isfunc--; - for (tblp = linelim ? experres : statres; tblp->key; tblp++) - if (((tblp->key[0]^tokenst[0])&0137)==0 - && tblp->key[tokenl]==0) { - int i = 1; - while (i<tokenl && ((tokenst[i]^tblp->key[i])&0137)==0) - i++; - if (i >= tokenl) { - ret = tblp->val; - colstate = (ret <= S_FORMAT); - if (isgoto) { - isfunc = isgoto = 0; - if (ret != K_ERROR && ret != K_INVALID) - ret = WORD; + for (tblp = linelim ? experres : statres; tblp->key; tblp++) { + if (((tblp->key[0]^tokenst[0])&0137)==0) { + int i = 1; + while (tblp->key[i] && i<tokenl && ((tokenst[i]^tblp->key[i])&0137)==0) + i++; + if (i >= tokenl && tblp->key[i] == '\0') { + ret = tblp->val; + colstate = (ret <= S_FORMAT); + if (isgoto) { + isfunc = isgoto = 0; + if (ret != K_ERROR && ret != K_INVALID) + ret = WORD; } break; } } + } } if (ret == WORD) { |