Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/Lean/Elab/Tactic/BuiltinTactic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,6 @@ partial def evalChoiceAux (tactics : Array Syntax) (i : Nat) : TacticM Unit :=

@[builtin_tactic skip] def evalSkip : Tactic := fun _ => pure ()

@[builtin_tactic unknown] def evalUnknown : Tactic := fun stx => do
addCompletionInfo <| CompletionInfo.tactic stx

@[builtin_tactic failIfSuccess] def evalFailIfSuccess : Tactic := fun stx =>
Term.withoutErrToSorry <| withoutRecover do
let tactic := stx[1]
Expand Down
13 changes: 0 additions & 13 deletions src/Lean/Parser/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -142,19 +142,6 @@ def error (msg : String) : Parser := {
fn := errorFn msg
}

def errorAtSavedPosFn (msg : String) (delta : Bool) : ParserFn := fun c s =>
match c.savedPos? with
| none => s
| some pos =>
let pos := if delta then c.next pos else pos
s.mkUnexpectedErrorAt msg pos

/-- Generate an error at the position saved with the `withPosition` combinator.
If `delta == true`, then it reports at saved position+1.
This useful to make sure a parser consumed at least one character. -/
@[builtin_doc] def errorAtSavedPos (msg : String) (delta : Bool) : Parser := {
fn := errorAtSavedPosFn msg delta
}

/-- Succeeds if `c.prec <= prec` -/
def checkPrecFn (prec : Nat) : ParserFn := fun c s =>
Expand Down
9 changes: 0 additions & 9 deletions src/Lean/Parser/Tactic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,6 @@ builtin_initialize
register_parser_alias tacticSeq
register_parser_alias tacticSeqIndentGt

/- This is a fallback tactic parser for any identifier which exists only
to improve syntax error messages.
```
example : True := by foo -- unknown tactic
```
-/
@[builtin_tactic_parser] def «unknown» := leading_parser
withPosition (ident >> errorAtSavedPos "unknown tactic" true)

@[builtin_tactic_parser] def nestedTactic := tacticSeqBracketed

def matchRhs := Term.hole <|> Term.syntheticHole <|> tacticSeq
Expand Down
2 changes: 0 additions & 2 deletions src/Lean/PrettyPrinter/Formatter.lean
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,6 @@ def parserOfStack.formatter (offset : Nat) (_prec : Nat := 0) : Formatter := do

@[combinator_formatter error, expose]
def error.formatter (_msg : String) : Formatter := pure ()
@[combinator_formatter errorAtSavedPos, expose]
def errorAtSavedPos.formatter (_msg : String) (_delta : Bool) : Formatter := pure ()
@[combinator_formatter lookahead, expose]
def lookahead.formatter (_ : Formatter) : Formatter := pure ()

Expand Down
4 changes: 0 additions & 4 deletions src/Lean/PrettyPrinter/Parenthesizer.lean
Original file line number Diff line number Diff line change
Expand Up @@ -410,10 +410,6 @@ def rawStx.parenthesizer : CategoryParenthesizer | _ => do
def error.parenthesizer (_msg : String) : Parenthesizer :=
pure ()

@[combinator_parenthesizer errorAtSavedPos, expose]
def errorAtSavedPos.parenthesizer (_msg : String) (_delta : Bool) : Parenthesizer :=
pure ()

@[combinator_parenthesizer atomic, expose]
def atomic.parenthesizer (p : Parenthesizer) : Parenthesizer :=
p
Expand Down
Loading
Loading