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:
Bob Nystrom
2014-04-03 00:31:58 +00:00
parent 5a017d17de
commit c606e93516
13 changed files with 45 additions and 27 deletions
+4 -4
View File
@@ -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