The initial Parser type in parser.ts reuses the DecodeError type from decoder.ts. It does this because there was already a bevy of combinators for creating and merging various DecodeError structures (intersection, union, leaf, etc) and I was unclear on the structure of errors I might encounter in designing parser.ts.
It has become clear that this implementation of parser really only has a one or more errors and that the errors should include cursor and length information to create better error messages.
Additionally, I want to look into partial parse results so recovery is an option.
The initial Parser type in parser.ts reuses the DecodeError type from decoder.ts. It does this because there was already a bevy of combinators for creating and merging various DecodeError structures (intersection, union, leaf, etc) and I was unclear on the structure of errors I might encounter in designing parser.ts.
It has become clear that this implementation of parser really only has a one or more errors and that the errors should include cursor and length information to create better error messages.
Additionally, I want to look into partial parse results so recovery is an option.