Skip to content

feat: make repeat and while syntax builtin#13442

Merged
sgraf812 merged 1 commit into
masterfrom
sg/builtin-repeat-while
Apr 17, 2026
Merged

feat: make repeat and while syntax builtin#13442
sgraf812 merged 1 commit into
masterfrom
sg/builtin-repeat-while

Conversation

@sgraf812
Copy link
Copy Markdown
Contributor

This PR promotes the repeat, while, and repeat ... until parsers from syntax declarations in Init.While to @[builtin_doElem_parser] definitions in Lean.Parser.Do, alongside the other do-element parsers. The while variants and repeat ... until get @[builtin_macro] expansions; repeat itself gets a @[builtin_doElem_elab] so a follow-up can extend it with an option-driven choice between Loop.mk and a well-founded Repeat.mk.

The new builtin parsers are registered at low priority so that the bootstrapping syntax declarations in Init.While (still needed for stage0 compatibility) take precedence during the transition. After the next stage0 update, the Init.While syntax and macros can be removed.

@sgraf812 sgraf812 added the changelog-language Language features and metaprograms label Apr 17, 2026
@sgraf812 sgraf812 enabled auto-merge April 17, 2026 13:25
@sgraf812 sgraf812 disabled auto-merge April 17, 2026 13:50
@sgraf812 sgraf812 force-pushed the sg/builtin-repeat-while branch from f46e20b to 74985da Compare April 17, 2026 14:34
@sgraf812 sgraf812 requested a review from kim-em as a code owner April 17, 2026 14:34
@sgraf812 sgraf812 enabled auto-merge April 17, 2026 14:35
@sgraf812 sgraf812 force-pushed the sg/builtin-repeat-while branch from 74985da to fec8c61 Compare April 17, 2026 14:41
@sgraf812 sgraf812 force-pushed the sg/builtin-repeat-while branch from fec8c61 to a327854 Compare April 17, 2026 14:50
@sgraf812 sgraf812 added this pull request to the merge queue Apr 17, 2026
Merged via the queue into master with commit 704df34 Apr 17, 2026
17 checks passed
@github-actions github-actions Bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Apr 17, 2026
@mathlib-lean-pr-testing
Copy link
Copy Markdown

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 348ed9b3b0a8b0ac026dc9297e24bad6493631ec --onto fed2f32651e1e24a507c12aae234ac59e4d9916a. You can force Mathlib CI using the force-mathlib-ci label. (2026-04-17 16:14:19)

@leanprover-bot
Copy link
Copy Markdown
Collaborator

Reference manual CI status:

  • ❗ Reference manual CI will not be attempted unless your PR branches off the nightly-with-manual branch. Try git rebase 348ed9b3b0a8b0ac026dc9297e24bad6493631ec --onto 3fc99eef102549c743c6c63547983319bfae6f01. You can force reference manual CI using the force-manual-ci label. (2026-04-17 16:14:21)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog-language Language features and metaprograms toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants