fixing implicit-call-in-function-in-parens bug.
This commit is contained in:
parent
8317960f81
commit
df97effb9c
|
@ -162,7 +162,7 @@
|
||||||
stack[stack.length - 1] += last;
|
stack[stack.length - 1] += last;
|
||||||
}
|
}
|
||||||
open = stack[stack.length - 1] > 0;
|
open = stack[stack.length - 1] > 0;
|
||||||
if (!(typeof post !== "undefined" && post !== null) || (start_parens > parens) || (parens === 0 && include(IMPLICIT_END, tag))) {
|
if (!(typeof post !== "undefined" && post !== null) || (start_parens > parens) || (start_parens === parens && include(IMPLICIT_END, tag))) {
|
||||||
if (tag === 'INDENT' && prev && include(IMPLICIT_BLOCK, prev[0])) {
|
if (tag === 'INDENT' && prev && include(IMPLICIT_BLOCK, prev[0])) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,7 +124,7 @@ exports.Rewriter: class Rewriter
|
||||||
last: stack.pop()
|
last: stack.pop()
|
||||||
stack[stack.length - 1]: + last
|
stack[stack.length - 1]: + last
|
||||||
open: stack[stack.length - 1] > 0
|
open: stack[stack.length - 1] > 0
|
||||||
if !post? or (start_parens > parens) or (parens is 0 and include IMPLICIT_END, tag)
|
if !post? or (start_parens > parens) or (start_parens is parens and include IMPLICIT_END, tag)
|
||||||
return 1 if tag is 'INDENT' and prev and include IMPLICIT_BLOCK, prev[0]
|
return 1 if tag is 'INDENT' and prev and include IMPLICIT_BLOCK, prev[0]
|
||||||
return 1 if tag is 'OUTDENT' and token.generated
|
return 1 if tag is 'OUTDENT' and token.generated
|
||||||
if open or tag is 'INDENT'
|
if open or tag is 'INDENT'
|
||||||
|
|
|
@ -129,3 +129,12 @@ result: (f 1).toString()
|
||||||
.length
|
.length
|
||||||
|
|
||||||
ok result is 1
|
ok result is 1
|
||||||
|
|
||||||
|
|
||||||
|
# Test implicit calls in functions in parens:
|
||||||
|
result: ((val) ->
|
||||||
|
[].push val
|
||||||
|
val
|
||||||
|
)(10)
|
||||||
|
|
||||||
|
ok result is 10
|
||||||
|
|
Loading…
Reference in New Issue