単項演算子を実�

This commit is contained in:
otya128 committed 2015-06-07 19:33:51 +09:00
1 parent 978a7a6ee7
commit 628b259caf
5 files changed
+37 -8

No files matched your search

+6 -1
View File
@@ -747,7 +747,12 @@ class Parser
//TODO:UnaryOperatorの実装
//とりあえず0-exprを作成
lex.popFront();
node = new BinaryOperator(new Constant(Value(0)), TokenType.Minus, expression());
node = new BinaryOperator(new Constant(Value(0)), TokenType.Minus, factor());
return node;
case TokenType.LogicalNot:
case TokenType.Not:
lex.popFront();
node = new UnaryOperator(token.type, factor());
return node;
default:
return node;