Syntax errors don't display the file show an incorrect line number #214

Closed
nophead opened this Issue Oct 30, 2012 · 5 comments

Comments

Projects
None yet
5 participants
Contributor

nophead commented Oct 30, 2012

A syntax error message gives just a line number but it is not the line number in the current file. It includes all the lines in included files, so is no use for locating the error. Indeed the error might be in one of the included files, so it needs to display a file name in that case as well.

With a large project finding where the syntax error is is like trying to find a needle in a hay stack. One has to create a deliberate error and see if the reported number is less and them move it around to home in.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Owner

kintel commented Oct 31, 2012

I hear you.
The parser is a bit messy and I think I would prefer cleaning it up a bit before fixing this, as well as reading up a bit on flex/bison (unless someone has an elegant way of doing this that is:))

work around: I found it useful to pad included scad files to a 51, 101, 151 (etc) lines, so that it is not too difficult to calculate what line is the culprit.

another work around I use is to put the includes at the bottom of your main file, thus your code errors report the correct line number.

Contributor

GilesBathgate commented May 15, 2013

I think this has been broken since I added support for nested includes (sorry) I like the work around though ;)

Owner

kintel commented May 27, 2016

Fixed by #1637

kintel closed this May 27, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment