You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
New atoms introduced by syntax and its derived commands are not allowed to begin with digits or single or double quotes, nor may their first two characters be a valid prefix of an escaped name. They may also not be empty.
We surround atoms with spaces to indicate pretty-printing, but the atom validation routine does not ignore these spaces.
Context
This came up while documenting the specific rules for infix operators in the reference manual.
Steps to Reproduce
Enter the following code: infix:40 "9" => Nat.add
Observe the error message invalid atom
Add a space: infix:40 " 9" => Nat.add
The error message disappears
Expected behavior:
The error messages should be identical. An invalid atom doesn't become valid because it should be printed with spaces.
Actual behavior:
The declaration is accepted.
Versions
From live.lean-lang.org: "4.15.0-nightly-2024-11-08"
This PR improves the validation of new syntactic tokens. Previously, the
validation code had inconsistencies: some atoms would be accepted only
if they had a leading space as a pretty printer hint. Additionally,
atoms with internal whitespace are no longer allowed.
Closes#6011
…r#6012)
This PR improves the validation of new syntactic tokens. Previously, the
validation code had inconsistencies: some atoms would be accepted only
if they had a leading space as a pretty printer hint. Additionally,
atoms with internal whitespace are no longer allowed.
Closesleanprover#6011
Description
New atoms introduced by
syntax
and its derived commands are not allowed to begin with digits or single or double quotes, nor may their first two characters be a valid prefix of an escaped name. They may also not be empty.We surround atoms with spaces to indicate pretty-printing, but the atom validation routine does not ignore these spaces.
Context
This came up while documenting the specific rules for infix operators in the reference manual.
Steps to Reproduce
infix:40 "9" => Nat.add
invalid atom
infix:40 " 9" => Nat.add
Expected behavior:
The error messages should be identical. An invalid atom doesn't become valid because it should be printed with spaces.
Actual behavior:
The declaration is accepted.
Versions
From
live.lean-lang.org
:"4.15.0-nightly-2024-11-08"
Additional Information
Link to code
Impact
Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.
The text was updated successfully, but these errors were encountered: