Open Sway007 opened 2 weeks ago
The changes in this pull request involve modifications to several classes within the shader-lab package. Key updates include altering the advance
method in the BaseScanner
class to require a numeric argument and implementing conditional compilation directives. Additionally, a new private static method _dropScope
was added to the ShaderContentParser
class to streamline scope management. Various instances of the advance
method were replaced with _advance
across the Lexer
, PpParser
, and PpScanner
classes, alongside updates to error handling and method signatures for clarity.
File Path | Change Summary |
---|---|
packages/shader-lab/src/common/BaseScanner.ts |
- Updated advance method signature from advance(count = 1): void to advance(count: number): void . - Modified implementation to include verbosity checks and removed early return in _advance . |
packages/shader-lab/src/contentParser/ShaderContentParser.ts |
- Added private static method _dropScope() to centralize scope-dropping logic in _parseSubShader and _parsePass methods. |
packages/shader-lab/src/lexer/Lexer.ts | - Replaced calls to advance()method with _advance()` in various methods, including token scanning methods. |
|
packages/shader-lab/src/preprocessor/PpParser.ts |
- Replaced instances of scanner.advance() with scanner._advance() across multiple parsing methods. - Updated return types for several parsing methods to PpConstant . |
packages/shader-lab/src/preprocessor/PpScanner.ts |
- Replaced calls to advance() with _advance() across multiple scanning methods, ensuring consistent advancement logic. |
advance()
method with _advance()
in various methods of the Lexer
class, which is directly related to the modifications made to the advance
method in the BaseScanner
class in the main PR.ShaderContentParser
class, specifically the _parsePass
method, which is relevant as it deals with parsing logic that may interact with the advance
method's functionality in the BaseScanner
class.In the land of shaders, where rabbits play,
We hop through code on this fine day.
With_advance
now leading the way,
Our parsing dances, come what may!
So let’s celebrate with a joyful cheer,
For changes made, we hold so dear! 🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Attention: Patch coverage is 66.27907%
with 29 lines
in your changes missing coverage. Please review.
Project coverage is 66.67%. Comparing base (
a7b36ad
) to head (f1180a0
). Report is 21 commits behind head on dev/1.4.
Files with missing lines | Patch % | Lines |
---|---|---|
packages/shader-lab/src/lexer/Lexer.ts | 55.00% | 27 Missing :warning: |
packages/shader-lab/src/preprocessor/PpParser.ts | 75.00% | 2 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Scanner
dropScope
inParser
for greater readabilitySummary by CodeRabbit