Skip to content

Conversation

@mcoffin
Copy link

@mcoffin mcoffin commented Mar 29, 2024

Previously, if things that utilized this separated match pattern would fail if encountering any unexpected/unknown elements.

EX. when parsing the OpenXR spec, require can contain interaction_profile elements, which causes parse_interface_item to return None (as an error case), and the rest of the block is never processed.

I introduced an alternative pattern to unwrap_attribute! in parse_attributes! that allowggs to acheive a simliar pattern, without the early return being in the macro, allowing the invoker to regain control of the control flow.

This allowed moving all invocations of parse_interface_item to more standard parse_* function patterns used elsewhere, allowing it to function simliarly and properly handle unexpected elements.

With this patch, the 1.0.33 OpenXR specification parses, with the expected non-fatal errors of unrecognized elements that are unique to OpenXR and not Vulkan.

mcoffin added 2 commits March 28, 2024 21:10
previously, if things that utilized this separated match pattern would
fail if encountering any unexpected/unknown elements.

EX. when parsing the OpenXR spec, `require` can contain
`interaction_profile` elements, which causes `parse_interface_item` to
return None (as an error case), and the rest of the block is never
processed.

I introduced an alternative pattern to `unwrap_attribute!` in
`parse_attributes!` that allows to acheive a simliar pattern, without
the early return being *in the macro*, allowing the invoker to regain
control of the control flow.

This allowed moving all invocations of `parse_interface_item` to more
standard `parse_*` function patterns used elsewhere, allowing it to
function simliarly and properly handle unexpected elements.
…PI spec

This is off by default since use of this crate to parse non-vulkan APIs
isn't widespread enough to justify it's automation in CI jobs
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.

1 participant