GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
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.
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.
I think this has been broken since I added support for nested includes (sorry) I like the work around though ;)
Fixed by #1637