fixing non-spaced function application.

This commit is contained in:
Jeremy Ashkenas 2010-04-13 09:05:55 -04:00
parent 4ced1d65b4
commit 0d860516ac
3 changed files with 9 additions and 4 deletions

View File

@ -434,7 +434,7 @@
tok[0] = 'PARAM';
} else if (_a === ')') {
tok[0] = 'PARAM_END';
} else if (_a === '(') {
} else if (_a === '(' || _a === 'CALL_START') {
tok[0] = 'PARAM_START';
return tok[0];
}

View File

@ -315,9 +315,9 @@ exports.Lexer: class Lexer
tok: @prev i
return if not tok
switch tok[0]
when 'IDENTIFIER' then tok[0]: 'PARAM'
when ')' then tok[0]: 'PARAM_END'
when '(' then return tok[0]: 'PARAM_START'
when 'IDENTIFIER' then tok[0]: 'PARAM'
when ')' then tok[0]: 'PARAM_END'
when '(', 'CALL_START' then return tok[0]: 'PARAM_START'
true
# Close up all remaining open blocks at the end of the file.

View File

@ -76,6 +76,11 @@ fn: (arg) -> arg
ok fn(fn {prop: 101}).prop is 101
# Function calls sans-spacing.
ok((fn(x) ->
3
)() is 3)
# Multi-blocks with optional parens.
result: fn( ->