Skip to content

test(highlight): pin dotted dictionary keys in custom bodies - #80

Merged
felixtensor merged 2 commits into
mainfrom
test/dotted-key-highlight
Oct 7, 2026
Merged

felixtensor merged 2 commits into
mainfrom
test/dotted-key-highlight

Conversation

@felixtensor

Copy link
Copy Markdown
Owner

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 @attribute on the key at the three positions #78 moves, with linalg.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.

#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
felixtensor force-pushed the test/dotted-key-highlight branch from e7ac358 to 34c84e6 Compare October 7, 2026 06:42
@felixtensor
felixtensor merged commit 2f71616 into main Oct 7, 2026
11 checks passed
@felixtensor
felixtensor deleted the test/dotted-key-highlight branch October 7, 2026 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant