Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> how else are you going to ever resynchronize after an error?

An error-cost-minimizing dynamic programming parser could do this.



That fundamentally misunderstands the problem in multiple ways:

* this is still during lexing, not yet to parsing

* there are multiple valid token sequences that vary only with a single character at the start of the file. This is very common with Python multi-line strings in particular, since they are widely used as docstrings.


One could fold lexing into the parsing and do error cost minimization on both.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: