From d5d1138607d25b2be15d337b40ff07d8d4e24684 Mon Sep 17 00:00:00 2001 From: otya128 Date: Tue, 6 Dec 2016 19:23:10 +0900 Subject: [PATCH] Support function OUT (no argument) --- SMILEBASIC/parser.d | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/SMILEBASIC/parser.d b/SMILEBASIC/parser.d index b363dda..1fbb505 100644 --- a/SMILEBASIC/parser.d +++ b/SMILEBASIC/parser.d @@ -908,12 +908,18 @@ class Parser if(lex.front().type == TokenType.Out) { lex.popFront(); + token = lex.front(); while(true) { token = lex.front(); Expression arg = expression(); if(!isLValue(arg)) { + //to support func args... OUT (no argument) + if (!func.outVariable.length) + { + break; + } syntaxError(); return null; } @@ -1060,6 +1066,10 @@ class Parser //左辺値か bool isLValue(Expression expr) { + if (!expr) + { + return false; + } if(expr.type == NodeType.Variable) { return true;