complete implicit functions, I think these are done.
This commit is contained in:
parent
e998a81b63
commit
386d3dd307
|
@ -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,
|
||||
|
|
|
@ -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'
|
Loading…
Reference in New Issue