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

> in type context is always reduced to the numerical comparison operator #31

Open
agcom opened this issue Jul 28, 2022 · 0 comments
Open
Labels
bug Something isn't working

Comments

@agcom
Copy link
Owner

agcom commented Jul 28, 2022

Without this rule for > characters, two consecutive > brackets in a type such as List would be tokenized as the signed right shift operator >>, while three consecutive > brackets in a type such as List<List> would be tokenized as the unsigned right shift operator >>>. Worse, the tokenization of four or more consecutive > brackets in a type such as List<List<List>> would be ambiguous, as various combinations of >, >>, and >>> tokens could represent the >>>> characters.

Ref.: https://docs.oracle.com/javase/specs/jls/se17/html/jls-3.html

From agcom/lex-java#8.

@agcom agcom added the bug Something isn't working label Jul 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant