Skip to content

fix(parser): end a named function statement at its closing brace 🧱 - #581

Merged
timfennis merged 1 commit into
masterfrom
bugfix/named-fn-ends-at-brace
Dec 2, 2026
Merged

timfennis merged 1 commit into
masterfrom
bugfix/named-fn-ends-at-brace

Conversation

@timfennis

Copy link
Copy Markdown
Owner

A named function followed on the next line by a tuple or a list was parsed as a call or an index of the function, so this program was rejected with "only a statement can declare a named function":

fn dist(a, b) { … }
("r" <> input).pairwise(dist).sum.print;
  • A statement that starts with a named function (fn f(…) or pure fn f(…)) now ends at its closing brace, as a statement that starts with if, a loop or a block already did. What follows starts the next statement.
  • An anonymous function is unchanged, so fn(x) { x + 1 }(5) still calls it where it's written.
  • A named function can only be a statement, so no program that ran before is rejected now.

Written with AI (Claude Code), all of it.

🤖 Generated with Claude Code

Co-authored-by: Claude Opus 5.5 noreply@anthropic.com

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-02T06:15:11.008666Z ff4d518 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@timfennis
timfennis merged commit 861cb9d into master Dec 2, 2026
1 check passed
@timfennis
timfennis deleted the bugfix/named-fn-ends-at-brace branch December 2, 2026 06:38
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