mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-18 11:31:20 -05:00
enabling passed functions to fire implicit method calls
This commit is contained in:
@@ -22,7 +22,7 @@ module CoffeeScript
|
|||||||
IMPLICIT_END = [:IF, :UNLESS, :FOR, :WHILE, "\n", :PARAM_START, :OUTDENT]
|
IMPLICIT_END = [:IF, :UNLESS, :FOR, :WHILE, "\n", :PARAM_START, :OUTDENT]
|
||||||
IMPLICIT_CALL = [:IDENTIFIER, :NUMBER, :STRING, :JS, :REGEX, :NEW, :PARAM_START,
|
IMPLICIT_CALL = [:IDENTIFIER, :NUMBER, :STRING, :JS, :REGEX, :NEW, :PARAM_START,
|
||||||
:TRY, :DELETE, :INSTANCEOF, :TYPEOF, :SWITCH, :ARGUMENTS,
|
:TRY, :DELETE, :INSTANCEOF, :TYPEOF, :SWITCH, :ARGUMENTS,
|
||||||
:TRUE, :FALSE, :YES, :NO, :ON, :OFF, '!', '!!', :NOT]
|
:TRUE, :FALSE, :YES, :NO, :ON, :OFF, '!', '!!', :NOT, '=>']
|
||||||
|
|
||||||
# The inverse mappings of token pairs we're trying to fix up.
|
# The inverse mappings of token pairs we're trying to fix up.
|
||||||
INVERSES = BALANCED_PAIRS.inject({}) do |memo, pair|
|
INVERSES = BALANCED_PAIRS.inject({}) do |memo, pair|
|
||||||
|
|||||||
@@ -52,3 +52,6 @@ print Math.FastAdd(20, 20) is 40
|
|||||||
print 100 > 1 if 1 > 0
|
print 100 > 1 if 1 > 0
|
||||||
print true unless false
|
print true unless false
|
||||||
print true for i in [1..3]
|
print true for i in [1..3]
|
||||||
|
|
||||||
|
print_func: (f) => print(f())
|
||||||
|
print_func => true
|
||||||
Reference in New Issue
Block a user