Skip to content

feat: leading whitespace on first token#12662

Open
mhuisi wants to merge 1 commit intoleanprover:masterfrom
mhuisi:push-qlmwuqotrxwu
Open

feat: leading whitespace on first token#12662
mhuisi wants to merge 1 commit intoleanprover:masterfrom
mhuisi:push-qlmwuqotrxwu

Conversation

@mhuisi
Copy link
Contributor

@mhuisi mhuisi commented Feb 23, 2026

This PR adjusts the module parser to set the leading whitespace of the first token to the whitespace up to that token. If there are no actual tokens in the file, the leading whitespace is set on the final (empty) EOI token. This ensures that we do not lose the initial whitespace (e.g. comments) of a file in Syntax.

(Tests generated/adjusted by Claude)

@mhuisi mhuisi added the changelog-language Language features and metaprograms label Feb 23, 2026
@mhuisi mhuisi requested a review from Kha February 23, 2026 19:30
@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 Feb 23, 2026
@leanprover-bot
Copy link
Collaborator

Reference manual CI status:

  • ❗ Reference manual CI can not be attempted yet, as the nightly-testing-2026-02-17 tag does not exist there yet. We will retry when you push more commits. If you rebase your branch onto nightly-with-manual, reference manual CI should run now. You can force reference manual CI using the force-manual-ci label. (2026-02-23 20:39:55)

mathlib-nightly-testing bot pushed a commit to leanprover-community/batteries that referenced this pull request Feb 23, 2026
@github-actions github-actions bot added the mathlib4-nightly-available A branch for this PR exists at leanprover-community/mathlib4-nightly-testing:lean-pr-testing-NNNN label Feb 23, 2026
mathlib-nightly-testing bot pushed a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Feb 23, 2026
@mathlib-lean-pr-testing mathlib-lean-pr-testing bot added the breaks-mathlib This is not necessarily a blocker for merging: but there needs to be a plan label Feb 23, 2026
@mathlib-lean-pr-testing
Copy link

Mathlib CI status (docs):

@mathlib-lean-pr-testing
Copy link

Mathlib CI status (docs):

@mathlib-lean-pr-testing
Copy link

Mathlib CI status (docs):

mathlib-nightly-testing bot pushed a commit to leanprover-community/batteries that referenced this pull request Feb 25, 2026
mathlib-nightly-testing bot pushed a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Feb 25, 2026
@mathlib-lean-pr-testing
Copy link

Mathlib CI status (docs):

@mathlib-lean-pr-testing mathlib-lean-pr-testing bot added builds-mathlib CI has verified that Mathlib builds against this PR and removed breaks-mathlib This is not necessarily a blocker for merging: but there needs to be a plan labels Feb 26, 2026
@mathlib-lean-pr-testing
Copy link

Mathlib CI status (docs):

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

builds-mathlib CI has verified that Mathlib builds against this PR changelog-language Language features and metaprograms mathlib4-nightly-available A branch for this PR exists at leanprover-community/mathlib4-nightly-testing:lean-pr-testing-NNNN 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