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

Final step to parse webgpu Idl #8

Merged

Conversation

ygdrasil-io
Copy link
Contributor

No description provided.

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.
@ygdrasil-io ygdrasil-io mentioned this pull request Feb 23, 2025
16 tasks
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.
@ygdrasil-io ygdrasil-io marked this pull request as ready for review February 24, 2025 01:55
@ygdrasil-io
Copy link
Contributor Author

More than expected has been added to this PR. Check #2 to get the full list.

@fabmax
Copy link
Owner

fabmax commented Feb 24, 2025

looks good!

@fabmax fabmax merged commit f6af86d into fabmax:main Feb 24, 2025
2 checks passed
@ygdrasil-io ygdrasil-io deleted the feature/add-union-type-and-constructor branch February 24, 2025 19:01
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