Require strict indentation in nested by
-s
#1811
Merged
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 makes the non-bracketed tactic sequence parser following a nested
by
require strictindentation.
Mentored by @digama0, this PR introduces
Tactic.tacticSeqIndentGt
which is the same asTactic.tacticSeq
(by
's current tactic sequence parser) but withcheckColGt "strict indentation"
right before the non-bracketed tactic sequence.It does not use
leading_parser
but instead builds aTactic.tacticSeq
node, the idea beingthat antiquotations should not have to care whether the tactic sequence allows non-strict
indentation or not. It also makes the change relatively shallow and local.
Motivation
Currently, the first element of a non-bracketed tactic sequences after a
by
can be indentedarbitrarily. The parser will accept the sequence as long as its tail has the same indentation as the
first element:
No problem for top-level
by
s, but things can get confusing (especially for newcomers) for nestedby
s:This PR turns it into an error:
to force