Type alias DeadEnd

DeadEnd: {
    col: number;
    problem: Problem;
    row: number;
}

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.

Type declaration

  • col: number
  • problem: Problem
  • row: number