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 new features and modify final fields #4646

Closed
wants to merge 2 commits into from
Closed

Conversation

RobEin
Copy link
Contributor

@RobEin RobEin commented Jun 23, 2024

Added method:
getMode()

Added read-only property:
modeStack

Modified fields:
DEFAULT_MODE
MORE
SKIP
DEFAULT_TOKEN_CHANNEL
HIDDEN
MIN_CHAR_VALUE
MAX_CHAR_VALUE

Final fields cannot be used in the case clause of the switch statement.
error message:

"The expression of a constant pattern must be a valid constant."

e.g:
The folowing example does not work with final field but it works with constant field:

switch (curMode) {
  case Lexer.DEFAULT_MODE:
    ...
}

It would be worthwhile to review the other classes in this regard.

Nick Nobles and others added 2 commits June 23, 2024 22:35
Signed-off-by: Nick Nobles <[email protected]>
Signed-off-by: Robert Einhorn <[email protected]>
@vHanda
Copy link

vHanda commented Sep 8, 2024

ping. I'd love to have this merged soon.

@RobEin RobEin closed this by deleting the head repository Sep 13, 2024
@RobEin
Copy link
Contributor Author

RobEin commented Sep 15, 2024

Can we expect a review on this?
I have developed a Dart target (about 300 lines) for a Python parser where these new features would be needed.
I also spent a lot of time modifying the Dart runtime for these new features.
So I had a lot of work in it and it may be useful for others.

@RobEin
Copy link
Contributor Author

RobEin commented Sep 23, 2024

Here is a Python parser with a Dart port that already uses the above modifications.

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