javascript grammar and automatic semocolon insertion
问题 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