Skip to content

✨ feat: implement paren-free function calls and update documentation#1717

Merged
harehare merged 5 commits into
mainfrom
feat/implement-paren-free-function-calls
May 10, 2026
Merged

✨ feat: implement paren-free function calls and update documentation#1717
harehare merged 5 commits into
mainfrom
feat/implement-paren-free-function-calls

Conversation

@harehare

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Implements “paren-free” function invocation in pipeline position in mq-lang, allowing bare identifiers (and qualified accesses) that resolve to 0- or 1-required-parameter functions to be auto-called, and adds documentation + tests to cover the new behavior.

Changes:

  • Add evaluator support to auto-call user-defined and builtin functions when a pipeline step is a bare identifier / qualified access.
  • Add integration and evaluator tests covering paren-free calls (user functions, builtins, chaining, and qualified access cases).
  • Document the new paren-free calling behavior in the reference docs.

Reviewed changes

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

File Description
docs/books/src/reference/functions.md Adds reference documentation for parenthesis-free calls in pipeline position.
crates/mq-lang/tests/integration_tests.rs Adds integration tests covering paren-free calls across user-defined functions, builtins, chaining, and “function as value” cases.
crates/mq-lang/src/eval.rs Implements the auto-call logic in the evaluator and adds unit tests for qualified-access paren-free calls.

Comment on lines +152 to +153
- A **0-argument function** invoked without `()` is called with no explicit arguments.
- A **1-argument function** invoked without `()` receives the current pipeline value as its implicit argument.
Comment thread crates/mq-lang/tests/integration_tests.rs Outdated
@codspeed-hq

codspeed-hq Bot commented May 10, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 29 untouched benchmarks


Comparing feat/implement-paren-free-function-calls (da5aee2) with main (78ac5db)

Open in CodSpeed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread crates/mq-lang/tests/integration_tests.rs Outdated
Comment on lines +469 to +475
fn maybe_auto_call_pipeline_ident(
&mut self,
value: RuntimeValue,
runtime_value: &RuntimeValue,
expr: &Shared<ast::Node>,
env: &Shared<SharedCell<Env>>,
) -> EvalResult {
@harehare harehare merged commit 5151f74 into main May 10, 2026
7 checks passed
@harehare harehare deleted the feat/implement-paren-free-function-calls branch May 10, 2026 13:52
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