Support function OUT (no argument)
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user