yet another state machine fix

This commit is contained in:
minjaesong
2020-06-10 01:29:29 +09:00
parent 851ff9c277
commit 1f88a878be

View File

@@ -357,15 +357,14 @@ basicFunctions._interpretLine = function(lnum, cmd) {
/* do nothing */
}
else if (0x22 == charCode) {
sb = "";
mode = "quote"
}
else if (basicFunctions._isParen(charCode)) {
sb = "";
sb = "" + char;
mode = "paren";
}
else if (basicFunctions._isSeparator(charCode)) {
sb = "";
sb = "" + char;
mode = "sep";
}
else {
@@ -430,6 +429,9 @@ basicFunctions._interpretLine = function(lnum, cmd) {
if (tokens.length != states.length) throw "InternalError: size of tokens and states does not match (line: "+lnum+")";
// END TOKENISE
println(tokens.join("~"));
println(states.join(" "));
// ELABORATION : distinguish numbers and operators from literals
k = 0;
while (k < states.length) { // using while loop because array size will change during the execution
@@ -517,6 +519,11 @@ basicFunctions._interpretLine = function(lnum, cmd) {
}
// END ELABORATION
println(tokens.join("~"));
println(states.join(" "));
// PARSING (SYNTAX ANALYSIS)
var syntaxTree = basicFunctions._parseTokens(lnum, tokens, states, 0);
println("k bye");
@@ -524,10 +531,6 @@ basicFunctions._interpretLine = function(lnum, cmd) {
// END PARSING
println(tokens.join("~"));
println(states.join(" "));
return lnum + 1;
}; // end INTERPRETLINE