javascript grammar and automatic semocolon insertion

主宰稳场 提交于 2019-12-11 08:05:17

问题


I'm trying to implement javascript parser and I stuck in a problem. Javascript has a technique called "semicolon insertion". So what is a common way to deal with automatic semicolon insertion in js parsers?

Should I rewrite original grammar to make it be able to deal with auto semicolons? Is it possible?

Or should I implement parser for original grammar and then use some tricky technique to deal with semicolons ?

All suggestions are welcome.

来源:https://stackoverflow.com/questions/14295850/javascript-grammar-and-automatic-semocolon-insertion

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!