Skip to content

Commit

Permalink
fix: we want to catch runtime exceptions in doc-gen4
Browse files Browse the repository at this point in the history
  • Loading branch information
hargoniX committed Nov 18, 2023
1 parent d70b47c commit e966ab8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
1 change: 1 addition & 0 deletions DocGen4/Load.lean
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def load (task : Process.AnalyzeTask) : IO (Process.AnalyzerResult × Hierarchy)
-- TODO: Figure out whether this could cause some bugs
fileName := default,
fileMap := default,
catchRuntimeEx := true,
}

Prod.fst <$> Meta.MetaM.toIO (Process.process task) config { env := env } {} {}
Expand Down
5 changes: 3 additions & 2 deletions DocGen4/Process/Analyze.lean
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,11 @@ def process (task : AnalyzeTask) : MetaM (AnalyzerResult × Hierarchy) := do

try
let config := {
maxHeartbeats := 50000000,
maxHeartbeats := 5000000,
options := ← getOptions,
fileName := ← getFileName,
fileMap := ← getFileMap
fileMap := ← getFileMap,
catchRuntimeEx := true,
}
let analysis ← Prod.fst <$> Meta.MetaM.toIO (DocInfo.ofConstant (name, cinfo)) config { env := env } {} {}
if let some dinfo := analysis then
Expand Down
6 changes: 1 addition & 5 deletions DocGen4/Process/DefinitionInfo.lean
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,7 @@ def DefinitionInfo.ofDefinitionVal (v : DefinitionVal) : MetaM DefinitionInfo :=
let isNonComputable := isNoncomputable (← getEnv) v.name

try
-- Temporary workaround until
-- https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/maxRecDepth.20in.20getEqnsFor.3F/near/402917295
-- is adddressed
let eqs? : Option (Array Name) := none
-- let eqs? ← getEqnsFor? v.name
let eqs? ← getEqnsFor? v.name

match eqs? with
| some eqs =>
Expand Down

0 comments on commit e966ab8

Please sign in to comment.