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:
parent
4c7dda37a2
commit
40a6caeed8
3 changed files with 18 additions and 3 deletions
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue