chore: use binderIdent consistently in grammar #2105
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR normalizes usage of
binderIdent
vsident
across the lean grammar. To construct this PR I reviewed every occurrence ofident
to determine whether (1) it is introducing a new binding and (2) it would make sense to be allowed to use_
with the meaning of introducing an unnamed (hygienic automatically named) variable, especially in cases where the unused variables linter might fire.Currently the PR does not compile because there will be some staging and other bugfixing regarding the use and implementation of the
_
part of these commands. Before proceeding I would like a thumbs-up regarding all (or a subset of) the grammar changes proposed here. In the examples below each occurrence of_x
represents anident
that would be allowed to be_
under the proposal.{ _x // e }
by intros _x
by rename a => _x
by injection e with _x
by injections _x
by have' _x := e
by generalize _x : e = _x
by cases _x : e
termination_by' _x => e
decreasing_by _x => tac
initialize _x : e <- e
notation "foo" _x => e
macro "foo" _x:cat : cat => e
match _x : e with | _x@pat => e
let _x y := e; e
have _x y := e; e
Additionally, places which used
ident <|> hole
for binders were changed to usebinderIdent
. This decreases the amount of ad-hoc special casing required in programs consuming and constructing lean syntax like mathport. (Unfortunately there is still some conversion required to go frombinderIdent
toterm
, since the_
case is represented differently in each case.)