Repository navigation
fix: remove withPosition in macro and elab - #15019
Merged
Merged
Conversation
mhuisi
force-pushed
the
push-sklnzxoulxkz
branch
from
September 4, 2026 11:55
458420c to
c828195
Compare
mhuisi
force-pushed
the
push-sklnzxoulxkz
branch
from
September 4, 2026 11:57
c828195 to
55a2c57
Compare
|
Mathlib CI status (docs):
|
|
The adaptation PR for this PR is leanprover/downstream-lean4#42. |
Collaborator
|
Reference manual CI status:
|
Kha
approved these changes
Sep 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR removes the
withPositionmarker from the body ofmacroandelabdeclarations.We typically always use
withPositionon 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
withPositionwas 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.