mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
reverting the grammar to the pre-slice notation.
This commit is contained in:
parent
864275f07e
commit
572aa4e98f
3 changed files with 98 additions and 118 deletions
|
@ -340,18 +340,10 @@
|
|||
})
|
||||
],
|
||||
// The slice literal.
|
||||
Slice: [o("INDEX_START . . Expression INDEX_END", function() {
|
||||
return new RangeNode(null, $4);
|
||||
}), o("INDEX_START Expression . . INDEX_END", function() {
|
||||
return new RangeNode($2, null);
|
||||
}), o("INDEX_START Expression . . Expression INDEX_END", function() {
|
||||
Slice: [o("INDEX_START Expression . . Expression INDEX_END", function() {
|
||||
return new RangeNode($2, $5);
|
||||
}), o("INDEX_START . . . Expression INDEX_END", function() {
|
||||
return new RangeNode(null, $5, true);
|
||||
}), o("INDEX_START Expression . . . Expression INDEX_END", function() {
|
||||
return new RangeNode($2, $6, true);
|
||||
}), o("INDEX_START . . . INDEX_END", function() {
|
||||
return new RangeNode(null, null, true);
|
||||
})
|
||||
],
|
||||
// The array literal.
|
||||
|
|
198
lib/parser.js
198
lib/parser.js
File diff suppressed because one or more lines are too long
|
@ -328,12 +328,8 @@ grammar: {
|
|||
|
||||
# The slice literal.
|
||||
Slice: [
|
||||
o "INDEX_START . . Expression INDEX_END", -> new RangeNode null, $4
|
||||
o "INDEX_START Expression . . INDEX_END", -> new RangeNode $2, null
|
||||
o "INDEX_START Expression . . Expression INDEX_END", -> new RangeNode $2, $5
|
||||
o "INDEX_START . . . Expression INDEX_END", -> new RangeNode null, $5, true
|
||||
o "INDEX_START Expression . . . Expression INDEX_END", -> new RangeNode $2, $6, true
|
||||
o "INDEX_START . . . INDEX_END", -> new RangeNode null, null, true
|
||||
o "INDEX_START Expression . . Expression INDEX_END", -> new RangeNode $2, $5
|
||||
o "INDEX_START Expression . . . Expression INDEX_END", -> new RangeNode $2, $6, true
|
||||
]
|
||||
|
||||
# The array literal.
|
||||
|
|
Loading…
Add table
Reference in a new issue