A parser can run into situations where there is no way to make progress.
When that happens, I record the row and col where you got stuck and the
particular problem you ran into. That is a DeadEnd!
Note: I count rows and columns like a text editor. The beginning is row=1
and col=1. As I chomp characters, the col increments. When I reach a \n
character, I increment the row and set col=1.
A parser can run into situations where there is no way to make progress. When that happens, I record the
rowandcolwhere you got stuck and the particularproblemyou ran into. That is aDeadEnd!Note: I count rows and columns like a text editor. The beginning is
row=1andcol=1. As I chomp characters, thecolincrements. When I reach a\ncharacter, I increment therowand setcol=1.