summary refs log tree commit diff stats
path: root/tests/parser
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2017-04-02 15:05:04 +0200
committerAndreas Rumpf <rumpf_a@web.de>2017-04-02 15:05:04 +0200
commita543b89bf85fab3b211478a464dc1b87beb95217 (patch)
tree2c4056376972e7580bcd3c351511ec46a13e3b5f /tests/parser
parentd7eb146d28515e9aea5ae0f98e01b09bd96b5919 (diff)
downloadNim-a543b89bf85fab3b211478a464dc1b87beb95217.tar.gz
language addition: colon-block for expressions in let/var context
Diffstat (limited to 'tests/parser')
-rw-r--r--tests/parser/tletcolon.nim33
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"