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
+2 -2
View File
@@ -1,6 +1,6 @@
var fiber = Fiber.create(fn {
var fiber = Fiber.create {
IO.print("fiber")
})
}
IO.print("before") // expect: before
fiber.run // expect: fiber