import { ANTLRErrorListener, Token, Recognizer, RecognitionException } from 'antlr4ts' // A hacky solution to use the listener to emit errors. In production code all error behavoirs should be handled in the // ANTLRErrorStrategy, but this way allows a quick shortcut for verbose error messages for debugging in test export class RDFTestingErrorHandler implements ANTLRErrorListener { syntaxError(_recognizer: Recognizer, _offendingSymbol: Token | undefined, line: number, charPositionInLine: number, msg: string, _e: RecognitionException | undefined){ throw new Error(`line ${line}:${charPositionInLine} ${msg}`) } }