feat: replace block syntax with fn keyword for function literals across compiler and tests

Rename `block` parsing rule to `fn` by adding TOKEN_FN token and function prefix rule, removing the old block prefix from TOKEN_LEFT_BRACE. Update compiler.c to replace `block()` with `function()` and add fn equality primitives (fn_eqeq, fn_bangeq) in primitives.c. Migrate test files: rename block_call.wren to fn_call.wren, block_syntax.wren to fn_syntax.wren, and replace `{ ... }` with `fn { ... }` or `fn expr` syntax. Remove obsolete bool_equality.wren test.
This commit is contained in:
Bob Nystrom
2013-11-06 15:47:47 +00:00
parent cae70590d8
commit 46977dceea
9 changed files with 98 additions and 63 deletions
+3
View File
@@ -0,0 +1,3 @@
io.write((fn 123).call) // expect: 123
// TODO(bob): Arguments.