mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
Disallowing Splats outside of ParamLists and ArgLists ... where they belong. This is in anticipation of the next commit...
This commit is contained in:
@@ -34,7 +34,7 @@
|
||||
return new LiteralNode($1);
|
||||
})
|
||||
],
|
||||
Expression: [o("Value"), o("Call"), o("Code"), o("Operation"), o("Assign"), o("If"), o("Try"), o("While"), o("For"), o("Switch"), o("Extends"), o("Class"), o("Splat"), o("Existence"), o("Comment")],
|
||||
Expression: [o("Value"), o("Call"), o("Code"), o("Operation"), o("Assign"), o("If"), o("Try"), o("While"), o("For"), o("Switch"), o("Extends"), o("Class"), o("Existence"), o("Comment")],
|
||||
Block: [
|
||||
o("INDENT Body OUTDENT", function() {
|
||||
return $2;
|
||||
@@ -317,16 +317,17 @@
|
||||
ArgList: [
|
||||
o("", function() {
|
||||
return [];
|
||||
}), o("Expression", function() {
|
||||
}), o("Arg", function() {
|
||||
return [$1];
|
||||
}), o("ArgList , Expression", function() {
|
||||
}), o("ArgList , Arg", function() {
|
||||
return $1.concat([$3]);
|
||||
}), o("ArgList OptComma TERMINATOR Expression", function() {
|
||||
}), o("ArgList OptComma TERMINATOR Arg", function() {
|
||||
return $1.concat([$4]);
|
||||
}), o("ArgList OptComma INDENT ArgList OptComma OUTDENT", function() {
|
||||
return $1.concat($4);
|
||||
})
|
||||
],
|
||||
Arg: [o("Expression"), o("Splat")],
|
||||
SimpleArgs: [
|
||||
o("Expression"), o("SimpleArgs , Expression", function() {
|
||||
return $1 instanceof Array ? $1.concat([$3]) : [$1].concat([$3]);
|
||||
|
||||
346
lib/parser.js
346
lib/parser.js
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user