Parse backtick literals into typed Literal instances in AssemblyFormatParser#8
Merged
jonathanvdc merged 3 commits intomainfrom Mar 29, 2026
Merged
Conversation
Agent-Logs-Url: https://github.com/jonathanvdc/MLIR.NET/sessions/1b229da3-fc52-4455-b19b-a0ed9698c51a Co-authored-by: jonathanvdc <9839946+jonathanvdc@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add parser for MLIR ODS Model AssemblyFormat Literals
Parse backtick literals into typed Literal instances in AssemblyFormatParser
Mar 29, 2026
jonathanvdc
requested changes
Mar 29, 2026
Owner
jonathanvdc
left a comment
There was a problem hiding this comment.
Great work but the build is failing due to these changes. Can you debug why and fix the issue?
…sumer and DialectTests
Copilot stopped work on behalf of
jonathanvdc due to an error
March 29, 2026 03:50
jonathanvdc
approved these changes
Mar 29, 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.
LiteralChunk.Valuestored the raw string between backticks with no structured representation. This addsLiteral.Parse(string)to decompose that string into typedLiteralinstances, and switchesLiteralChunk.ValuefromstringtoIReadOnlyList<Literal>.Model changes (
LiteralChunk.cs)LiteralChunk.Value:string→IReadOnlyList<Literal>WhitespaceLiteral(string spaces)added alongside existingPunctuationLiteral,KeywordLiteral,NewlineLiteral,EmptyLiteralLiteral.Parse(string text)— static parser with the following rules:""[EmptyLiteral]\n[NewlineLiteral]\n\n[NewlineLiteral, NewlineLiteral]" "/" "[WhitespaceLiteral(" ")]/[WhitespaceLiteral(" ")]->[PunctuationLiteral(Arrow)]->([PunctuationLiteral(Arrow), PunctuationLiteral(LParen)]else[KeywordLiteral("else")]->takes longest-match priority over-(Minus). Consecutive spaces are grouped into a singleWhitespaceLiteral.Parser change (
AssemblyFormatParser.cs)ParseLiteral()now callsLiteral.Parse(value)and passes the result to theLiteralChunkconstructor.Tests
Existing
LiteralChunk.Valuestring comparisons updated to checkPunctuationLiteral.TokenKind. Sixteen newLiteral.Parsetests added covering all documented examples.📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.