diff options
author | Fabian Keller <bluenote10@users.noreply.github.com> | 2017-11-06 20:33:01 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2017-11-06 20:33:01 +0100 |
commit | 40a6caeed86e0ed3740fa88fdc7b5aa2bb4a28d5 (patch) | |
tree | 13f5d6b340ae98bda16f643c34d653bc12bacf34 /tests/parser | |
parent | 4c7dda37a2c2ea60c76a1b8d1b942f7819afb5aa (diff) | |
download | Nim-40a6caeed86e0ed3740fa88fdc7b5aa2bb4a28d5.tar.gz |
Block expressions (#6695)
* enabled parsing of block expressions * added test case; closes #3827 * adjusted grammar doc strings * updated grammar in docs
Diffstat (limited to 'tests/parser')
-rw-r--r-- | tests/parser/tletcolon.nim | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/parser/tletcolon.nim b/tests/parser/tletcolon.nim index eab7a8edd..7eaa5e3e5 100644 --- a/tests/parser/tletcolon.nim +++ b/tests/parser/tletcolon.nim @@ -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 \ No newline at end of file |