Skip to content

🐛 fix: bracket-based selector syntax (.[n], .[n][m])#1430

Merged
harehare merged 1 commit intomainfrom
fix/selector-bracket-syntax
Mar 12, 2026
Merged

🐛 fix: bracket-based selector syntax (.[n], .[n][m])#1430
harehare merged 1 commit intomainfrom
fix/selector-bracket-syntax

Conversation

@harehare
Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings March 12, 2026 12:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes bracket-based selector syntax so selectors like .[n] and .[n][m] are correctly recognized (including in HIR symbol extraction), and updates the published CLI help text to reflect the current set of CLI options.

Changes:

  • Add parsing support for bracket-based selectors (.[n], .[n][m], .[n][], .[][m]) in mq-lang selector parsing and formatting.
  • Teach mq-hir to construct the correct mq_lang::Selector from CST nodes for bracket selectors (where the selector token is "." and brackets/indices are child tokens).
  • Remove outdated --json/--csv/--yaml/... module flags from the duplicated CLI help text in docs and README.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
docs/books/src/reference/cli.md Removes outdated CLI flags from the documented help output.
crates/mq-lang/src/selector.rs Adds bracket-selector parsing and updates selector string formatting/tests.
crates/mq-hir/src/hir.rs Adds CST→Selector reconstruction for bracket selectors and updates HIR tests.
README.md Keeps README CLI help text in sync by removing the same outdated flags.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 12, 2026

Merging this PR will not alter performance

✅ 29 untouched benchmarks


Comparing fix/selector-bracket-syntax (c0432dd) with main (795b7e1)1

Open in CodSpeed

Footnotes

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

@harehare harehare merged commit c8da21e into main Mar 12, 2026
10 checks passed
@harehare harehare deleted the fix/selector-bracket-syntax branch March 12, 2026 12:34
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.

2 participants