-
Notifications
You must be signed in to change notification settings - Fork 4
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 typedef and namespace #7
Merged
fabmax
merged 10 commits into
fabmax:main
from
ygdrasil-io:feature/add-typedef-and-namespace
Feb 23, 2025
Merged
add typedef and namespace #7
fabmax
merged 10 commits into
fabmax:main
from
ygdrasil-io:feature/add-typedef-and-namespace
Feb 23, 2025
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Introduced support for parsing `typedef` elements in WebIDL. Implemented a `TypeDefParser` class, updated `WebIdlParserType` to include `TypeDef`, and added a new `IdlTypeDef` model for improved functionality.
Replaced `parseChildren(termToken: String?)` with a simplified overload in `ElementParser` and updated its usage in `TypeDefParser`. This improves code clarity and avoids unnecessary parameter passing where not required.
Introduce typedef parsing functionality to the WebIDL parser, including updates to the `TypeDefParser` and `IdlModel` classes to handle typedef definitions. Added corresponding test cases to verify the parsing logic, ensuring typedefs are correctly modeled and included in the overall structure.
Introduces parsing and model support for namespaces and their constants in the WebIDL parser. Updates include adding `NamespaceParser`, `ConstantParser`, and relevant model adjustments to handle namespaces and constant definitions. Tests and IDL resources are updated to validate the new functionality.
Removed the `parentDictionary` property and associated logic, which were unused in the `IdlConstant` class. Additionally, changed `defaultValue` initialization to `lateinit` to streamline builder usage.
The 'sourcePackage' property and its related code were redundant and served no functional purpose. This cleanup improves code clarity and removes unnecessary complexity in the NamespaceParser and IdlNamespace classes.
The `finishModel` function was removed as it was not being used anywhere in the code. This cleanup simplifies the class and reduces unnecessary code, improving maintainability.
Updated variable and method names from 'constantes' to 'constants' in both `ParserTest` and `IdlNamespace` classes. This ensures alignment with standard naming conventions and improves code readability.
ATypeDef3 was commented out and left unused in the file. Removing it simplifies the code and avoids unnecessary clutter in the test resource.
fabmax
reviewed
Feb 23, 2025
override suspend fun parse(): String { | ||
popToken("const") | ||
val type = parseType() | ||
val tokens = popUntilPattern(";") ?: parserException("Failed parsing member") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume the exception message should be "Failed parsing constant"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
Adjusted the error message for parsing failure from "member" to "constant" to improve clarity and accuracy. This ensures the message aligns with the context of parsing constants.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.