Provides a typed code field for programmatic error handling.
All library errors (LexerError, ParseError, EvaluatorError)
extend this class.
Error messages never embed the source position — every subclass reports it
through structured fields instead, readable uniformly via
getErrorSpan. Prefer isRollParserError over instanceof: it
also matches errors from another realm or a duplicate copy of the library.
Base error class for all roll-parser errors.
Provides a typed
codefield for programmatic error handling. All library errors (LexerError,ParseError,EvaluatorError) extend this class.Error messages never embed the source position — every subclass reports it through structured fields instead, readable uniformly via getErrorSpan. Prefer isRollParserError over
instanceof: it also matches errors from another realm or a duplicate copy of the library.Example