Skip to content

fix: remove withPosition in macro and elab - #15019

Merged
mhuisi merged 1 commit into
leanprover:masterfrom
mhuisi:push-sklnzxoulxkz
Sep 4, 2026
Merged

mhuisi merged 1 commit into
leanprover:masterfrom
mhuisi:push-sklnzxoulxkz

Conversation

@mhuisi

@mhuisi mhuisi commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

This PR removes the withPosition marker from the body of macro and elab declarations.

We typically always use withPosition on parts of the syntax that are always layouted to the start of a line so as to not induce visual alignment constraints on a sub-term, only a relative indentation constraint.
Since bodies of declarations often start with a piece of "sticky" syntax that we append after the separation token before the body of a declaration (e.g. do, by, fun, etc.), declaration bodies are not always layouted to the start of a line, which in turn forces a strange visual alignment constraint on the body.

The withPosition was originally added because of this issue, where they body of a macro would keep parsing after the command: #lean4 > Command terminator @ 💬
However, this has since been made obsolete by #13229.

@mhuisi mhuisi added the changelog-no Do not include this PR in the release changelog label Sep 4, 2026
@mhuisi mhuisi added the downstream Request a downstream-lean4 adaptation PR. label Sep 4, 2026
@mhuisi mhuisi added changelog-language Language features and metaprograms downstream Request a downstream-lean4 adaptation PR. and removed changelog-no Do not include this PR in the release changelog downstream Request a downstream-lean4 adaptation PR. labels Sep 4, 2026
@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 Sep 4, 2026
@mathlib-lean-pr-testing

Copy link
Copy Markdown

Mathlib CI status (docs):

  • ❗ Mathlib CI can not be attempted yet, as the nightly-testing-2026-09-03 tag does not exist there yet. We will retry when you push more commits. If you rebase your branch onto nightly-with-mathlib, Mathlib CI should run now. You can force Mathlib CI using the force-mathlib-ci label. (2026-09-04 12:15:25)

@downstream-lean4

Copy link
Copy Markdown

The adaptation PR for this PR is leanprover/downstream-lean4#42.

@leanprover-bot leanprover-bot added the builds-manual CI has verified that the Lean Language Reference builds against this PR label Sep 4, 2026
@leanprover-bot

leanprover-bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Collaborator

Reference manual CI status:

@mhuisi
mhuisi requested a review from Kha September 4, 2026 12:57
@mhuisi
mhuisi added this pull request to the merge queue Sep 4, 2026
Merged via the queue into leanprover:master with commit d54b02f Sep 4, 2026
53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

builds-manual CI has verified that the Lean Language Reference builds against this PR changelog-language Language features and metaprograms downstream Request a downstream-lean4 adaptation PR. 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.

3 participants