-
-
Notifications
You must be signed in to change notification settings - Fork 397
Fix macro match bug when code token contains character .
#2622
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
|
|
||
|
|
||
| vec2 q = vec2(uv.x * iResolution.x, uv.y * iResolution.y).xy / iResolution.xy; | ||
| vec2 p = ( 2.0 * vec2(uv.x * iResolution.x, uv.y * iResolution.y).xy - iResolution.xy ) / min( iResolution.y, iResolution.x ); |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| #define fragCoord vec2(uv.x * iResolution.x, uv.y * iResolution.y) | ||
|
|
||
| vec2 q = fragCoord.xy / iResolution.xy; | ||
| vec2 p = ( 2.0 * fragCoord.xy - iResolution.xy ) / min( iResolution.y, iResolution.x ); | ||
Oops, something went wrong.
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.
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.
💡 Verification agent
🧩 Analysis chain
Source test case valid for testing period character in macros.
The test case correctly defines a macro
fragCoordon line 1 and uses it with property access (.xy) on lines 3-4, which tests the scenario described in the PR objective. This provides a good test case for verifying that macros containing period characters are properly expanded.However, I notice that the actual implementation change to
isPpCharacters(removing period from recognized characters) isn't included in the files for review. This is an important part of the fix.🏁 Script executed:
Length of output: 261
Attention: Missing Implementation Update in
isPpCharactersThe test file at
tests/src/shader-lab/test-case/source/macro.txtsuccessfully verifies macro expansion with period characters. However, after running the verification script, it appears that while the functionisPpCharactersis present in bothpackages/shader-lab/src/preprocessor/PpScanner.tsandpackages/shader-lab/src/lexer/Utils.ts, its implementation has not been updated to remove the period ('.') from the recognized characters. This part of the fix, which is critical for the PR objective, is currently missing.Test Case:
tests/src/shader-lab/test-case/source/macro.txtIssue:
packages/shader-lab/src/lexer/Utils.tsisPpCharactersdoes not reflect the change to exclude the period character.Please update
isPpCharactersto remove the period from the set of recognized characters as described in the PR objective.