Repository navigation
test(highlight): pin dotted dictionary keys in custom bodies - #80
Merged
Merged
Conversation
#69 was reported as a highlighting bug: in a custom operation body a dotted key such as `allocation.offset` was painted as an operation name. #78 fixed the tree, but no fixture pinned the capture; the existing dotted keys sit under `module attributes {...}`, which a dedicated rule parses. The fixture asserts `@attribute` on the key after operands, after a region close, and after a type inside `(...)`, the three positions #78 moves in real code, and keeps `arith.addf` in `linalg.map { arith.addf }` an operation name. Input verified with `mlir-opt --verify-diagnostics`. Before #78 (30fac68) it fails at the first key: `function.builtin`, not `attribute`.
The rule assumes no operation's custom syntax starts with `=`. Say that, instead of "no operation name is followed by `=`": a scan of 4,813 ODS assembly formats and 321 hand-written `parse()` functions across llvm-project, CIRCT, IREE, Triton, torch-mlir, tt-mlir, StableHLO and ByteIR found none that starts with `=`. The grammar comment says the same; it is a comment, so the generated files do not change.
felixtensor
force-pushed
the
test/dotted-key-highlight
branch
from
October 7, 2026 06:42
e7ac358 to
34c84e6
Compare
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.
Problem: no highlight fixture covers a dotted dictionary key in a custom-op body, the symptom #69 reported, and #78's doc sentence claims more than its evidence.
Fix: a fixture asserting
@attributeon the key at the three positions #78 moves, withlinalg.map { arith.addf }as the guard. It fails before #78. The doc and the grammar comment now say "no custom assembly format starts with=", which a scan of 4,813 ODS formats confirmed.