Coco 38aa762: rewriter: made addImplicitBraces consume multiple leading comments
This commit is contained in:
parent
b52a1ed60a
commit
1f5727fe9d
|
@ -138,7 +138,7 @@
|
||||||
}
|
}
|
||||||
stack.push(['{']);
|
stack.push(['{']);
|
||||||
idx = ago === '@' ? i - 2 : i - 1;
|
idx = ago === '@' ? i - 2 : i - 1;
|
||||||
if (this.tag(idx - 2) === 'HERECOMMENT') {
|
while (this.tag(idx - 2) === 'HERECOMMENT') {
|
||||||
idx -= 2;
|
idx -= 2;
|
||||||
}
|
}
|
||||||
value = new String('{');
|
value = new String('{');
|
||||||
|
|
|
@ -115,8 +115,8 @@ class exports.Rewriter
|
||||||
return 1 unless tag is ':' and
|
return 1 unless tag is ':' and
|
||||||
((ago = @tag i - 2) is ':' or stack[stack.length - 1]?[0] isnt '{')
|
((ago = @tag i - 2) is ':' or stack[stack.length - 1]?[0] isnt '{')
|
||||||
stack.push ['{']
|
stack.push ['{']
|
||||||
idx = if ago is '@' then i - 2 else i - 1
|
idx = if ago is '@' then i - 2 else i - 1
|
||||||
idx -= 2 if @tag(idx - 2) is 'HERECOMMENT'
|
idx -= 2 while @tag(idx - 2) is 'HERECOMMENT'
|
||||||
value = new String('{')
|
value = new String('{')
|
||||||
value.generated = yes
|
value.generated = yes
|
||||||
tok = ['{', value, token[2]]
|
tok = ['{', value, token[2]]
|
||||||
|
|
|
@ -216,6 +216,8 @@ eq '\\`', `
|
||||||
|
|
||||||
# Shorthand objects with property references.
|
# Shorthand objects with property references.
|
||||||
obj =
|
obj =
|
||||||
|
### comment one ###
|
||||||
|
### comment two ###
|
||||||
one: 1
|
one: 1
|
||||||
two: 2
|
two: 2
|
||||||
object: -> {@one, @two}
|
object: -> {@one, @two}
|
||||||
|
|
Loading…
Reference in New Issue