mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
Fix for bug with chaining
This commit is contained in:
parent
c937e49689
commit
1aed9c545f
2 changed files with 21 additions and 2 deletions
|
@ -231,7 +231,16 @@ exports.Rewriter: class Rewriter
|
||||||
return 1 if tag is INVERSES[mtag]
|
return 1 if tag is INVERSES[mtag]
|
||||||
debt[mtag]: + 1
|
debt[mtag]: + 1
|
||||||
val: if mtag is 'INDENT' then match[1] else INVERSES[mtag]
|
val: if mtag is 'INDENT' then match[1] else INVERSES[mtag]
|
||||||
|
|
||||||
|
# Edge case, lookahead and if we are inserting in front of a
|
||||||
|
# subsequent opening token, insert ahead of it and re-queue onto
|
||||||
|
# stack.
|
||||||
|
if @tokens[i + 2]?[0] == mtag
|
||||||
|
@tokens.splice i + 3, 0, [INVERSES[mtag], val]
|
||||||
|
stack.push(match)
|
||||||
|
else
|
||||||
@tokens.splice i, 0, [INVERSES[mtag], val]
|
@tokens.splice i, 0, [INVERSES[mtag], val]
|
||||||
|
|
||||||
return 1
|
return 1
|
||||||
else
|
else
|
||||||
return 1
|
return 1
|
||||||
|
|
|
@ -34,3 +34,13 @@ six:
|
||||||
3
|
3
|
||||||
|
|
||||||
ok six is 6
|
ok six is 6
|
||||||
|
|
||||||
|
# Bug due to rewriting issue with indented array literals
|
||||||
|
func: () ->
|
||||||
|
ok arguments.length is 1
|
||||||
|
|
||||||
|
func(
|
||||||
|
[[[[[],
|
||||||
|
[]],
|
||||||
|
[[]]]],
|
||||||
|
[]])
|
||||||
|
|
Loading…
Reference in a new issue