Conversation
Co-authored-by: jcant0n <1783366+jcant0n@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Review code changes in PR #7 for compliance and improvements
Apply PR #7: Parse #define constants and fix array type bindings (with code standards improvements)
Mar 12, 2026
This file contains hidden or 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
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.
PR #7 introduced parsing of
#defineentries from the Khronos registry and fixed struct members whose array sizes are defined by symbolic constants (e.g.,XrUuid.data,XrApiLayerCreateInfo.settings_file_location). This applies those changes with modularity and maintainability improvements.Generator fixes
StructureDefinition.cs— Regex now usesRegex.Escape()on member name, named capture groups,match.Successinstead ofmatch.Captures.Count > 0, and correctly setsm.ConstantValuewhen the array bound is a symbolic name rather than a literal integerOpenXRSpecification.cs— AddedDefinesdictionary populated by parsing<type category="define">entries via regex; used downstream to resolve array sizesProgram.cs— Replaced duplicated constant-resolution branches with a singleTryResolveArrayCounthelper that searches API Constants → enum values →#defineentries in order; added null-safety +InvalidOperationExceptionwith context when resolution failsHelpers.cs— MovedTryParseDefineIntValuehere (was inlined inProgram); handles decimal, hex (0x), sign, and numeric suffixes; rejects compound expressions including subtractionConstantDefinition.cs— FixedNormalizeValuereturn type fromobjecttostringGenerated output (
Structs.cs)Three struct members corrected by the above fixes:
XrUuiddatabyte datafixed byte data[(int)OpenXRNative.XR_UUID_SIZE]XrApiLayerCreateInfosettings_file_locationbyte settings_file_locationfixed byte settings_file_location[512]XrEyeGazesFBgazeXrEyeGazeFB gazeXrEyeGazeFB gaze_0; XrEyeGazeFB gaze_1Original prompt
This pull request was created from Copilot chat.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.