RUNでスロット指定できなかった問題を修正/式のパースでの謎バグ修正
This commit is contained in:
@@ -1702,17 +1702,16 @@ class Parser
|
|||||||
}
|
}
|
||||||
token = lex.front();
|
token = lex.front();
|
||||||
bool constexpr;
|
bool constexpr;
|
||||||
Expression op__ = op;
|
|
||||||
if (op.item1.type == NodeType.Constant && op.item2.type == NodeType.Constant)
|
if (op.item1.type == NodeType.Constant && op.item2.type == NodeType.Constant)
|
||||||
{
|
{
|
||||||
double result;
|
double result;
|
||||||
if (constcalc((cast(Constant)op.item1).value, (cast(Constant)op.item2).value, op.operator, 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;
|
constexpr = true;
|
||||||
if(order != getOPRank(token.type))
|
if(order != getOPRank(token.type))
|
||||||
return op__;
|
return l;
|
||||||
op = new BinaryOperator(op__, lex.location);
|
op = new BinaryOperator(l, lex.location);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1720,7 +1719,7 @@ class Parser
|
|||||||
write(tt, " ");
|
write(tt, " ");
|
||||||
if(order == getOPRank(token.type))
|
if(order == getOPRank(token.type))
|
||||||
{
|
{
|
||||||
BinaryOperator op2 = new BinaryOperator(op__, lex.location);
|
BinaryOperator op2 = new BinaryOperator(op, lex.location);
|
||||||
op.item1 = op2;
|
op.item1 = op2;
|
||||||
}
|
}
|
||||||
version(none)stdout.flush();
|
version(none)stdout.flush();
|
||||||
|
|||||||
@@ -1257,12 +1257,12 @@ class PetitComputer
|
|||||||
auto token = lex.front();
|
auto token = lex.front();
|
||||||
if(token.type == otya.smilebasic.token.TokenType.Iden && token.value.stringValue == "RUN")
|
if(token.type == otya.smilebasic.token.TokenType.Iden && token.value.stringValue == "RUN")
|
||||||
{
|
{
|
||||||
lex.popFront();
|
|
||||||
token = lex.front();
|
|
||||||
int slot;
|
|
||||||
bool empty = lex.empty();
|
bool empty = lex.empty();
|
||||||
|
int slot;
|
||||||
if(!empty)
|
if(!empty)
|
||||||
{
|
{
|
||||||
|
lex.popFront();
|
||||||
|
token = lex.front();
|
||||||
if(token.type != otya.smilebasic.token.TokenType.Integer)
|
if(token.type != otya.smilebasic.token.TokenType.Integer)
|
||||||
{
|
{
|
||||||
printConsole("Illegal function call", "\n");
|
printConsole("Illegal function call", "\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user