Skip to content

Escape token text in VB grammar generator - #84659

Merged
jjonescz merged 1 commit into
dotnet:mainfrom
JJordan0C:fix/escape-vb-grammar-token-text
Jul 29, 2026
Merged

jjonescz merged 1 commit into
dotnet:mainfrom
JJordan0C:fix/escape-vb-grammar-token-text

Conversation

@JJordan0C

@JJordan0C JJordan0C commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Fixes #84635

The Visual Basic grammar generator only escaped token text when the entire text was \ or '. As a result, \= was emitted as the invalid ANTLR literal '\='.

Escape backslashes and apostrophes in every token text before emitting a grammar literal, then regenerate VisualBasic.Grammar.g4. Existing escaped token output remains unchanged, while IntegerDivideEqualsToken is now emitted as '\\='.

Validation:

Microsoft Reviewers: Open in CodeFlow

@JJordan0C
JJordan0C requested a review from a team as a code owner July 28, 2026 16:19
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service dotnet-policy-service Bot added the Community The pull request was submitted by a contributor who is not a Microsoft employee. label Jul 28, 2026
@JJordan0C

Copy link
Copy Markdown
Contributor Author

@dotnet-policy-service agree

@333fred

333fred commented Jul 28, 2026

Copy link
Copy Markdown
Member

@dotnet/roslyn-compiler for a second review of a community PR.

@jjonescz
jjonescz merged commit d315a4a into dotnet:main Jul 29, 2026
30 checks passed
@jjonescz

Copy link
Copy Markdown
Member

Thanks for the contribution, @JJordan0C!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-Compilers Community The pull request was submitted by a contributor who is not a Microsoft employee.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VisualBasic.Grammar.g4: invalid ANTLR escape '\=' for IntegerDivideEqualsToken (file unparseable)

4 participants