OUTを配列変数などに対応させた
This commit is contained in:
@@ -940,9 +940,9 @@ class Compiler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//TODO:OUT
|
//TODO:OUT
|
||||||
foreach_reverse(wstring var; func.outVariable)
|
foreach_reverse(var; func.outVariable)
|
||||||
{
|
{
|
||||||
genCodePopVar(var, s);
|
compilePopVar(var, s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -443,7 +443,7 @@ class CallFunctionStatement : Statement
|
|||||||
{
|
{
|
||||||
wstring name;
|
wstring name;
|
||||||
Expression[] args;
|
Expression[] args;
|
||||||
wstring[] outVariable;
|
Expression[] outVariable;
|
||||||
this(wstring n, SourceLocation loc)
|
this(wstring n, SourceLocation loc)
|
||||||
{
|
{
|
||||||
super.location = loc;
|
super.location = loc;
|
||||||
@@ -455,7 +455,7 @@ class CallFunctionStatement : Statement
|
|||||||
{
|
{
|
||||||
args ~= arg;
|
args ~= arg;
|
||||||
}
|
}
|
||||||
void addOut(wstring var)
|
void addOut(Expression var)
|
||||||
{
|
{
|
||||||
outVariable ~= var;
|
outVariable ~= var;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -858,13 +858,13 @@ class Parser
|
|||||||
while(true)
|
while(true)
|
||||||
{
|
{
|
||||||
token = lex.front();
|
token = lex.front();
|
||||||
if(token.type != TokenType.Iden)
|
Expression arg = expression();
|
||||||
|
if(!isLValue(arg))
|
||||||
{
|
{
|
||||||
|
syntaxError();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
wstring arg = token.value.stringValue;
|
|
||||||
func.addOut(arg);
|
func.addOut(arg);
|
||||||
lex.popFront();
|
|
||||||
token = lex.front();
|
token = lex.front();
|
||||||
if(token.type == TokenType.Comma)
|
if(token.type == TokenType.Comma)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user