From 2ae805d35c93efe7b70c15921ca83f57269dcc1a Mon Sep 17 00:00:00 2001 From: otya128 Date: Wed, 7 Sep 2016 18:06:39 +0900 Subject: [PATCH] =?UTF-8?q?RUN=E3=81=A7=E3=82=B9=E3=83=AD=E3=83=83?= =?UTF-8?q?=E3=83=88=E6=8C=87=E5=AE=9A=E3=81=A7=E3=81=8D=E3=81=AA=E3=81=8B?= =?UTF-8?q?=E3=81=A3=E3=81=9F=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?/=E5=BC=8F=E3=81=AE=E3=83=91=E3=83=BC=E3=82=B9=E3=81=A7?= =?UTF-8?q?=E3=81=AE=E8=AC=8E=E3=83=90=E3=82=B0=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SMILEBASIC/parser.d | 9 ++++----- SMILEBASIC/petitcomputer.d | 6 +++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/SMILEBASIC/parser.d b/SMILEBASIC/parser.d index 3335f98..05bba9d 100644 --- a/SMILEBASIC/parser.d +++ b/SMILEBASIC/parser.d @@ -1702,17 +1702,16 @@ class Parser } token = lex.front(); bool constexpr; - Expression op__ = op; if (op.item1.type == NodeType.Constant && op.item2.type == NodeType.Constant) { double result; if (constcalc((cast(Constant)op.item1).value, (cast(Constant)op.item2).value, op.operator, result)) { - op__ = new Constant(Value(result), lex.location); + auto l = new Constant(Value(result), lex.location); constexpr = true; if(order != getOPRank(token.type)) - return op__; - op = new BinaryOperator(op__, lex.location); + return l; + op = new BinaryOperator(l, lex.location); continue; } } @@ -1720,7 +1719,7 @@ class Parser write(tt, " "); if(order == getOPRank(token.type)) { - BinaryOperator op2 = new BinaryOperator(op__, lex.location); + BinaryOperator op2 = new BinaryOperator(op, lex.location); op.item1 = op2; } version(none)stdout.flush(); diff --git a/SMILEBASIC/petitcomputer.d b/SMILEBASIC/petitcomputer.d index 7919417..75ab5a0 100644 --- a/SMILEBASIC/petitcomputer.d +++ b/SMILEBASIC/petitcomputer.d @@ -1257,12 +1257,12 @@ class PetitComputer auto token = lex.front(); if(token.type == otya.smilebasic.token.TokenType.Iden && token.value.stringValue == "RUN") { - lex.popFront(); - token = lex.front(); - int slot; bool empty = lex.empty(); + int slot; if(!empty) { + lex.popFront(); + token = lex.front(); if(token.type != otya.smilebasic.token.TokenType.Integer) { printConsole("Illegal function call", "\n");