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

remove setMode method #4561

Closed
wants to merge 0 commits into from
Closed

remove setMode method #4561

wants to merge 0 commits into from

Conversation

RobEin
Copy link
Contributor

@RobEin RobEin commented Mar 18, 2024

Added:

  • Lexer.mode(...)
  • Lexer.getMode() (instead of _mode field)
  • Lexer.getModeStack()
  • Recognizer.getErrorListenerDispatch()
  • Recognizer.getLiteralNames()
  • Recognizer.getSymbolicNames()
  • Token.INVALID_TYPE
  • Token.getTokenSource()

Removed (fixed):

  • more(m: number) method

@RobEin RobEin marked this pull request as draft March 18, 2024 00:49
@RobEin RobEin marked this pull request as ready for review March 18, 2024 04:04
@@ -22,7 +22,9 @@ export declare class Lexer extends Recognizer<number> {
nextToken(): Token;
skip(): void;
more(): void;
more(m: number): void;
mode(m: number): void;
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add a setMode both here and in js and mark this one as deprecated ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What will be the next ANTLR version, i.e. from which version should it be marked as deprecated?
since 4.13.2?

@@ -6,4 +6,7 @@ export declare class Recognizer<TSymbol> {

removeErrorListeners(): void;
addErrorListener(listener: ErrorListener<TSymbol>): void;
getErrorListenerDispatch(): ErrorListener<TSymbol>;
Copy link
Contributor

Choose a reason for hiding this comment

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

can you rename to getErrorListener() and add to js ?

Copy link
Contributor Author

@RobEin RobEin Mar 18, 2024

Choose a reason for hiding this comment

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

... and I think the getErrorListenerDispatch method should be also marked as depricated in js.

@@ -0,0 +1,60 @@
import HashMap from "../src/antlr4/misc/HashMap.js";
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like you need to rebase first

@@ -6,4 +6,7 @@ export declare class Recognizer<TSymbol> {

removeErrorListeners(): void;
addErrorListener(listener: ErrorListener<TSymbol>): void;
getErrorListenerDispatch(): ErrorListener<TSymbol>;
getLiteralNames(): string[] | [];
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think the type is correct. The array cannot be empty and it contains string | null elements

Copy link
Contributor

Choose a reason for hiding this comment

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

Same here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I started from this.
I will correct it to:

    getLiteralNames(): string[];
    getSymbolicNames(): string[];

@ericvergnaud
Copy link
Contributor

ericvergnaud commented Mar 18, 2024 via email

@RobEin RobEin closed this Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants