feat: convert fiber tests to use block arguments instead of anonymous function literals
Update all fiber test files to replace `Fiber.create(fn { ... })` with `Fiber.create { ... }` block syntax, and add compiler support for parsing block bodies without requiring a newline after the opening brace. The compiler changes include removing `TOKEN_LEFT_BRACE` from the newline-discarding token list and adding `match(compiler, TOKEN_LINE)` calls in `finishBlock`, `methodCall`, `function`, and `block` to handle empty block bodies and inline expressions.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
var fiber = Fiber.create(fn {
|
||||
var fiber = Fiber.create {
|
||||
IO.print("run")
|
||||
})
|
||||
}
|
||||
|
||||
fiber.run // expect: run
|
||||
fiber.run // expect runtime error: Cannot run a finished fiber.
|
||||
|
||||
Reference in New Issue
Block a user