complete implicit functions, I think these are done.

This commit is contained in:
Jeremy Ashkenas 2010-01-26 21:15:56 -05:00
parent e998a81b63
commit 386d3dd307
2 changed files with 13 additions and 1 deletions

View File

@ -19,7 +19,7 @@ module CoffeeScript
EXPRESSION_CLOSE = [:CATCH, :WHEN, :ELSE, :FINALLY] + EXPRESSION_TAIL
# Tokens pairs that, in immediate succession, indicate an implicit call.
IMPLICIT_FUNC = [:IDENTIFIER, :SUPER]
IMPLICIT_FUNC = [:IDENTIFIER, :SUPER, ')', :CALL_END, ']', :INDEX_END]
IMPLICIT_END = [:IF, :UNLESS, :FOR, :WHILE, "\n", :OUTDENT]
IMPLICIT_CALL = [:IDENTIFIER, :NUMBER, :STRING, :JS, :REGEX, :NEW, :PARAM_START,
:TRY, :DELETE, :INSTANCEOF, :TYPEOF, :SWITCH, :ARGUMENTS,

View File

@ -64,3 +64,15 @@ result: call ->
Math.Add(5, 5)
print result is 10
# And even with strange things like this:
funcs: [(x) -> x, (x) -> x * x]
result: funcs[1] 5
print result is 25
result: ("hello".slice) 3
print result is 'lo'