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:
+2
-6
@@ -1,6 +1,2 @@
|
||||
io.write(1 + 2)
|
||||
io.write(3 - 1)
|
||||
io.write(10 / 3)
|
||||
io.write(20 * 30)
|
||||
io.write("abc" + "def")
|
||||
io.write(1 + "string")
|
||||
if (false) io.write("bad2")
|
||||
if (false) io.write("bad")
|
||||
|
||||
Reference in New Issue
Block a user