- Preparing search index...
 
- The search index is not available
 
Kombo - v3.0.0 
 
Type alias DeadEnd<CTX, PROBLEM>
 
Dead
End
<CTX, PROBLEM>: {     col
: number;     contextStack
: immutable.Stack<Located<CTX>>;     problem
: PROBLEM;     row
: number; } 
Type declaration
- 
col: number
 
- 
contextStack: immutable.Stack<Located<CTX>>
 
- 
problem: PROBLEM
 
- 
row: number
 
  
 
 
When we reach a deadend we return all the information you need to create great error message.
Example
Say you are parsing a function named
viewHealthDatathat contains a list. You might get aDeadEndlike this:We have a ton of information here! So in the error message, we can say that “I ran into an issue when parsing a
listin the definition ofviewHealthData. It looks like there is an extra comma.” Or maybe something even better!Furthermore, many parsers just put a mark where the problem manifested. By tracking the
rowandcolof the context, we can show a much larger region as a way of indicating “I thought I was parsing this thing that starts over here.” Otherwise, you can get very confusing error messages on a missing]or}or)because “I need more indentation” on something unrelated.Note: Rows and columns are counted like a text editor. The beginning is
row=1andcol=1. Thecolincrements as characters are chomped. When a\nis chomped,rowis incremented andcolstarts over again at1.See