1
0
forked from Mirror/wren

Improve explanation of single-expression blocks.

Fix #390.
This commit is contained in:
Bob Nystrom
2017-01-12 11:05:03 -08:00
parent 0a2bc4a8a7
commit 479ca7ec6d

View File

@ -124,6 +124,17 @@ same as doing:
return "single expression"
}
Statements are not allowed in this form (since they don't produce values), which
means nothing starting with `class`, `for`, `if`, `import`, `return`,
`var`, or `while`. If you want a block that contains a single statement,
put a newline in there:
:::wren
{
if (happy) {
System.print("I'm feelin' it!")
}
}
## Precedence and Associativity