Permalink
Browse files

put back 'not in' operator (fixes regression #372593)

  • Loading branch information...
1 parent dd4aa47 commit 2f2481772dbf7cb3f1928a8f5be2740e2bb67581 @bamboo bamboo committed Jul 25, 2012
@@ -458,6 +458,10 @@ class DuckyIntegrationTestFixture(AbstractIntegrationTestFixture):
RunTestCase("tests/integration/new-1.js")
+ [Test] def not_in():
+ RunTestCase("tests/integration/not-in.js")
+
+
[Test] def null_initializer():
RunTestCase("tests/integration/null-initializer.js")
@@ -456,6 +456,10 @@ partial class StrictIntegrationTestFixture(AbstractIntegrationTestFixture):
RunTestCase("tests/integration/new-1.js")
+ [Test] def not_in():
+ RunTestCase("tests/integration/not-in.js")
+
+
[Test] def null_initializer():
RunTestCase("tests/integration/null-initializer.js")
@@ -48,6 +48,7 @@ tokens
INTERFACE="interface";
INSTANCEOF="instanceof";
NEW="new";
+ NOT="not";
NULL="null";
RETURN="return";
PUBLIC="public";
@@ -1421,7 +1422,7 @@ prefix_unary_expression returns [Expression e]
sub:SUBTRACT { op = sub; uOperator = UnaryOperatorType.UnaryNegation; } |
inc:INCREMENT { op = inc; uOperator = UnaryOperatorType.Increment; } |
dec:DECREMENT { op = dec; uOperator = UnaryOperatorType.Decrement; } |
- nt:NOT { op = nt; uOperator = UnaryOperatorType.LogicalNot; } |
+ nt:LOGICAL_NOT { op = nt; uOperator = UnaryOperatorType.LogicalNot; } |
oc:BITWISE_NOT { op = oc; uOperator = UnaryOperatorType.OnesComplement; }
)
e=unary_expression { e = UnaryExpression(ToLexicalInfo(op), uOperator, e) }
@@ -1498,6 +1499,7 @@ comparison returns [Expression e]
(
(
(
+ (tni:NOT IN { op = BinaryOperatorType.NotMember; token = tni; } ) |
(tin:IN { op = BinaryOperatorType.Member; token = tin; } ) |
(tgt:GREATER_THAN { op = BinaryOperatorType.GreaterThan; token = tgt; } ) |
(tgte:GREATER_THAN_OR_EQUAL { op = BinaryOperatorType.GreaterThanOrEqual; token = tgte }) |
@@ -1887,7 +1889,7 @@ EQUALITY: "==";
INEQUALITY: "!=";
-NOT: '!';
+LOGICAL_NOT: '!';
QUESTION_MARK: '?';
@@ -0,0 +1,7 @@
+/*
+not
+yeah
+*/
+var array = ["apple", "orange", "kiwi"];
+for each (var item in ["microsoft", "apple"])
+ print(item not in array ? "not" : "yeah");

0 comments on commit 2f24817

Please sign in to comment.