Skip to content

Conversation

@kmill
Copy link
Collaborator

@kmill kmill commented Jun 4, 2025

This PR closes #3791, making sure that the Syntax formatter inserts whitespace before and after comments in the leading and trailing text of Syntax to avoid having comments comment out any following syntax, and to avoid comments' lexical syntax from being interpreted as being part of another syntax. If the text contains newlines before or after any comments, they are formatted as hard newlines rather than soft newlines. For example, -- comments will have a hard newline after them. Note: metaprograms generating Syntax with comments should be sure to include newlines at the ends of -- comments.

@kmill kmill added the changelog-pp Pretty printing label Jun 4, 2025
@kmill kmill requested a review from digama0 as a code owner June 4, 2025 04:29
kmill added 2 commits June 12, 2025 18:14
This PR closes leanprover#3791, making sure that the Syntax formatter inserts soft newlines before and after comments in the leading and trailing text of Syntax. If the text contains newlines before or after any comments, they are formatted as hard newlines rather than soft newlines. For example, `--` comments will have a hard newline after them.
@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 Jun 13, 2025
@leanprover-community-bot
Copy link
Collaborator

leanprover-community-bot commented Jun 13, 2025

Mathlib CI status (docs):

  • ❗ Batteries CI can not be attempted yet, as the nightly-testing-2025-06-12 tag does not exist there yet. We will retry when you push more commits. If you rebase your branch onto nightly-with-mathlib, Batteries CI should run now. You can force Mathlib CI using the force-mathlib-ci label. (2025-06-13 08:55:14)
    Forcing Mathlib CI because the force-mathlib-ci label is present, despite problem: - ❗ Batteries CI can not be attempted yet, as the nightly-testing-2025-06-12 tag does not exist there yet. We will retry when you push more commits. If you rebase your branch onto nightly-with-mathlib, Batteries CI should run now. (2025-06-13 18:40:40)

leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Jun 13, 2025
@kmill kmill enabled auto-merge June 26, 2025 19:23
@kmill kmill added this pull request to the merge queue Jun 26, 2025
Merged via the queue into leanprover:master with commit b56ad5a Jun 26, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog-pp Pretty printing force-mathlib-ci 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.

Lean.PrettyPrinter puts comments in invalid places

2 participants