1
0

Support function OUT (no argument)

This commit is contained in:
otya128
2016-12-06 19:23:10 +09:00
parent 6e8a4bc396
commit d5d1138607

View File

@@ -908,12 +908,18 @@ class Parser
if(lex.front().type == TokenType.Out) if(lex.front().type == TokenType.Out)
{ {
lex.popFront(); lex.popFront();
token = lex.front();
while(true) while(true)
{ {
token = lex.front(); token = lex.front();
Expression arg = expression(); Expression arg = expression();
if(!isLValue(arg)) if(!isLValue(arg))
{ {
//to support func args... OUT (no argument)
if (!func.outVariable.length)
{
break;
}
syntaxError(); syntaxError();
return null; return null;
} }
@@ -1060,6 +1066,10 @@ class Parser
//左辺値か //左辺値か
bool isLValue(Expression expr) bool isLValue(Expression expr)
{ {
if (!expr)
{
return false;
}
if(expr.type == NodeType.Variable) if(expr.type == NodeType.Variable)
{ {
return true; return true;