1
0

複数の引数のINPUTが正常に動くように

This commit is contained in:
otya128
2015-08-19 11:37:22 +09:00
parent c75b129567
commit a9d7cd1953
2 changed files with 15 additions and 4 deletions

View File

@@ -79,8 +79,8 @@ DEF ONGOSUBTEST
RETURN RETURN
@4 @4
END END
INPUT "A";INPUT$ INPUT INPUT$,IN
?INPUT$ ?INPUT$,IN
@DATA_1 @DATA_1
DATA "A",1,2,3,4 DATA "A",1,2,3,4
LOCATE 10, LOCATE 10,

View File

@@ -824,7 +824,7 @@ class Parser
return null; return null;
} }
auto token = lex.front(); 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); Input input = new Input(message, token.type == TokenType.Semicolon);
do do
@@ -836,7 +836,6 @@ class Parser
syntaxError(); syntaxError();
} }
input.addVariable(expr); input.addVariable(expr);
lex.popFront();
token = lex.front(); token = lex.front();
} while(token.type == TokenType.Comma); } while(token.type == TokenType.Comma);
return input; return input;
@@ -850,6 +849,18 @@ class Parser
} }
Input input = new Input(null, true); Input input = new Input(null, true);
input.addVariable(message); 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; return input;
} }
} }