-
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
Final step to parse webgpu Idl #8
Merged
fabmax
merged 9 commits into
fabmax:main
from
ygdrasil-io:feature/add-union-type-and-constructor
Feb 24, 2025
Merged
Final step to parse webgpu Idl #8
fabmax
merged 9 commits into
fabmax:main
from
ygdrasil-io:feature/add-union-type-and-constructor
Feb 24, 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
Replaces IdlType with the more specific IdlSimpleType for better type distinction and error handling. Updates affected classes, methods, and parsers to consistently use the new type. Adds stricter type checks to prevent unsupported types at runtime.
Updated code to explicitly cast and validate types as `IdlSimpleType` where needed. This enforces stricter type safety and avoids potential runtime errors with unsupported types. Adjusted related test cases and helper methods for compatibility.
Implemented `IdlUnionType` to handle union types and updated the parser to recognize and process them. Modified tests to validate the correct parsing of union types and adjusted related assertions. Introduced a utility function `removeUnionToken` for cleaner token handling.
Updated the startsWithType function to properly preprocess lines that begin with a parenthesis by removing the leading '(' before checking basic types. This ensures better compatibility and prevents potential parsing issues.
Introduced functionality to parse and model constructors in WebIDL, including support for optional parameters and conflict checks with setlike elements. Updated related parsers and models to handle constructors and enhance parent parser handling with null safety.
Changed the definition of `ATypeDef2` in the IDL file to use a nullable `DOMString?` instead of `DOMString`. Adjusted the related test assertion to align with this change, ensuring consistency between the IDL and its test coverage.
Implemented parsing logic to handle "partial interface" constructs in WebIDL. Updated the model, parser, and related tests to reflect the support for partial interfaces, ensuring correctness and expanding functionality.
Renamed the `removeUnionToken` function to `removeUnionEndToken` for better clarity and to align with its functionality. Updated all corresponding method calls to use the new name.
Introduce parsing and modeling of default values for function parameters in WebIDL. Updated tests and IDL resources to include a constructor example with default parameter values. Adjusted `FunctionParameterParser` and `IdlFunctionParameter` to handle and store default values.
More than expected has been added to this PR. Check #2 to get the full list. |
looks good! |
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.