mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-18 03:21:20 -05:00
Disallowing Splats outside of ParamLists and ArgLists ... where they belong. This is in anticipation of the next commit...
This commit is contained in:
@@ -97,7 +97,6 @@ grammar =
|
||||
o "Switch"
|
||||
o "Extends"
|
||||
o "Class"
|
||||
o "Splat"
|
||||
o "Existence"
|
||||
o "Comment"
|
||||
]
|
||||
@@ -361,12 +360,18 @@ grammar =
|
||||
# (i.e. comma-separated expressions). Newlines work as well.
|
||||
ArgList: [
|
||||
o "", -> []
|
||||
o "Expression", -> [$1]
|
||||
o "ArgList , Expression", -> $1.concat [$3]
|
||||
o "ArgList OptComma TERMINATOR Expression", -> $1.concat [$4]
|
||||
o "Arg", -> [$1]
|
||||
o "ArgList , Arg", -> $1.concat [$3]
|
||||
o "ArgList OptComma TERMINATOR Arg", -> $1.concat [$4]
|
||||
o "ArgList OptComma INDENT ArgList OptComma OUTDENT", -> $1.concat $4
|
||||
]
|
||||
|
||||
# Valid arguments are Expressions or Splats.
|
||||
Arg: [
|
||||
o "Expression"
|
||||
o "Splat"
|
||||
]
|
||||
|
||||
# Just simple, comma-separated, required arguments (no fancy syntax). We need
|
||||
# this to be separate from the **ArgList** for use in **Switch** blocks, where
|
||||
# having the newlines wouldn't make sense.
|
||||
|
||||
Reference in New Issue
Block a user