export class ErrorParserRegistry {
    parsers = [];
    register(parser) {
        this.parsers.push(parser);
        this.parsers.sort((a, b) => b.priority - a.priority);
    }
    parse(input) {
        for (const parser of this.parsers) {
            if (parser.canParse(input)) {
                const result = parser.parse(input);
                if (result)
                    return result;
            }
        }
        return null;
    }
    getRegistered() {
        return this.parsers.map(p => p.name);
    }
}
//# sourceMappingURL=types.js.map