alexschneider / teascript

5 stars 2 forks source link

Commented lines don't count as "used" line numbers #73

Closed whusted closed 9 years ago

whusted commented 9 years ago

For example, an invalid program, like invalid_programs/program4.tea, looks like:

1. # an invalid for statement
2. 
3. for x if a is 3 in y:
4.  out("what")
5. end

with the line numbers denoted. Since comments are ignored, the lines that they take up are also ignored. When an error is (correctly) thrown parsing this program, it reads:

line 2: Expected in, found if

Not a huge deal, but definitely makes it more difficult for a programmer to find his or her errors