bugfix: invalid indentation for 'else' is detected; optional indentation for 'if' expressions

This commit is contained in:
Araq 2012-01-13 14:59:58 +01:00
commit c682a1da2b
4 changed files with 36 additions and 3 deletions

27
tests/reject/tind1.nim Normal file
View file

@ -0,0 +1,27 @@
discard """
line: 24
errormsg: "invalid indentation"
"""
import macros
# finally optional indentation in 'if' expressions :-):
var x = if 4 != 5:
"yes"
else:
"no"
macro mymacro(n: expr): expr = result = n[1][0]
mymacro:
echo "test"
else:
echo "else part"
if 4 == 3:
echo "bug"
else:
echo "no bug"