From b1f3ad24a2a3d0dd78f1e05ab2555f7c94086f0f Mon Sep 17 00:00:00 2001 From: Jeremy Ashkenas Date: Thu, 24 Dec 2009 00:37:33 -0500 Subject: [PATCH] added git st with the new operator regex --- examples/code.cs | 2 +- lib/coffee_script/grammar.y | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/code.cs b/examples/code.cs index ad520571..f6d58537 100644 --- a/examples/code.cs +++ b/examples/code.cs @@ -99,7 +99,7 @@ while true continue if continuing. # Unary operators. -!true +!!true # Lexical scoping. a: 5 diff --git a/lib/coffee_script/grammar.y b/lib/coffee_script/grammar.y index d07ad289..65941b37 100644 --- a/lib/coffee_script/grammar.y +++ b/lib/coffee_script/grammar.y @@ -18,7 +18,7 @@ token JS # Declare order of operations. prechigh - nonassoc UMINUS NOT '!' '~' + nonassoc UMINUS NOT '!' '!!' '~' left '*' '/' '%' left '+' '-' left '<<' '>>' '>>>' @@ -138,6 +138,7 @@ rule # https://www.cs.auckland.ac.nz/references/ruby/ProgrammingRuby/language.html Operation: '!' Expression { result = OpNode.new(val[0], val[1]) } + | '!!' Expression { result = OpNode.new(val[0], val[1]) } | '-' Expression = UMINUS { result = OpNode.new(val[0], val[1]) } | NOT Expression { result = OpNode.new(val[0], val[1]) } | '~' Expression { result = OpNode.new(val[0], val[1]) }