Block expressions (#6695)

* enabled parsing of block expressions
* added test case; closes #3827
* adjusted grammar doc strings
* updated grammar in docs
This commit is contained in:
Fabian Keller
2017-11-06 20:33:01 +01:00
committed by Andreas Rumpf
parent 4c7dda37a2
commit 40a6caeed8
3 changed files with 18 additions and 3 deletions

View File

@@ -4,7 +4,8 @@ discard """
44 3
more body code
yes
yes'''
yes
block expression works'''
"""
template x(body): untyped =
@@ -50,3 +51,11 @@ let format =
else:
echo "Texture Format Unknown, assuming RGB" #This echo causes an error
TextureInternalFormat.RGB
# Block as expressions #3827
block:
let x = block:
var y = 2
echo "block expression works"
y*y
doAssert x == 4