News for hackers. Stuff that matters.
Re:Ohm: Parsing Made Easy by dman on Tuesday October 17, 2017 @12:15PM (#15492158)
Any thoughts on how to handle parsing for the IDE use case where a document is being edited that might have errors in it. I would usually expect an area around the cursor that is an area that receives edita and hence contains errors. I would also expect a header and footer surrounding the edited area that would be okay structurally since its unchanged from a previously sound definition of the file.
Re:Ohm: Parsing Made Easy by bd82 on Tuesday October 17, 2017 @01:09PM (#15492648)
One option would be to use a Parser that supports fault tolerance and error recovery.

In hand crafted parsers this error recovery may be added manually (but resulting in a-lot of work...) For example: search for the word "recovery" in the TypeScript parser which is used to provide Language Services for the VSCode IDE. https://github.com/Microsoft/TypeScript/blob/master/src/comp...

Automatic Error Recovery using heuristics can also be implemented by parsing Libraries. In the world of JavaScript I'm familiar with two libraries that support Error Recovery:

Antlr4 - https://github.com/antlr/antlr4

Chevrotain - https://github.com/SAP/chevrotain (disclaimer - I'm the author of Chevrotain)

Re:Ohm: Parsing Made Easy by pdubroy on Tuesday October 17, 2017 @12:39PM (#15492388)
You might be interested in Ohm's incremental parsing support. I'll be presenting a paper on this at SPLASH next week: https://ohmlang.github.io/pubs/sle2017/incremental-packrat-p....

In theory, what you're suggesting should be possible to implement with our incremental packrat parsing algorithm. But we haven't tried it yet, so I can't say for sure.

Re:Ohm: Parsing Made Easy by dman on Tuesday October 17, 2017 @12:51PM (#15492492)
Thanks!