Repository navigation
refactor: address pending SonarCloud S3881/S3776 items in lexer and ReusableStringWriter - #679
Merged
Merged
Conversation
The only constructor is private, so no subclass can exist outside the type; sealing is not an API break. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…(Sonar S3776) Behavior-preserving extraction of helper methods: - Tokenizer: ParseExpressionToken, ReadExtraBraces, ReadExpressionOpening, ReadStaticCharacter - LiteralParser: AppendEscapeSequence, IsEndOfLiteral Adds HelperLiteralArgumentsAreParsed characterization tests (also pass against the pre-refactor code). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
30 of 34 tasks
|
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.



Partial progress on the SonarCloud remediation tracking issue (#641). No behavior or public API changes.
Changes
ReusableStringWriter. Its only constructor is private, so no subclass can exist outside the type and sealing does not break the API.Dispose(bool)still returns the instance to the pool instead of callingbase.Dispose(a comment now explains why).Tokenizer— SplitParseinto smaller helpers without changing behavior:ParseExpressionToken,ReadExtraBraces(shared by{{{/{{{{and}}}/}}}}),ReadExpressionOpeningandReadStaticCharacter(backslash escapes in static text). The order in which characters are read and peeked is unchanged.LiteralParser— Moved escape handling and end-of-literal detection intoAppendEscapeSequenceandIsEndOfLiteral.Verification
HelperLiteralArgumentsAreParsedcover escaped and unescaped quotes, non-delimiter escapes, and number literals ending at},)and space. They pass on both the old and the new code.Not addressed here
IDescriptor<TOptions>): removing the parameter breaks the API and needs a major version.BlockHelperFunctionBinder.BindByRef/PartialBinder.VisitPartialExpression: left alone because of the ExpressionShortcuts scoping constraint described in SonarCloud quality/security remediation tracking #641.🤖 Generated with Claude Code
Closes #641