first draft of mandatory parentheses around function definition param lists -- all tests pass

This commit is contained in:
Jeremy Ashkenas
2010-01-26 00:40:58 -05:00
parent 63b44a2b03
commit 460b3f6d8e
57 changed files with 1396 additions and 1561 deletions

View File

@@ -25,8 +25,9 @@ class LexerTest < Test::Unit::TestCase
end
def test_lexing_function_definition
code = "x, y => x * y"
assert @lex.tokenize(code) == [[:PARAM, "x"], [",", ","], [:PARAM, "y"],
code = "(x, y) => x * y"
assert @lex.tokenize(code) == [[:PARAM_START, "("], [:PARAM, "x"],
[",", ","], [:PARAM, "y"], [:PARAM_END, ")"],
["=>", "=>"], [:INDENT, 2], [:IDENTIFIER, "x"], ["*", "*"],
[:IDENTIFIER, "y"], [:OUTDENT, 2], ["\n", "\n"]]
end