diff --git a/SMILEBASIC/TEST.txt b/SMILEBASIC/TEST.txt index 5b4c6d7..d08e8ab 100644 --- a/SMILEBASIC/TEST.txt +++ b/SMILEBASIC/TEST.txt @@ -79,8 +79,8 @@ DEF ONGOSUBTEST RETURN @4 END -INPUT "A";INPUT$ -?INPUT$ +INPUT INPUT$,IN +?INPUT$,IN @DATA_1 DATA "A",1,2,3,4 LOCATE 10, diff --git a/SMILEBASIC/parser.d b/SMILEBASIC/parser.d index 5bf61c9..0f03189 100644 --- a/SMILEBASIC/parser.d +++ b/SMILEBASIC/parser.d @@ -824,7 +824,7 @@ class Parser return null; } auto token = lex.front(); - if(token.type == TokenType.Semicolon || token.type == TokenType.Comma) + if(token.type == TokenType.Semicolon || (token.type == TokenType.Comma && !isLValue(message))) { Input input = new Input(message, token.type == TokenType.Semicolon); do @@ -836,7 +836,6 @@ class Parser syntaxError(); } input.addVariable(expr); - lex.popFront(); token = lex.front(); } while(token.type == TokenType.Comma); return input; @@ -850,6 +849,18 @@ class Parser } Input input = new Input(null, true); input.addVariable(message); + do + { + lex.popFront(); + auto expr = expression(); + if(!isLValue(expr)) + { + syntaxError(); + } + input.addVariable(expr); + token = lex.front(); + } while(token.type == TokenType.Comma); + return input; } }