[macruby-changes] [2508] MacRuby/trunk/parse.y
source_changes at macosforge.org
source_changes at macosforge.org
Sun Sep 6 22:12:37 PDT 2009
Revision: 2508
http://trac.macosforge.org/projects/ruby/changeset/2508
Author: lsansonetti at apple.com
Date: 2009-09-06 22:12:36 -0700 (Sun, 06 Sep 2009)
Log Message:
-----------
backported new 1.9 changes regarding the not keyword
Modified Paths:
--------------
MacRuby/trunk/parse.y
Modified: MacRuby/trunk/parse.y
===================================================================
--- MacRuby/trunk/parse.y 2009-09-07 02:54:41 UTC (rev 2507)
+++ MacRuby/trunk/parse.y 2009-09-07 05:12:36 UTC (rev 2508)
@@ -1218,14 +1218,14 @@
$$ = dispatch3(binary, $1, ripper_intern("or"), $3);
%*/
}
- | keyword_not expr
- {
- /*%%%*/
- $$ = call_uni_op(cond($2), '!');
- /*%
- $$ = dispatch2(unary, ripper_intern("not"), $2);
- %*/
- }
+ | keyword_not opt_nl expr
+ {
+ /*%%%*/
+ $$ = call_uni_op(cond($3), '!');
+ /*%
+ $$ = dispatch2(unary, ripper_intern("not"), $3);
+ %*/
+ }
| '!' command_call
{
/*%%%*/
@@ -2774,6 +2774,22 @@
$$ = dispatch1(defined, $5);
%*/
}
+ | keyword_not tLPAREN expr rparen
+ {
+ /*%%%*/
+ $$ = call_uni_op(cond($3), '!');
+ /*%
+ $$ = dispatch2(unary, ripper_intern("not"), $3);
+ %*/
+ }
+ | keyword_not tLPAREN rparen
+ {
+ /*%%%*/
+ $$ = call_uni_op(cond(NEW_NIL()), '!');
+ /*%
+ $$ = dispatch2(unary, ripper_intern("not"), Qnil);
+ %*/
+ }
| operation brace_block
{
/*%%%*/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090906/25c11c12/attachment-0001.html>
More information about the macruby-changes
mailing list