diff --git a/stage0/src/Lean/Elab/Declaration.lean b/stage0/src/Lean/Elab/Declaration.lean index fc5be538dd..6bbdba8f7e 100644 --- a/stage0/src/Lean/Elab/Declaration.lean +++ b/stage0/src/Lean/Elab/Declaration.lean @@ -94,12 +94,14 @@ def elabAxiom (modifiers : Modifiers) (stx : Syntax) : CommandElabM Unit := do match sortDeclLevelParams scopeLevelNames allUserLevelNames usedParams with | Except.error msg => throwErrorAt stx msg | Except.ok levelParams => + let type ← instantiateMVars type let decl := Declaration.axiomDecl { name := declName, levelParams := levelParams, type := type, isUnsafe := modifiers.isUnsafe } + trace[Elab.axiom] "{declName} : {type}" Term.ensureNoUnassignedMVars decl addDecl decl withSaveInfoContext do -- save new env @@ -342,4 +344,7 @@ def expandInitCmd (builtin : Bool) : Macro := fun stx => do @[builtinMacro Lean.Parser.Command.«builtin_initialize»] def expandBuiltinInitialize : Macro := expandInitCmd (builtin := true) +builtin_initialize + registerTraceClass `Elab.axiom + end Lean.Elab.Command diff --git a/stage0/src/Lean/Elab/Import.lean b/stage0/src/Lean/Elab/Import.lean index 505b50f375..002c8a8d45 100644 --- a/stage0/src/Lean/Elab/Import.lean +++ b/stage0/src/Lean/Elab/Import.lean @@ -4,6 +4,8 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Sebastian Ullrich -/ import Lean.Parser.Module +import Lean.Data.Json + namespace Lean.Elab def headerToImports (header : Syntax) : List Import := @@ -38,4 +40,27 @@ def printImports (input : String) (fileName : Option String) : IO Unit := do let fname ← findOLean dep.module IO.println fname +deriving instance ToJson for Import + +structure PrintImportResult where + imports? : Option (Array Import) := none + errors : Array String := #[] + deriving ToJson + +structure PrintImportsResult where + imports : Array PrintImportResult + deriving ToJson + +@[export lean_print_imports_json] +def printImportsJson (fileNames : Array String) : IO Unit := do + let rs ← fileNames.mapM fun fn => do + try + let (deps, _, msgs) ← parseImports (← IO.FS.readFile ⟨fn⟩) fn + if msgs.hasErrors then + return { errors := (← msgs.toList.toArray.mapM (·.toString)) } + else + return { imports? := some deps.toArray } + catch e => return { errors := #[e.toString] } + IO.println (toJson { imports := rs : PrintImportsResult }) + end Lean.Elab diff --git a/stage0/src/Std/Data/PersistentArray.lean b/stage0/src/Std/Data/PersistentArray.lean index e19d044060..367652b66d 100644 --- a/stage0/src/Std/Data/PersistentArray.lean +++ b/stage0/src/Std/Data/PersistentArray.lean @@ -71,7 +71,7 @@ partial def setAux : PersistentArrayNode α → USize → USize → α → Persi let j := div2Shift i shift let i := mod2Shift i shift let shift := shift - initShift - node $ cs.modify j.toNat $ fun c => setAux c i shift a + node <| cs.modify j.toNat fun c => setAux c i shift a | leaf cs, i, _, a => leaf (cs.set! i.toNat a) def set (t : PersistentArray α) (i : Nat) (a : α) : PersistentArray α := @@ -85,7 +85,7 @@ def set (t : PersistentArray α) (i : Nat) (a : α) : PersistentArray α := let j := div2Shift i shift let i := mod2Shift i shift let shift := shift - initShift - node $ cs.modify j.toNat $ fun c => modifyAux f c i shift + node <| cs.modify j.toNat fun c => modifyAux f c i shift | leaf cs, i, _ => leaf (cs.modify i.toNat f) @[specialize] def modify [Inhabited α] (t : PersistentArray α) (i : Nat) (f : α → α) : PersistentArray α := @@ -109,9 +109,9 @@ partial def insertNewLeaf : PersistentArrayNode α → USize → USize → Array let i := mod2Shift i shift let shift := shift - initShift if j.toNat < cs.size then - node $ cs.modify j.toNat fun c => insertNewLeaf c i shift a + node <| cs.modify j.toNat fun c => insertNewLeaf c i shift a else - node $ cs.push $ mkNewPath shift a + node <| cs.push <| mkNewPath shift a | n, _, _, _ => n -- unreachable def mkNewTail (t : PersistentArray α) : PersistentArray α := diff --git a/stage0/src/util/shell.cpp b/stage0/src/util/shell.cpp index be80baf9d2..6663da05ed 100644 --- a/stage0/src/util/shell.cpp +++ b/stage0/src/util/shell.cpp @@ -20,6 +20,7 @@ Author: Leonardo de Moura #include "runtime/debug.h" #include "runtime/sstream.h" #include "runtime/load_dynlib.h" +#include "runtime/array_ref.h" #include "util/timer.h" #include "util/macros.h" #include "util/io.h" @@ -233,6 +234,7 @@ static struct option g_long_options[] = { {"stats", no_argument, 0, 'a'}, {"quiet", no_argument, 0, 'q'}, {"deps", no_argument, 0, 'd'}, + {"deps-json", no_argument, 0, 'J'}, {"timeout", optional_argument, 0, 'T'}, {"c", optional_argument, 0, 'c'}, {"exitOnPanic", no_argument, 0, 'e'}, @@ -392,6 +394,12 @@ void print_imports(std::string const & input, std::string const & fname) { consume_io_result(lean_print_imports(mk_string(input), mk_option_some(mk_string(fname)), io_mk_world())); } +/* def printImportsJson (fileNames : Array String) : IO Unit */ +extern "C" object* lean_print_imports_json(object * file_names, object * w); +void print_imports_json(array_ref const & fnames) { + consume_io_result(lean_print_imports_json(fnames.to_obj_arg(), io_mk_world())); +} + extern "C" object* lean_environment_free_regions(object * env, object * w); void environment_free_regions(environment && env) { consume_io_result(lean_environment_free_regions(env.steal(), io_mk_world())); @@ -442,6 +450,7 @@ extern "C" LEAN_EXPORT int lean_main(int argc, char ** argv) { bool use_stdin = false; unsigned trust_lvl = LEAN_BELIEVER_TRUST_LEVEL + 1; bool only_deps = false; + bool deps_json = false; bool stats = false; // 0 = don't run server, 1 = watchdog, 2 = worker int run_server = 0; @@ -535,6 +544,10 @@ extern "C" LEAN_EXPORT int lean_main(int argc, char ** argv) { case 'd': only_deps = true; break; + case 'J': + only_deps = true; + deps_json = true; + break; case 'a': stats = true; break; @@ -622,6 +635,15 @@ extern "C" LEAN_EXPORT int lean_main(int argc, char ** argv) { else if (run_server == 2) return run_server_worker(opts); + if (only_deps && deps_json) { + buffer fns; + for (int i = optind; i < argc; i++) { + fns.push_back(string_ref(argv[i])); + } + print_imports_json(fns); + return 0; + } + if (use_stdin) { if (argc - optind != 0) { mod_fn = argv[optind++]; diff --git a/stage0/stdlib/Lean/Elab/Declaration.c b/stage0/stdlib/Lean/Elab/Declaration.c index 68aceeacc8..f820eebd01 100644 --- a/stage0/stdlib/Lean/Elab/Declaration.c +++ b/stage0/stdlib/Lean/Elab/Declaration.c @@ -33,10 +33,13 @@ LEAN_EXPORT lean_object* l_Lean_addDeclarationRanges___at_Lean_Elab_Command_elab lean_object* l_Lean_Elab_expandOptDeclSig(lean_object*); LEAN_EXPORT lean_object* l_Array_forInUnsafe_loop___at_Lean_Elab_Command_elabAttr___spec__3___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); static lean_object* l___private_Lean_Elab_Declaration_0__Lean_Elab_Command_expandDeclNamespace_x3f___closed__1; +static lean_object* l_Lean_Elab_Command_elabAxiom___lambda__5___closed__5; +lean_object* l_Lean_registerTraceClass(lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_addTermInfo_x27(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_erase_macro_scopes(lean_object*); static lean_object* l___regBuiltin_Lean_Elab_Command_expandInitialize___closed__3; lean_object* l_Lean_stringToMessageData(lean_object*); +static lean_object* l_Lean_Elab_Command_elabAxiom___lambda__5___closed__6; lean_object* lean_mk_empty_array_with_capacity(lean_object*); static lean_object* l___regBuiltin_Lean_Elab_Command_elabDeclaration_declRange___closed__4; static lean_object* l_Lean_Elab_Command_expandInitCmd___lambda__1___closed__43; @@ -61,7 +64,6 @@ static lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_Declaration_ static lean_object* l___regBuiltin_Lean_Elab_Command_expandInitialize___closed__4; uint8_t lean_usize_dec_eq(size_t, size_t); lean_object* lean_array_uget(lean_object*, size_t); -static lean_object* l_Lean_Elab_Command_elabAxiom___lambda__4___closed__3; lean_object* l_Lean_Elab_resolveGlobalConstNoOverloadWithInfo___at___private_Lean_Elab_PatternVar_0__Lean_Elab_Term_CollectPatternVars_doubleQuotedNameToPattern___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); static lean_object* l_Lean_Elab_Command_checkValidCtorModifier___at___private_Lean_Elab_Declaration_0__Lean_Elab_Command_inductiveSyntaxToView___spec__1___lambda__2___closed__1; static lean_object* l_Lean_Elab_Command_checkValidCtorModifier___at___private_Lean_Elab_Declaration_0__Lean_Elab_Command_inductiveSyntaxToView___spec__1___closed__2; @@ -104,7 +106,7 @@ LEAN_EXPORT lean_object* l_Lean_Elab_Command_checkValidCtorModifier___at___priva LEAN_EXPORT lean_object* l___private_Lean_Elab_Declaration_0__Lean_Elab_Command_isMutualPreambleCommand___boxed(lean_object*); LEAN_EXPORT lean_object* l___private_Lean_Elab_Declaration_0__Lean_Elab_Command_splitMutualPreamble(lean_object*); uint8_t lean_name_eq(lean_object*, lean_object*); -LEAN_EXPORT lean_object* l_Lean_Elab_Command_elabAxiom___lambda__5(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +LEAN_EXPORT lean_object* l_Lean_Elab_Command_elabAxiom___lambda__5(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); static lean_object* l___private_Lean_Elab_Declaration_0__Lean_Elab_Command_isMutualPreambleCommand___closed__1; lean_object* l_Lean_Elab_elabAttrs___at_Lean_Elab_Command_elabMutualDef___spec__3(lean_object*, lean_object*, lean_object*, lean_object*); static lean_object* l___regBuiltin_Lean_Elab_Command_elabDeclaration_declRange___closed__1; @@ -121,15 +123,14 @@ LEAN_EXPORT lean_object* l_Lean_Elab_liftMacroM___at_Lean_Elab_Command_elabDecla static lean_object* l___regBuiltin_Lean_Elab_Command_expandMutualElement___closed__3; lean_object* l_Lean_MonadRef_mkInfoFromRefPos___at___aux__Init__Notation______macroRules__precMax__1___spec__1(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Array_forInUnsafe_loop___at_Lean_Elab_Command_elabAttr___spec__1___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -LEAN_EXPORT lean_object* l_Lean_Elab_Command_elabAxiom___lambda__5___boxed(lean_object**); static lean_object* l___regBuiltin_Lean_Elab_Command_expandBuiltinInitialize_declRange___closed__7; lean_object* l_Array_toSubarray___rarg(lean_object*, lean_object*, lean_object*); +static lean_object* l_Lean_Elab_Command_elabAxiom___lambda__5___closed__8; LEAN_EXPORT lean_object* l___private_Lean_Elab_Declaration_0__Lean_Elab_Command_expandDeclIdNamespace_x3f(lean_object*, lean_object*, lean_object*); lean_object* lean_array_push(lean_object*, lean_object*); lean_object* lean_array_get_size(lean_object*); static lean_object* l___private_Lean_Elab_Declaration_0__Lean_Elab_Command_isMutualPreambleCommand___closed__8; LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_Declaration_0__Lean_Elab_Command_elabMutualInductive___spec__1(size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*); -static lean_object* l_Lean_Elab_Command_elabAxiom___lambda__4___closed__4; lean_object* lean_string_append(lean_object*, lean_object*); static lean_object* l___regBuiltin_Lean_Elab_Command_expandInitialize_declRange___closed__4; static lean_object* l___regBuiltin_Lean_Elab_Command_elabAttr_declRange___closed__1; @@ -138,6 +139,7 @@ uint8_t l_Lean_Name_isPrefixOf(lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_applyAttributesAt(lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Elab_Command_getTerminationHints(lean_object*); static lean_object* l___private_Lean_Elab_Declaration_0__Lean_Elab_Command_expandDeclNamespace_x3f___closed__25; +static lean_object* l_Lean_Elab_Command_elabAxiom___lambda__5___closed__1; static lean_object* l___private_Lean_Elab_Declaration_0__Lean_Elab_Command_isMutualPreambleCommand___closed__4; lean_object* l_Std_mkHashSetImp___rarg(lean_object*); LEAN_EXPORT lean_object* l_Lean_Elab_liftMacroM___at_Lean_Elab_Command_elabDeclaration___spec__1___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*); @@ -154,10 +156,10 @@ static lean_object* l___private_Lean_Elab_Declaration_0__Lean_Elab_Command_isMut uint8_t lean_usize_dec_lt(size_t, size_t); lean_object* l_liftExcept___at_Lean_Elab_liftMacroM___spec__1(lean_object*, lean_object*, lean_object*); static lean_object* l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__1; -static lean_object* l_Lean_Elab_Command_elabAxiom___lambda__4___closed__1; static lean_object* l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__2; static lean_object* l___regBuiltin_Lean_Elab_Command_elabAttr_declRange___closed__2; -LEAN_EXPORT lean_object* l_Lean_Elab_Command_elabAxiom___lambda__4___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +LEAN_EXPORT lean_object* l_Lean_Elab_Command_elabAxiom___lambda__4___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +static lean_object* l_Lean_Elab_Command_elabAxiom___lambda__5___closed__3; LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_Declaration_0__Lean_Elab_Command_elabMutualInductive___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_levelZero; LEAN_EXPORT lean_object* l_Lean_throwMaxRecDepthAt___at_Lean_Elab_Command_elabDeclaration___spec__4___boxed(lean_object*, lean_object*, lean_object*, lean_object*); @@ -175,6 +177,7 @@ static lean_object* l___regBuiltin_Lean_Elab_Command_elabMutual_declRange___clos static lean_object* l___regBuiltin_Lean_Elab_Command_expandMutualElement_declRange___closed__3; static lean_object* l_Array_forInUnsafe_loop___at_Lean_Elab_Command_elabMutual___spec__1___lambda__1___closed__1; LEAN_EXPORT lean_object* l_Array_forInUnsafe_loop___at_Lean_Elab_Command_elabAttr___spec__1(lean_object*, size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*); +static lean_object* l_Lean_Elab_Command_elabAxiom___lambda__5___closed__7; static lean_object* l___private_Lean_Elab_Declaration_0__Lean_Elab_Command_expandDeclNamespace_x3f___closed__11; static lean_object* l_Lean_Elab_addDeclarationRanges___at_Lean_Elab_Command_elabAxiom___spec__1___closed__2; static lean_object* l___private_Lean_Elab_Declaration_0__Lean_Elab_Command_expandDeclNamespace_x3f___closed__22; @@ -249,7 +252,6 @@ lean_object* l_Lean_mkConstWithLevelParams___at___private_Lean_Elab_PreDefinitio LEAN_EXPORT lean_object* l_Array_forInUnsafe_loop___at_Lean_Elab_Command_elabAttr___spec__2(lean_object*, lean_object*, size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); static lean_object* l___private_Lean_Elab_Declaration_0__Lean_Elab_Command_expandDeclNamespace_x3f___closed__16; lean_object* l_Lean_Syntax_getId(lean_object*); -static lean_object* l_Lean_Elab_Command_elabAxiom___lambda__6___closed__1; LEAN_EXPORT lean_object* l_Lean_Elab_Command_elabClassInductive(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Array_forInUnsafe_loop___at_Lean_Elab_Command_elabAttr___spec__3___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_addAutoBoundImplicits_x27___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -281,7 +283,6 @@ lean_object* l_Lean_FileMap_toPosition(lean_object*, lean_object*); LEAN_EXPORT lean_object* l___regBuiltin_Lean_Elab_Command_expandMutualPreamble_declRange(lean_object*); static lean_object* l___regBuiltin_Lean_Elab_Command_elabMutual_declRange___closed__6; static lean_object* l___regBuiltin_Lean_Elab_Command_elabAttr___closed__1; -static lean_object* l_Lean_Elab_Command_elabAxiom___lambda__4___closed__2; LEAN_EXPORT lean_object* l_Lean_Elab_Command_expandInitCmd___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); uint8_t l_Lean_Elab_Command_isDefLike(lean_object*); static lean_object* l_Lean_Elab_Command_expandInitCmd___lambda__1___closed__13; @@ -302,12 +303,14 @@ static lean_object* l___private_Lean_Elab_Declaration_0__Lean_Elab_Command_expan static lean_object* l___regBuiltin_Lean_Elab_Command_elabAttr___closed__4; static lean_object* l_Lean_Elab_Command_expandInitCmd___lambda__1___closed__17; static lean_object* l_Lean_Elab_Command_elabAttr___closed__1; +static lean_object* l_Lean_Elab_Command_elabAxiom___lambda__5___closed__4; size_t lean_usize_of_nat(lean_object*); static lean_object* l___regBuiltin_Lean_Elab_Command_elabAttr___closed__2; LEAN_EXPORT lean_object* l_Lean_Elab_Command_elabAxiom___lambda__1___boxed(lean_object*); lean_object* l_Lean_Elab_expandDeclIdCore(lean_object*); LEAN_EXPORT lean_object* l_Lean_Elab_Command_elabAttr___boxed(lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT uint8_t l___private_Lean_Elab_Declaration_0__Lean_Elab_Command_isMutualDef(lean_object*); +lean_object* l_Lean_addTrace___at___private_Lean_Elab_Term_0__Lean_Elab_Term_postponeElabTerm___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_addMacroScope(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Array_forInUnsafe_loop___at_Lean_Elab_Command_expandMutualElement___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT uint8_t l___private_Lean_Elab_Declaration_0__Lean_Elab_Command_isMutualPreambleCommand(lean_object*); @@ -331,6 +334,7 @@ LEAN_EXPORT lean_object* l___regBuiltin_Lean_Elab_Command_expandMutualElement(le static lean_object* l_Lean_Elab_Command_expandInitCmd___lambda__1___closed__47; static lean_object* l___private_Lean_Elab_Declaration_0__Lean_Elab_Command_ensureValidNamespace___closed__3; LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_Declaration_0__Lean_Elab_Command_inductiveSyntaxToView___spec__3(lean_object*, lean_object*, size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*); +LEAN_EXPORT lean_object* l_Lean_Elab_Command_elabAxiom___lambda__7(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); static lean_object* l___private_Lean_Elab_Declaration_0__Lean_Elab_Command_expandDeclNamespace_x3f___closed__13; static lean_object* l___regBuiltin_Lean_Elab_Command_elabDeclaration_declRange___closed__5; LEAN_EXPORT lean_object* l_Lean_Elab_liftMacroM___at_Lean_Elab_Command_elabDeclaration___spec__1___lambda__4___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -350,20 +354,22 @@ lean_object* l_Lean_Macro_throwError___rarg(lean_object*, lean_object*, lean_obj static lean_object* l___regBuiltin_Lean_Elab_Command_expandMutualNamespace___closed__6; lean_object* l_Lean_Syntax_getSepArgs(lean_object*); uint8_t l_Lean_isAttribute(lean_object*, lean_object*); +static lean_object* l_Lean_Elab_Command_elabAxiom___lambda__7___closed__1; LEAN_EXPORT lean_object* l___regBuiltin_Lean_Elab_Command_expandInitialize_declRange(lean_object*); +lean_object* l___private_Lean_Util_Trace_0__Lean_checkTraceOptionM___at___private_Lean_Elab_Term_0__Lean_Elab_Term_postponeElabTerm___spec__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); static lean_object* l___regBuiltin_Lean_Elab_Command_expandMutualElement_declRange___closed__1; static lean_object* l_Lean_Elab_Command_expandInitCmd___closed__4; static lean_object* l___regBuiltin_Lean_Elab_Command_expandBuiltinInitialize_declRange___closed__1; static lean_object* l_Lean_Elab_Command_expandInitCmd___lambda__1___closed__46; static lean_object* l___private_Lean_Elab_Declaration_0__Lean_Elab_Command_expandDeclNamespace_x3f___closed__12; static lean_object* l_Lean_Elab_Command_expandInitCmd___closed__11; +static lean_object* l_Lean_Elab_Command_elabAxiom___lambda__5___closed__10; extern lean_object* l_Lean_Elab_macroAttribute; static lean_object* l___regBuiltin_Lean_Elab_Command_expandMutualNamespace___closed__2; lean_object* l_Lean_Syntax_setArg(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_withMacroExpansion___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_environment_main_module(lean_object*); LEAN_EXPORT lean_object* l_Lean_Elab_throwUnsupportedSyntax___at_Lean_Elab_Command_elabDeclaration___spec__5___boxed(lean_object*, lean_object*); -static lean_object* l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__7; LEAN_EXPORT lean_object* l_Lean_Elab_Command_elabMutual(lean_object*, lean_object*, lean_object*, lean_object*); static lean_object* l___regBuiltin_Lean_Elab_Command_expandBuiltinInitialize_declRange___closed__2; LEAN_EXPORT lean_object* l___private_Lean_Elab_Declaration_0__Lean_Elab_Command_elabMutualInductive(lean_object*, lean_object*, lean_object*, lean_object*); @@ -384,6 +390,7 @@ lean_object* l_Lean_Name_append(lean_object*, lean_object*); lean_object* l_Lean_throwError___at_Lean_Elab_Command_expandDeclId___spec__4(lean_object*, lean_object*, lean_object*, lean_object*); static lean_object* l_Lean_Elab_Command_elabInductive___closed__1; lean_object* l_Lean_Syntax_getKind(lean_object*); +LEAN_EXPORT lean_object* l_Lean_Elab_Command_elabAxiom___lambda__7___boxed(lean_object**); static lean_object* l_Lean_Elab_Command_expandInitCmd___lambda__1___closed__23; static lean_object* l___regBuiltin_Lean_Elab_Command_expandBuiltinInitialize_declRange___closed__5; lean_object* l_Lean_MacroScopesView_review(lean_object*); @@ -401,7 +408,7 @@ static lean_object* l___regBuiltin_Lean_Elab_Command_expandBuiltinInitialize_dec static lean_object* l___regBuiltin_Lean_Elab_Command_expandMutualNamespace_declRange___closed__2; lean_object* l_ReaderT_pure___at_Lean_Elab_liftMacroM___spec__2___rarg___boxed(lean_object*, lean_object*, lean_object*); static lean_object* l_Lean_Elab_Command_expandInitCmd___lambda__1___closed__48; -LEAN_EXPORT lean_object* l_Lean_Elab_Command_elabAxiom___lambda__4(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +LEAN_EXPORT lean_object* l_Lean_Elab_Command_elabAxiom___lambda__4(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); static lean_object* l_Array_forInUnsafe_loop___at_Lean_Elab_Command_elabAttr___spec__1___closed__3; lean_object* l_Lean_throwErrorAt___at___private_Lean_Elab_Binders_0__Lean_Elab_Term_ensureAtomicBinderName___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Array_forInUnsafe_loop___at_Lean_Elab_Command_expandMutualElement___spec__1(lean_object*, size_t, size_t, lean_object*, lean_object*, lean_object*); @@ -445,6 +452,7 @@ uint8_t l_Lean_Syntax_isNone(lean_object*); static lean_object* l_Lean_Elab_Command_expandInitCmd___lambda__1___closed__5; static lean_object* l_Lean_Elab_Command_expandInitCmd___closed__18; static lean_object* l_Lean_Elab_Command_getTerminationHints___closed__1; +LEAN_EXPORT lean_object* l_Lean_Elab_Command_initFn____x40_Lean_Elab_Declaration___hyg_5577_(lean_object*); lean_object* l_Lean_Elab_Modifiers_addAttribute(lean_object*, lean_object*); static lean_object* l_Lean_Elab_Command_expandInitCmd___lambda__1___closed__28; LEAN_EXPORT lean_object* l_Lean_Elab_Command_checkValidCtorModifier___at___private_Lean_Elab_Declaration_0__Lean_Elab_Command_inductiveSyntaxToView___spec__1___lambda__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -502,6 +510,7 @@ LEAN_EXPORT lean_object* l_Lean_Elab_Command_elabInductive(lean_object*, lean_ob static lean_object* l___regBuiltin_Lean_Elab_Command_expandMutualNamespace_declRange___closed__5; lean_object* l_Lean_Elab_Command_getScope___rarg(lean_object*, lean_object*); static lean_object* l_Lean_Elab_Command_expandInitCmd___lambda__1___closed__49; +static lean_object* l_Lean_Elab_Command_elabAxiom___lambda__5___closed__9; LEAN_EXPORT lean_object* l_Lean_throwError___at_Lean_Elab_Command_elabDeclaration___spec__3___boxed(lean_object*, lean_object*, lean_object*, lean_object*); static lean_object* l___regBuiltin_Lean_Elab_Command_elabAttr_declRange___closed__5; LEAN_EXPORT uint8_t l_Array_anyMUnsafe_any___at___private_Lean_Elab_Declaration_0__Lean_Elab_Command_isMutualDef___spec__1(lean_object*, size_t, size_t); @@ -509,6 +518,7 @@ LEAN_EXPORT lean_object* l_Lean_Elab_Command_elabAttr(lean_object*, lean_object* static lean_object* l_Lean_Elab_Command_elabDeclaration___closed__1; LEAN_EXPORT lean_object* l_Array_anyMUnsafe_any___at___private_Lean_Elab_Declaration_0__Lean_Elab_Command_isMutualInductive___spec__1___boxed(lean_object*, lean_object*, lean_object*); static lean_object* l_Lean_Elab_Command_expandInitCmd___lambda__1___closed__24; +static lean_object* l_Lean_Elab_Command_elabAxiom___lambda__5___closed__11; LEAN_EXPORT lean_object* l_Lean_Elab_addAuxDeclarationRanges___at___private_Lean_Elab_Declaration_0__Lean_Elab_Command_inductiveSyntaxToView___spec__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); static lean_object* l_Lean_Elab_Command_elabDeclaration___closed__3; LEAN_EXPORT lean_object* l_Array_forInUnsafe_loop___at_Lean_Elab_Command_expandMutualNamespace___spec__1(lean_object*, size_t, size_t, lean_object*, lean_object*, lean_object*); @@ -554,6 +564,7 @@ uint8_t lean_string_dec_eq(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Elab_Command_elabAxiom___lambda__3(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); uint8_t lean_nat_dec_lt(lean_object*, lean_object*); static lean_object* l___regBuiltin_Lean_Elab_Command_expandMutualPreamble___closed__2; +static lean_object* l_Lean_Elab_Command_elabAxiom___lambda__5___closed__2; LEAN_EXPORT lean_object* l___regBuiltin_Lean_Elab_Command_elabAttr(lean_object*); uint8_t l_Lean_Syntax_isIdent(lean_object*); static lean_object* l_Lean_Elab_Command_elabMutual___closed__1; @@ -3483,7 +3494,271 @@ x_12 = l_Lean_Elab_Term_applyAttributesAt(x_1, x_2, x_11, x_4, x_5, x_6, x_7, x_ return x_12; } } -static lean_object* _init_l_Lean_Elab_Command_elabAxiom___lambda__4___closed__1() { +LEAN_EXPORT lean_object* l_Lean_Elab_Command_elabAxiom___lambda__4(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12) { +_start: +{ +lean_object* x_13; +lean_inc(x_11); +lean_inc(x_10); +lean_inc(x_9); +lean_inc(x_8); +lean_inc(x_7); +lean_inc(x_6); +lean_inc(x_1); +x_13 = l_Lean_Elab_Term_ensureNoUnassignedMVars(x_1, x_6, x_7, x_8, x_9, x_10, x_11, x_12); +if (lean_obj_tag(x_13) == 0) +{ +lean_object* x_14; lean_object* x_15; +x_14 = lean_ctor_get(x_13, 1); +lean_inc(x_14); +lean_dec(x_13); +lean_inc(x_11); +lean_inc(x_10); +lean_inc(x_9); +lean_inc(x_8); +lean_inc(x_7); +lean_inc(x_6); +lean_inc(x_1); +x_15 = l_Lean_addDecl___at_Lean_Elab_Term_declareTacticSyntax___spec__1(x_1, x_6, x_7, x_8, x_9, x_10, x_11, x_14); +if (lean_obj_tag(x_15) == 0) +{ +lean_object* x_16; lean_object* x_17; lean_object* x_18; +x_16 = lean_ctor_get(x_15, 1); +lean_inc(x_16); +lean_dec(x_15); +lean_inc(x_2); +x_17 = lean_alloc_closure((void*)(l_Lean_Elab_Command_elabAxiom___lambda__2), 9, 2); +lean_closure_set(x_17, 0, x_2); +lean_closure_set(x_17, 1, x_3); +lean_inc(x_11); +lean_inc(x_10); +lean_inc(x_9); +lean_inc(x_8); +lean_inc(x_7); +lean_inc(x_6); +x_18 = l_Lean_Elab_withSaveInfoContext___at___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux___spec__2(x_17, x_6, x_7, x_8, x_9, x_10, x_11, x_16); +if (lean_obj_tag(x_18) == 0) +{ +lean_object* x_19; uint8_t x_20; lean_object* x_21; +x_19 = lean_ctor_get(x_18, 1); +lean_inc(x_19); +lean_dec(x_18); +x_20 = 0; +lean_inc(x_11); +lean_inc(x_10); +lean_inc(x_6); +lean_inc(x_2); +x_21 = l_Lean_Elab_Term_applyAttributesAt(x_2, x_4, x_20, x_6, x_7, x_8, x_9, x_10, x_11, x_19); +if (lean_obj_tag(x_21) == 0) +{ +lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; uint8_t x_27; +x_22 = lean_ctor_get(x_21, 1); +lean_inc(x_22); +lean_dec(x_21); +x_23 = lean_st_ref_get(x_11, x_22); +x_24 = lean_ctor_get(x_23, 0); +lean_inc(x_24); +x_25 = lean_ctor_get(x_23, 1); +lean_inc(x_25); +lean_dec(x_23); +x_26 = lean_ctor_get(x_24, 0); +lean_inc(x_26); +lean_dec(x_24); +lean_inc(x_2); +x_27 = l_Lean_isExtern(x_26, x_2); +if (x_27 == 0) +{ +uint8_t x_28; lean_object* x_29; +lean_dec(x_1); +x_28 = 1; +x_29 = l_Lean_Elab_Term_applyAttributesAt(x_2, x_4, x_28, x_6, x_7, x_8, x_9, x_10, x_11, x_25); +lean_dec(x_9); +lean_dec(x_8); +lean_dec(x_7); +return x_29; +} +else +{ +lean_object* x_30; +lean_inc(x_11); +lean_inc(x_10); +lean_inc(x_9); +lean_inc(x_8); +lean_inc(x_7); +lean_inc(x_6); +x_30 = l_Lean_compileDecl___at_Lean_Elab_Term_declareTacticSyntax___spec__3(x_1, x_6, x_7, x_8, x_9, x_10, x_11, x_25); +if (lean_obj_tag(x_30) == 0) +{ +lean_object* x_31; uint8_t x_32; lean_object* x_33; +x_31 = lean_ctor_get(x_30, 1); +lean_inc(x_31); +lean_dec(x_30); +x_32 = 1; +x_33 = l_Lean_Elab_Term_applyAttributesAt(x_2, x_4, x_32, x_6, x_7, x_8, x_9, x_10, x_11, x_31); +lean_dec(x_9); +lean_dec(x_8); +lean_dec(x_7); +return x_33; +} +else +{ +uint8_t x_34; +lean_dec(x_11); +lean_dec(x_10); +lean_dec(x_9); +lean_dec(x_8); +lean_dec(x_7); +lean_dec(x_6); +lean_dec(x_2); +x_34 = !lean_is_exclusive(x_30); +if (x_34 == 0) +{ +return x_30; +} +else +{ +lean_object* x_35; lean_object* x_36; lean_object* x_37; +x_35 = lean_ctor_get(x_30, 0); +x_36 = lean_ctor_get(x_30, 1); +lean_inc(x_36); +lean_inc(x_35); +lean_dec(x_30); +x_37 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_37, 0, x_35); +lean_ctor_set(x_37, 1, x_36); +return x_37; +} +} +} +} +else +{ +uint8_t x_38; +lean_dec(x_11); +lean_dec(x_10); +lean_dec(x_9); +lean_dec(x_8); +lean_dec(x_7); +lean_dec(x_6); +lean_dec(x_2); +lean_dec(x_1); +x_38 = !lean_is_exclusive(x_21); +if (x_38 == 0) +{ +return x_21; +} +else +{ +lean_object* x_39; lean_object* x_40; lean_object* x_41; +x_39 = lean_ctor_get(x_21, 0); +x_40 = lean_ctor_get(x_21, 1); +lean_inc(x_40); +lean_inc(x_39); +lean_dec(x_21); +x_41 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_41, 0, x_39); +lean_ctor_set(x_41, 1, x_40); +return x_41; +} +} +} +else +{ +uint8_t x_42; +lean_dec(x_11); +lean_dec(x_10); +lean_dec(x_9); +lean_dec(x_8); +lean_dec(x_7); +lean_dec(x_6); +lean_dec(x_2); +lean_dec(x_1); +x_42 = !lean_is_exclusive(x_18); +if (x_42 == 0) +{ +return x_18; +} +else +{ +lean_object* x_43; lean_object* x_44; lean_object* x_45; +x_43 = lean_ctor_get(x_18, 0); +x_44 = lean_ctor_get(x_18, 1); +lean_inc(x_44); +lean_inc(x_43); +lean_dec(x_18); +x_45 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_45, 0, x_43); +lean_ctor_set(x_45, 1, x_44); +return x_45; +} +} +} +else +{ +uint8_t x_46; +lean_dec(x_11); +lean_dec(x_10); +lean_dec(x_9); +lean_dec(x_8); +lean_dec(x_7); +lean_dec(x_6); +lean_dec(x_3); +lean_dec(x_2); +lean_dec(x_1); +x_46 = !lean_is_exclusive(x_15); +if (x_46 == 0) +{ +return x_15; +} +else +{ +lean_object* x_47; lean_object* x_48; lean_object* x_49; +x_47 = lean_ctor_get(x_15, 0); +x_48 = lean_ctor_get(x_15, 1); +lean_inc(x_48); +lean_inc(x_47); +lean_dec(x_15); +x_49 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_49, 0, x_47); +lean_ctor_set(x_49, 1, x_48); +return x_49; +} +} +} +else +{ +uint8_t x_50; +lean_dec(x_11); +lean_dec(x_10); +lean_dec(x_9); +lean_dec(x_8); +lean_dec(x_7); +lean_dec(x_6); +lean_dec(x_3); +lean_dec(x_2); +lean_dec(x_1); +x_50 = !lean_is_exclusive(x_13); +if (x_50 == 0) +{ +return x_13; +} +else +{ +lean_object* x_51; lean_object* x_52; lean_object* x_53; +x_51 = lean_ctor_get(x_13, 0); +x_52 = lean_ctor_get(x_13, 1); +lean_inc(x_52); +lean_inc(x_51); +lean_dec(x_13); +x_53 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_53, 0, x_51); +lean_ctor_set(x_53, 1, x_52); +return x_53; +} +} +} +} +static lean_object* _init_l_Lean_Elab_Command_elabAxiom___lambda__5___closed__1() { _start: { lean_object* x_1; @@ -3491,7 +3766,7 @@ x_1 = lean_alloc_closure((void*)(l_Lean_Elab_Command_elabAxiom___lambda__1___box return x_1; } } -static lean_object* _init_l_Lean_Elab_Command_elabAxiom___lambda__4___closed__2() { +static lean_object* _init_l_Lean_Elab_Command_elabAxiom___lambda__5___closed__2() { _start: { lean_object* x_1; lean_object* x_2; @@ -3500,7 +3775,7 @@ x_2 = l_Std_mkHashSetImp___rarg(x_1); return x_2; } } -static lean_object* _init_l_Lean_Elab_Command_elabAxiom___lambda__4___closed__3() { +static lean_object* _init_l_Lean_Elab_Command_elabAxiom___lambda__5___closed__3() { _start: { lean_object* x_1; lean_object* x_2; @@ -3509,12 +3784,12 @@ x_2 = lean_mk_empty_array_with_capacity(x_1); return x_2; } } -static lean_object* _init_l_Lean_Elab_Command_elabAxiom___lambda__4___closed__4() { +static lean_object* _init_l_Lean_Elab_Command_elabAxiom___lambda__5___closed__4() { _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = l_Lean_Elab_Command_elabAxiom___lambda__4___closed__2; -x_2 = l_Lean_Elab_Command_elabAxiom___lambda__4___closed__3; +x_1 = l_Lean_Elab_Command_elabAxiom___lambda__5___closed__2; +x_2 = l_Lean_Elab_Command_elabAxiom___lambda__5___closed__3; x_3 = lean_alloc_ctor(0, 3, 0); lean_ctor_set(x_3, 0, x_1); lean_ctor_set(x_3, 1, x_1); @@ -3522,11 +3797,74 @@ lean_ctor_set(x_3, 2, x_2); return x_3; } } -LEAN_EXPORT lean_object* l_Lean_Elab_Command_elabAxiom___lambda__4(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12, lean_object* x_13, lean_object* x_14, lean_object* x_15, lean_object* x_16) { +static lean_object* _init_l_Lean_Elab_Command_elabAxiom___lambda__5___closed__5() { +_start: +{ +lean_object* x_1; +x_1 = lean_mk_string_from_bytes("Elab", 4); +return x_1; +} +} +static lean_object* _init_l_Lean_Elab_Command_elabAxiom___lambda__5___closed__6() { +_start: +{ +lean_object* x_1; lean_object* x_2; lean_object* x_3; +x_1 = lean_box(0); +x_2 = l_Lean_Elab_Command_elabAxiom___lambda__5___closed__5; +x_3 = lean_name_mk_string(x_1, x_2); +return x_3; +} +} +static lean_object* _init_l_Lean_Elab_Command_elabAxiom___lambda__5___closed__7() { +_start: +{ +lean_object* x_1; lean_object* x_2; lean_object* x_3; +x_1 = l_Lean_Elab_Command_elabAxiom___lambda__5___closed__6; +x_2 = l___private_Lean_Elab_Declaration_0__Lean_Elab_Command_expandDeclNamespace_x3f___closed__17; +x_3 = lean_name_mk_string(x_1, x_2); +return x_3; +} +} +static lean_object* _init_l_Lean_Elab_Command_elabAxiom___lambda__5___closed__8() { +_start: +{ +lean_object* x_1; +x_1 = lean_mk_string_from_bytes("", 0); +return x_1; +} +} +static lean_object* _init_l_Lean_Elab_Command_elabAxiom___lambda__5___closed__9() { +_start: +{ +lean_object* x_1; lean_object* x_2; +x_1 = l_Lean_Elab_Command_elabAxiom___lambda__5___closed__8; +x_2 = l_Lean_stringToMessageData(x_1); +return x_2; +} +} +static lean_object* _init_l_Lean_Elab_Command_elabAxiom___lambda__5___closed__10() { +_start: +{ +lean_object* x_1; +x_1 = lean_mk_string_from_bytes(" : ", 3); +return x_1; +} +} +static lean_object* _init_l_Lean_Elab_Command_elabAxiom___lambda__5___closed__11() { +_start: +{ +lean_object* x_1; lean_object* x_2; +x_1 = l_Lean_Elab_Command_elabAxiom___lambda__5___closed__10; +x_2 = l_Lean_stringToMessageData(x_1); +return x_2; +} +} +LEAN_EXPORT lean_object* l_Lean_Elab_Command_elabAxiom___lambda__5(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12, lean_object* x_13, lean_object* x_14, lean_object* x_15, lean_object* x_16) { _start: { lean_object* x_17; uint8_t x_18; lean_object* x_19; x_17 = lean_ctor_get(x_1, 1); +lean_inc(x_17); x_18 = 2; lean_inc(x_15); lean_inc(x_14); @@ -3595,7 +3933,7 @@ x_37 = lean_ctor_get(x_35, 1); lean_inc(x_37); lean_dec(x_35); x_38 = lean_unsigned_to_nat(1u); -x_39 = l_Lean_Elab_Command_elabAxiom___lambda__4___closed__1; +x_39 = l_Lean_Elab_Command_elabAxiom___lambda__5___closed__1; x_40 = l_Lean_Elab_Term_levelMVarToParam(x_36, x_38, x_39, x_10, x_11, x_12, x_13, x_14, x_15, x_37); x_41 = lean_ctor_get(x_40, 0); lean_inc(x_41); @@ -3605,7 +3943,7 @@ lean_dec(x_40); x_43 = lean_ctor_get(x_41, 0); lean_inc(x_43); lean_dec(x_41); -x_44 = l_Lean_Elab_Command_elabAxiom___lambda__4___closed__4; +x_44 = l_Lean_Elab_Command_elabAxiom___lambda__5___closed__4; lean_inc(x_43); x_45 = l_Lean_CollectLevelParams_main(x_43, x_44); x_46 = lean_ctor_get(x_45, 2); @@ -3616,8 +3954,10 @@ if (lean_obj_tag(x_47) == 0) { lean_object* x_48; lean_object* x_49; lean_object* x_50; lean_object* x_51; lean_dec(x_43); +lean_dec(x_17); lean_dec(x_8); lean_dec(x_2); +lean_dec(x_1); x_48 = lean_ctor_get(x_47, 0); lean_inc(x_48); lean_dec(x_47); @@ -3630,288 +3970,123 @@ lean_dec(x_15); lean_dec(x_13); lean_dec(x_12); lean_dec(x_11); +lean_dec(x_7); return x_51; } else { -lean_object* x_52; lean_object* x_53; uint8_t x_54; lean_object* x_55; lean_object* x_56; lean_object* x_57; +lean_object* x_52; lean_object* x_53; lean_object* x_54; lean_object* x_55; lean_object* x_56; uint8_t x_57; lean_object* x_58; lean_object* x_59; lean_object* x_60; uint8_t x_61; lean_object* x_62; lean_object* x_78; lean_object* x_79; lean_object* x_80; uint8_t x_81; +lean_dec(x_7); x_52 = lean_ctor_get(x_47, 0); lean_inc(x_52); lean_dec(x_47); +x_53 = l_Lean_instantiateMVars___at_Lean_Elab_Term_MVarErrorInfo_logError___spec__1(x_43, x_10, x_11, x_12, x_13, x_14, x_15, x_42); +x_54 = lean_ctor_get(x_53, 0); +lean_inc(x_54); +x_55 = lean_ctor_get(x_53, 1); +lean_inc(x_55); +lean_dec(x_53); +lean_inc(x_54); lean_inc(x_2); -x_53 = lean_alloc_ctor(0, 3, 0); -lean_ctor_set(x_53, 0, x_2); -lean_ctor_set(x_53, 1, x_52); -lean_ctor_set(x_53, 2, x_43); -x_54 = lean_ctor_get_uint8(x_1, sizeof(void*)*2 + 3); -x_55 = lean_alloc_ctor(0, 1, 1); -lean_ctor_set(x_55, 0, x_53); -lean_ctor_set_uint8(x_55, sizeof(void*)*1, x_54); -x_56 = lean_alloc_ctor(0, 1, 0); -lean_ctor_set(x_56, 0, x_55); -lean_inc(x_15); -lean_inc(x_14); -lean_inc(x_13); -lean_inc(x_12); -lean_inc(x_11); -lean_inc(x_10); -lean_inc(x_56); -x_57 = l_Lean_Elab_Term_ensureNoUnassignedMVars(x_56, x_10, x_11, x_12, x_13, x_14, x_15, x_42); -if (lean_obj_tag(x_57) == 0) -{ -lean_object* x_58; lean_object* x_59; -x_58 = lean_ctor_get(x_57, 1); -lean_inc(x_58); -lean_dec(x_57); -lean_inc(x_15); -lean_inc(x_14); -lean_inc(x_13); -lean_inc(x_12); -lean_inc(x_11); -lean_inc(x_10); -lean_inc(x_56); -x_59 = l_Lean_addDecl___at_Lean_Elab_Term_declareTacticSyntax___spec__1(x_56, x_10, x_11, x_12, x_13, x_14, x_15, x_58); -if (lean_obj_tag(x_59) == 0) -{ -lean_object* x_60; lean_object* x_61; lean_object* x_62; -x_60 = lean_ctor_get(x_59, 1); -lean_inc(x_60); -lean_dec(x_59); -lean_inc(x_2); -x_61 = lean_alloc_closure((void*)(l_Lean_Elab_Command_elabAxiom___lambda__2), 9, 2); -lean_closure_set(x_61, 0, x_2); -lean_closure_set(x_61, 1, x_8); -lean_inc(x_15); -lean_inc(x_14); -lean_inc(x_13); -lean_inc(x_12); -lean_inc(x_11); -lean_inc(x_10); -x_62 = l_Lean_Elab_withSaveInfoContext___at___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux___spec__2(x_61, x_10, x_11, x_12, x_13, x_14, x_15, x_60); -if (lean_obj_tag(x_62) == 0) -{ -lean_object* x_63; uint8_t x_64; lean_object* x_65; -x_63 = lean_ctor_get(x_62, 1); -lean_inc(x_63); -lean_dec(x_62); -x_64 = 0; -lean_inc(x_15); -lean_inc(x_14); -lean_inc(x_10); -lean_inc(x_2); -x_65 = l_Lean_Elab_Term_applyAttributesAt(x_2, x_17, x_64, x_10, x_11, x_12, x_13, x_14, x_15, x_63); -if (lean_obj_tag(x_65) == 0) -{ -lean_object* x_66; lean_object* x_67; lean_object* x_68; lean_object* x_69; lean_object* x_70; uint8_t x_71; -x_66 = lean_ctor_get(x_65, 1); -lean_inc(x_66); -lean_dec(x_65); -x_67 = lean_st_ref_get(x_15, x_66); -x_68 = lean_ctor_get(x_67, 0); -lean_inc(x_68); -x_69 = lean_ctor_get(x_67, 1); -lean_inc(x_69); -lean_dec(x_67); -x_70 = lean_ctor_get(x_68, 0); -lean_inc(x_70); -lean_dec(x_68); -lean_inc(x_2); -x_71 = l_Lean_isExtern(x_70, x_2); -if (x_71 == 0) -{ -uint8_t x_72; lean_object* x_73; -lean_dec(x_56); -x_72 = 1; -x_73 = l_Lean_Elab_Term_applyAttributesAt(x_2, x_17, x_72, x_10, x_11, x_12, x_13, x_14, x_15, x_69); -lean_dec(x_13); -lean_dec(x_12); -lean_dec(x_11); -return x_73; -} -else -{ -lean_object* x_74; -lean_inc(x_15); -lean_inc(x_14); -lean_inc(x_13); -lean_inc(x_12); -lean_inc(x_11); -lean_inc(x_10); -x_74 = l_Lean_compileDecl___at_Lean_Elab_Term_declareTacticSyntax___spec__3(x_56, x_10, x_11, x_12, x_13, x_14, x_15, x_69); -if (lean_obj_tag(x_74) == 0) -{ -lean_object* x_75; uint8_t x_76; lean_object* x_77; -x_75 = lean_ctor_get(x_74, 1); -lean_inc(x_75); -lean_dec(x_74); -x_76 = 1; -x_77 = l_Lean_Elab_Term_applyAttributesAt(x_2, x_17, x_76, x_10, x_11, x_12, x_13, x_14, x_15, x_75); -lean_dec(x_13); -lean_dec(x_12); -lean_dec(x_11); -return x_77; -} -else -{ -uint8_t x_78; -lean_dec(x_15); -lean_dec(x_14); -lean_dec(x_13); -lean_dec(x_12); -lean_dec(x_11); -lean_dec(x_10); -lean_dec(x_2); -x_78 = !lean_is_exclusive(x_74); -if (x_78 == 0) -{ -return x_74; -} -else -{ -lean_object* x_79; lean_object* x_80; lean_object* x_81; -x_79 = lean_ctor_get(x_74, 0); -x_80 = lean_ctor_get(x_74, 1); -lean_inc(x_80); +x_56 = lean_alloc_ctor(0, 3, 0); +lean_ctor_set(x_56, 0, x_2); +lean_ctor_set(x_56, 1, x_52); +lean_ctor_set(x_56, 2, x_54); +x_57 = lean_ctor_get_uint8(x_1, sizeof(void*)*2 + 3); +lean_dec(x_1); +x_58 = lean_alloc_ctor(0, 1, 1); +lean_ctor_set(x_58, 0, x_56); +lean_ctor_set_uint8(x_58, sizeof(void*)*1, x_57); +x_59 = lean_alloc_ctor(0, 1, 0); +lean_ctor_set(x_59, 0, x_58); +x_60 = l_Lean_Elab_Command_elabAxiom___lambda__5___closed__7; +x_78 = lean_st_ref_get(x_15, x_55); +x_79 = lean_ctor_get(x_78, 0); lean_inc(x_79); -lean_dec(x_74); -x_81 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_81, 0, x_79); -lean_ctor_set(x_81, 1, x_80); -return x_81; -} -} -} +x_80 = lean_ctor_get(x_79, 3); +lean_inc(x_80); +lean_dec(x_79); +x_81 = lean_ctor_get_uint8(x_80, sizeof(void*)*1); +lean_dec(x_80); +if (x_81 == 0) +{ +lean_object* x_82; +x_82 = lean_ctor_get(x_78, 1); +lean_inc(x_82); +lean_dec(x_78); +x_61 = x_24; +x_62 = x_82; +goto block_77; } else { -uint8_t x_82; -lean_dec(x_56); -lean_dec(x_15); -lean_dec(x_14); -lean_dec(x_13); -lean_dec(x_12); -lean_dec(x_11); -lean_dec(x_10); -lean_dec(x_2); -x_82 = !lean_is_exclusive(x_65); -if (x_82 == 0) -{ -return x_65; -} -else -{ -lean_object* x_83; lean_object* x_84; lean_object* x_85; -x_83 = lean_ctor_get(x_65, 0); -x_84 = lean_ctor_get(x_65, 1); -lean_inc(x_84); +lean_object* x_83; lean_object* x_84; lean_object* x_85; lean_object* x_86; uint8_t x_87; +x_83 = lean_ctor_get(x_78, 1); lean_inc(x_83); -lean_dec(x_65); -x_85 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_85, 0, x_83); -lean_ctor_set(x_85, 1, x_84); -return x_85; +lean_dec(x_78); +x_84 = l___private_Lean_Util_Trace_0__Lean_checkTraceOptionM___at___private_Lean_Elab_Term_0__Lean_Elab_Term_postponeElabTerm___spec__2(x_60, x_10, x_11, x_12, x_13, x_14, x_15, x_83); +x_85 = lean_ctor_get(x_84, 0); +lean_inc(x_85); +x_86 = lean_ctor_get(x_84, 1); +lean_inc(x_86); +lean_dec(x_84); +x_87 = lean_unbox(x_85); +lean_dec(x_85); +x_61 = x_87; +x_62 = x_86; +goto block_77; +} +block_77: +{ +if (x_61 == 0) +{ +lean_object* x_63; lean_object* x_64; +lean_dec(x_54); +x_63 = lean_box(0); +x_64 = l_Lean_Elab_Command_elabAxiom___lambda__4(x_59, x_2, x_8, x_17, x_63, x_10, x_11, x_12, x_13, x_14, x_15, x_62); +lean_dec(x_17); +return x_64; +} +else +{ +lean_object* x_65; lean_object* x_66; lean_object* x_67; lean_object* x_68; lean_object* x_69; lean_object* x_70; lean_object* x_71; lean_object* x_72; lean_object* x_73; lean_object* x_74; lean_object* x_75; lean_object* x_76; +lean_inc(x_2); +x_65 = lean_alloc_ctor(4, 1, 0); +lean_ctor_set(x_65, 0, x_2); +x_66 = l_Lean_Elab_Command_elabAxiom___lambda__5___closed__9; +x_67 = lean_alloc_ctor(10, 2, 0); +lean_ctor_set(x_67, 0, x_66); +lean_ctor_set(x_67, 1, x_65); +x_68 = l_Lean_Elab_Command_elabAxiom___lambda__5___closed__11; +x_69 = lean_alloc_ctor(10, 2, 0); +lean_ctor_set(x_69, 0, x_67); +lean_ctor_set(x_69, 1, x_68); +x_70 = lean_alloc_ctor(2, 1, 0); +lean_ctor_set(x_70, 0, x_54); +x_71 = lean_alloc_ctor(10, 2, 0); +lean_ctor_set(x_71, 0, x_69); +lean_ctor_set(x_71, 1, x_70); +x_72 = lean_alloc_ctor(10, 2, 0); +lean_ctor_set(x_72, 0, x_71); +lean_ctor_set(x_72, 1, x_66); +x_73 = l_Lean_addTrace___at___private_Lean_Elab_Term_0__Lean_Elab_Term_postponeElabTerm___spec__1(x_60, x_72, x_10, x_11, x_12, x_13, x_14, x_15, x_62); +x_74 = lean_ctor_get(x_73, 0); +lean_inc(x_74); +x_75 = lean_ctor_get(x_73, 1); +lean_inc(x_75); +lean_dec(x_73); +x_76 = l_Lean_Elab_Command_elabAxiom___lambda__4(x_59, x_2, x_8, x_17, x_74, x_10, x_11, x_12, x_13, x_14, x_15, x_75); +lean_dec(x_74); +lean_dec(x_17); +return x_76; +} } } } else { -uint8_t x_86; -lean_dec(x_56); -lean_dec(x_15); -lean_dec(x_14); -lean_dec(x_13); -lean_dec(x_12); -lean_dec(x_11); -lean_dec(x_10); -lean_dec(x_2); -x_86 = !lean_is_exclusive(x_62); -if (x_86 == 0) -{ -return x_62; -} -else -{ -lean_object* x_87; lean_object* x_88; lean_object* x_89; -x_87 = lean_ctor_get(x_62, 0); -x_88 = lean_ctor_get(x_62, 1); -lean_inc(x_88); -lean_inc(x_87); -lean_dec(x_62); -x_89 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_89, 0, x_87); -lean_ctor_set(x_89, 1, x_88); -return x_89; -} -} -} -else -{ -uint8_t x_90; -lean_dec(x_56); -lean_dec(x_15); -lean_dec(x_14); -lean_dec(x_13); -lean_dec(x_12); -lean_dec(x_11); -lean_dec(x_10); -lean_dec(x_8); -lean_dec(x_2); -x_90 = !lean_is_exclusive(x_59); -if (x_90 == 0) -{ -return x_59; -} -else -{ -lean_object* x_91; lean_object* x_92; lean_object* x_93; -x_91 = lean_ctor_get(x_59, 0); -x_92 = lean_ctor_get(x_59, 1); -lean_inc(x_92); -lean_inc(x_91); -lean_dec(x_59); -x_93 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_93, 0, x_91); -lean_ctor_set(x_93, 1, x_92); -return x_93; -} -} -} -else -{ -uint8_t x_94; -lean_dec(x_56); -lean_dec(x_15); -lean_dec(x_14); -lean_dec(x_13); -lean_dec(x_12); -lean_dec(x_11); -lean_dec(x_10); -lean_dec(x_8); -lean_dec(x_2); -x_94 = !lean_is_exclusive(x_57); -if (x_94 == 0) -{ -return x_57; -} -else -{ -lean_object* x_95; lean_object* x_96; lean_object* x_97; -x_95 = lean_ctor_get(x_57, 0); -x_96 = lean_ctor_get(x_57, 1); -lean_inc(x_96); -lean_inc(x_95); -lean_dec(x_57); -x_97 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_97, 0, x_95); -lean_ctor_set(x_97, 1, x_96); -return x_97; -} -} -} -} -else -{ -uint8_t x_98; +uint8_t x_88; +lean_dec(x_17); lean_dec(x_15); lean_dec(x_14); lean_dec(x_13); @@ -3919,32 +4094,35 @@ lean_dec(x_12); lean_dec(x_11); lean_dec(x_10); lean_dec(x_8); +lean_dec(x_7); lean_dec(x_6); lean_dec(x_5); lean_dec(x_2); -x_98 = !lean_is_exclusive(x_35); -if (x_98 == 0) +lean_dec(x_1); +x_88 = !lean_is_exclusive(x_35); +if (x_88 == 0) { return x_35; } else { -lean_object* x_99; lean_object* x_100; lean_object* x_101; -x_99 = lean_ctor_get(x_35, 0); -x_100 = lean_ctor_get(x_35, 1); -lean_inc(x_100); -lean_inc(x_99); +lean_object* x_89; lean_object* x_90; lean_object* x_91; +x_89 = lean_ctor_get(x_35, 0); +x_90 = lean_ctor_get(x_35, 1); +lean_inc(x_90); +lean_inc(x_89); lean_dec(x_35); -x_101 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_101, 0, x_99); -lean_ctor_set(x_101, 1, x_100); -return x_101; +x_91 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_91, 0, x_89); +lean_ctor_set(x_91, 1, x_90); +return x_91; } } } else { -uint8_t x_102; +uint8_t x_92; +lean_dec(x_17); lean_dec(x_15); lean_dec(x_14); lean_dec(x_13); @@ -3952,34 +4130,37 @@ lean_dec(x_12); lean_dec(x_11); lean_dec(x_10); lean_dec(x_8); +lean_dec(x_7); lean_dec(x_6); lean_dec(x_5); lean_dec(x_4); lean_dec(x_2); -x_102 = !lean_is_exclusive(x_32); -if (x_102 == 0) +lean_dec(x_1); +x_92 = !lean_is_exclusive(x_32); +if (x_92 == 0) { return x_32; } else { -lean_object* x_103; lean_object* x_104; lean_object* x_105; -x_103 = lean_ctor_get(x_32, 0); -x_104 = lean_ctor_get(x_32, 1); -lean_inc(x_104); -lean_inc(x_103); +lean_object* x_93; lean_object* x_94; lean_object* x_95; +x_93 = lean_ctor_get(x_32, 0); +x_94 = lean_ctor_get(x_32, 1); +lean_inc(x_94); +lean_inc(x_93); lean_dec(x_32); -x_105 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_105, 0, x_103); -lean_ctor_set(x_105, 1, x_104); -return x_105; +x_95 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_95, 0, x_93); +lean_ctor_set(x_95, 1, x_94); +return x_95; } } } else { -uint8_t x_106; +uint8_t x_96; lean_dec(x_22); +lean_dec(x_17); lean_dec(x_15); lean_dec(x_14); lean_dec(x_13); @@ -3988,33 +4169,36 @@ lean_dec(x_11); lean_dec(x_10); lean_dec(x_9); lean_dec(x_8); +lean_dec(x_7); lean_dec(x_6); lean_dec(x_5); lean_dec(x_4); lean_dec(x_2); -x_106 = !lean_is_exclusive(x_25); -if (x_106 == 0) +lean_dec(x_1); +x_96 = !lean_is_exclusive(x_25); +if (x_96 == 0) { return x_25; } else { -lean_object* x_107; lean_object* x_108; lean_object* x_109; -x_107 = lean_ctor_get(x_25, 0); -x_108 = lean_ctor_get(x_25, 1); -lean_inc(x_108); -lean_inc(x_107); +lean_object* x_97; lean_object* x_98; lean_object* x_99; +x_97 = lean_ctor_get(x_25, 0); +x_98 = lean_ctor_get(x_25, 1); +lean_inc(x_98); +lean_inc(x_97); lean_dec(x_25); -x_109 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_109, 0, x_107); -lean_ctor_set(x_109, 1, x_108); -return x_109; +x_99 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_99, 0, x_97); +lean_ctor_set(x_99, 1, x_98); +return x_99; } } } else { -uint8_t x_110; +uint8_t x_100; +lean_dec(x_17); lean_dec(x_15); lean_dec(x_14); lean_dec(x_13); @@ -4023,33 +4207,36 @@ lean_dec(x_11); lean_dec(x_10); lean_dec(x_9); lean_dec(x_8); +lean_dec(x_7); lean_dec(x_6); lean_dec(x_5); lean_dec(x_4); lean_dec(x_2); -x_110 = !lean_is_exclusive(x_21); -if (x_110 == 0) +lean_dec(x_1); +x_100 = !lean_is_exclusive(x_21); +if (x_100 == 0) { return x_21; } else { -lean_object* x_111; lean_object* x_112; lean_object* x_113; -x_111 = lean_ctor_get(x_21, 0); -x_112 = lean_ctor_get(x_21, 1); -lean_inc(x_112); -lean_inc(x_111); +lean_object* x_101; lean_object* x_102; lean_object* x_103; +x_101 = lean_ctor_get(x_21, 0); +x_102 = lean_ctor_get(x_21, 1); +lean_inc(x_102); +lean_inc(x_101); lean_dec(x_21); -x_113 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_113, 0, x_111); -lean_ctor_set(x_113, 1, x_112); -return x_113; +x_103 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_103, 0, x_101); +lean_ctor_set(x_103, 1, x_102); +return x_103; } } } else { -uint8_t x_114; +uint8_t x_104; +lean_dec(x_17); lean_dec(x_15); lean_dec(x_14); lean_dec(x_13); @@ -4058,39 +4245,41 @@ lean_dec(x_11); lean_dec(x_10); lean_dec(x_9); lean_dec(x_8); +lean_dec(x_7); lean_dec(x_6); lean_dec(x_5); lean_dec(x_4); lean_dec(x_3); lean_dec(x_2); -x_114 = !lean_is_exclusive(x_19); -if (x_114 == 0) +lean_dec(x_1); +x_104 = !lean_is_exclusive(x_19); +if (x_104 == 0) { return x_19; } else { -lean_object* x_115; lean_object* x_116; lean_object* x_117; -x_115 = lean_ctor_get(x_19, 0); -x_116 = lean_ctor_get(x_19, 1); -lean_inc(x_116); -lean_inc(x_115); +lean_object* x_105; lean_object* x_106; lean_object* x_107; +x_105 = lean_ctor_get(x_19, 0); +x_106 = lean_ctor_get(x_19, 1); +lean_inc(x_106); +lean_inc(x_105); lean_dec(x_19); -x_117 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_117, 0, x_115); -lean_ctor_set(x_117, 1, x_116); -return x_117; +x_107 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_107, 0, x_105); +lean_ctor_set(x_107, 1, x_106); +return x_107; } } } } -LEAN_EXPORT lean_object* l_Lean_Elab_Command_elabAxiom___lambda__5(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12, lean_object* x_13, lean_object* x_14, lean_object* x_15, lean_object* x_16, lean_object* x_17) { +LEAN_EXPORT lean_object* l_Lean_Elab_Command_elabAxiom___lambda__6(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12, lean_object* x_13, lean_object* x_14, lean_object* x_15, lean_object* x_16, lean_object* x_17) { _start: { lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; x_18 = l_Lean_Syntax_getArgs(x_1); lean_inc(x_6); -x_19 = lean_alloc_closure((void*)(l_Lean_Elab_Command_elabAxiom___lambda__4___boxed), 16, 8); +x_19 = lean_alloc_closure((void*)(l_Lean_Elab_Command_elabAxiom___lambda__5), 16, 8); lean_closure_set(x_19, 0, x_2); lean_closure_set(x_19, 1, x_3); lean_closure_set(x_19, 2, x_4); @@ -4109,7 +4298,7 @@ x_22 = l_Lean_Elab_Term_withoutAutoBoundImplicit___rarg(x_21, x_11, x_12, x_13, return x_22; } } -static lean_object* _init_l_Lean_Elab_Command_elabAxiom___lambda__6___closed__1() { +static lean_object* _init_l_Lean_Elab_Command_elabAxiom___lambda__7___closed__1() { _start: { lean_object* x_1; lean_object* x_2; @@ -4118,7 +4307,7 @@ x_2 = l_Lean_mkSort(x_1); return x_2; } } -LEAN_EXPORT lean_object* l_Lean_Elab_Command_elabAxiom___lambda__6(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12, lean_object* x_13, lean_object* x_14, lean_object* x_15, lean_object* x_16, lean_object* x_17) { +LEAN_EXPORT lean_object* l_Lean_Elab_Command_elabAxiom___lambda__7(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12, lean_object* x_13, lean_object* x_14, lean_object* x_15, lean_object* x_16, lean_object* x_17) { _start: { uint8_t x_18; lean_object* x_19; @@ -4169,7 +4358,7 @@ x_36 = l_Lean_Core_resetMessageLog(x_15, x_16, x_32); x_37 = lean_ctor_get(x_36, 1); lean_inc(x_37); lean_dec(x_36); -x_38 = lean_alloc_closure((void*)(l_Lean_Elab_Command_elabAxiom___lambda__5___boxed), 17, 8); +x_38 = lean_alloc_closure((void*)(l_Lean_Elab_Command_elabAxiom___lambda__6___boxed), 17, 8); lean_closure_set(x_38, 0, x_2); lean_closure_set(x_38, 1, x_3); lean_closure_set(x_38, 2, x_4); @@ -4178,7 +4367,7 @@ lean_closure_set(x_38, 4, x_6); lean_closure_set(x_38, 5, x_7); lean_closure_set(x_38, 6, x_8); lean_closure_set(x_38, 7, x_9); -x_39 = l_Lean_Elab_Command_elabAxiom___lambda__6___closed__1; +x_39 = l_Lean_Elab_Command_elabAxiom___lambda__7___closed__1; x_40 = l_Lean_Elab_Term_addAutoBoundImplicits_x27___rarg(x_10, x_39, x_38, x_11, x_12, x_13, x_14, x_15, x_16, x_37); return x_40; } @@ -4226,7 +4415,7 @@ x_56 = l_Lean_Core_resetMessageLog(x_15, x_16, x_32); x_57 = lean_ctor_get(x_56, 1); lean_inc(x_57); lean_dec(x_56); -x_58 = lean_alloc_closure((void*)(l_Lean_Elab_Command_elabAxiom___lambda__5___boxed), 17, 8); +x_58 = lean_alloc_closure((void*)(l_Lean_Elab_Command_elabAxiom___lambda__6___boxed), 17, 8); lean_closure_set(x_58, 0, x_2); lean_closure_set(x_58, 1, x_3); lean_closure_set(x_58, 2, x_4); @@ -4235,7 +4424,7 @@ lean_closure_set(x_58, 4, x_6); lean_closure_set(x_58, 5, x_7); lean_closure_set(x_58, 6, x_8); lean_closure_set(x_58, 7, x_9); -x_59 = l_Lean_Elab_Command_elabAxiom___lambda__6___closed__1; +x_59 = l_Lean_Elab_Command_elabAxiom___lambda__7___closed__1; x_60 = l_Lean_Elab_Term_addAutoBoundImplicits_x27___rarg(x_10, x_59, x_58, x_55, x_12, x_13, x_14, x_15, x_16, x_57); return x_60; } @@ -4335,7 +4524,7 @@ lean_inc(x_26); lean_dec(x_24); x_27 = lean_ctor_get(x_25, 5); lean_inc(x_27); -x_28 = lean_alloc_closure((void*)(l_Lean_Elab_Command_elabAxiom___lambda__6___boxed), 17, 9); +x_28 = lean_alloc_closure((void*)(l_Lean_Elab_Command_elabAxiom___lambda__7___boxed), 17, 9); lean_closure_set(x_28, 0, x_25); lean_closure_set(x_28, 1, x_11); lean_closure_set(x_28, 2, x_1); @@ -4439,41 +4628,14 @@ lean_dec(x_2); return x_11; } } -LEAN_EXPORT lean_object* l_Lean_Elab_Command_elabAxiom___lambda__4___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12, lean_object* x_13, lean_object* x_14, lean_object* x_15, lean_object* x_16) { +LEAN_EXPORT lean_object* l_Lean_Elab_Command_elabAxiom___lambda__4___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12) { _start: { -lean_object* x_17; -x_17 = l_Lean_Elab_Command_elabAxiom___lambda__4(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10, x_11, x_12, x_13, x_14, x_15, x_16); -lean_dec(x_7); -lean_dec(x_1); -return x_17; -} -} -LEAN_EXPORT lean_object* l_Lean_Elab_Command_elabAxiom___lambda__5___boxed(lean_object** _args) { -lean_object* x_1 = _args[0]; -lean_object* x_2 = _args[1]; -lean_object* x_3 = _args[2]; -lean_object* x_4 = _args[3]; -lean_object* x_5 = _args[4]; -lean_object* x_6 = _args[5]; -lean_object* x_7 = _args[6]; -lean_object* x_8 = _args[7]; -lean_object* x_9 = _args[8]; -lean_object* x_10 = _args[9]; -lean_object* x_11 = _args[10]; -lean_object* x_12 = _args[11]; -lean_object* x_13 = _args[12]; -lean_object* x_14 = _args[13]; -lean_object* x_15 = _args[14]; -lean_object* x_16 = _args[15]; -lean_object* x_17 = _args[16]; -_start: -{ -lean_object* x_18; -x_18 = l_Lean_Elab_Command_elabAxiom___lambda__5(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10, x_11, x_12, x_13, x_14, x_15, x_16, x_17); -lean_dec(x_10); -lean_dec(x_1); -return x_18; +lean_object* x_13; +x_13 = l_Lean_Elab_Command_elabAxiom___lambda__4(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10, x_11, x_12); +lean_dec(x_5); +lean_dec(x_4); +return x_13; } } LEAN_EXPORT lean_object* l_Lean_Elab_Command_elabAxiom___lambda__6___boxed(lean_object** _args) { @@ -4498,6 +4660,33 @@ _start: { lean_object* x_18; x_18 = l_Lean_Elab_Command_elabAxiom___lambda__6(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10, x_11, x_12, x_13, x_14, x_15, x_16, x_17); +lean_dec(x_10); +lean_dec(x_1); +return x_18; +} +} +LEAN_EXPORT lean_object* l_Lean_Elab_Command_elabAxiom___lambda__7___boxed(lean_object** _args) { +lean_object* x_1 = _args[0]; +lean_object* x_2 = _args[1]; +lean_object* x_3 = _args[2]; +lean_object* x_4 = _args[3]; +lean_object* x_5 = _args[4]; +lean_object* x_6 = _args[5]; +lean_object* x_7 = _args[6]; +lean_object* x_8 = _args[7]; +lean_object* x_9 = _args[8]; +lean_object* x_10 = _args[9]; +lean_object* x_11 = _args[10]; +lean_object* x_12 = _args[11]; +lean_object* x_13 = _args[12]; +lean_object* x_14 = _args[13]; +lean_object* x_15 = _args[14]; +lean_object* x_16 = _args[15]; +lean_object* x_17 = _args[16]; +_start: +{ +lean_object* x_18; +x_18 = l_Lean_Elab_Command_elabAxiom___lambda__7(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10, x_11, x_12, x_13, x_14, x_15, x_16, x_17); lean_dec(x_1); return x_18; } @@ -6883,17 +7072,19 @@ return x_7; static lean_object* _init_l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__1() { _start: { -lean_object* x_1; -x_1 = lean_mk_string_from_bytes("Elab", 4); -return x_1; +lean_object* x_1; lean_object* x_2; lean_object* x_3; +x_1 = l___private_Lean_Elab_Declaration_0__Lean_Elab_Command_expandDeclNamespace_x3f___closed__2; +x_2 = l_Lean_Elab_Command_elabAxiom___lambda__5___closed__5; +x_3 = lean_name_mk_string(x_1, x_2); +return x_3; } } static lean_object* _init_l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__2() { _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = l___private_Lean_Elab_Declaration_0__Lean_Elab_Command_expandDeclNamespace_x3f___closed__2; -x_2 = l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__1; +x_1 = l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__1; +x_2 = l___private_Lean_Elab_Declaration_0__Lean_Elab_Command_expandDeclNamespace_x3f___closed__5; x_3 = lean_name_mk_string(x_1, x_2); return x_3; } @@ -6901,32 +7092,22 @@ return x_3; static lean_object* _init_l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__3() { _start: { -lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__2; -x_2 = l___private_Lean_Elab_Declaration_0__Lean_Elab_Command_expandDeclNamespace_x3f___closed__5; -x_3 = lean_name_mk_string(x_1, x_2); -return x_3; -} -} -static lean_object* _init_l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__4() { -_start: -{ lean_object* x_1; x_1 = lean_mk_string_from_bytes("elabDeclaration", 15); return x_1; } } -static lean_object* _init_l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__5() { +static lean_object* _init_l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__4() { _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__3; -x_2 = l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__4; +x_1 = l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__2; +x_2 = l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__3; x_3 = lean_name_mk_string(x_1, x_2); return x_3; } } -static lean_object* _init_l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__6() { +static lean_object* _init_l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__5() { _start: { lean_object* x_1; @@ -6934,7 +7115,7 @@ x_1 = l_Lean_Elab_Command_commandElabAttribute; return x_1; } } -static lean_object* _init_l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__7() { +static lean_object* _init_l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__6() { _start: { lean_object* x_1; @@ -6946,10 +7127,10 @@ LEAN_EXPORT lean_object* l___regBuiltin_Lean_Elab_Command_elabDeclaration(lean_o _start: { lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; -x_2 = l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__6; +x_2 = l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__5; x_3 = l___private_Lean_Elab_Declaration_0__Lean_Elab_Command_expandDeclNamespace_x3f___closed__8; -x_4 = l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__5; -x_5 = l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__7; +x_4 = l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__4; +x_5 = l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__6; x_6 = l_Lean_KeyedDeclsAttribute_addBuiltin___rarg(x_2, x_3, x_4, x_5, x_1); return x_6; } @@ -6958,7 +7139,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Command_elabDeclaration_declR _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = lean_unsigned_to_nat(168u); +x_1 = lean_unsigned_to_nat(170u); x_2 = lean_unsigned_to_nat(0u); x_3 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_3, 0, x_1); @@ -6970,7 +7151,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Command_elabDeclaration_declR _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = lean_unsigned_to_nat(189u); +x_1 = lean_unsigned_to_nat(191u); x_2 = lean_unsigned_to_nat(41u); x_3 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_3, 0, x_1); @@ -6998,7 +7179,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Command_elabDeclaration_declR _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = lean_unsigned_to_nat(168u); +x_1 = lean_unsigned_to_nat(170u); x_2 = lean_unsigned_to_nat(4u); x_3 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_3, 0, x_1); @@ -7010,7 +7191,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Command_elabDeclaration_declR _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = lean_unsigned_to_nat(168u); +x_1 = lean_unsigned_to_nat(170u); x_2 = lean_unsigned_to_nat(19u); x_3 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_3, 0, x_1); @@ -7050,7 +7231,7 @@ LEAN_EXPORT lean_object* l___regBuiltin_Lean_Elab_Command_elabDeclaration_declRa _start: { lean_object* x_2; lean_object* x_3; lean_object* x_4; -x_2 = l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__5; +x_2 = l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__4; x_3 = l___regBuiltin_Lean_Elab_Command_elabDeclaration_declRange___closed__7; x_4 = l_Lean_addBuiltinDeclarationRanges(x_2, x_3, x_1); return x_4; @@ -8159,7 +8340,7 @@ _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; x_1 = lean_box(0); -x_2 = l_Lean_Elab_Command_elabAxiom___lambda__4___closed__3; +x_2 = l_Lean_Elab_Command_elabAxiom___lambda__5___closed__3; x_3 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_3, 0, x_2); lean_ctor_set(x_3, 1, x_1); @@ -8411,7 +8592,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Command_expandMutualNamespace _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__3; +x_1 = l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__2; x_2 = l___regBuiltin_Lean_Elab_Command_expandMutualNamespace___closed__3; x_3 = lean_name_mk_string(x_1, x_2); return x_3; @@ -8449,7 +8630,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Command_expandMutualNamespace _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = lean_unsigned_to_nat(233u); +x_1 = lean_unsigned_to_nat(235u); x_2 = lean_unsigned_to_nat(0u); x_3 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_3, 0, x_1); @@ -8461,7 +8642,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Command_expandMutualNamespace _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = lean_unsigned_to_nat(250u); +x_1 = lean_unsigned_to_nat(252u); x_2 = lean_unsigned_to_nat(34u); x_3 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_3, 0, x_1); @@ -8489,7 +8670,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Command_expandMutualNamespace _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = lean_unsigned_to_nat(233u); +x_1 = lean_unsigned_to_nat(235u); x_2 = lean_unsigned_to_nat(4u); x_3 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_3, 0, x_1); @@ -8501,7 +8682,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Command_expandMutualNamespace _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = lean_unsigned_to_nat(233u); +x_1 = lean_unsigned_to_nat(235u); x_2 = lean_unsigned_to_nat(25u); x_3 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_3, 0, x_1); @@ -8738,7 +8919,7 @@ static lean_object* _init_l_Lean_Elab_Command_expandMutualElement___closed__1() _start: { lean_object* x_1; uint8_t x_2; lean_object* x_3; lean_object* x_4; -x_1 = l_Lean_Elab_Command_elabAxiom___lambda__4___closed__3; +x_1 = l_Lean_Elab_Command_elabAxiom___lambda__5___closed__3; x_2 = 0; x_3 = lean_box(x_2); x_4 = lean_alloc_ctor(0, 2, 0); @@ -8895,7 +9076,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Command_expandMutualElement__ _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__3; +x_1 = l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__2; x_2 = l___regBuiltin_Lean_Elab_Command_expandMutualElement___closed__1; x_3 = lean_name_mk_string(x_1, x_2); return x_3; @@ -8925,7 +9106,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Command_expandMutualElement_d _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = lean_unsigned_to_nat(253u); +x_1 = lean_unsigned_to_nat(255u); x_2 = lean_unsigned_to_nat(0u); x_3 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_3, 0, x_1); @@ -8937,7 +9118,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Command_expandMutualElement_d _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = lean_unsigned_to_nat(263u); +x_1 = lean_unsigned_to_nat(265u); x_2 = lean_unsigned_to_nat(26u); x_3 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_3, 0, x_1); @@ -8965,7 +9146,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Command_expandMutualElement_d _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = lean_unsigned_to_nat(253u); +x_1 = lean_unsigned_to_nat(255u); x_2 = lean_unsigned_to_nat(4u); x_3 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_3, 0, x_1); @@ -8977,7 +9158,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Command_expandMutualElement_d _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = lean_unsigned_to_nat(253u); +x_1 = lean_unsigned_to_nat(255u); x_2 = lean_unsigned_to_nat(23u); x_3 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_3, 0, x_1); @@ -9047,7 +9228,7 @@ _start: lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; x_1 = lean_box(2); x_2 = l_Lean_Elab_Command_elabDeclaration___closed__4; -x_3 = l_Lean_Elab_Command_elabAxiom___lambda__4___closed__3; +x_3 = l_Lean_Elab_Command_elabAxiom___lambda__5___closed__3; x_4 = lean_alloc_ctor(1, 3, 0); lean_ctor_set(x_4, 0, x_1); lean_ctor_set(x_4, 1, x_2); @@ -9195,7 +9376,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Command_expandMutualPreamble_ _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__3; +x_1 = l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__2; x_2 = l___regBuiltin_Lean_Elab_Command_expandMutualPreamble___closed__1; x_3 = lean_name_mk_string(x_1, x_2); return x_3; @@ -9225,7 +9406,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Command_expandMutualPreamble_ _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = lean_unsigned_to_nat(266u); +x_1 = lean_unsigned_to_nat(268u); x_2 = lean_unsigned_to_nat(0u); x_3 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_3, 0, x_1); @@ -9237,7 +9418,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Command_expandMutualPreamble_ _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = lean_unsigned_to_nat(273u); +x_1 = lean_unsigned_to_nat(275u); x_2 = lean_unsigned_to_nat(74u); x_3 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_3, 0, x_1); @@ -9265,7 +9446,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Command_expandMutualPreamble_ _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = lean_unsigned_to_nat(266u); +x_1 = lean_unsigned_to_nat(268u); x_2 = lean_unsigned_to_nat(4u); x_3 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_3, 0, x_1); @@ -9277,7 +9458,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Command_expandMutualPreamble_ _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = lean_unsigned_to_nat(266u); +x_1 = lean_unsigned_to_nat(268u); x_2 = lean_unsigned_to_nat(24u); x_3 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_3, 0, x_1); @@ -9810,7 +9991,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Command_elabMutual___closed__ _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__3; +x_1 = l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__2; x_2 = l___regBuiltin_Lean_Elab_Command_elabMutual___closed__1; x_3 = lean_name_mk_string(x_1, x_2); return x_3; @@ -9828,7 +10009,7 @@ LEAN_EXPORT lean_object* l___regBuiltin_Lean_Elab_Command_elabMutual(lean_object _start: { lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; -x_2 = l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__6; +x_2 = l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__5; x_3 = l___regBuiltin_Lean_Elab_Command_expandMutualNamespace___closed__2; x_4 = l___regBuiltin_Lean_Elab_Command_elabMutual___closed__2; x_5 = l___regBuiltin_Lean_Elab_Command_elabMutual___closed__3; @@ -9840,7 +10021,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Command_elabMutual_declRange_ _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = lean_unsigned_to_nat(276u); +x_1 = lean_unsigned_to_nat(278u); x_2 = lean_unsigned_to_nat(0u); x_3 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_3, 0, x_1); @@ -9852,7 +10033,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Command_elabMutual_declRange_ _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = lean_unsigned_to_nat(293u); +x_1 = lean_unsigned_to_nat(295u); x_2 = lean_unsigned_to_nat(37u); x_3 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_3, 0, x_1); @@ -9880,7 +10061,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Command_elabMutual_declRange_ _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = lean_unsigned_to_nat(276u); +x_1 = lean_unsigned_to_nat(278u); x_2 = lean_unsigned_to_nat(4u); x_3 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_3, 0, x_1); @@ -9892,7 +10073,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Command_elabMutual_declRange_ _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = lean_unsigned_to_nat(276u); +x_1 = lean_unsigned_to_nat(278u); x_2 = lean_unsigned_to_nat(14u); x_3 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_3, 0, x_1); @@ -10555,7 +10736,7 @@ static lean_object* _init_l_Lean_Elab_Command_elabAttr___closed__1() { _start: { lean_object* x_1; lean_object* x_2; -x_1 = l_Lean_Elab_Command_elabAxiom___lambda__4___closed__3; +x_1 = l_Lean_Elab_Command_elabAxiom___lambda__5___closed__3; x_2 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_2, 0, x_1); lean_ctor_set(x_2, 1, x_1); @@ -10824,7 +11005,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Command_elabAttr___closed__4( _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__3; +x_1 = l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__2; x_2 = l___regBuiltin_Lean_Elab_Command_elabAttr___closed__3; x_3 = lean_name_mk_string(x_1, x_2); return x_3; @@ -10842,7 +11023,7 @@ LEAN_EXPORT lean_object* l___regBuiltin_Lean_Elab_Command_elabAttr(lean_object* _start: { lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; -x_2 = l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__6; +x_2 = l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__5; x_3 = l___regBuiltin_Lean_Elab_Command_elabAttr___closed__2; x_4 = l___regBuiltin_Lean_Elab_Command_elabAttr___closed__4; x_5 = l___regBuiltin_Lean_Elab_Command_elabAttr___closed__5; @@ -10854,7 +11035,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Command_elabAttr_declRange___ _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = lean_unsigned_to_nat(296u); +x_1 = lean_unsigned_to_nat(298u); x_2 = lean_unsigned_to_nat(34u); x_3 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_3, 0, x_1); @@ -10866,7 +11047,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Command_elabAttr_declRange___ _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = lean_unsigned_to_nat(313u); +x_1 = lean_unsigned_to_nat(315u); x_2 = lean_unsigned_to_nat(39u); x_3 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_3, 0, x_1); @@ -10894,7 +11075,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Command_elabAttr_declRange___ _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = lean_unsigned_to_nat(296u); +x_1 = lean_unsigned_to_nat(298u); x_2 = lean_unsigned_to_nat(38u); x_3 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_3, 0, x_1); @@ -10906,7 +11087,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Command_elabAttr_declRange___ _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = lean_unsigned_to_nat(296u); +x_1 = lean_unsigned_to_nat(298u); x_2 = lean_unsigned_to_nat(46u); x_3 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_3, 0, x_1); @@ -13718,7 +13899,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Command_expandInitialize___cl _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__3; +x_1 = l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__2; x_2 = l___regBuiltin_Lean_Elab_Command_expandInitialize___closed__3; x_3 = lean_name_mk_string(x_1, x_2); return x_3; @@ -13748,7 +13929,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Command_expandInitialize_decl _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = lean_unsigned_to_nat(339u); +x_1 = lean_unsigned_to_nat(341u); x_2 = lean_unsigned_to_nat(49u); x_3 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_3, 0, x_1); @@ -13760,7 +13941,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Command_expandInitialize_decl _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = lean_unsigned_to_nat(340u); +x_1 = lean_unsigned_to_nat(342u); x_2 = lean_unsigned_to_nat(34u); x_3 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_3, 0, x_1); @@ -13788,7 +13969,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Command_expandInitialize_decl _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = lean_unsigned_to_nat(339u); +x_1 = lean_unsigned_to_nat(341u); x_2 = lean_unsigned_to_nat(53u); x_3 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_3, 0, x_1); @@ -13800,7 +13981,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Command_expandInitialize_decl _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = lean_unsigned_to_nat(339u); +x_1 = lean_unsigned_to_nat(341u); x_2 = lean_unsigned_to_nat(69u); x_3 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_3, 0, x_1); @@ -13885,7 +14066,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Command_expandBuiltinInitiali _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__3; +x_1 = l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__2; x_2 = l___regBuiltin_Lean_Elab_Command_expandBuiltinInitialize___closed__3; x_3 = lean_name_mk_string(x_1, x_2); return x_3; @@ -13915,7 +14096,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Command_expandBuiltinInitiali _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = lean_unsigned_to_nat(342u); +x_1 = lean_unsigned_to_nat(344u); x_2 = lean_unsigned_to_nat(57u); x_3 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_3, 0, x_1); @@ -13927,7 +14108,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Command_expandBuiltinInitiali _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = lean_unsigned_to_nat(343u); +x_1 = lean_unsigned_to_nat(345u); x_2 = lean_unsigned_to_nat(33u); x_3 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_3, 0, x_1); @@ -13955,7 +14136,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Command_expandBuiltinInitiali _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = lean_unsigned_to_nat(342u); +x_1 = lean_unsigned_to_nat(344u); x_2 = lean_unsigned_to_nat(61u); x_3 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_3, 0, x_1); @@ -13967,7 +14148,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Command_expandBuiltinInitiali _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = lean_unsigned_to_nat(342u); +x_1 = lean_unsigned_to_nat(344u); x_2 = lean_unsigned_to_nat(84u); x_3 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_3, 0, x_1); @@ -14013,6 +14194,15 @@ x_4 = l_Lean_addBuiltinDeclarationRanges(x_2, x_3, x_1); return x_4; } } +LEAN_EXPORT lean_object* l_Lean_Elab_Command_initFn____x40_Lean_Elab_Declaration___hyg_5577_(lean_object* x_1) { +_start: +{ +lean_object* x_2; lean_object* x_3; +x_2 = l_Lean_Elab_Command_elabAxiom___lambda__5___closed__7; +x_3 = l_Lean_registerTraceClass(x_2, x_1); +return x_3; +} +} lean_object* initialize_Init(uint8_t builtin, lean_object*); lean_object* initialize_Lean_Util_CollectLevelParams(uint8_t builtin, lean_object*); lean_object* initialize_Lean_Elab_DeclUtil(uint8_t builtin, lean_object*); @@ -14118,16 +14308,30 @@ l_Lean_Elab_addDeclarationRanges___at_Lean_Elab_Command_elabAxiom___spec__1___cl lean_mark_persistent(l_Lean_Elab_addDeclarationRanges___at_Lean_Elab_Command_elabAxiom___spec__1___closed__1); l_Lean_Elab_addDeclarationRanges___at_Lean_Elab_Command_elabAxiom___spec__1___closed__2 = _init_l_Lean_Elab_addDeclarationRanges___at_Lean_Elab_Command_elabAxiom___spec__1___closed__2(); lean_mark_persistent(l_Lean_Elab_addDeclarationRanges___at_Lean_Elab_Command_elabAxiom___spec__1___closed__2); -l_Lean_Elab_Command_elabAxiom___lambda__4___closed__1 = _init_l_Lean_Elab_Command_elabAxiom___lambda__4___closed__1(); -lean_mark_persistent(l_Lean_Elab_Command_elabAxiom___lambda__4___closed__1); -l_Lean_Elab_Command_elabAxiom___lambda__4___closed__2 = _init_l_Lean_Elab_Command_elabAxiom___lambda__4___closed__2(); -lean_mark_persistent(l_Lean_Elab_Command_elabAxiom___lambda__4___closed__2); -l_Lean_Elab_Command_elabAxiom___lambda__4___closed__3 = _init_l_Lean_Elab_Command_elabAxiom___lambda__4___closed__3(); -lean_mark_persistent(l_Lean_Elab_Command_elabAxiom___lambda__4___closed__3); -l_Lean_Elab_Command_elabAxiom___lambda__4___closed__4 = _init_l_Lean_Elab_Command_elabAxiom___lambda__4___closed__4(); -lean_mark_persistent(l_Lean_Elab_Command_elabAxiom___lambda__4___closed__4); -l_Lean_Elab_Command_elabAxiom___lambda__6___closed__1 = _init_l_Lean_Elab_Command_elabAxiom___lambda__6___closed__1(); -lean_mark_persistent(l_Lean_Elab_Command_elabAxiom___lambda__6___closed__1); +l_Lean_Elab_Command_elabAxiom___lambda__5___closed__1 = _init_l_Lean_Elab_Command_elabAxiom___lambda__5___closed__1(); +lean_mark_persistent(l_Lean_Elab_Command_elabAxiom___lambda__5___closed__1); +l_Lean_Elab_Command_elabAxiom___lambda__5___closed__2 = _init_l_Lean_Elab_Command_elabAxiom___lambda__5___closed__2(); +lean_mark_persistent(l_Lean_Elab_Command_elabAxiom___lambda__5___closed__2); +l_Lean_Elab_Command_elabAxiom___lambda__5___closed__3 = _init_l_Lean_Elab_Command_elabAxiom___lambda__5___closed__3(); +lean_mark_persistent(l_Lean_Elab_Command_elabAxiom___lambda__5___closed__3); +l_Lean_Elab_Command_elabAxiom___lambda__5___closed__4 = _init_l_Lean_Elab_Command_elabAxiom___lambda__5___closed__4(); +lean_mark_persistent(l_Lean_Elab_Command_elabAxiom___lambda__5___closed__4); +l_Lean_Elab_Command_elabAxiom___lambda__5___closed__5 = _init_l_Lean_Elab_Command_elabAxiom___lambda__5___closed__5(); +lean_mark_persistent(l_Lean_Elab_Command_elabAxiom___lambda__5___closed__5); +l_Lean_Elab_Command_elabAxiom___lambda__5___closed__6 = _init_l_Lean_Elab_Command_elabAxiom___lambda__5___closed__6(); +lean_mark_persistent(l_Lean_Elab_Command_elabAxiom___lambda__5___closed__6); +l_Lean_Elab_Command_elabAxiom___lambda__5___closed__7 = _init_l_Lean_Elab_Command_elabAxiom___lambda__5___closed__7(); +lean_mark_persistent(l_Lean_Elab_Command_elabAxiom___lambda__5___closed__7); +l_Lean_Elab_Command_elabAxiom___lambda__5___closed__8 = _init_l_Lean_Elab_Command_elabAxiom___lambda__5___closed__8(); +lean_mark_persistent(l_Lean_Elab_Command_elabAxiom___lambda__5___closed__8); +l_Lean_Elab_Command_elabAxiom___lambda__5___closed__9 = _init_l_Lean_Elab_Command_elabAxiom___lambda__5___closed__9(); +lean_mark_persistent(l_Lean_Elab_Command_elabAxiom___lambda__5___closed__9); +l_Lean_Elab_Command_elabAxiom___lambda__5___closed__10 = _init_l_Lean_Elab_Command_elabAxiom___lambda__5___closed__10(); +lean_mark_persistent(l_Lean_Elab_Command_elabAxiom___lambda__5___closed__10); +l_Lean_Elab_Command_elabAxiom___lambda__5___closed__11 = _init_l_Lean_Elab_Command_elabAxiom___lambda__5___closed__11(); +lean_mark_persistent(l_Lean_Elab_Command_elabAxiom___lambda__5___closed__11); +l_Lean_Elab_Command_elabAxiom___lambda__7___closed__1 = _init_l_Lean_Elab_Command_elabAxiom___lambda__7___closed__1(); +lean_mark_persistent(l_Lean_Elab_Command_elabAxiom___lambda__7___closed__1); l_Lean_Elab_Command_checkValidCtorModifier___at___private_Lean_Elab_Declaration_0__Lean_Elab_Command_inductiveSyntaxToView___spec__1___lambda__1___closed__1 = _init_l_Lean_Elab_Command_checkValidCtorModifier___at___private_Lean_Elab_Declaration_0__Lean_Elab_Command_inductiveSyntaxToView___spec__1___lambda__1___closed__1(); lean_mark_persistent(l_Lean_Elab_Command_checkValidCtorModifier___at___private_Lean_Elab_Declaration_0__Lean_Elab_Command_inductiveSyntaxToView___spec__1___lambda__1___closed__1); l_Lean_Elab_Command_checkValidCtorModifier___at___private_Lean_Elab_Declaration_0__Lean_Elab_Command_inductiveSyntaxToView___spec__1___lambda__1___closed__2 = _init_l_Lean_Elab_Command_checkValidCtorModifier___at___private_Lean_Elab_Declaration_0__Lean_Elab_Command_inductiveSyntaxToView___spec__1___lambda__1___closed__2(); @@ -14202,8 +14406,6 @@ l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__5 = _init_l___regBuil lean_mark_persistent(l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__5); l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__6 = _init_l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__6(); lean_mark_persistent(l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__6); -l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__7 = _init_l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__7(); -lean_mark_persistent(l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__7); res = l___regBuiltin_Lean_Elab_Command_elabDeclaration(lean_io_mk_world()); if (lean_io_result_is_error(res)) return res; lean_dec_ref(res); @@ -14642,6 +14844,9 @@ lean_mark_persistent(l___regBuiltin_Lean_Elab_Command_expandBuiltinInitialize_de res = l___regBuiltin_Lean_Elab_Command_expandBuiltinInitialize_declRange(lean_io_mk_world()); if (lean_io_result_is_error(res)) return res; lean_dec_ref(res); +res = l_Lean_Elab_Command_initFn____x40_Lean_Elab_Declaration___hyg_5577_(lean_io_mk_world()); +if (lean_io_result_is_error(res)) return res; +lean_dec_ref(res); return lean_io_result_mk_ok(lean_box(0)); } #ifdef __cplusplus diff --git a/stage0/stdlib/Lean/Elab/Import.c b/stage0/stdlib/Lean/Elab/Import.c index 4422678781..d0c7ab34de 100644 --- a/stage0/stdlib/Lean/Elab/Import.c +++ b/stage0/stdlib/Lean/Elab/Import.c @@ -1,6 +1,6 @@ // Lean compiler output // Module: Lean.Elab.Import -// Imports: Init Lean.Parser.Module +// Imports: Init Lean.Parser.Module Lean.Data.Json #include #if defined(__clang__) #pragma clang diagnostic ignored "-Wunused-parameter" @@ -14,40 +14,88 @@ extern "C" { #endif lean_object* l_List_reverse___rarg(lean_object*); +LEAN_EXPORT lean_object* l_Lean_Elab_instToJsonImport; lean_object* lean_string_push(lean_object*, uint32_t); +size_t lean_usize_add(size_t, size_t); +lean_object* lean_mk_empty_array_with_capacity(lean_object*); +LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_printImportsJson___spec__1(size_t, size_t, lean_object*, lean_object*); +LEAN_EXPORT lean_object* l___private_Lean_Elab_Import_0__Lean_Elab_toJsonPrintImportsResult____x40_Lean_Elab_Import___hyg_517_(lean_object*); static lean_object* l_Lean_Elab_headerToImports___closed__4; lean_object* lean_name_mk_string(lean_object*, lean_object*); lean_object* l_Lean_Parser_parseHeader(lean_object*, lean_object*); +lean_object* lean_array_uget(lean_object*, size_t); lean_object* lean_io_error_to_string(lean_object*); +static lean_object* l___private_Lean_Elab_Import_0__Lean_Elab_toJsonImport____x40_Lean_Elab_Import___hyg_401____closed__1; +lean_object* lean_array_uset(lean_object*, size_t, lean_object*); +static lean_object* l___private_Lean_Elab_Import_0__Lean_Elab_toJsonImport____x40_Lean_Elab_Import___hyg_401____closed__2; +static lean_object* l___private_Lean_Elab_Import_0__Lean_Elab_toJsonPrintImportResult____x40_Lean_Elab_Import___hyg_472____closed__1; +LEAN_EXPORT lean_object* l_Lean_Elab_PrintImportResult_imports_x3f___default; static lean_object* l_Lean_Elab_headerToImports___closed__2; LEAN_EXPORT lean_object* l_Lean_Elab_headerToImports(lean_object*); lean_object* l_Lean_Parser_mkInputContext(lean_object*, lean_object*); +lean_object* lean_array_push(lean_object*, lean_object*); +lean_object* lean_array_get_size(lean_object*); +LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_Import_0__Lean_Elab_toJsonPrintImportsResult____x40_Lean_Elab_Import___hyg_517____spec__1(size_t, size_t, lean_object*); +static lean_object* l_Lean_Elab_PrintImportResult_errors___default___closed__1; +lean_object* l_List_join___rarg(lean_object*); +uint8_t lean_usize_dec_lt(size_t, size_t); static lean_object* l_Lean_Elab_headerToImports___closed__1; LEAN_EXPORT lean_object* l_Lean_Elab_headerToImports___boxed(lean_object*); +static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_printImportsJson___spec__2___closed__1; lean_object* l_Lean_findOLean(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Elab_processHeader(lean_object*, lean_object*, lean_object*, lean_object*, uint32_t, lean_object*); static lean_object* l_Lean_Elab_parseImports___closed__1; +lean_object* l_Lean_MessageLog_toList(lean_object*); +LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_printImportsJson___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*); static lean_object* l_Lean_Elab_headerToImports___closed__3; +static lean_object* l___private_Lean_Elab_Import_0__Lean_Elab_toJsonPrintImportResult____x40_Lean_Elab_Import___hyg_472____closed__2; +lean_object* l_Lean_Name_toString(lean_object*, uint8_t); lean_object* l_IO_print___at_IO_println___spec__1(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_List_forIn_loop___at_Lean_Elab_printImports___spec__2(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Syntax_getId(lean_object*); +LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_Import_0__Lean_Elab_toJsonPrintImportResult____x40_Lean_Elab_Import___hyg_472____spec__3(size_t, size_t, lean_object*); LEAN_EXPORT lean_object* l_Lean_Elab_processHeader___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_array_to_list(lean_object*, lean_object*); static lean_object* l_Lean_Elab_processHeader___closed__1; +LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_Import_0__Lean_Elab_toJsonPrintImportsResult____x40_Lean_Elab_Import___hyg_517____spec__1___boxed(lean_object*, lean_object*, lean_object*); +LEAN_EXPORT lean_object* l_Lean_Elab_PrintImportResult_errors___default; lean_object* l_Lean_FileMap_toPosition(lean_object*, lean_object*); lean_object* l_Lean_FileMap_ofString(lean_object*); +LEAN_EXPORT lean_object* l___private_Lean_Elab_Import_0__Lean_Elab_toJsonPrintImportResult____x40_Lean_Elab_Import___hyg_472_(lean_object*); +LEAN_EXPORT lean_object* l___private_Lean_Elab_Import_0__Lean_Elab_toJsonImport____x40_Lean_Elab_Import___hyg_401_(lean_object*); +size_t lean_usize_of_nat(lean_object*); lean_object* l_Lean_Syntax_getPos_x3f(lean_object*, uint8_t); lean_object* lean_mk_empty_environment(uint32_t, lean_object*); +LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_Import_0__Lean_Elab_toJsonPrintImportResult____x40_Lean_Elab_Import___hyg_472____spec__2___boxed(lean_object*, lean_object*, lean_object*); lean_object* lean_import_modules(lean_object*, lean_object*, uint32_t, lean_object*); +LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_Import_0__Lean_Elab_toJsonPrintImportResult____x40_Lean_Elab_Import___hyg_472____spec__2(size_t, size_t, lean_object*); +lean_object* l_List_redLength___rarg(lean_object*); lean_object* l_Std_PersistentArray_push___rarg(lean_object*, lean_object*); +static lean_object* l_Lean_Elab_instToJsonPrintImportsResult___closed__1; lean_object* l_Lean_Syntax_getArgs(lean_object*); +static lean_object* l_Lean_Elab_instToJsonPrintImportResult___closed__1; +lean_object* l_Lean_Json_mkObj(lean_object*); +LEAN_EXPORT lean_object* l_Lean_Elab_instToJsonPrintImportResult; +lean_object* l_Lean_Json_pretty(lean_object*, lean_object*); +static lean_object* l_Lean_Elab_instToJsonImport___closed__1; +lean_object* l_List_toArrayAux___rarg(lean_object*, lean_object*); uint8_t l_Lean_Syntax_isNone(lean_object*); LEAN_EXPORT lean_object* l_List_mapTRAux___at_Lean_Elab_headerToImports___spec__1(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Elab_parseImports(lean_object*, lean_object*, lean_object*); +LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_printImportsJson___spec__2(size_t, size_t, lean_object*, lean_object*); +lean_object* l_IO_FS_readFile(lean_object*, lean_object*); LEAN_EXPORT lean_object* lean_print_imports(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Syntax_getArg(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_IO_println___at_Lean_Elab_printImports___spec__1(lean_object*, lean_object*); +LEAN_EXPORT lean_object* l_Lean_Json_opt___at___private_Lean_Elab_Import_0__Lean_Elab_toJsonPrintImportResult____x40_Lean_Elab_Import___hyg_472____spec__1(lean_object*, lean_object*); +LEAN_EXPORT lean_object* l_IO_println___at_Lean_Elab_printImportsJson___spec__3(lean_object*, lean_object*); +LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_printImportsJson___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*); +uint8_t l_Std_PersistentArray_anyM___at_Lean_MessageLog_hasErrors___spec__1(lean_object*); +LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_Import_0__Lean_Elab_toJsonPrintImportResult____x40_Lean_Elab_Import___hyg_472____spec__3___boxed(lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Message_toString(lean_object*, uint8_t, lean_object*); +LEAN_EXPORT lean_object* l_Lean_Elab_instToJsonPrintImportsResult; lean_object* l_List_appendTR___rarg(lean_object*, lean_object*); +LEAN_EXPORT lean_object* lean_print_imports_json(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_List_mapTRAux___at_Lean_Elab_headerToImports___spec__1(lean_object* x_1, lean_object* x_2) { _start: { @@ -1064,8 +1112,657 @@ return x_21; } } } +static lean_object* _init_l___private_Lean_Elab_Import_0__Lean_Elab_toJsonImport____x40_Lean_Elab_Import___hyg_401____closed__1() { +_start: +{ +lean_object* x_1; +x_1 = lean_mk_string_from_bytes("module", 6); +return x_1; +} +} +static lean_object* _init_l___private_Lean_Elab_Import_0__Lean_Elab_toJsonImport____x40_Lean_Elab_Import___hyg_401____closed__2() { +_start: +{ +lean_object* x_1; +x_1 = lean_mk_string_from_bytes("runtimeOnly", 11); +return x_1; +} +} +LEAN_EXPORT lean_object* l___private_Lean_Elab_Import_0__Lean_Elab_toJsonImport____x40_Lean_Elab_Import___hyg_401_(lean_object* x_1) { +_start: +{ +lean_object* x_2; uint8_t x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; uint8_t x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; +x_2 = lean_ctor_get(x_1, 0); +lean_inc(x_2); +x_3 = 1; +x_4 = l_Lean_Name_toString(x_2, x_3); +x_5 = lean_alloc_ctor(3, 1, 0); +lean_ctor_set(x_5, 0, x_4); +x_6 = l___private_Lean_Elab_Import_0__Lean_Elab_toJsonImport____x40_Lean_Elab_Import___hyg_401____closed__1; +x_7 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_7, 0, x_6); +lean_ctor_set(x_7, 1, x_5); +x_8 = lean_box(0); +x_9 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_9, 0, x_7); +lean_ctor_set(x_9, 1, x_8); +x_10 = lean_ctor_get_uint8(x_1, sizeof(void*)*1); +lean_dec(x_1); +x_11 = lean_alloc_ctor(1, 0, 1); +lean_ctor_set_uint8(x_11, 0, x_10); +x_12 = l___private_Lean_Elab_Import_0__Lean_Elab_toJsonImport____x40_Lean_Elab_Import___hyg_401____closed__2; +x_13 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_13, 0, x_12); +lean_ctor_set(x_13, 1, x_11); +x_14 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_14, 0, x_13); +lean_ctor_set(x_14, 1, x_8); +x_15 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_15, 0, x_14); +lean_ctor_set(x_15, 1, x_8); +x_16 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_16, 0, x_9); +lean_ctor_set(x_16, 1, x_15); +x_17 = l_List_join___rarg(x_16); +x_18 = l_Lean_Json_mkObj(x_17); +return x_18; +} +} +static lean_object* _init_l_Lean_Elab_instToJsonImport___closed__1() { +_start: +{ +lean_object* x_1; +x_1 = lean_alloc_closure((void*)(l___private_Lean_Elab_Import_0__Lean_Elab_toJsonImport____x40_Lean_Elab_Import___hyg_401_), 1, 0); +return x_1; +} +} +static lean_object* _init_l_Lean_Elab_instToJsonImport() { +_start: +{ +lean_object* x_1; +x_1 = l_Lean_Elab_instToJsonImport___closed__1; +return x_1; +} +} +static lean_object* _init_l_Lean_Elab_PrintImportResult_imports_x3f___default() { +_start: +{ +lean_object* x_1; +x_1 = lean_box(0); +return x_1; +} +} +static lean_object* _init_l_Lean_Elab_PrintImportResult_errors___default___closed__1() { +_start: +{ +lean_object* x_1; lean_object* x_2; +x_1 = lean_unsigned_to_nat(0u); +x_2 = lean_mk_empty_array_with_capacity(x_1); +return x_2; +} +} +static lean_object* _init_l_Lean_Elab_PrintImportResult_errors___default() { +_start: +{ +lean_object* x_1; +x_1 = l_Lean_Elab_PrintImportResult_errors___default___closed__1; +return x_1; +} +} +LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_Import_0__Lean_Elab_toJsonPrintImportResult____x40_Lean_Elab_Import___hyg_472____spec__2(size_t x_1, size_t x_2, lean_object* x_3) { +_start: +{ +uint8_t x_4; +x_4 = lean_usize_dec_lt(x_2, x_1); +if (x_4 == 0) +{ +return x_3; +} +else +{ +lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; size_t x_9; size_t x_10; lean_object* x_11; +x_5 = lean_array_uget(x_3, x_2); +x_6 = lean_unsigned_to_nat(0u); +x_7 = lean_array_uset(x_3, x_2, x_6); +x_8 = l___private_Lean_Elab_Import_0__Lean_Elab_toJsonImport____x40_Lean_Elab_Import___hyg_401_(x_5); +x_9 = 1; +x_10 = lean_usize_add(x_2, x_9); +x_11 = lean_array_uset(x_7, x_2, x_8); +x_2 = x_10; +x_3 = x_11; +goto _start; +} +} +} +LEAN_EXPORT lean_object* l_Lean_Json_opt___at___private_Lean_Elab_Import_0__Lean_Elab_toJsonPrintImportResult____x40_Lean_Elab_Import___hyg_472____spec__1(lean_object* x_1, lean_object* x_2) { +_start: +{ +if (lean_obj_tag(x_2) == 0) +{ +lean_object* x_3; +lean_dec(x_1); +x_3 = lean_box(0); +return x_3; +} +else +{ +lean_object* x_4; lean_object* x_5; size_t x_6; size_t x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; +x_4 = lean_ctor_get(x_2, 0); +lean_inc(x_4); +lean_dec(x_2); +x_5 = lean_array_get_size(x_4); +x_6 = lean_usize_of_nat(x_5); +lean_dec(x_5); +x_7 = 0; +x_8 = l_Array_mapMUnsafe_map___at___private_Lean_Elab_Import_0__Lean_Elab_toJsonPrintImportResult____x40_Lean_Elab_Import___hyg_472____spec__2(x_6, x_7, x_4); +x_9 = lean_alloc_ctor(4, 1, 0); +lean_ctor_set(x_9, 0, x_8); +x_10 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_10, 0, x_1); +lean_ctor_set(x_10, 1, x_9); +x_11 = lean_box(0); +x_12 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_12, 0, x_10); +lean_ctor_set(x_12, 1, x_11); +return x_12; +} +} +} +LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_Import_0__Lean_Elab_toJsonPrintImportResult____x40_Lean_Elab_Import___hyg_472____spec__3(size_t x_1, size_t x_2, lean_object* x_3) { +_start: +{ +uint8_t x_4; +x_4 = lean_usize_dec_lt(x_2, x_1); +if (x_4 == 0) +{ +return x_3; +} +else +{ +lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; size_t x_9; size_t x_10; lean_object* x_11; +x_5 = lean_array_uget(x_3, x_2); +x_6 = lean_unsigned_to_nat(0u); +x_7 = lean_array_uset(x_3, x_2, x_6); +x_8 = lean_alloc_ctor(3, 1, 0); +lean_ctor_set(x_8, 0, x_5); +x_9 = 1; +x_10 = lean_usize_add(x_2, x_9); +x_11 = lean_array_uset(x_7, x_2, x_8); +x_2 = x_10; +x_3 = x_11; +goto _start; +} +} +} +static lean_object* _init_l___private_Lean_Elab_Import_0__Lean_Elab_toJsonPrintImportResult____x40_Lean_Elab_Import___hyg_472____closed__1() { +_start: +{ +lean_object* x_1; +x_1 = lean_mk_string_from_bytes("imports", 7); +return x_1; +} +} +static lean_object* _init_l___private_Lean_Elab_Import_0__Lean_Elab_toJsonPrintImportResult____x40_Lean_Elab_Import___hyg_472____closed__2() { +_start: +{ +lean_object* x_1; +x_1 = lean_mk_string_from_bytes("errors", 6); +return x_1; +} +} +LEAN_EXPORT lean_object* l___private_Lean_Elab_Import_0__Lean_Elab_toJsonPrintImportResult____x40_Lean_Elab_Import___hyg_472_(lean_object* x_1) { +_start: +{ +lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; size_t x_7; size_t x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; +x_2 = lean_ctor_get(x_1, 0); +lean_inc(x_2); +x_3 = l___private_Lean_Elab_Import_0__Lean_Elab_toJsonPrintImportResult____x40_Lean_Elab_Import___hyg_472____closed__1; +x_4 = l_Lean_Json_opt___at___private_Lean_Elab_Import_0__Lean_Elab_toJsonPrintImportResult____x40_Lean_Elab_Import___hyg_472____spec__1(x_3, x_2); +x_5 = lean_ctor_get(x_1, 1); +lean_inc(x_5); +lean_dec(x_1); +x_6 = lean_array_get_size(x_5); +x_7 = lean_usize_of_nat(x_6); +lean_dec(x_6); +x_8 = 0; +x_9 = l_Array_mapMUnsafe_map___at___private_Lean_Elab_Import_0__Lean_Elab_toJsonPrintImportResult____x40_Lean_Elab_Import___hyg_472____spec__3(x_7, x_8, x_5); +x_10 = lean_alloc_ctor(4, 1, 0); +lean_ctor_set(x_10, 0, x_9); +x_11 = l___private_Lean_Elab_Import_0__Lean_Elab_toJsonPrintImportResult____x40_Lean_Elab_Import___hyg_472____closed__2; +x_12 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_12, 0, x_11); +lean_ctor_set(x_12, 1, x_10); +x_13 = lean_box(0); +x_14 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_14, 0, x_12); +lean_ctor_set(x_14, 1, x_13); +x_15 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_15, 0, x_14); +lean_ctor_set(x_15, 1, x_13); +x_16 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_16, 0, x_4); +lean_ctor_set(x_16, 1, x_15); +x_17 = l_List_join___rarg(x_16); +x_18 = l_Lean_Json_mkObj(x_17); +return x_18; +} +} +LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_Import_0__Lean_Elab_toJsonPrintImportResult____x40_Lean_Elab_Import___hyg_472____spec__2___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +_start: +{ +size_t x_4; size_t x_5; lean_object* x_6; +x_4 = lean_unbox_usize(x_1); +lean_dec(x_1); +x_5 = lean_unbox_usize(x_2); +lean_dec(x_2); +x_6 = l_Array_mapMUnsafe_map___at___private_Lean_Elab_Import_0__Lean_Elab_toJsonPrintImportResult____x40_Lean_Elab_Import___hyg_472____spec__2(x_4, x_5, x_3); +return x_6; +} +} +LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_Import_0__Lean_Elab_toJsonPrintImportResult____x40_Lean_Elab_Import___hyg_472____spec__3___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +_start: +{ +size_t x_4; size_t x_5; lean_object* x_6; +x_4 = lean_unbox_usize(x_1); +lean_dec(x_1); +x_5 = lean_unbox_usize(x_2); +lean_dec(x_2); +x_6 = l_Array_mapMUnsafe_map___at___private_Lean_Elab_Import_0__Lean_Elab_toJsonPrintImportResult____x40_Lean_Elab_Import___hyg_472____spec__3(x_4, x_5, x_3); +return x_6; +} +} +static lean_object* _init_l_Lean_Elab_instToJsonPrintImportResult___closed__1() { +_start: +{ +lean_object* x_1; +x_1 = lean_alloc_closure((void*)(l___private_Lean_Elab_Import_0__Lean_Elab_toJsonPrintImportResult____x40_Lean_Elab_Import___hyg_472_), 1, 0); +return x_1; +} +} +static lean_object* _init_l_Lean_Elab_instToJsonPrintImportResult() { +_start: +{ +lean_object* x_1; +x_1 = l_Lean_Elab_instToJsonPrintImportResult___closed__1; +return x_1; +} +} +LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_Import_0__Lean_Elab_toJsonPrintImportsResult____x40_Lean_Elab_Import___hyg_517____spec__1(size_t x_1, size_t x_2, lean_object* x_3) { +_start: +{ +uint8_t x_4; +x_4 = lean_usize_dec_lt(x_2, x_1); +if (x_4 == 0) +{ +return x_3; +} +else +{ +lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; size_t x_9; size_t x_10; lean_object* x_11; +x_5 = lean_array_uget(x_3, x_2); +x_6 = lean_unsigned_to_nat(0u); +x_7 = lean_array_uset(x_3, x_2, x_6); +x_8 = l___private_Lean_Elab_Import_0__Lean_Elab_toJsonPrintImportResult____x40_Lean_Elab_Import___hyg_472_(x_5); +x_9 = 1; +x_10 = lean_usize_add(x_2, x_9); +x_11 = lean_array_uset(x_7, x_2, x_8); +x_2 = x_10; +x_3 = x_11; +goto _start; +} +} +} +LEAN_EXPORT lean_object* l___private_Lean_Elab_Import_0__Lean_Elab_toJsonPrintImportsResult____x40_Lean_Elab_Import___hyg_517_(lean_object* x_1) { +_start: +{ +lean_object* x_2; size_t x_3; size_t x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; +x_2 = lean_array_get_size(x_1); +x_3 = lean_usize_of_nat(x_2); +lean_dec(x_2); +x_4 = 0; +x_5 = l_Array_mapMUnsafe_map___at___private_Lean_Elab_Import_0__Lean_Elab_toJsonPrintImportsResult____x40_Lean_Elab_Import___hyg_517____spec__1(x_3, x_4, x_1); +x_6 = lean_alloc_ctor(4, 1, 0); +lean_ctor_set(x_6, 0, x_5); +x_7 = l___private_Lean_Elab_Import_0__Lean_Elab_toJsonPrintImportResult____x40_Lean_Elab_Import___hyg_472____closed__1; +x_8 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_8, 0, x_7); +lean_ctor_set(x_8, 1, x_6); +x_9 = lean_box(0); +x_10 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_10, 0, x_8); +lean_ctor_set(x_10, 1, x_9); +x_11 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_11, 0, x_10); +lean_ctor_set(x_11, 1, x_9); +x_12 = l_List_join___rarg(x_11); +x_13 = l_Lean_Json_mkObj(x_12); +return x_13; +} +} +LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_Import_0__Lean_Elab_toJsonPrintImportsResult____x40_Lean_Elab_Import___hyg_517____spec__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +_start: +{ +size_t x_4; size_t x_5; lean_object* x_6; +x_4 = lean_unbox_usize(x_1); +lean_dec(x_1); +x_5 = lean_unbox_usize(x_2); +lean_dec(x_2); +x_6 = l_Array_mapMUnsafe_map___at___private_Lean_Elab_Import_0__Lean_Elab_toJsonPrintImportsResult____x40_Lean_Elab_Import___hyg_517____spec__1(x_4, x_5, x_3); +return x_6; +} +} +static lean_object* _init_l_Lean_Elab_instToJsonPrintImportsResult___closed__1() { +_start: +{ +lean_object* x_1; +x_1 = lean_alloc_closure((void*)(l___private_Lean_Elab_Import_0__Lean_Elab_toJsonPrintImportsResult____x40_Lean_Elab_Import___hyg_517_), 1, 0); +return x_1; +} +} +static lean_object* _init_l_Lean_Elab_instToJsonPrintImportsResult() { +_start: +{ +lean_object* x_1; +x_1 = l_Lean_Elab_instToJsonPrintImportsResult___closed__1; +return x_1; +} +} +LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_printImportsJson___spec__1(size_t x_1, size_t x_2, lean_object* x_3, lean_object* x_4) { +_start: +{ +uint8_t x_5; +x_5 = lean_usize_dec_lt(x_2, x_1); +if (x_5 == 0) +{ +lean_object* x_6; +x_6 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_6, 0, x_3); +lean_ctor_set(x_6, 1, x_4); +return x_6; +} +else +{ +lean_object* x_7; lean_object* x_8; lean_object* x_9; uint8_t x_10; lean_object* x_11; +x_7 = lean_array_uget(x_3, x_2); +x_8 = lean_unsigned_to_nat(0u); +x_9 = lean_array_uset(x_3, x_2, x_8); +x_10 = 0; +x_11 = l_Lean_Message_toString(x_7, x_10, x_4); +if (lean_obj_tag(x_11) == 0) +{ +lean_object* x_12; lean_object* x_13; size_t x_14; size_t x_15; lean_object* x_16; +x_12 = lean_ctor_get(x_11, 0); +lean_inc(x_12); +x_13 = lean_ctor_get(x_11, 1); +lean_inc(x_13); +lean_dec(x_11); +x_14 = 1; +x_15 = lean_usize_add(x_2, x_14); +x_16 = lean_array_uset(x_9, x_2, x_12); +x_2 = x_15; +x_3 = x_16; +x_4 = x_13; +goto _start; +} +else +{ +uint8_t x_18; +lean_dec(x_9); +x_18 = !lean_is_exclusive(x_11); +if (x_18 == 0) +{ +return x_11; +} +else +{ +lean_object* x_19; lean_object* x_20; lean_object* x_21; +x_19 = lean_ctor_get(x_11, 0); +x_20 = lean_ctor_get(x_11, 1); +lean_inc(x_20); +lean_inc(x_19); +lean_dec(x_11); +x_21 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_21, 0, x_19); +lean_ctor_set(x_21, 1, x_20); +return x_21; +} +} +} +} +} +static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_printImportsJson___spec__2___closed__1() { +_start: +{ +lean_object* x_1; lean_object* x_2; +x_1 = lean_unsigned_to_nat(1u); +x_2 = lean_mk_empty_array_with_capacity(x_1); +return x_2; +} +} +LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_printImportsJson___spec__2(size_t x_1, size_t x_2, lean_object* x_3, lean_object* x_4) { +_start: +{ +uint8_t x_5; +x_5 = lean_usize_dec_lt(x_2, x_1); +if (x_5 == 0) +{ +lean_object* x_6; +x_6 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_6, 0, x_3); +lean_ctor_set(x_6, 1, x_4); +return x_6; +} +else +{ +lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_22; +x_7 = lean_array_uget(x_3, x_2); +x_8 = lean_unsigned_to_nat(0u); +x_9 = lean_array_uset(x_3, x_2, x_8); +x_22 = l_IO_FS_readFile(x_7, x_4); +if (lean_obj_tag(x_22) == 0) +{ +lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; +x_23 = lean_ctor_get(x_22, 0); +lean_inc(x_23); +x_24 = lean_ctor_get(x_22, 1); +lean_inc(x_24); +lean_dec(x_22); +x_25 = lean_alloc_ctor(1, 1, 0); +lean_ctor_set(x_25, 0, x_7); +x_26 = l_Lean_Elab_parseImports(x_23, x_25, x_24); +if (lean_obj_tag(x_26) == 0) +{ +lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; uint8_t x_32; +x_27 = lean_ctor_get(x_26, 0); +lean_inc(x_27); +x_28 = lean_ctor_get(x_27, 1); +lean_inc(x_28); +x_29 = lean_ctor_get(x_26, 1); +lean_inc(x_29); +lean_dec(x_26); +x_30 = lean_ctor_get(x_27, 0); +lean_inc(x_30); +lean_dec(x_27); +x_31 = lean_ctor_get(x_28, 1); +lean_inc(x_31); +lean_dec(x_28); +lean_inc(x_31); +x_32 = l_Std_PersistentArray_anyM___at_Lean_MessageLog_hasErrors___spec__1(x_31); +if (x_32 == 0) +{ +lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; size_t x_39; size_t x_40; lean_object* x_41; +lean_dec(x_31); +x_33 = l_List_redLength___rarg(x_30); +x_34 = lean_mk_empty_array_with_capacity(x_33); +lean_dec(x_33); +x_35 = l_List_toArrayAux___rarg(x_30, x_34); +x_36 = lean_alloc_ctor(1, 1, 0); +lean_ctor_set(x_36, 0, x_35); +x_37 = l_Lean_Elab_PrintImportResult_errors___default___closed__1; +x_38 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_38, 0, x_36); +lean_ctor_set(x_38, 1, x_37); +x_39 = 1; +x_40 = lean_usize_add(x_2, x_39); +x_41 = lean_array_uset(x_9, x_2, x_38); +x_2 = x_40; +x_3 = x_41; +x_4 = x_29; +goto _start; +} +else +{ +lean_object* x_43; lean_object* x_44; lean_object* x_45; lean_object* x_46; lean_object* x_47; size_t x_48; size_t x_49; lean_object* x_50; +lean_dec(x_30); +x_43 = l_Lean_MessageLog_toList(x_31); +x_44 = l_List_redLength___rarg(x_43); +x_45 = lean_mk_empty_array_with_capacity(x_44); +lean_dec(x_44); +x_46 = l_List_toArrayAux___rarg(x_43, x_45); +x_47 = lean_array_get_size(x_46); +x_48 = lean_usize_of_nat(x_47); +lean_dec(x_47); +x_49 = 0; +x_50 = l_Array_mapMUnsafe_map___at_Lean_Elab_printImportsJson___spec__1(x_48, x_49, x_46, x_29); +if (lean_obj_tag(x_50) == 0) +{ +lean_object* x_51; lean_object* x_52; lean_object* x_53; lean_object* x_54; size_t x_55; size_t x_56; lean_object* x_57; +x_51 = lean_ctor_get(x_50, 0); +lean_inc(x_51); +x_52 = lean_ctor_get(x_50, 1); +lean_inc(x_52); +lean_dec(x_50); +x_53 = lean_box(0); +x_54 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_54, 0, x_53); +lean_ctor_set(x_54, 1, x_51); +x_55 = 1; +x_56 = lean_usize_add(x_2, x_55); +x_57 = lean_array_uset(x_9, x_2, x_54); +x_2 = x_56; +x_3 = x_57; +x_4 = x_52; +goto _start; +} +else +{ +lean_object* x_59; lean_object* x_60; +x_59 = lean_ctor_get(x_50, 0); +lean_inc(x_59); +x_60 = lean_ctor_get(x_50, 1); +lean_inc(x_60); +lean_dec(x_50); +x_10 = x_59; +x_11 = x_60; +goto block_21; +} +} +} +else +{ +lean_object* x_61; lean_object* x_62; +x_61 = lean_ctor_get(x_26, 0); +lean_inc(x_61); +x_62 = lean_ctor_get(x_26, 1); +lean_inc(x_62); +lean_dec(x_26); +x_10 = x_61; +x_11 = x_62; +goto block_21; +} +} +else +{ +lean_object* x_63; lean_object* x_64; +lean_dec(x_7); +x_63 = lean_ctor_get(x_22, 0); +lean_inc(x_63); +x_64 = lean_ctor_get(x_22, 1); +lean_inc(x_64); +lean_dec(x_22); +x_10 = x_63; +x_11 = x_64; +goto block_21; +} +block_21: +{ +lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; size_t x_17; size_t x_18; lean_object* x_19; +x_12 = lean_box(0); +x_13 = lean_io_error_to_string(x_10); +x_14 = l_Array_mapMUnsafe_map___at_Lean_Elab_printImportsJson___spec__2___closed__1; +x_15 = lean_array_push(x_14, x_13); +x_16 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_16, 0, x_12); +lean_ctor_set(x_16, 1, x_15); +x_17 = 1; +x_18 = lean_usize_add(x_2, x_17); +x_19 = lean_array_uset(x_9, x_2, x_16); +x_2 = x_18; +x_3 = x_19; +x_4 = x_11; +goto _start; +} +} +} +} +LEAN_EXPORT lean_object* l_IO_println___at_Lean_Elab_printImportsJson___spec__3(lean_object* x_1, lean_object* x_2) { +_start: +{ +lean_object* x_3; lean_object* x_4; uint32_t x_5; lean_object* x_6; lean_object* x_7; +x_3 = lean_unsigned_to_nat(80u); +x_4 = l_Lean_Json_pretty(x_1, x_3); +x_5 = 10; +x_6 = lean_string_push(x_4, x_5); +x_7 = l_IO_print___at_IO_println___spec__1(x_6, x_2); +return x_7; +} +} +LEAN_EXPORT lean_object* lean_print_imports_json(lean_object* x_1, lean_object* x_2) { +_start: +{ +lean_object* x_3; size_t x_4; size_t x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; +x_3 = lean_array_get_size(x_1); +x_4 = lean_usize_of_nat(x_3); +lean_dec(x_3); +x_5 = 0; +x_6 = l_Array_mapMUnsafe_map___at_Lean_Elab_printImportsJson___spec__2(x_4, x_5, x_1, x_2); +x_7 = lean_ctor_get(x_6, 0); +lean_inc(x_7); +x_8 = lean_ctor_get(x_6, 1); +lean_inc(x_8); +lean_dec(x_6); +x_9 = l___private_Lean_Elab_Import_0__Lean_Elab_toJsonPrintImportsResult____x40_Lean_Elab_Import___hyg_517_(x_7); +x_10 = l_IO_println___at_Lean_Elab_printImportsJson___spec__3(x_9, x_8); +return x_10; +} +} +LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_printImportsJson___spec__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { +_start: +{ +size_t x_5; size_t x_6; lean_object* x_7; +x_5 = lean_unbox_usize(x_1); +lean_dec(x_1); +x_6 = lean_unbox_usize(x_2); +lean_dec(x_2); +x_7 = l_Array_mapMUnsafe_map___at_Lean_Elab_printImportsJson___spec__1(x_5, x_6, x_3, x_4); +return x_7; +} +} +LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_printImportsJson___spec__2___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { +_start: +{ +size_t x_5; size_t x_6; lean_object* x_7; +x_5 = lean_unbox_usize(x_1); +lean_dec(x_1); +x_6 = lean_unbox_usize(x_2); +lean_dec(x_2); +x_7 = l_Array_mapMUnsafe_map___at_Lean_Elab_printImportsJson___spec__2(x_5, x_6, x_3, x_4); +return x_7; +} +} lean_object* initialize_Init(uint8_t builtin, lean_object*); lean_object* initialize_Lean_Parser_Module(uint8_t builtin, lean_object*); +lean_object* initialize_Lean_Data_Json(uint8_t builtin, lean_object*); static bool _G_initialized = false; LEAN_EXPORT lean_object* initialize_Lean_Elab_Import(uint8_t builtin, lean_object* w) { lean_object * res; @@ -1077,6 +1774,9 @@ lean_dec_ref(res); res = initialize_Lean_Parser_Module(builtin, lean_io_mk_world()); if (lean_io_result_is_error(res)) return res; lean_dec_ref(res); +res = initialize_Lean_Data_Json(builtin, lean_io_mk_world()); +if (lean_io_result_is_error(res)) return res; +lean_dec_ref(res); l_Lean_Elab_headerToImports___closed__1 = _init_l_Lean_Elab_headerToImports___closed__1(); lean_mark_persistent(l_Lean_Elab_headerToImports___closed__1); l_Lean_Elab_headerToImports___closed__2 = _init_l_Lean_Elab_headerToImports___closed__2(); @@ -1089,6 +1789,34 @@ l_Lean_Elab_processHeader___closed__1 = _init_l_Lean_Elab_processHeader___closed lean_mark_persistent(l_Lean_Elab_processHeader___closed__1); l_Lean_Elab_parseImports___closed__1 = _init_l_Lean_Elab_parseImports___closed__1(); lean_mark_persistent(l_Lean_Elab_parseImports___closed__1); +l___private_Lean_Elab_Import_0__Lean_Elab_toJsonImport____x40_Lean_Elab_Import___hyg_401____closed__1 = _init_l___private_Lean_Elab_Import_0__Lean_Elab_toJsonImport____x40_Lean_Elab_Import___hyg_401____closed__1(); +lean_mark_persistent(l___private_Lean_Elab_Import_0__Lean_Elab_toJsonImport____x40_Lean_Elab_Import___hyg_401____closed__1); +l___private_Lean_Elab_Import_0__Lean_Elab_toJsonImport____x40_Lean_Elab_Import___hyg_401____closed__2 = _init_l___private_Lean_Elab_Import_0__Lean_Elab_toJsonImport____x40_Lean_Elab_Import___hyg_401____closed__2(); +lean_mark_persistent(l___private_Lean_Elab_Import_0__Lean_Elab_toJsonImport____x40_Lean_Elab_Import___hyg_401____closed__2); +l_Lean_Elab_instToJsonImport___closed__1 = _init_l_Lean_Elab_instToJsonImport___closed__1(); +lean_mark_persistent(l_Lean_Elab_instToJsonImport___closed__1); +l_Lean_Elab_instToJsonImport = _init_l_Lean_Elab_instToJsonImport(); +lean_mark_persistent(l_Lean_Elab_instToJsonImport); +l_Lean_Elab_PrintImportResult_imports_x3f___default = _init_l_Lean_Elab_PrintImportResult_imports_x3f___default(); +lean_mark_persistent(l_Lean_Elab_PrintImportResult_imports_x3f___default); +l_Lean_Elab_PrintImportResult_errors___default___closed__1 = _init_l_Lean_Elab_PrintImportResult_errors___default___closed__1(); +lean_mark_persistent(l_Lean_Elab_PrintImportResult_errors___default___closed__1); +l_Lean_Elab_PrintImportResult_errors___default = _init_l_Lean_Elab_PrintImportResult_errors___default(); +lean_mark_persistent(l_Lean_Elab_PrintImportResult_errors___default); +l___private_Lean_Elab_Import_0__Lean_Elab_toJsonPrintImportResult____x40_Lean_Elab_Import___hyg_472____closed__1 = _init_l___private_Lean_Elab_Import_0__Lean_Elab_toJsonPrintImportResult____x40_Lean_Elab_Import___hyg_472____closed__1(); +lean_mark_persistent(l___private_Lean_Elab_Import_0__Lean_Elab_toJsonPrintImportResult____x40_Lean_Elab_Import___hyg_472____closed__1); +l___private_Lean_Elab_Import_0__Lean_Elab_toJsonPrintImportResult____x40_Lean_Elab_Import___hyg_472____closed__2 = _init_l___private_Lean_Elab_Import_0__Lean_Elab_toJsonPrintImportResult____x40_Lean_Elab_Import___hyg_472____closed__2(); +lean_mark_persistent(l___private_Lean_Elab_Import_0__Lean_Elab_toJsonPrintImportResult____x40_Lean_Elab_Import___hyg_472____closed__2); +l_Lean_Elab_instToJsonPrintImportResult___closed__1 = _init_l_Lean_Elab_instToJsonPrintImportResult___closed__1(); +lean_mark_persistent(l_Lean_Elab_instToJsonPrintImportResult___closed__1); +l_Lean_Elab_instToJsonPrintImportResult = _init_l_Lean_Elab_instToJsonPrintImportResult(); +lean_mark_persistent(l_Lean_Elab_instToJsonPrintImportResult); +l_Lean_Elab_instToJsonPrintImportsResult___closed__1 = _init_l_Lean_Elab_instToJsonPrintImportsResult___closed__1(); +lean_mark_persistent(l_Lean_Elab_instToJsonPrintImportsResult___closed__1); +l_Lean_Elab_instToJsonPrintImportsResult = _init_l_Lean_Elab_instToJsonPrintImportsResult(); +lean_mark_persistent(l_Lean_Elab_instToJsonPrintImportsResult); +l_Array_mapMUnsafe_map___at_Lean_Elab_printImportsJson___spec__2___closed__1 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_printImportsJson___spec__2___closed__1(); +lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_printImportsJson___spec__2___closed__1); return lean_io_result_mk_ok(lean_box(0)); } #ifdef __cplusplus