Talesoft / tale-jade

A complete and fully-functional implementation of the Jade template language for PHP
http://jade.talesoft.codes
MIT License
88 stars 10 forks source link

Syntax errors are hard to debug #108

Closed ponychicken closed 8 years ago

ponychicken commented 8 years ago

Just received this: Tale\Jade\Parser\Exception: Failed to parse Jade: The import instruction can't have children (indent at 5:2) in /Volumes/Leo/kirbysites/site/plugins/jade/vendor/talesoft/tale-jade/Parser.php on line 1199

It would be nice if errors always said which jade file caused the error and where..

TorbenKoehn commented 8 years ago

Can you give me the stacktrace of that one?

I'll try to improve this.

ponychicken commented 8 years ago

screenshot 2016-06-28 13 04 19

TorbenKoehn commented 8 years ago

Okay

Well, the error itself seems to occur on an include or extends statement (Both are seen as imports by the Tale Jade engine). Make sure that those don't have any kind of child element or a sibling element that's indented too far (Mixing tabs and spaces may also create this error)

I can't tell you, which file it is, sadly, I'll improve error reporting further :)

TorbenKoehn commented 8 years ago

I improved error handling and re-wrote most error messages.

If you find something that doesn't show errors detailed enough, re-open this issue please :)