Javascript based lexer

Myako Toudai 12 years ago updated by Alexander Blach (Developer) 12 years ago 3
I know own interpreters are not allowed, but why not implement an file lexer?

The problem is, we don't see syntax errors. For me I can write HTML files with javascript source an run them. But you don't see often errors... maybe you get a blank screen but no message. The result is we need to search every file for a syntax fault. 

Maybe it would be a very nice feature to add a javascript based lexer ( like Jison ). People could write custom lexers ( or you provide some for base langauges like js ), that could check the current selected file. Maybe a button in the upper right corner, check syntax or something like else. The file content would be send through a small javascript ( the instantiated jison parser ) and this could give us error informations and syntax faults with line number and enhanced descriptions.

Feel free to discuss about that idea :D

Greets Alex
For debugging JavaScript code, you can use Firebug Lite with Textastic. It also has a console for logging.
Nice tip thanks, any tutorial available ? :)

But this idea would be for other languages as well, but it is only an idea for you. Feel free to use it if you want =)

PS: Thanks for Textastic, it is very good and yes, maybe the most use app by me on ipad ( I'm a student ).
Thanks for the description of your idea. I understand that it's not only for JavaScript.

Regarding Firebug: Just follow the instructions on the Firebug Lite site. You need to reference it in the html code. If you download it and use the local link variant you can use it without an internet connection.