Repository navigation
feat: leading whitespace on first token - #12662
Conversation
|
Reference manual CI status:
|
|
Mathlib CI status (docs):
|
|
Mathlib CI status (docs):
|
|
Mathlib CI status (docs):
|
|
Mathlib CI status (docs):
|
|
Mathlib CI status (docs):
|
bd55a8b to
b986134
Compare
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
b986134 to
defcb0a
Compare
|
!bench |
|
Benchmark results for defcb0a against b4f768b are in! @mhuisi Warning These warnings may indicate that the benchmark results are not directly comparable, for example due to changes in the runner configuration or hardware.
Small changes (1🟥)
|
|
!bench |
|
Benchmark results for defcb0a against b4f768b are in! @mhuisi Warning These warnings may indicate that the benchmark results are not directly comparable, for example due to changes in the runner configuration or hardware.
Small changes (1🟥)
|
|
!bench |
|
Benchmark results for defcb0a against b4f768b are in! @Garmelon Warning These warnings may indicate that the benchmark results are not directly comparable, for example due to changes in the runner configuration or hardware.
Large changes (1✅)
Small changes (1🟥)
|
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) Co-authored-by: Claude Sonnet 4.6 <[email protected]>
…incrementality (leanprover#14396) Regression introduced in leanprover#12662. Closes leanprover#14394.
…incrementality (leanprover#14396) Regression introduced in leanprover#12662. Closes leanprover#14394.
… as whitespace (leanprover#924) leanprover/lean4#12662 changed the module parser to by default include the text preceding the first token in a Lean file as whitespace belonging to that token. That parser infrastructure also is used for `lean` blocks in the blog genre. The change in the PR had the effect that the first `lean` block for an `exampleContext` always included the whole preceding Verso file contents as leading whitespace at the first command token. Fixes leanprover#923.
… as whitespace (#924) leanprover/lean4#12662 changed the module parser to by default include the text preceding the first token in a Lean file as whitespace belonging to that token. That parser infrastructure also is used for `lean` blocks in the blog genre. The change in the PR had the effect that the first `lean` block for an `exampleContext` always included the whole preceding Verso file contents as leading whitespace at the first command token. Fixes #923.
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)