Skip to content

✨feat(lang): support def without params in parser#1413

Merged
harehare merged 4 commits intomainfrom
feat/support-def-without-params-in-parser
Mar 10, 2026
Merged

✨feat(lang): support def without params in parser#1413
harehare merged 4 commits intomainfrom
feat/support-def-without-params-in-parser

Conversation

@harehare
Copy link
Copy Markdown
Owner

  • Improve AST and CST parser to handle function definitions without parameters
  • Add tests for def without params
  • Update dependencies in Cargo.lock

- Improve AST and CST parser to handle function definitions without parameters
- Add tests for def without params
- Update dependencies in Cargo.lock
Copilot AI review requested due to automatic review settings March 10, 2026 12:40
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

Adds support in mq-lang parsers for def declarations that omit the parameter list entirely (e.g., def f: ...), aligning both CST and AST parsing and extending test coverage for the new syntax.

Changes:

  • Update CST parse_def to skip parameter parsing when a : follows the function name.
  • Update AST parse_def to allow empty params when a : follows the function name.
  • Add parser tests for def without params; refresh dependency lockfile.

Reviewed changes

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

File Description
crates/mq-lang/src/cst/parser.rs Allow CST def parsing without (...) when directly followed by :; adds a CST test case.
crates/mq-lang/src/ast/parser.rs Allow AST def parsing without (...) when directly followed by :; adds an AST test case.
Cargo.lock Dependency lockfile updates.

Copilot AI review requested due to automatic review settings March 10, 2026 12:45
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

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

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 10, 2026

Merging this PR will not alter performance

✅ 29 untouched benchmarks


Comparing feat/support-def-without-params-in-parser (08a91db) with main (0b2d021)

Open in CodSpeed

@harehare harehare merged commit 795b7e1 into main Mar 10, 2026
6 checks passed
@harehare harehare deleted the feat/support-def-without-params-in-parser branch March 10, 2026 14:18
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