-
Notifications
You must be signed in to change notification settings - Fork 201
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
Rework token single inheritance into multiple classifications/ categories #564
Labels
Milestone
Comments
Breaking ChangesCreateToken API
Tokens as Classes
|
Categories propertyThis replaces the deprecated parent property. interface ITokenConfig {
categories?: TokenType | TokenType[]
} This means multiple classifications are supported. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently Token inheritance is limited to single inheritance.
There is no reason to limit the inheritance to single inheritance as the diamond problem
can no longer exist here as the tokens are no longer instances of their classes
but are instead simple JS Objects with properties.
Instead the inheritance can be modeled as traits in Scala or multiple interfaces in Java.
This actually has common valid use cases:
Consider the above example of the "TrueLiteral" token. In an ECMAScript grammar
one may want to mark it as both:
The text was updated successfully, but these errors were encountered: