Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: require idents come in a column after the start of a command #3799

Merged
merged 1 commit into from
Mar 29, 2024

Conversation

kmill
Copy link
Collaborator

@kmill kmill commented Mar 28, 2024

Commands that can optionally parse an ident or parse any number of idents generally should require that the ident use colGt. This keeps typos in commands from being interpreted as identifiers.

For example, without this rule,

universe u
Open Lean

parses the same as universe u Open Lean. It would be better to get an error on Open.

This PR adds checkColGt to section, namespace, end, variable, and universe.

Closes #2684

Commands that can parse an `ident` generally should require that the `ident` use `colGt`. This keeps typos in commands from being interpreted as identifiers.

For example, without this rule,
```
universe u
Open Lean
````
parses the same as `universe u Open Lean`. It would be better to get an error on `Open`.

This PR adds `checkColGt` to `section`, `namespace`, `end`, `variable`, and `universe`.

Closes leanprover#2684
@kmill kmill requested a review from Kha as a code owner March 28, 2024 12:48
@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 Mar 28, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Mar 28, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Mar 28, 2024
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the builds-mathlib CI has verified that Mathlib builds against this PR label Mar 28, 2024
@leanprover-community-mathlib4-bot
Copy link
Collaborator

leanprover-community-mathlib4-bot commented Mar 28, 2024

Mathlib CI status (docs):

leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Mar 28, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Mar 28, 2024
@leodemoura leodemoura added this pull request to the merge queue Mar 29, 2024
Merged via the queue into leanprover:master with commit b15b971 Mar 29, 2024
18 checks passed
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 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.

RFC: universe could work only on single lines or successive indented lines
4 participants