feat: report undefined variable errors on the line where they are used

Store the line number of first use in implicitly declared variables as a numeric value, then synthesize a token at that line when reporting the error, ensuring bounded error message length even for pathologically long variable names.
This commit is contained in:
Bob Nystrom
2016-03-16 15:00:28 +00:00
parent 8fb291517d
commit f16e5c775f
4 changed files with 24 additions and 16 deletions
+2 -4
View File
@@ -1,6 +1,4 @@
var fn = Fn.new {
System.print(Foo)
System.print(Bar)
System.print(Foo) // expect error
System.print(Bar) // expect error
}
// expect error line 6