diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2017-04-02 15:05:04 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2017-04-02 15:05:04 +0200 |
commit | a543b89bf85fab3b211478a464dc1b87beb95217 (patch) | |
tree | 2c4056376972e7580bcd3c351511ec46a13e3b5f /tests/parser | |
parent | d7eb146d28515e9aea5ae0f98e01b09bd96b5919 (diff) | |
download | Nim-a543b89bf85fab3b211478a464dc1b87beb95217.tar.gz |
language addition: colon-block for expressions in let/var context
Diffstat (limited to 'tests/parser')
-rw-r--r-- | tests/parser/tletcolon.nim | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/parser/tletcolon.nim b/tests/parser/tletcolon.nim new file mode 100644 index 000000000..ec7c24106 --- /dev/null +++ b/tests/parser/tletcolon.nim @@ -0,0 +1,33 @@ +discard """ + output: '''boo +3 +44 3 +more body code +yes +yes''' +""" + +template x(body): untyped = + body + 44 + +template y(val, body): untyped = + body + val + +proc mana = + let foo = x: + echo "boo" + var foo2 = y 3: + echo "3" + echo foo, " ", foo2 + +mana() +let other = x: + echo "more body code" + if true: + echo "yes" + else: + echo "no" +let outer = y(5): + echo "yes" |