diff --git a/SMILEBASIC/compiler.d b/SMILEBASIC/compiler.d index 791f30a..dff12ac 100644 --- a/SMILEBASIC/compiler.d +++ b/SMILEBASIC/compiler.d @@ -940,9 +940,9 @@ class Compiler } } //TODO:OUT - foreach_reverse(wstring var; func.outVariable) + foreach_reverse(var; func.outVariable) { - genCodePopVar(var, s); + compilePopVar(var, s); } } break; diff --git a/SMILEBASIC/node.d b/SMILEBASIC/node.d index 1f98d09..82c3aac 100644 --- a/SMILEBASIC/node.d +++ b/SMILEBASIC/node.d @@ -443,7 +443,7 @@ class CallFunctionStatement : Statement { wstring name; Expression[] args; - wstring[] outVariable; + Expression[] outVariable; this(wstring n, SourceLocation loc) { super.location = loc; @@ -455,7 +455,7 @@ class CallFunctionStatement : Statement { args ~= arg; } - void addOut(wstring var) + void addOut(Expression var) { outVariable ~= var; } diff --git a/SMILEBASIC/parser.d b/SMILEBASIC/parser.d index 6c6c795..b42600e 100644 --- a/SMILEBASIC/parser.d +++ b/SMILEBASIC/parser.d @@ -858,13 +858,13 @@ class Parser while(true) { token = lex.front(); - if(token.type != TokenType.Iden) + Expression arg = expression(); + if(!isLValue(arg)) { + syntaxError(); return null; } - wstring arg = token.value.stringValue; func.addOut(arg); - lex.popFront(); token = lex.front(); if(token.type == TokenType.Comma) {