Skip to content

Commit a7f2ca1

Browse files
committed
back compatible with v4.13.0
1 parent 29a9aae commit a7f2ca1

File tree

4 files changed

+23
-9
lines changed

4 files changed

+23
-9
lines changed

REPL/Future.lean

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import Lean
2+
3+
namespace List
4+
5+
def flatten : List (List α) → List α
6+
| [] => []
7+
| a :: as => a ++ flatten as
8+
9+
def flatMap {α : Type u} {β : Type v} (a : List α) (b : α → List β) : List β := flatten (map b a)
10+
11+
end List

REPL/JSON.lean

+3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@ Authors: Scott Morrison
66
import Lean.Data.Json
77
import Lean.Message
88
import Lean.Elab.InfoTree.Main
9+
import REPL.Future
10+
911

1012
open Lean Elab InfoTree
1113

14+
1215
namespace REPL
1316

1417
structure CommandOptions where

REPL/Lean/InfoTree.lean

+8-8
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Scott Morrison
55
-/
66
import Lean
7-
7+
import REPL.Future
88
/-!
99
Additional functions to deal with `InfoTree`.
1010
-/
@@ -214,13 +214,13 @@ def sorries (t : InfoTree) : List (ContextInfo × SorryType × Position × Posit
214214

215215
def tactics (t : InfoTree) : List (ContextInfo × Syntax × List MVarId × Position × Position × Array Name) :=
216216
-- HACK: creating a child ngen
217-
t.findTacticNodes.map fun ⟨i, ctx⟩ =>
218-
let range := stxRange ctx.fileMap i.stx
219-
( { ctx with mctx := i.mctxBefore, ngen := ctx.ngen.mkChild.1 },
220-
i.stx,
221-
i.goalsBefore,
222-
range.fst,
223-
range.snd,
217+
t.findTacticNodes.map fun ⟨i, ctx⟩ =>
218+
let range := stxRange ctx.fileMap i.stx
219+
( { ctx with mctx := i.mctxBefore, ngen := ctx.ngen.mkChild.1 },
220+
i.stx,
221+
i.goalsBefore,
222+
range.fst,
223+
range.snd,
224224
i.getUsedConstantsAsSet.toArray )
225225

226226

lean-toolchain

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
leanprover/lean4:v4.14.0-rc1
1+
leanprover/lean4:v4.13.0

0 commit comments

Comments
 (0)