mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-19 03:44:23 -05:00
trying out new arrows for function literals -> is a function, => is a bound function
This commit is contained in:
@@ -25,10 +25,10 @@ class LexerTest < Test::Unit::TestCase
|
||||
end
|
||||
|
||||
def test_lexing_function_definition
|
||||
code = "(x, y) => x * y"
|
||||
code = "(x, y) -> x * y"
|
||||
assert @lex.tokenize(code) == [[:PARAM_START, "("], [:PARAM, "x"],
|
||||
[",", ","], [:PARAM, "y"], [:PARAM_END, ")"],
|
||||
["=>", "=>"], [:INDENT, 2], [:IDENTIFIER, "x"], ["*", "*"],
|
||||
["->", "->"], [:INDENT, 2], [:IDENTIFIER, "x"], ["*", "*"],
|
||||
[:IDENTIFIER, "y"], [:OUTDENT, 2], ["\n", "\n"]]
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user