mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-04-11 03:00:13 -04:00
adding a block test and using PARAM_SPLAT to remove the last shift/reduce conflict
This commit is contained in:
@@ -5,7 +5,7 @@ token IF ELSE UNLESS
|
||||
token NUMBER STRING REGEX
|
||||
token TRUE FALSE YES NO ON OFF
|
||||
token IDENTIFIER PROPERTY_ACCESS
|
||||
token CODE PARAM NEW RETURN
|
||||
token CODE PARAM PARAM_SPLAT NEW RETURN
|
||||
token TRY CATCH FINALLY THROW
|
||||
token BREAK CONTINUE
|
||||
token FOR IN BY WHILE
|
||||
@@ -17,12 +17,9 @@ token COMMENT
|
||||
token JS
|
||||
token INDENT OUTDENT
|
||||
|
||||
# We expect one shift-reduce conflict. Because of the lexer, it will never occur.
|
||||
expect 1
|
||||
|
||||
# Declare order of operations.
|
||||
prechigh
|
||||
nonassoc UMINUS SPLAT NOT '!' '!!' '~' '++' '--' '?'
|
||||
nonassoc UMINUS PARAM_SPLAT SPLAT NOT '!' '!!' '~' '++' '--' '?'
|
||||
left '*' '/' '%'
|
||||
left '+' '-'
|
||||
left '<<' '>>' '>>>'
|
||||
@@ -203,7 +200,7 @@ rule
|
||||
|
||||
Param:
|
||||
PARAM
|
||||
| '*' PARAM = SPLAT { result = ParamSplatNode.new(val[1]) }
|
||||
| PARAM_SPLAT PARAM { result = ParamSplatNode.new(val[1]) }
|
||||
;
|
||||
|
||||
Splat:
|
||||
|
||||
Reference in New Issue
Block a user