fixing an overzealous access in the rewriter
This commit is contained in:
parent
79fa4723ab
commit
51e80484e2
|
@ -94,7 +94,7 @@
|
|||
this.tokens.splice(i + 2, 1);
|
||||
this.tokens.splice(i - 2, 1);
|
||||
return 0;
|
||||
} else if (prev && prev[0] === 'TERMINATOR' && after[0] === 'INDENT') {
|
||||
} else if (prev && prev[0] === 'TERMINATOR' && after && after[0] === 'INDENT') {
|
||||
this.tokens.splice(i + 2, 1);
|
||||
this.tokens[i - 1] = after;
|
||||
return 1;
|
||||
|
|
|
@ -80,7 +80,7 @@ re::adjust_comments: ->
|
|||
@tokens.splice(i + 2, 1)
|
||||
@tokens.splice(i - 2, 1)
|
||||
return 0
|
||||
else if prev and prev[0] is 'TERMINATOR' and after[0] is 'INDENT'
|
||||
else if prev and prev[0] is 'TERMINATOR' and after and after[0] is 'INDENT'
|
||||
@tokens.splice(i + 2, 1)
|
||||
@tokens[i - 1]: after
|
||||
return 1
|
||||
|
|
|
@ -19,3 +19,7 @@ switch 'string'
|
|||
# comment
|
||||
|
||||
puts func()
|
||||
|
||||
func
|
||||
func
|
||||
# Line3
|
||||
|
|
Loading…
Reference in New Issue