Skip to content

✨ feat(mq-check): match patterns against markdown node kinds#1958

Merged
harehare merged 1 commit into
mainfrom
feat/match-node-kind-patterns
Jul 1, 2026
Merged

✨ feat(mq-check): match patterns against markdown node kinds#1958
harehare merged 1 commit into
mainfrom
feat/match-node-kind-patterns

Conversation

@harehare

@harehare harehare commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Extend match type patterns so an arm like :h1 or :code matches a markdown value against a node-kind selector (same names as selectors, without the leading .), in addition to the existing type names (:string, :number, etc.). Attribute selectors (e.g. :lang) are rejected since they don't identify a node kind.

Also fix match guard/body evaluation to run against the matched value instead of the pipeline's ., so attribute selectors like .depth or .lang resolve correctly inside a guard or arm body without binding a variable first.

Close #1946

Extend `match` type patterns so an arm like `:h1` or `:code` matches a
markdown value against a node-kind selector (same names as selectors,
without the leading `.`), in addition to the existing type names
(`:string`, `:number`, etc.). Attribute selectors (e.g. `:lang`) are
rejected since they don't identify a node kind.

Also fix match guard/body evaluation to run against the matched value
instead of the pipeline's `.`, so attribute selectors like `.depth` or
`.lang` resolve correctly inside a guard or arm body without binding a
variable first.
@codspeed-hq

codspeed-hq Bot commented Jul 1, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing feat/match-node-kind-patterns (1a2beeb) with main (61cd65b)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (3ba33fa) during the generation of this report, so 61cd65b was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@harehare harehare merged commit e3d21e5 into main Jul 1, 2026
11 checks passed
@harehare harehare deleted the feat/match-node-kind-patterns branch July 1, 2026 13:09
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.

Markdown node type patterns in match expressions

1 participant