Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add lexer error message provider #1716

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

msujew
Copy link
Member

@msujew msujew commented Oct 15, 2024

Addresses an issue exposed in #1715. Currently, there's no easy way to override the lexer error message provider for chevrotain.

This change adds a service that will be used by the lexer for that.

@msujew msujew added the parser Parser related issue label Oct 15, 2024
import type { LexingReport, TokenBuilder } from './token-builder.js';

export abstract class AbstractLexerErrorMessageProvider implements ILexerErrorMessageProvider {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be more in line with the rest of the implementation (especially in the parser module) if this was instead:

Suggested change
export abstract class AbstractLexerErrorMessageProvider implements ILexerErrorMessageProvider {
export class DefaultLexerErrorMessageProvider implements ILexerErrorMessageProvider {

and then this was the class used in src/default-module.ts instead of using defaultLexerErrorProvider directly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parser Parser related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants