language addition: colon-block for expressions in let/var context

This commit is contained in:
Andreas Rumpf
2017-04-02 15:05:04 +02:00
parent d7eb146d28
commit a543b89bf8
3 changed files with 62 additions and 10 deletions

View File

@@ -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"