Parser Error Doesn't Handle Imported Files Correctly #193

Closed
andrewburgess opened this Issue May 14, 2012 · 5 comments

Projects

None yet

2 participants

@andrewburgess

It seems that the code to generate the ParserException (namely, Tokenizer.GetZone()) doesn't account for other files, so when Parser.GenerateParserError() is called, it's happening against the root .less file instead of the actual file with the error.

When trying to format the error message, the area where the error occurs is quite likely to be beyond the length of the main input string, so an unrelated exception is thrown which hides the initial error.

@andrewburgess

I've put in a quick and dirty workaround for the moment so that the original error message doesn't get squashed. You can view here: andrewburgess/dotless@8cebe5c

@lukeapage
Member

Thanks for reporting this, we should fix it soon.

@lukeapage
Member

oh and if you are feeling generous and want to give us a pull request with the full fix.. go ahead.

@lukeapage
Member

In case anyone else is looking at fixing this, I am working on a fix. It is a lot more difficult that it suggests. My first attempt to keep Root still catching errors at each import hit a dead end and now I'm replacing passing round the index, with passing round a complete location..

@lukeapage
Member

Fixed by 099503d

@lukeapage lukeapage closed this Jun 1, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment