File tree 2 files changed +4
-6
lines changed
2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -9,11 +9,12 @@ import SubVerso.Examples.Env
9
9
open Lean
10
10
open SubVerso.Examples
11
11
12
- def main : (args : List String) → IO UInt32
12
+ unsafe def main : (args : List String) → IO UInt32
13
13
| [mod, outFile] => do
14
14
try
15
15
initSearchPath (← findSysroot)
16
16
let modName := mod.toName
17
+ enableInitializersExecution
17
18
let env ← SubVerso.Compat.importModules #[{module := modName, runtimeOnly := false }] {}
18
19
let modExamples := highlighted.getState env
19
20
let useful := relevant modName modExamples
Original file line number Diff line number Diff line change @@ -12,8 +12,7 @@ open Lean.Elab.Command (liftTermElabM)
12
12
open SubVerso Examples
13
13
open SubVerso.Highlighting (Highlighted highlight)
14
14
15
-
16
- def main : (args : List String) → IO UInt32
15
+ unsafe def main : (args : List String) → IO UInt32
17
16
| [mod, outFile] => do
18
17
try
19
18
initSearchPath (← findSysroot)
@@ -29,6 +28,7 @@ def main : (args : List String) → IO UInt32
29
28
let ictx := Parser.mkInputContext (← IO.FS.readFile fname) fname.toString
30
29
let (headerStx, parserState, msgs) ← Parser.parseHeader ictx
31
30
let imports := headerToImports headerStx
31
+ enableInitializersExecution
32
32
let env ← importModules imports {}
33
33
let pctx : Context := {inputCtx := ictx}
34
34
@@ -55,6 +55,3 @@ def main : (args : List String) → IO UInt32
55
55
| other => do
56
56
IO.eprintln s! "Didn't understand args: { other} "
57
57
pure 1
58
- where
59
- relevant (mod : Name) (examples : NameMap (NameMap Json)) : List (String × Json) :=
60
- examples.find? mod |>.getD {} |>.toList |>.map fun p => {p with fst := p.fst.toString (escape := false )}
You can’t perform that action at this time.
0 commit comments