From 827208d1d6bc969108e1d06b328d66027a0da7f3 Mon Sep 17 00:00:00 2001 From: Denton Liu Date: Wed, 20 Jul 2016 14:03:07 -0400 Subject: [PATCH 1/2] Move `in` as a keyword to reserved word section --- libsolidity/parsing/Token.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libsolidity/parsing/Token.h b/libsolidity/parsing/Token.h index 703e88f66..dd3d3ec0f 100644 --- a/libsolidity/parsing/Token.h +++ b/libsolidity/parsing/Token.h @@ -129,7 +129,6 @@ namespace solidity T(GreaterThan, ">", 7) \ T(LessThanOrEqual, "<=", 7) \ T(GreaterThanOrEqual, ">=", 7) \ - K(In, "in", 7) \ \ /* Unary operators. */ \ /* IsUnaryOp() relies on this block of enum values */ \ @@ -220,6 +219,7 @@ namespace solidity K(Case, "case", 0) \ K(Catch, "catch", 0) \ K(Final, "final", 0) \ + K(In, "in", 0) \ K(Inline, "inline", 0) \ K(Let, "let", 0) \ K(Match, "match", 0) \ From 8fbe994075ce36bec66645aa7eb389dda71754cf Mon Sep 17 00:00:00 2001 From: Denton Liu Date: Wed, 20 Jul 2016 17:05:24 -0400 Subject: [PATCH 2/2] Fix isCompareOp() --- libsolidity/parsing/Token.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libsolidity/parsing/Token.h b/libsolidity/parsing/Token.h index dd3d3ec0f..581df3a59 100644 --- a/libsolidity/parsing/Token.h +++ b/libsolidity/parsing/Token.h @@ -267,7 +267,7 @@ public: static bool isCommutativeOp(Value op) { return op == BitOr || op == BitXor || op == BitAnd || op == Add || op == Mul || op == Equal || op == NotEqual; } static bool isArithmeticOp(Value op) { return Add <= op && op <= Exp; } - static bool isCompareOp(Value op) { return Equal <= op && op <= In; } + static bool isCompareOp(Value op) { return Equal <= op && op <= GreaterThanOrEqual; } static Value AssignmentToBinaryOp(Value op) {