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,12 +1,12 @@
|
||||
var b = Fiber.create(fn {
|
||||
var b = Fiber.create {
|
||||
IO.print("fiber b")
|
||||
})
|
||||
}
|
||||
|
||||
var a = Fiber.create(fn {
|
||||
var a = Fiber.create {
|
||||
IO.print("begin fiber a")
|
||||
b.run
|
||||
IO.print("end fiber a")
|
||||
})
|
||||
}
|
||||
|
||||
IO.print("begin main")
|
||||
a.run
|
||||
|
||||
Reference in New Issue
Block a user