1
0

単項演算子を配列に使うとうまくパースできなかった問題を修正

This commit is contained in:
otya128
2016-09-03 11:58:04 +09:00
parent df1bdb87e3
commit d138da32eb

View File

@@ -1729,12 +1729,12 @@ class Parser
//TODO:UnaryOperatorの実装
//とりあえず0-exprを作成
lex.popFront();
node = new BinaryOperator(new Constant(Value(0), lex.location), TokenType.Minus, factor(), lex.location);
node = new BinaryOperator(new Constant(Value(0), lex.location), TokenType.Minus, term(2/*array*/, null), lex.location);
return node;
case TokenType.LogicalNot:
case TokenType.Not:
lex.popFront();
node = new UnaryOperator(token.type, factor(), lex.location);
node = new UnaryOperator(token.type, term(2/*array*/, null), lex.location);
return node;
default:
return node;