Merge pull request #2566 from nanoant/parser-diagnostic-location

Parser: Fix location (line, col) for diagnostics
This commit is contained in:
Andreas Rumpf 2015-04-24 12:33:11 +02:00
commit 6a016743aa
6 changed files with 50 additions and 4 deletions

View file

@ -0,0 +1,12 @@
discard """
file: "tinvcolonlocation1.nim"
line: 8
column: 3
errormsg: "':' expected"
"""
try #<- missing ':'
echo "try"
except:
echo "except"
finally:
echo "finally"

View file

@ -0,0 +1,15 @@
discard """
file: "tinvcolonlocation2.nim"
line: 11
column: 1
errormsg: "':' expected"
"""
try:
echo "try"
except #<- missing ':'
echo "except"
finally:
#<-- error will be here above, at the beginning of finally,
# since compiler tries to consome echo and part of except
# expression
echo "finally"

View file

@ -0,0 +1,12 @@
discard """
file: "tinvcolonlocation3.nim"
line: 12
column: 3
errormsg: "':' expected"
"""
try:
echo "try"
except:
echo "except"
finally #<- missing ':'
echo "finally"