Skip to content

Commit

Permalink
suppress
Browse files Browse the repository at this point in the history
  • Loading branch information
mattrobball committed Sep 21, 2023
1 parent 1d29854 commit c02bcb6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Lean/Elab/PreDefinition/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ namespace Lean.Elab
open Meta
open Term

register_builtin_option compiler.suppress : Bool := {
defValue := false
group := "compiler"
descr := "suppress compilation"
}

/--
A (potentially recursive) definition.
The elaborator converts it into Kernel definitions using many different strategies.
Expand Down Expand Up @@ -78,6 +84,9 @@ private def shouldGenCodeFor (preDef : PreDefinition) : Bool :=
!preDef.kind.isTheorem && !preDef.modifiers.isNoncomputable

private def compileDecl (decl : Declaration) : TermElabM Bool := do
if compiler.suppress.get (← getOptions) then
return true
else
try
Lean.compileDecl decl
catch ex =>
Expand Down

0 comments on commit c02bcb6

Please sign in to comment.