-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tracking errors to line and column #1
Comments
Hi, I'm on vacation, so I can't look right now (I have no computer ;) ) I'll Thanks, celer
|
I've dramatically improved the error handling, given that I'm not parsing the JavaScript. When possible I provide a line number in the exception and a .line property as well. But there are still cases that I can't handle without fully parsing the JavaScript. |
Trying out the new version and I intentionally referenced a missing variable
I got no hint where this error occured. I worry that when I move on with my project it may take lots of time to find out where errors occured. |
It turns out all of my cases are always undebuggable ... like missing |
Hmm, so given your feature requests/issues the right answer is to include a JavaScript parser (there is an example one as part of peg.js), but I'm thinking that the entire package would need a serious re-write to make that work (I'll think on this some more) In the mean time, I've immediately improved the detection of unbalanced braces and parens, which works and passes my tests but, isn't as good as actually including a JS parser. Check out the newly pushed package Over the next few days I'll take a look at how some of the other template engines do their error handling to see if they get by without parsing the JavaScript. I was trying to let the Node interpreter do this for me, but it really doesn't do a good job of providing enough details to pin-point the line the error occurred on. |
Have you given any more thought to the problem? The mature parser of JS is of course http://esprima.org/ I think that big win would be to at least leave the line numbers the same from the template to the generated JS. May look ugly while generating that code but debugging would be whole lot easier. Then any errors when caught could tell in which template file the error occurred. I wanna share with you the project I am doing which is using fire-ts at its core. fire-ts is really awesome and better than everything else but still hard to code at time. You wouldn't happen to have syntax highlighting for Sublime Text, would you? |
Hi Damian, I haven't put much more thought on it, I have about 8 projects I'm involved Your node cbinding is pretty neat. I wrote fire-ts to generate java and I don't have any syntax highlighting that really works well. Thanks, Dave On Tue, May 13, 2014 at 2:14 PM, Damian Kaczmarek
|
Hi! First of all, nice addon. I firstly tried EJS for code generation but indentation really sucked. When I get reference errors in the template function is there a way to track it down to line and column? EJS does it so it should be possible. Thanks!
The text was updated successfully, but these errors were encountered: