From fe45476d91153d5ccbf1800189d2d750fa3c16b5 Mon Sep 17 00:00:00 2001 From: Leonardo de Moura Date: Sat, 27 Jul 2019 18:23:53 -0700 Subject: [PATCH] chore(stage0): update --- src/stage0/init/lean/compiler/ir/emitcpp.cpp | 26 +- src/stage0/init/lean/elaborator/basic.cpp | 1841 +++++++++-------- src/stage0/init/lean/environment.cpp | 915 ++++----- src/stage0/init/lean/path.cpp | 1888 ++++++++++-------- 4 files changed, 2534 insertions(+), 2136 deletions(-) diff --git a/src/stage0/init/lean/compiler/ir/emitcpp.cpp b/src/stage0/init/lean/compiler/ir/emitcpp.cpp index 0ebc8552f1..f144eb6326 100644 --- a/src/stage0/init/lean/compiler/ir/emitcpp.cpp +++ b/src/stage0/init/lean/compiler/ir/emitcpp.cpp @@ -317,6 +317,7 @@ obj* l_Nat_mforAux___main___at_Lean_IR_EmitCpp_emitDeclAux___spec__2___boxed(obj obj* l_Array_mforAux___main___at_Lean_IR_EmitCpp_emitCase___spec__1___closed__1; obj* l_Lean_IR_EmitCpp_emitApp___closed__2; extern obj* l_Char_quoteCore___closed__5; +obj* l_List_foldl___main___at_Lean_moduleNameOfFileName___spec__1(obj*, obj*); namespace lean { obj* nat_add(obj*, obj*); } @@ -451,7 +452,6 @@ obj* l_RBNode_revFold___main___at_Lean_IR_EmitCpp_emitFnDecls___spec__4(obj*, ob obj* l_Lean_IR_EmitCpp_emitInitFn___boxed(obj*, obj*); obj* l_Nat_mforAux___main___at_Lean_IR_EmitCpp_emitTailCall___spec__1(obj*, obj*, obj*, obj*, obj*, obj*); obj* l_Lean_IR_EmitCpp_openNamespacesFor___boxed(obj*, obj*, obj*); -obj* l_List_foldl___main___at_Lean_IR_EmitCpp_cppQualifiedNameToName___spec__1(obj*, obj*); obj* l_Lean_IR_EmitCpp_emitFileHeader___closed__6; obj* l_Lean_IR_EmitCpp_emitReuse(obj*, obj*, obj*, uint8, obj*, obj*, obj*); obj* l_Array_get(obj*, obj*, obj*, obj*); @@ -3266,28 +3266,6 @@ lean::dec(x_1); return x_6; } } -obj* l_List_foldl___main___at_Lean_IR_EmitCpp_cppQualifiedNameToName___spec__1(obj* x_1, obj* x_2) { -_start: -{ -if (lean::obj_tag(x_2) == 0) -{ -return x_1; -} -else -{ -obj* x_3; obj* x_4; obj* x_5; -x_3 = lean::cnstr_get(x_2, 0); -lean::inc(x_3); -x_4 = lean::cnstr_get(x_2, 1); -lean::inc(x_4); -lean::dec(x_2); -x_5 = lean_name_mk_string(x_1, x_3); -x_1 = x_5; -x_2 = x_4; -goto _start; -} -} -} obj* l_Lean_IR_EmitCpp_cppQualifiedNameToName(obj* x_1) { _start: { @@ -3295,7 +3273,7 @@ obj* x_2; obj* x_3; obj* x_4; obj* x_5; x_2 = l_Lean_IR_EmitCpp_toCppName___closed__1; x_3 = l_String_split(x_1, x_2); x_4 = lean::box(0); -x_5 = l_List_foldl___main___at_Lean_IR_EmitCpp_cppQualifiedNameToName___spec__1(x_4, x_3); +x_5 = l_List_foldl___main___at_Lean_moduleNameOfFileName___spec__1(x_4, x_3); return x_5; } } diff --git a/src/stage0/init/lean/elaborator/basic.cpp b/src/stage0/init/lean/elaborator/basic.cpp index 3224be050a..0c3b9af596 100644 --- a/src/stage0/init/lean/elaborator/basic.cpp +++ b/src/stage0/init/lean/elaborator/basic.cpp @@ -18,7 +18,6 @@ obj* l_Lean_checkSyntaxNodeKind___closed__1; obj* l_Lean_mkMessage(obj*, obj*, obj*, obj*); obj* l_Lean_Elab_getOpenDecls(obj*); obj* l_Lean_SMap_empty___at_Lean_mkBuiltinTermElabTable___spec__1___closed__2; -extern "C" obj* lean_set_search_path(obj*); obj* l_RBNode_setBlack___main___rarg(obj*); obj* l_Lean_declareBuiltinCommandElab(obj*, obj*, obj*, obj*); obj* l_unsafeCast(obj*, obj*, obj*, obj*); @@ -31,9 +30,13 @@ obj* l_Lean_attrParamSyntaxToIdentifier(obj*); obj* l_Lean_ElabScope_Inhabited; extern "C" uint8 lean_name_dec_eq(obj*, obj*); obj* l_Lean_Elab_runIO___rarg(obj*); +extern "C" obj* lean_io_realpath(obj*, obj*); obj* l_Lean_processCommandsAux___main___boxed(obj*); obj* l_Lean_FileMap_toPosition___main(obj*, obj*); extern obj* l_Array_empty___closed__1; +namespace lean { +obj* nat_sub(obj*, obj*); +} extern obj* l_Lean_registerEnvExtensionUnsafe___rarg___closed__2; obj* l_Lean_mkCommandElabAttribute___closed__1; obj* l_Lean_Elab_Inhabited___boxed(obj*, obj*); @@ -45,14 +48,13 @@ extern obj* l_Lean_registerPersistentEnvExtensionUnsafe___rarg___closed__2; obj* l_Array_mkArray(obj*, obj*, obj*); obj* l_Lean_Elab_resolveNamespaceUsingOpenDecls___boxed(obj*, obj*, obj*); obj* l_Lean_registerBuiltinTermElabAttr___closed__5; -obj* l_Array_miterateAux___main___at_Lean_processHeaderAux___spec__2___boxed(obj*, obj*, obj*, obj*, obj*, obj*); +obj* l_Array_miterateAux___main___at_Lean_processHeaderAux___spec__2___boxed(obj*, obj*, obj*, obj*, obj*, obj*, obj*); obj* l_Array_anyMAux___main___at_Lean_mkCommandElabAttribute___spec__3___boxed(obj*, obj*, obj*); obj* l_Lean_mkElabAttribute___rarg___lambda__1(obj*, obj*, obj*); obj* l_Lean_declareBuiltinTermElab___closed__2; obj* l_Lean_updateCmdPos___boxed(obj*); extern obj* l_Lean_EnvExtension_Inhabited___rarg___closed__1; obj* l_Lean_processCommands(obj*, obj*); -obj* l_Lean_setSearchPathOld___boxed(obj*); extern obj* l_Lean_AttributeImpl_inhabited___closed__5; obj* l_Lean_mkElabAttribute___at_Lean_mkCommandElabAttribute___spec__1(obj*, obj*, obj*, obj*); obj* l_RBNode_find___main___at_Lean_addBuiltinCommandElab___spec__4(obj*, obj*); @@ -70,10 +72,11 @@ obj* l_Lean_addBuiltinTermElab___closed__2; obj* l_Lean_registerBuiltinTermElabAttr___lambda__1___closed__1; obj* l_Lean_registerBuiltinTermElabAttr___closed__7; extern obj* l_Lean_Parser_Command_docComment___elambda__1___closed__2; +extern obj* l_Lean_findOLean___closed__1; obj* l_Lean_termElabAttribute___closed__3; obj* l_Lean_registerBuiltinTermElabAttr___closed__4; obj* l_Lean_registerAttribute(obj*, obj*); -obj* l_Array_miterateAux___main___at_Lean_processHeaderAux___spec__2(obj*, obj*, obj*, obj*, obj*, obj*); +obj* l_Array_miterateAux___main___at_Lean_processHeaderAux___spec__2(obj*, obj*, obj*, obj*, obj*, obj*, obj*); obj* l_Lean_Elab_Inhabited(obj*, obj*); obj* l_Lean_logElabException(obj*, obj*, obj*); namespace lean { @@ -92,12 +95,12 @@ obj* get_namespaces_core(obj*); } obj* l_Lean_processCommandsAux(obj*); obj* l_Lean_Elab_removeRoot(obj*); -obj* l_Lean_absolutizeModuleNameAux___boxed(obj*, obj*, obj*); obj* l_Array_uget(obj*, obj*, usize, obj*); obj* l_Lean_processCommandsAux___main___rarg(obj*, obj*); extern obj* l_Lean_registerPersistentEnvExtensionUnsafe___rarg___closed__4; obj* l_Lean_Name_toStringWithSep___main(obj*, obj*); obj* l_Lean_processCommandsAux___boxed(obj*); +obj* l_Lean_addRel___main(obj*, obj*); extern obj* l_Lean_mkInitAttr___lambda__1___closed__1; obj* l_AssocList_find___main___at_Lean_elabTerm___spec__3___boxed(obj*, obj*); obj* l_Lean_registerBuiltinCommandElabAttr___closed__2; @@ -111,7 +114,7 @@ obj* l_IO_Prim_Ref_set(obj*, obj*, obj*, obj*); extern obj* l_Lean_Options_empty; obj* l_HashMapImp_find___at_Lean_elabTerm___spec__2(obj*, obj*); obj* l_Lean_elabCommand(obj*, obj*, obj*); -obj* l_Lean_processHeader(obj*, obj*, obj*, uint32, obj*); +obj* l_Lean_processHeader(obj*, obj*, obj*, obj*, uint32, obj*); obj* l_Lean_addBuiltinCommandElab___boxed(obj*, obj*, obj*, obj*); obj* l_IO_ofExcept___at_Lean_Parser_declareBuiltinParser___spec__1(obj*, obj*); obj* l_Lean_toMessage___main(obj*, obj*, obj*); @@ -143,7 +146,7 @@ obj* l_Lean_Elab_runIO___boxed(obj*, obj*, obj*); obj* l_Lean_commandElabAttribute; obj* l_Lean_processCommand(obj*, obj*); obj* l_Lean_elabTerm___closed__2; -obj* l_Lean_processHeader___boxed(obj*, obj*, obj*, obj*, obj*); +obj* l_Lean_processHeader___boxed(obj*, obj*, obj*, obj*, obj*, obj*); obj* l_Lean_mkBuiltinCommandElabTable(obj*); obj* l_Lean_toMessage(obj*, obj*, obj*); extern "C" obj* lean_expr_mk_const(obj*, obj*); @@ -181,6 +184,9 @@ uint8 nat_dec_lt(obj*, obj*); obj* l_RBNode_find___main___at_Lean_addBuiltinCommandElab___spec__4___boxed(obj*, obj*); obj* l_Lean_Elab_resolveNamespaceUsingScopes___boxed(obj*, obj*, obj*); obj* l_Lean_updateCmdPos___rarg(obj*); +namespace lean { +obj* module_name_of_file_core(obj*, obj*); +} extern obj* l_Lean_PersistentEnvExtension_inhabited___rarg___closed__1; obj* l_Lean_Syntax_getArgs___rarg(obj*); obj* l_Lean_checkSyntaxNodeKindAtNamespaces___main___boxed(obj*, obj*, obj*); @@ -192,8 +198,9 @@ obj* l_Lean_addBuiltinTermElab___closed__1; obj* l_Lean_addBuiltinTermElab(obj*, obj*, obj*, obj*); obj* l_HashMapImp_insert___at_Lean_addBuiltinTermElab___spec__8(obj*, obj*, obj*); obj* l_Lean_registerBuiltinCommandElabAttr___lambda__1(obj*, obj*, obj*, uint8, obj*); +obj* l_System_FilePath_dirName(obj*); obj* l_Lean_declareBuiltinCommandElab___boxed(obj*, obj*, obj*, obj*); -obj* l_Lean_processHeaderAux(obj*, uint32, obj*); +obj* l_Lean_processHeaderAux(obj*, obj*, uint32, obj*); uint8 l_Lean_SMap_contains___main___at_Lean_addBuiltinTermElab___spec__1(obj*, obj*); obj* l_Lean_SMap_empty___at_Lean_mkBuiltinCommandElabTable___spec__1; obj* l_Array_fget(obj*, obj*, obj*); @@ -229,10 +236,12 @@ obj* l_Lean_mkBuiltinTermElabTable(obj*); obj* l_Lean_logErrorUsingCmdPos(obj*, obj*, obj*); obj* l_Lean_registerBuiltinCommandElabAttr___closed__5; obj* l_Lean_termElabAttribute___closed__2; +obj* l_Lean_modNameToFileName___main(obj*); obj* l_Lean_syntaxNodeKindOfAttrParam(obj*, obj*, obj*, obj*); obj* l_Lean_updateCmdPos(obj*); obj* l_AssocList_contains___main___at_Lean_addBuiltinCommandElab___spec__3___boxed(obj*, obj*); obj* l_Lean_Elab_resolveNamespace___boxed(obj*, obj*, obj*); +extern obj* l___private_init_lean_path_1__pathSep___closed__1; obj* l_Lean_ElabException_Inhabited___closed__1; obj* l_mkHashMap___at_Lean_mkBuiltinTermElabTable___spec__2(obj*); extern obj* l_Lean_Parser_mkCommandParserAttribute___closed__4; @@ -241,11 +250,14 @@ obj* l_Lean_Elab_getOpenDecls___boxed(obj*); obj* l_IO_Prim_mkRef(obj*, obj*, obj*); obj* l_Lean_runElab___at_Lean_processCommand___spec__1(obj*, obj*, obj*); obj* l_Lean_SMap_contains___main___at_Lean_addBuiltinCommandElab___spec__1___boxed(obj*, obj*); -obj* l_Array_miterateAux___main___at_Lean_processHeaderAux___spec__1(obj*, obj*, obj*, obj*, obj*, obj*); +obj* l_Array_miterateAux___main___at_Lean_processHeaderAux___spec__1(obj*, obj*, obj*, obj*, obj*, obj*, obj*); uint8 l_Lean_isNamespace(obj*, obj*); obj* l_Lean_mkCApp(obj*, obj*); obj* l_Lean_SMap_insert___main___at_Lean_addBuiltinCommandElab___spec__5(obj*, obj*, obj*); obj* l_Lean_testFrontend___closed__2; +namespace lean { +obj* absolutize_module_name_core(obj*, obj*, obj*, obj*); +} obj* l_Lean_Parser_parseCommand___main(obj*, obj*, obj*, obj*); obj* l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_mkCommandElabAttribute___spec__2(obj*, obj*); obj* l_Lean_SMap_find___main___at_Lean_elabCommand___spec__1(obj*, obj*); @@ -257,6 +269,7 @@ obj* l_Lean_registerBuiltinTermElabAttr___lambda__1___closed__5; obj* l_Lean_mkCommandElabAttribute(obj*); obj* l_Lean_syntaxNodeKindOfAttrParam___boxed(obj*, obj*, obj*, obj*); obj* l_HashMapImp_expand___at_Lean_addBuiltinCommandElab___spec__9(obj*, obj*); +obj* l_Lean_absolutizeModuleName___closed__1; obj* l_Lean_registerEnvExtensionUnsafe___at_Lean_mkTermElabAttribute___spec__4(obj*, obj*); obj* l_List_head___main___at_Lean_Elab_getOpenDecls___spec__1(obj*); obj* l_EState_bind___rarg(obj*, obj*, obj*); @@ -273,7 +286,6 @@ obj* l_Lean_mkMessage___boxed(obj*, obj*, obj*, obj*); obj* l_Lean_Name_replacePrefix___main(obj*, obj*, obj*); obj* l_Lean_ElabException_Inhabited___closed__2; extern obj* l_System_FilePath_dirName___closed__1; -obj* l_Lean_absolutizeModuleNameAux(obj*, obj*, obj*); obj* l_Lean_processHeaderAux___closed__1; obj* l_Lean_logErrorUsingCmdPos___boxed(obj*, obj*, obj*); obj* l_Lean_checkSyntaxNodeKindAtNamespaces(obj*, obj*, obj*); @@ -339,6 +351,8 @@ namespace lean { uint8 nat_dec_le(obj*, obj*); } obj* l_Lean_ElabAttribute_Inhabited___rarg(obj*); +extern obj* l_Lean_findLeanFile___closed__1; +obj* l_Lean_toBaseDir(obj*, obj*); obj* l_Lean_Syntax_getPos___rarg(obj*); obj* l_Lean_ElabScope_Inhabited___closed__1; obj* l_Lean_mkElabAttribute___rarg___lambda__1___boxed(obj*, obj*, obj*); @@ -350,7 +364,7 @@ obj* l_Lean_registerBuiltinCommandElabAttr___lambda__1___closed__4; obj* l_Lean_mkElabAttribute___rarg___lambda__2___closed__1; obj* l_Lean_registerBuiltinCommandElabAttr___lambda__1___boxed(obj*, obj*, obj*, obj*, obj*); obj* l_Lean_registerBuiltinTermElabAttr___closed__3; -obj* l_Lean_processHeaderAux___boxed(obj*, obj*, obj*); +obj* l_Lean_processHeaderAux___boxed(obj*, obj*, obj*, obj*); obj* l_Lean_registerBuiltinCommandElabAttr(obj*); obj* l_Lean_registerBuiltinCommandElabAttr___closed__1; obj* l_Lean_declareBuiltinElab(obj*, obj*, obj*, obj*, obj*); @@ -375,12 +389,11 @@ obj* l_Lean_mkElabAttribute___rarg___closed__1; obj* l_AssocList_contains___main___at_Lean_addBuiltinTermElab___spec__3___boxed(obj*, obj*); obj* l_Lean_mkTermElabAttribute(obj*); extern obj* l_Lean_registerEnvExtensionUnsafe___rarg___closed__1; -obj* l_Lean_absolutizeModuleNameAux___closed__1; obj* l_IO_Prim_Ref_reset(obj*, obj*, obj*); obj* l_Lean_Elab_rootNamespace___closed__1; obj* l_Lean_testFrontend___closed__4; extern obj* l___private_init_lean_environment_5__envExtensionsRef; -obj* l_Array_miterateAux___main___at_Lean_processHeaderAux___spec__1___boxed(obj*, obj*, obj*, obj*, obj*, obj*); +obj* l_Array_miterateAux___main___at_Lean_processHeaderAux___spec__1___boxed(obj*, obj*, obj*, obj*, obj*, obj*, obj*); obj* l_Lean_builtinTermElabTable; obj* l_Lean_SMap_insert___main___at_Lean_addBuiltinTermElab___spec__5(obj*, obj*, obj*); obj* l_Lean_Parser_isValidSyntaxNodeKind(obj*, obj*); @@ -16254,390 +16267,422 @@ x_3 = l_Lean_processCommandsAux___main___rarg(x_1, x_2); return x_3; } } -obj* _init_l_Lean_absolutizeModuleNameAux___closed__1() { +obj* _init_l_Lean_absolutizeModuleName___closed__1() { _start: { obj* x_1; -x_1 = lean::mk_string("relative imports are not supported yet"); +x_1 = lean::mk_string("invalid use of relative import, file name of main file is not available"); return x_1; } } -obj* l_Lean_absolutizeModuleNameAux(obj* x_1, obj* x_2, obj* x_3) { +namespace lean { +obj* absolutize_module_name_core(obj* x_1, obj* x_2, obj* x_3, obj* x_4) { _start: { -if (lean::obj_tag(x_2) == 0) +if (lean::obj_tag(x_3) == 0) { -uint8 x_4; -x_4 = !lean::is_exclusive(x_3); -if (x_4 == 0) +uint8 x_5; +lean::dec(x_1); +x_5 = !lean::is_exclusive(x_4); +if (x_5 == 0) { -obj* x_5; -x_5 = lean::cnstr_get(x_3, 0); -lean::dec(x_5); -lean::cnstr_set(x_3, 0, x_1); -return x_3; +obj* x_6; +x_6 = lean::cnstr_get(x_4, 0); +lean::dec(x_6); +lean::cnstr_set(x_4, 0, x_2); +return x_4; } else { -obj* x_6; obj* x_7; -x_6 = lean::cnstr_get(x_3, 1); -lean::inc(x_6); +obj* x_7; obj* x_8; +x_7 = lean::cnstr_get(x_4, 1); +lean::inc(x_7); +lean::dec(x_4); +x_8 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_8, 0, x_2); +lean::cnstr_set(x_8, 1, x_7); +return x_8; +} +} +else +{ +if (lean::obj_tag(x_1) == 0) +{ +uint8 x_9; lean::dec(x_3); -x_7 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_7, 0, x_1); -lean::cnstr_set(x_7, 1, x_6); +lean::dec(x_2); +x_9 = !lean::is_exclusive(x_4); +if (x_9 == 0) +{ +obj* x_10; obj* x_11; +x_10 = lean::cnstr_get(x_4, 0); +lean::dec(x_10); +x_11 = l_Lean_absolutizeModuleName___closed__1; +lean::cnstr_set_tag(x_4, 1); +lean::cnstr_set(x_4, 0, x_11); +return x_4; +} +else +{ +obj* x_12; obj* x_13; obj* x_14; +x_12 = lean::cnstr_get(x_4, 1); +lean::inc(x_12); +lean::dec(x_4); +x_13 = l_Lean_absolutizeModuleName___closed__1; +x_14 = lean::alloc_cnstr(1, 2, 0); +lean::cnstr_set(x_14, 0, x_13); +lean::cnstr_set(x_14, 1, x_12); +return x_14; +} +} +else +{ +obj* x_15; obj* x_16; obj* x_17; obj* x_18; obj* x_19; obj* x_20; obj* x_21; obj* x_22; obj* x_23; obj* x_24; obj* x_25; obj* x_26; +x_15 = lean::cnstr_get(x_3, 0); +lean::inc(x_15); +lean::dec(x_3); +x_16 = lean::cnstr_get(x_1, 0); +lean::inc(x_16); +lean::dec(x_1); +x_17 = l_Lean_addRel___main(x_16, x_15); +lean::dec(x_15); +lean::dec(x_16); +x_18 = l___private_init_lean_path_1__pathSep___closed__1; +x_19 = lean::string_append(x_17, x_18); +x_20 = l_Lean_modNameToFileName___main(x_2); +lean::dec(x_2); +x_21 = lean::string_append(x_19, x_20); +lean::dec(x_20); +x_22 = l_Lean_findLeanFile___closed__1; +x_23 = lean::string_append(x_21, x_22); +x_24 = l_Lean_findOLean___closed__1; +x_25 = lean::string_append(x_23, x_24); +x_26 = lean::module_name_of_file_core(x_25, x_4); +return x_26; +} +} +} +} +} +obj* l_Array_miterateAux___main___at_Lean_processHeaderAux___spec__1(obj* x_1, obj* x_2, obj* x_3, obj* x_4, obj* x_5, obj* x_6, obj* x_7) { +_start: +{ +obj* x_8; uint8 x_9; +x_8 = lean::array_get_size(x_4); +x_9 = lean::nat_dec_lt(x_5, x_8); +lean::dec(x_8); +if (x_9 == 0) +{ +uint8 x_10; +lean::dec(x_5); +lean::dec(x_2); +lean::dec(x_1); +x_10 = !lean::is_exclusive(x_7); +if (x_10 == 0) +{ +obj* x_11; +x_11 = lean::cnstr_get(x_7, 0); +lean::dec(x_11); +lean::cnstr_set(x_7, 0, x_6); return x_7; } -} else { -uint8 x_8; -lean::dec(x_1); -x_8 = !lean::is_exclusive(x_3); -if (x_8 == 0) -{ -obj* x_9; obj* x_10; -x_9 = lean::cnstr_get(x_3, 0); -lean::dec(x_9); -x_10 = l_Lean_absolutizeModuleNameAux___closed__1; -lean::cnstr_set_tag(x_3, 1); -lean::cnstr_set(x_3, 0, x_10); -return x_3; -} -else -{ -obj* x_11; obj* x_12; obj* x_13; -x_11 = lean::cnstr_get(x_3, 1); -lean::inc(x_11); -lean::dec(x_3); -x_12 = l_Lean_absolutizeModuleNameAux___closed__1; -x_13 = lean::alloc_cnstr(1, 2, 0); -lean::cnstr_set(x_13, 0, x_12); -lean::cnstr_set(x_13, 1, x_11); +obj* x_12; obj* x_13; +x_12 = lean::cnstr_get(x_7, 1); +lean::inc(x_12); +lean::dec(x_7); +x_13 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_13, 0, x_6); +lean::cnstr_set(x_13, 1, x_12); return x_13; } } -} -} -obj* l_Lean_absolutizeModuleNameAux___boxed(obj* x_1, obj* x_2, obj* x_3) { -_start: -{ -obj* x_4; -x_4 = l_Lean_absolutizeModuleNameAux(x_1, x_2, x_3); -lean::dec(x_2); -return x_4; -} -} -obj* l_Array_miterateAux___main___at_Lean_processHeaderAux___spec__1(obj* x_1, obj* x_2, obj* x_3, obj* x_4, obj* x_5, obj* x_6) { -_start: -{ -obj* x_7; uint8 x_8; -x_7 = lean::array_get_size(x_3); -x_8 = lean::nat_dec_lt(x_4, x_7); -lean::dec(x_7); -if (x_8 == 0) -{ -uint8 x_9; -lean::dec(x_4); -lean::dec(x_1); -x_9 = !lean::is_exclusive(x_6); -if (x_9 == 0) -{ -obj* x_10; -x_10 = lean::cnstr_get(x_6, 0); -lean::dec(x_10); -lean::cnstr_set(x_6, 0, x_5); -return x_6; -} else { -obj* x_11; obj* x_12; -x_11 = lean::cnstr_get(x_6, 1); -lean::inc(x_11); -lean::dec(x_6); -x_12 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_12, 0, x_5); -lean::cnstr_set(x_12, 1, x_11); -return x_12; -} -} -else -{ -obj* x_13; obj* x_14; obj* x_15; obj* x_16; obj* x_17; obj* x_18; obj* x_19; uint8 x_20; -x_13 = lean::array_fget(x_3, x_4); -x_14 = lean::mk_nat_obj(1u); -x_15 = lean::nat_add(x_4, x_14); -lean::dec(x_4); -x_16 = l_Lean_Syntax_asNode___main___rarg(x_13); -lean::dec(x_13); -x_17 = lean::cnstr_get(x_16, 1); -lean::inc(x_17); -lean::dec(x_16); -x_18 = lean::mk_nat_obj(0u); -lean::inc(x_1); -x_19 = lean::array_get(x_1, x_17, x_18); -x_20 = l_Lean_Syntax_isNone___rarg(x_19); -if (x_20 == 0) -{ -obj* x_21; obj* x_22; obj* x_23; obj* x_24; obj* x_25; -x_21 = l_Lean_Syntax_getNumArgs___rarg(x_19); -lean::dec(x_19); -x_22 = lean::alloc_cnstr(1, 1, 0); -lean::cnstr_set(x_22, 0, x_21); -lean::inc(x_1); -x_23 = lean::array_get(x_1, x_17, x_14); +obj* x_14; obj* x_15; obj* x_16; obj* x_17; obj* x_18; obj* x_19; obj* x_20; uint8 x_21; +x_14 = lean::array_fget(x_4, x_5); +x_15 = lean::mk_nat_obj(1u); +x_16 = lean::nat_add(x_5, x_15); +lean::dec(x_5); +x_17 = l_Lean_Syntax_asNode___main___rarg(x_14); +lean::dec(x_14); +x_18 = lean::cnstr_get(x_17, 1); +lean::inc(x_18); lean::dec(x_17); -x_24 = l_Lean_Syntax_getIdentVal___main___rarg(x_23); -lean::dec(x_23); -x_25 = l_Lean_absolutizeModuleNameAux(x_24, x_22, x_6); +x_19 = lean::mk_nat_obj(0u); +lean::inc(x_2); +x_20 = lean::array_get(x_2, x_18, x_19); +x_21 = l_Lean_Syntax_isNone___rarg(x_20); +if (x_21 == 0) +{ +obj* x_22; obj* x_23; obj* x_24; obj* x_25; obj* x_26; obj* x_27; +x_22 = l_Lean_Syntax_getNumArgs___rarg(x_20); +lean::dec(x_20); +x_23 = lean::nat_sub(x_22, x_15); lean::dec(x_22); -if (lean::obj_tag(x_25) == 0) +x_24 = lean::alloc_cnstr(1, 1, 0); +lean::cnstr_set(x_24, 0, x_23); +lean::inc(x_2); +x_25 = lean::array_get(x_2, x_18, x_15); +lean::dec(x_18); +x_26 = l_Lean_Syntax_getIdentVal___main___rarg(x_25); +lean::dec(x_25); +lean::inc(x_1); +x_27 = lean::absolutize_module_name_core(x_1, x_26, x_24, x_7); +if (lean::obj_tag(x_27) == 0) { -uint8 x_26; -x_26 = !lean::is_exclusive(x_25); -if (x_26 == 0) +uint8 x_28; +x_28 = !lean::is_exclusive(x_27); +if (x_28 == 0) { -obj* x_27; obj* x_28; obj* x_29; -x_27 = lean::cnstr_get(x_25, 0); -x_28 = lean::alloc_cnstr(1, 2, 0); -lean::cnstr_set(x_28, 0, x_27); -lean::cnstr_set(x_28, 1, x_5); -x_29 = lean::box(0); -lean::cnstr_set(x_25, 0, x_29); -x_4 = x_15; -x_5 = x_28; -x_6 = x_25; +obj* x_29; obj* x_30; obj* x_31; +x_29 = lean::cnstr_get(x_27, 0); +x_30 = lean::alloc_cnstr(1, 2, 0); +lean::cnstr_set(x_30, 0, x_29); +lean::cnstr_set(x_30, 1, x_6); +x_31 = lean::box(0); +lean::cnstr_set(x_27, 0, x_31); +x_5 = x_16; +x_6 = x_30; +x_7 = x_27; goto _start; } else { -obj* x_31; obj* x_32; obj* x_33; obj* x_34; obj* x_35; -x_31 = lean::cnstr_get(x_25, 0); -x_32 = lean::cnstr_get(x_25, 1); +obj* x_33; obj* x_34; obj* x_35; obj* x_36; obj* x_37; +x_33 = lean::cnstr_get(x_27, 0); +x_34 = lean::cnstr_get(x_27, 1); +lean::inc(x_34); +lean::inc(x_33); +lean::dec(x_27); +x_35 = lean::alloc_cnstr(1, 2, 0); +lean::cnstr_set(x_35, 0, x_33); +lean::cnstr_set(x_35, 1, x_6); +x_36 = lean::box(0); +x_37 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_37, 0, x_36); +lean::cnstr_set(x_37, 1, x_34); +x_5 = x_16; +x_6 = x_35; +x_7 = x_37; +goto _start; +} +} +else +{ +uint8 x_39; +lean::dec(x_16); +lean::dec(x_6); +lean::dec(x_2); +lean::dec(x_1); +x_39 = !lean::is_exclusive(x_27); +if (x_39 == 0) +{ +return x_27; +} +else +{ +obj* x_40; obj* x_41; obj* x_42; +x_40 = lean::cnstr_get(x_27, 0); +x_41 = lean::cnstr_get(x_27, 1); +lean::inc(x_41); +lean::inc(x_40); +lean::dec(x_27); +x_42 = lean::alloc_cnstr(1, 2, 0); +lean::cnstr_set(x_42, 0, x_40); +lean::cnstr_set(x_42, 1, x_41); +return x_42; +} +} +} +else +{ +obj* x_43; obj* x_44; obj* x_45; obj* x_46; +lean::dec(x_20); +x_43 = lean::box(0); +lean::inc(x_2); +x_44 = lean::array_get(x_2, x_18, x_15); +lean::dec(x_18); +x_45 = l_Lean_Syntax_getIdentVal___main___rarg(x_44); +lean::dec(x_44); +lean::inc(x_1); +x_46 = lean::absolutize_module_name_core(x_1, x_45, x_43, x_7); +if (lean::obj_tag(x_46) == 0) +{ +uint8 x_47; +x_47 = !lean::is_exclusive(x_46); +if (x_47 == 0) +{ +obj* x_48; obj* x_49; obj* x_50; +x_48 = lean::cnstr_get(x_46, 0); +x_49 = lean::alloc_cnstr(1, 2, 0); +lean::cnstr_set(x_49, 0, x_48); +lean::cnstr_set(x_49, 1, x_6); +x_50 = lean::box(0); +lean::cnstr_set(x_46, 0, x_50); +x_5 = x_16; +x_6 = x_49; +x_7 = x_46; +goto _start; +} +else +{ +obj* x_52; obj* x_53; obj* x_54; obj* x_55; obj* x_56; +x_52 = lean::cnstr_get(x_46, 0); +x_53 = lean::cnstr_get(x_46, 1); +lean::inc(x_53); +lean::inc(x_52); +lean::dec(x_46); +x_54 = lean::alloc_cnstr(1, 2, 0); +lean::cnstr_set(x_54, 0, x_52); +lean::cnstr_set(x_54, 1, x_6); +x_55 = lean::box(0); +x_56 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_56, 0, x_55); +lean::cnstr_set(x_56, 1, x_53); +x_5 = x_16; +x_6 = x_54; +x_7 = x_56; +goto _start; +} +} +else +{ +uint8 x_58; +lean::dec(x_16); +lean::dec(x_6); +lean::dec(x_2); +lean::dec(x_1); +x_58 = !lean::is_exclusive(x_46); +if (x_58 == 0) +{ +return x_46; +} +else +{ +obj* x_59; obj* x_60; obj* x_61; +x_59 = lean::cnstr_get(x_46, 0); +x_60 = lean::cnstr_get(x_46, 1); +lean::inc(x_60); +lean::inc(x_59); +lean::dec(x_46); +x_61 = lean::alloc_cnstr(1, 2, 0); +lean::cnstr_set(x_61, 0, x_59); +lean::cnstr_set(x_61, 1, x_60); +return x_61; +} +} +} +} +} +} +obj* l_Array_miterateAux___main___at_Lean_processHeaderAux___spec__2(obj* x_1, obj* x_2, obj* x_3, obj* x_4, obj* x_5, obj* x_6, obj* x_7) { +_start: +{ +obj* x_8; uint8 x_9; +x_8 = lean::array_get_size(x_4); +x_9 = lean::nat_dec_lt(x_5, x_8); +lean::dec(x_8); +if (x_9 == 0) +{ +uint8 x_10; +lean::dec(x_5); +lean::dec(x_3); +lean::dec(x_1); +x_10 = !lean::is_exclusive(x_7); +if (x_10 == 0) +{ +obj* x_11; +x_11 = lean::cnstr_get(x_7, 0); +lean::dec(x_11); +lean::cnstr_set(x_7, 0, x_6); +return x_7; +} +else +{ +obj* x_12; obj* x_13; +x_12 = lean::cnstr_get(x_7, 1); +lean::inc(x_12); +lean::dec(x_7); +x_13 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_13, 0, x_6); +lean::cnstr_set(x_13, 1, x_12); +return x_13; +} +} +else +{ +obj* x_14; obj* x_15; obj* x_16; obj* x_17; obj* x_18; obj* x_19; obj* x_20; +x_14 = lean::array_fget(x_4, x_5); +x_15 = lean::mk_nat_obj(1u); +x_16 = lean::nat_add(x_5, x_15); +lean::dec(x_5); +x_17 = l_Lean_Syntax_getArg___rarg(x_14, x_15); +x_18 = l_Lean_Syntax_getArgs___rarg(x_17); +lean::dec(x_17); +x_19 = lean::mk_nat_obj(0u); +lean::inc(x_3); +lean::inc(x_1); +x_20 = l_Array_miterateAux___main___at_Lean_processHeaderAux___spec__1(x_1, x_3, x_14, x_18, x_19, x_6, x_7); +lean::dec(x_18); +lean::dec(x_14); +if (lean::obj_tag(x_20) == 0) +{ +uint8 x_21; +x_21 = !lean::is_exclusive(x_20); +if (x_21 == 0) +{ +obj* x_22; obj* x_23; +x_22 = lean::cnstr_get(x_20, 0); +x_23 = lean::box(0); +lean::cnstr_set(x_20, 0, x_23); +x_5 = x_16; +x_6 = x_22; +x_7 = x_20; +goto _start; +} +else +{ +obj* x_25; obj* x_26; obj* x_27; obj* x_28; +x_25 = lean::cnstr_get(x_20, 0); +x_26 = lean::cnstr_get(x_20, 1); +lean::inc(x_26); +lean::inc(x_25); +lean::dec(x_20); +x_27 = lean::box(0); +x_28 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_28, 0, x_27); +lean::cnstr_set(x_28, 1, x_26); +x_5 = x_16; +x_6 = x_25; +x_7 = x_28; +goto _start; +} +} +else +{ +uint8 x_30; +lean::dec(x_16); +lean::dec(x_3); +lean::dec(x_1); +x_30 = !lean::is_exclusive(x_20); +if (x_30 == 0) +{ +return x_20; +} +else +{ +obj* x_31; obj* x_32; obj* x_33; +x_31 = lean::cnstr_get(x_20, 0); +x_32 = lean::cnstr_get(x_20, 1); lean::inc(x_32); lean::inc(x_31); -lean::dec(x_25); +lean::dec(x_20); x_33 = lean::alloc_cnstr(1, 2, 0); lean::cnstr_set(x_33, 0, x_31); -lean::cnstr_set(x_33, 1, x_5); -x_34 = lean::box(0); -x_35 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_35, 0, x_34); -lean::cnstr_set(x_35, 1, x_32); -x_4 = x_15; -x_5 = x_33; -x_6 = x_35; -goto _start; -} -} -else -{ -uint8 x_37; -lean::dec(x_15); -lean::dec(x_5); -lean::dec(x_1); -x_37 = !lean::is_exclusive(x_25); -if (x_37 == 0) -{ -return x_25; -} -else -{ -obj* x_38; obj* x_39; obj* x_40; -x_38 = lean::cnstr_get(x_25, 0); -x_39 = lean::cnstr_get(x_25, 1); -lean::inc(x_39); -lean::inc(x_38); -lean::dec(x_25); -x_40 = lean::alloc_cnstr(1, 2, 0); -lean::cnstr_set(x_40, 0, x_38); -lean::cnstr_set(x_40, 1, x_39); -return x_40; -} -} -} -else -{ -obj* x_41; obj* x_42; obj* x_43; obj* x_44; -lean::dec(x_19); -x_41 = lean::box(0); -lean::inc(x_1); -x_42 = lean::array_get(x_1, x_17, x_14); -lean::dec(x_17); -x_43 = l_Lean_Syntax_getIdentVal___main___rarg(x_42); -lean::dec(x_42); -x_44 = l_Lean_absolutizeModuleNameAux(x_43, x_41, x_6); -if (lean::obj_tag(x_44) == 0) -{ -uint8 x_45; -x_45 = !lean::is_exclusive(x_44); -if (x_45 == 0) -{ -obj* x_46; obj* x_47; obj* x_48; -x_46 = lean::cnstr_get(x_44, 0); -x_47 = lean::alloc_cnstr(1, 2, 0); -lean::cnstr_set(x_47, 0, x_46); -lean::cnstr_set(x_47, 1, x_5); -x_48 = lean::box(0); -lean::cnstr_set(x_44, 0, x_48); -x_4 = x_15; -x_5 = x_47; -x_6 = x_44; -goto _start; -} -else -{ -obj* x_50; obj* x_51; obj* x_52; obj* x_53; obj* x_54; -x_50 = lean::cnstr_get(x_44, 0); -x_51 = lean::cnstr_get(x_44, 1); -lean::inc(x_51); -lean::inc(x_50); -lean::dec(x_44); -x_52 = lean::alloc_cnstr(1, 2, 0); -lean::cnstr_set(x_52, 0, x_50); -lean::cnstr_set(x_52, 1, x_5); -x_53 = lean::box(0); -x_54 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_54, 0, x_53); -lean::cnstr_set(x_54, 1, x_51); -x_4 = x_15; -x_5 = x_52; -x_6 = x_54; -goto _start; -} -} -else -{ -uint8 x_56; -lean::dec(x_15); -lean::dec(x_5); -lean::dec(x_1); -x_56 = !lean::is_exclusive(x_44); -if (x_56 == 0) -{ -return x_44; -} -else -{ -obj* x_57; obj* x_58; obj* x_59; -x_57 = lean::cnstr_get(x_44, 0); -x_58 = lean::cnstr_get(x_44, 1); -lean::inc(x_58); -lean::inc(x_57); -lean::dec(x_44); -x_59 = lean::alloc_cnstr(1, 2, 0); -lean::cnstr_set(x_59, 0, x_57); -lean::cnstr_set(x_59, 1, x_58); -return x_59; -} -} -} -} -} -} -obj* l_Array_miterateAux___main___at_Lean_processHeaderAux___spec__2(obj* x_1, obj* x_2, obj* x_3, obj* x_4, obj* x_5, obj* x_6) { -_start: -{ -obj* x_7; uint8 x_8; -x_7 = lean::array_get_size(x_3); -x_8 = lean::nat_dec_lt(x_4, x_7); -lean::dec(x_7); -if (x_8 == 0) -{ -uint8 x_9; -lean::dec(x_4); -lean::dec(x_2); -x_9 = !lean::is_exclusive(x_6); -if (x_9 == 0) -{ -obj* x_10; -x_10 = lean::cnstr_get(x_6, 0); -lean::dec(x_10); -lean::cnstr_set(x_6, 0, x_5); -return x_6; -} -else -{ -obj* x_11; obj* x_12; -x_11 = lean::cnstr_get(x_6, 1); -lean::inc(x_11); -lean::dec(x_6); -x_12 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_12, 0, x_5); -lean::cnstr_set(x_12, 1, x_11); -return x_12; -} -} -else -{ -obj* x_13; obj* x_14; obj* x_15; obj* x_16; obj* x_17; obj* x_18; obj* x_19; -x_13 = lean::array_fget(x_3, x_4); -x_14 = lean::mk_nat_obj(1u); -x_15 = lean::nat_add(x_4, x_14); -lean::dec(x_4); -x_16 = l_Lean_Syntax_getArg___rarg(x_13, x_14); -x_17 = l_Lean_Syntax_getArgs___rarg(x_16); -lean::dec(x_16); -x_18 = lean::mk_nat_obj(0u); -lean::inc(x_2); -x_19 = l_Array_miterateAux___main___at_Lean_processHeaderAux___spec__1(x_2, x_13, x_17, x_18, x_5, x_6); -lean::dec(x_17); -lean::dec(x_13); -if (lean::obj_tag(x_19) == 0) -{ -uint8 x_20; -x_20 = !lean::is_exclusive(x_19); -if (x_20 == 0) -{ -obj* x_21; obj* x_22; -x_21 = lean::cnstr_get(x_19, 0); -x_22 = lean::box(0); -lean::cnstr_set(x_19, 0, x_22); -x_4 = x_15; -x_5 = x_21; -x_6 = x_19; -goto _start; -} -else -{ -obj* x_24; obj* x_25; obj* x_26; obj* x_27; -x_24 = lean::cnstr_get(x_19, 0); -x_25 = lean::cnstr_get(x_19, 1); -lean::inc(x_25); -lean::inc(x_24); -lean::dec(x_19); -x_26 = lean::box(0); -x_27 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_27, 0, x_26); -lean::cnstr_set(x_27, 1, x_25); -x_4 = x_15; -x_5 = x_24; -x_6 = x_27; -goto _start; -} -} -else -{ -uint8 x_29; -lean::dec(x_15); -lean::dec(x_2); -x_29 = !lean::is_exclusive(x_19); -if (x_29 == 0) -{ -return x_19; -} -else -{ -obj* x_30; obj* x_31; obj* x_32; -x_30 = lean::cnstr_get(x_19, 0); -x_31 = lean::cnstr_get(x_19, 1); -lean::inc(x_31); -lean::inc(x_30); -lean::dec(x_19); -x_32 = lean::alloc_cnstr(1, 2, 0); -lean::cnstr_set(x_32, 0, x_30); -lean::cnstr_set(x_32, 1, x_31); -return x_32; +lean::cnstr_set(x_33, 1, x_32); +return x_33; } } } @@ -16673,487 +16718,633 @@ lean::cnstr_set(x_3, 1, x_1); return x_3; } } -obj* l_Lean_processHeaderAux(obj* x_1, uint32 x_2, obj* x_3) { +obj* l_Lean_processHeaderAux(obj* x_1, obj* x_2, uint32 x_3, obj* x_4) { _start: { -obj* x_4; obj* x_5; obj* x_29; obj* x_30; obj* x_31; obj* x_32; uint8 x_33; -x_4 = l_Lean_Syntax_asNode___main___rarg(x_1); -x_29 = lean::cnstr_get(x_4, 1); -lean::inc(x_29); -x_30 = lean::box(0); -x_31 = lean::mk_nat_obj(0u); -x_32 = lean::array_get(x_30, x_29, x_31); -lean::dec(x_29); -x_33 = l_Lean_Syntax_isNone___rarg(x_32); -lean::dec(x_32); -if (x_33 == 0) -{ -obj* x_34; -x_34 = lean::box(0); -x_5 = x_34; -goto block_28; -} -else +obj* x_5; obj* x_6; obj* x_30; obj* x_31; obj* x_32; obj* x_33; uint8 x_34; +x_5 = l_Lean_Syntax_asNode___main___rarg(x_2); +x_30 = lean::cnstr_get(x_5, 1); +lean::inc(x_30); +x_31 = lean::box(0); +x_32 = lean::mk_nat_obj(0u); +x_33 = lean::array_get(x_31, x_30, x_32); +lean::dec(x_30); +x_34 = l_Lean_Syntax_isNone___rarg(x_33); +lean::dec(x_33); +if (x_34 == 0) { obj* x_35; -x_35 = l_Lean_processHeaderAux___closed__3; -x_5 = x_35; -goto block_28; +x_35 = lean::box(0); +x_6 = x_35; +goto block_29; } -block_28: +else { -obj* x_6; obj* x_7; obj* x_8; obj* x_9; obj* x_10; obj* x_11; obj* x_12; -x_6 = lean::cnstr_get(x_4, 1); -lean::inc(x_6); -lean::dec(x_4); -x_7 = lean::box(0); -x_8 = lean::mk_nat_obj(1u); -x_9 = lean::array_get(x_7, x_6, x_8); -x_10 = l_Lean_Syntax_getArgs___rarg(x_9); -lean::dec(x_9); -x_11 = lean::mk_nat_obj(0u); -x_12 = l_Array_miterateAux___main___at_Lean_processHeaderAux___spec__2(x_6, x_7, x_10, x_11, x_5, x_3); +obj* x_36; +x_36 = l_Lean_processHeaderAux___closed__3; +x_6 = x_36; +goto block_29; +} +block_29: +{ +obj* x_7; obj* x_8; obj* x_9; obj* x_10; obj* x_11; obj* x_12; obj* x_13; +x_7 = lean::cnstr_get(x_5, 1); +lean::inc(x_7); +lean::dec(x_5); +x_8 = lean::box(0); +x_9 = lean::mk_nat_obj(1u); +x_10 = lean::array_get(x_8, x_7, x_9); +x_11 = l_Lean_Syntax_getArgs___rarg(x_10); lean::dec(x_10); -lean::dec(x_6); -if (lean::obj_tag(x_12) == 0) +x_12 = lean::mk_nat_obj(0u); +x_13 = l_Array_miterateAux___main___at_Lean_processHeaderAux___spec__2(x_1, x_7, x_8, x_11, x_12, x_6, x_4); +lean::dec(x_11); +lean::dec(x_7); +if (lean::obj_tag(x_13) == 0) { -uint8 x_13; -x_13 = !lean::is_exclusive(x_12); -if (x_13 == 0) +uint8 x_14; +x_14 = !lean::is_exclusive(x_13); +if (x_14 == 0) { -obj* x_14; obj* x_15; obj* x_16; obj* x_17; -x_14 = lean::cnstr_get(x_12, 0); -x_15 = lean::box(0); -lean::cnstr_set(x_12, 0, x_15); -x_16 = l_List_reverse___rarg(x_14); -x_17 = lean::import_modules_core(x_16, x_2, x_12); -return x_17; +obj* x_15; obj* x_16; obj* x_17; obj* x_18; +x_15 = lean::cnstr_get(x_13, 0); +x_16 = lean::box(0); +lean::cnstr_set(x_13, 0, x_16); +x_17 = l_List_reverse___rarg(x_15); +x_18 = lean::import_modules_core(x_17, x_3, x_13); +return x_18; } else { -obj* x_18; obj* x_19; obj* x_20; obj* x_21; obj* x_22; obj* x_23; -x_18 = lean::cnstr_get(x_12, 0); -x_19 = lean::cnstr_get(x_12, 1); +obj* x_19; obj* x_20; obj* x_21; obj* x_22; obj* x_23; obj* x_24; +x_19 = lean::cnstr_get(x_13, 0); +x_20 = lean::cnstr_get(x_13, 1); +lean::inc(x_20); lean::inc(x_19); -lean::inc(x_18); -lean::dec(x_12); -x_20 = lean::box(0); -x_21 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_21, 0, x_20); -lean::cnstr_set(x_21, 1, x_19); -x_22 = l_List_reverse___rarg(x_18); -x_23 = lean::import_modules_core(x_22, x_2, x_21); -return x_23; +lean::dec(x_13); +x_21 = lean::box(0); +x_22 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_22, 0, x_21); +lean::cnstr_set(x_22, 1, x_20); +x_23 = l_List_reverse___rarg(x_19); +x_24 = lean::import_modules_core(x_23, x_3, x_22); +return x_24; } } else { -uint8 x_24; -x_24 = !lean::is_exclusive(x_12); -if (x_24 == 0) +uint8 x_25; +x_25 = !lean::is_exclusive(x_13); +if (x_25 == 0) { -return x_12; +return x_13; } else { -obj* x_25; obj* x_26; obj* x_27; -x_25 = lean::cnstr_get(x_12, 0); -x_26 = lean::cnstr_get(x_12, 1); +obj* x_26; obj* x_27; obj* x_28; +x_26 = lean::cnstr_get(x_13, 0); +x_27 = lean::cnstr_get(x_13, 1); +lean::inc(x_27); lean::inc(x_26); -lean::inc(x_25); -lean::dec(x_12); -x_27 = lean::alloc_cnstr(1, 2, 0); -lean::cnstr_set(x_27, 0, x_25); -lean::cnstr_set(x_27, 1, x_26); -return x_27; +lean::dec(x_13); +x_28 = lean::alloc_cnstr(1, 2, 0); +lean::cnstr_set(x_28, 0, x_26); +lean::cnstr_set(x_28, 1, x_27); +return x_28; } } } } } -obj* l_Array_miterateAux___main___at_Lean_processHeaderAux___spec__1___boxed(obj* x_1, obj* x_2, obj* x_3, obj* x_4, obj* x_5, obj* x_6) { +obj* l_Array_miterateAux___main___at_Lean_processHeaderAux___spec__1___boxed(obj* x_1, obj* x_2, obj* x_3, obj* x_4, obj* x_5, obj* x_6, obj* x_7) { +_start: +{ +obj* x_8; +x_8 = l_Array_miterateAux___main___at_Lean_processHeaderAux___spec__1(x_1, x_2, x_3, x_4, x_5, x_6, x_7); +lean::dec(x_4); +lean::dec(x_3); +return x_8; +} +} +obj* l_Array_miterateAux___main___at_Lean_processHeaderAux___spec__2___boxed(obj* x_1, obj* x_2, obj* x_3, obj* x_4, obj* x_5, obj* x_6, obj* x_7) { +_start: +{ +obj* x_8; +x_8 = l_Array_miterateAux___main___at_Lean_processHeaderAux___spec__2(x_1, x_2, x_3, x_4, x_5, x_6, x_7); +lean::dec(x_4); +lean::dec(x_2); +return x_8; +} +} +obj* l_Lean_processHeaderAux___boxed(obj* x_1, obj* x_2, obj* x_3, obj* x_4) { +_start: +{ +uint32 x_5; obj* x_6; +x_5 = lean::unbox_uint32(x_3); +lean::dec(x_3); +x_6 = l_Lean_processHeaderAux(x_1, x_2, x_5, x_4); +lean::dec(x_2); +return x_6; +} +} +obj* l_Lean_processHeader(obj* x_1, obj* x_2, obj* x_3, obj* x_4, uint32 x_5, obj* x_6) { _start: { obj* x_7; -x_7 = l_Array_miterateAux___main___at_Lean_processHeaderAux___spec__1(x_1, x_2, x_3, x_4, x_5, x_6); -lean::dec(x_3); -lean::dec(x_2); +x_7 = l_Lean_processHeaderAux(x_1, x_2, x_5, x_6); +if (lean::obj_tag(x_7) == 0) +{ +uint8 x_8; +x_8 = !lean::is_exclusive(x_7); +if (x_8 == 0) +{ +obj* x_9; obj* x_10; +x_9 = lean::cnstr_get(x_7, 0); +x_10 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_10, 0, x_9); +lean::cnstr_set(x_10, 1, x_3); +lean::cnstr_set(x_7, 0, x_10); return x_7; } -} -obj* l_Array_miterateAux___main___at_Lean_processHeaderAux___spec__2___boxed(obj* x_1, obj* x_2, obj* x_3, obj* x_4, obj* x_5, obj* x_6) { -_start: +else { -obj* x_7; -x_7 = l_Array_miterateAux___main___at_Lean_processHeaderAux___spec__2(x_1, x_2, x_3, x_4, x_5, x_6); +obj* x_11; obj* x_12; obj* x_13; obj* x_14; +x_11 = lean::cnstr_get(x_7, 0); +x_12 = lean::cnstr_get(x_7, 1); +lean::inc(x_12); +lean::inc(x_11); +lean::dec(x_7); +x_13 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_13, 0, x_11); +lean::cnstr_set(x_13, 1, x_3); +x_14 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_14, 0, x_13); +lean::cnstr_set(x_14, 1, x_12); +return x_14; +} +} +else +{ +uint8 x_15; +x_15 = !lean::is_exclusive(x_7); +if (x_15 == 0) +{ +obj* x_16; obj* x_17; uint32 x_18; obj* x_19; +x_16 = lean::cnstr_get(x_7, 0); +x_17 = lean::box(0); +lean::cnstr_set_tag(x_7, 0); +lean::cnstr_set(x_7, 0, x_17); +x_18 = 0; +x_19 = lean::mk_empty_environment_core(x_18, x_7); +if (lean::obj_tag(x_19) == 0) +{ +uint8 x_20; +x_20 = !lean::is_exclusive(x_19); +if (x_20 == 0) +{ +obj* x_21; obj* x_22; obj* x_23; obj* x_24; obj* x_25; +x_21 = lean::cnstr_get(x_19, 0); +x_22 = l_Lean_Syntax_getPos___rarg(x_2); +x_23 = lean::cnstr_get(x_4, 2); +x_24 = lean::cnstr_get(x_4, 1); +x_25 = lean::box(0); +if (lean::obj_tag(x_22) == 0) +{ +obj* x_26; obj* x_27; uint8 x_28; obj* x_29; obj* x_30; obj* x_31; obj* x_32; +x_26 = lean::mk_nat_obj(0u); +x_27 = l_Lean_FileMap_toPosition___main(x_23, x_26); +x_28 = 2; +x_29 = l_String_splitAux___main___closed__1; +lean::inc(x_24); +x_30 = lean::alloc_cnstr(0, 5, 1); +lean::cnstr_set(x_30, 0, x_24); +lean::cnstr_set(x_30, 1, x_27); +lean::cnstr_set(x_30, 2, x_25); +lean::cnstr_set(x_30, 3, x_29); +lean::cnstr_set(x_30, 4, x_16); +lean::cnstr_set_scalar(x_30, sizeof(void*)*5, x_28); +x_31 = lean::alloc_cnstr(1, 2, 0); +lean::cnstr_set(x_31, 0, x_30); +lean::cnstr_set(x_31, 1, x_3); +x_32 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_32, 0, x_21); +lean::cnstr_set(x_32, 1, x_31); +lean::cnstr_set(x_19, 0, x_32); +return x_19; +} +else +{ +obj* x_33; obj* x_34; uint8 x_35; obj* x_36; obj* x_37; obj* x_38; obj* x_39; +x_33 = lean::cnstr_get(x_22, 0); +lean::inc(x_33); +lean::dec(x_22); +x_34 = l_Lean_FileMap_toPosition___main(x_23, x_33); +lean::dec(x_33); +x_35 = 2; +x_36 = l_String_splitAux___main___closed__1; +lean::inc(x_24); +x_37 = lean::alloc_cnstr(0, 5, 1); +lean::cnstr_set(x_37, 0, x_24); +lean::cnstr_set(x_37, 1, x_34); +lean::cnstr_set(x_37, 2, x_25); +lean::cnstr_set(x_37, 3, x_36); +lean::cnstr_set(x_37, 4, x_16); +lean::cnstr_set_scalar(x_37, sizeof(void*)*5, x_35); +x_38 = lean::alloc_cnstr(1, 2, 0); +lean::cnstr_set(x_38, 0, x_37); +lean::cnstr_set(x_38, 1, x_3); +x_39 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_39, 0, x_21); +lean::cnstr_set(x_39, 1, x_38); +lean::cnstr_set(x_19, 0, x_39); +return x_19; +} +} +else +{ +obj* x_40; obj* x_41; obj* x_42; obj* x_43; obj* x_44; obj* x_45; +x_40 = lean::cnstr_get(x_19, 0); +x_41 = lean::cnstr_get(x_19, 1); +lean::inc(x_41); +lean::inc(x_40); +lean::dec(x_19); +x_42 = l_Lean_Syntax_getPos___rarg(x_2); +x_43 = lean::cnstr_get(x_4, 2); +x_44 = lean::cnstr_get(x_4, 1); +x_45 = lean::box(0); +if (lean::obj_tag(x_42) == 0) +{ +obj* x_46; obj* x_47; uint8 x_48; obj* x_49; obj* x_50; obj* x_51; obj* x_52; obj* x_53; +x_46 = lean::mk_nat_obj(0u); +x_47 = l_Lean_FileMap_toPosition___main(x_43, x_46); +x_48 = 2; +x_49 = l_String_splitAux___main___closed__1; +lean::inc(x_44); +x_50 = lean::alloc_cnstr(0, 5, 1); +lean::cnstr_set(x_50, 0, x_44); +lean::cnstr_set(x_50, 1, x_47); +lean::cnstr_set(x_50, 2, x_45); +lean::cnstr_set(x_50, 3, x_49); +lean::cnstr_set(x_50, 4, x_16); +lean::cnstr_set_scalar(x_50, sizeof(void*)*5, x_48); +x_51 = lean::alloc_cnstr(1, 2, 0); +lean::cnstr_set(x_51, 0, x_50); +lean::cnstr_set(x_51, 1, x_3); +x_52 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_52, 0, x_40); +lean::cnstr_set(x_52, 1, x_51); +x_53 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_53, 0, x_52); +lean::cnstr_set(x_53, 1, x_41); +return x_53; +} +else +{ +obj* x_54; obj* x_55; uint8 x_56; obj* x_57; obj* x_58; obj* x_59; obj* x_60; obj* x_61; +x_54 = lean::cnstr_get(x_42, 0); +lean::inc(x_54); +lean::dec(x_42); +x_55 = l_Lean_FileMap_toPosition___main(x_43, x_54); +lean::dec(x_54); +x_56 = 2; +x_57 = l_String_splitAux___main___closed__1; +lean::inc(x_44); +x_58 = lean::alloc_cnstr(0, 5, 1); +lean::cnstr_set(x_58, 0, x_44); +lean::cnstr_set(x_58, 1, x_55); +lean::cnstr_set(x_58, 2, x_45); +lean::cnstr_set(x_58, 3, x_57); +lean::cnstr_set(x_58, 4, x_16); +lean::cnstr_set_scalar(x_58, sizeof(void*)*5, x_56); +x_59 = lean::alloc_cnstr(1, 2, 0); +lean::cnstr_set(x_59, 0, x_58); +lean::cnstr_set(x_59, 1, x_3); +x_60 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_60, 0, x_40); +lean::cnstr_set(x_60, 1, x_59); +x_61 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_61, 0, x_60); +lean::cnstr_set(x_61, 1, x_41); +return x_61; +} +} +} +else +{ +uint8 x_62; +lean::dec(x_16); lean::dec(x_3); -lean::dec(x_1); -return x_7; +x_62 = !lean::is_exclusive(x_19); +if (x_62 == 0) +{ +return x_19; +} +else +{ +obj* x_63; obj* x_64; obj* x_65; +x_63 = lean::cnstr_get(x_19, 0); +x_64 = lean::cnstr_get(x_19, 1); +lean::inc(x_64); +lean::inc(x_63); +lean::dec(x_19); +x_65 = lean::alloc_cnstr(1, 2, 0); +lean::cnstr_set(x_65, 0, x_63); +lean::cnstr_set(x_65, 1, x_64); +return x_65; } } -obj* l_Lean_processHeaderAux___boxed(obj* x_1, obj* x_2, obj* x_3) { +} +else +{ +obj* x_66; obj* x_67; obj* x_68; obj* x_69; uint32 x_70; obj* x_71; +x_66 = lean::cnstr_get(x_7, 0); +x_67 = lean::cnstr_get(x_7, 1); +lean::inc(x_67); +lean::inc(x_66); +lean::dec(x_7); +x_68 = lean::box(0); +x_69 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_69, 0, x_68); +lean::cnstr_set(x_69, 1, x_67); +x_70 = 0; +x_71 = lean::mk_empty_environment_core(x_70, x_69); +if (lean::obj_tag(x_71) == 0) +{ +obj* x_72; obj* x_73; obj* x_74; obj* x_75; obj* x_76; obj* x_77; obj* x_78; +x_72 = lean::cnstr_get(x_71, 0); +lean::inc(x_72); +x_73 = lean::cnstr_get(x_71, 1); +lean::inc(x_73); +if (lean::is_exclusive(x_71)) { + lean::cnstr_release(x_71, 0); + lean::cnstr_release(x_71, 1); + x_74 = x_71; +} else { + lean::dec_ref(x_71); + x_74 = lean::box(0); +} +x_75 = l_Lean_Syntax_getPos___rarg(x_2); +x_76 = lean::cnstr_get(x_4, 2); +x_77 = lean::cnstr_get(x_4, 1); +x_78 = lean::box(0); +if (lean::obj_tag(x_75) == 0) +{ +obj* x_79; obj* x_80; uint8 x_81; obj* x_82; obj* x_83; obj* x_84; obj* x_85; obj* x_86; +x_79 = lean::mk_nat_obj(0u); +x_80 = l_Lean_FileMap_toPosition___main(x_76, x_79); +x_81 = 2; +x_82 = l_String_splitAux___main___closed__1; +lean::inc(x_77); +x_83 = lean::alloc_cnstr(0, 5, 1); +lean::cnstr_set(x_83, 0, x_77); +lean::cnstr_set(x_83, 1, x_80); +lean::cnstr_set(x_83, 2, x_78); +lean::cnstr_set(x_83, 3, x_82); +lean::cnstr_set(x_83, 4, x_66); +lean::cnstr_set_scalar(x_83, sizeof(void*)*5, x_81); +x_84 = lean::alloc_cnstr(1, 2, 0); +lean::cnstr_set(x_84, 0, x_83); +lean::cnstr_set(x_84, 1, x_3); +x_85 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_85, 0, x_72); +lean::cnstr_set(x_85, 1, x_84); +if (lean::is_scalar(x_74)) { + x_86 = lean::alloc_cnstr(0, 2, 0); +} else { + x_86 = x_74; +} +lean::cnstr_set(x_86, 0, x_85); +lean::cnstr_set(x_86, 1, x_73); +return x_86; +} +else +{ +obj* x_87; obj* x_88; uint8 x_89; obj* x_90; obj* x_91; obj* x_92; obj* x_93; obj* x_94; +x_87 = lean::cnstr_get(x_75, 0); +lean::inc(x_87); +lean::dec(x_75); +x_88 = l_Lean_FileMap_toPosition___main(x_76, x_87); +lean::dec(x_87); +x_89 = 2; +x_90 = l_String_splitAux___main___closed__1; +lean::inc(x_77); +x_91 = lean::alloc_cnstr(0, 5, 1); +lean::cnstr_set(x_91, 0, x_77); +lean::cnstr_set(x_91, 1, x_88); +lean::cnstr_set(x_91, 2, x_78); +lean::cnstr_set(x_91, 3, x_90); +lean::cnstr_set(x_91, 4, x_66); +lean::cnstr_set_scalar(x_91, sizeof(void*)*5, x_89); +x_92 = lean::alloc_cnstr(1, 2, 0); +lean::cnstr_set(x_92, 0, x_91); +lean::cnstr_set(x_92, 1, x_3); +x_93 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_93, 0, x_72); +lean::cnstr_set(x_93, 1, x_92); +if (lean::is_scalar(x_74)) { + x_94 = lean::alloc_cnstr(0, 2, 0); +} else { + x_94 = x_74; +} +lean::cnstr_set(x_94, 0, x_93); +lean::cnstr_set(x_94, 1, x_73); +return x_94; +} +} +else +{ +obj* x_95; obj* x_96; obj* x_97; obj* x_98; +lean::dec(x_66); +lean::dec(x_3); +x_95 = lean::cnstr_get(x_71, 0); +lean::inc(x_95); +x_96 = lean::cnstr_get(x_71, 1); +lean::inc(x_96); +if (lean::is_exclusive(x_71)) { + lean::cnstr_release(x_71, 0); + lean::cnstr_release(x_71, 1); + x_97 = x_71; +} else { + lean::dec_ref(x_71); + x_97 = lean::box(0); +} +if (lean::is_scalar(x_97)) { + x_98 = lean::alloc_cnstr(1, 2, 0); +} else { + x_98 = x_97; +} +lean::cnstr_set(x_98, 0, x_95); +lean::cnstr_set(x_98, 1, x_96); +return x_98; +} +} +} +} +} +obj* l_Lean_processHeader___boxed(obj* x_1, obj* x_2, obj* x_3, obj* x_4, obj* x_5, obj* x_6) { _start: { -uint32 x_4; obj* x_5; -x_4 = lean::unbox_uint32(x_2); +uint32 x_7; obj* x_8; +x_7 = lean::unbox_uint32(x_5); +lean::dec(x_5); +x_8 = l_Lean_processHeader(x_1, x_2, x_3, x_4, x_7, x_6); +lean::dec(x_4); lean::dec(x_2); -x_5 = l_Lean_processHeaderAux(x_1, x_4, x_3); -lean::dec(x_1); -return x_5; +return x_8; } } -obj* l_Lean_processHeader(obj* x_1, obj* x_2, obj* x_3, uint32 x_4, obj* x_5) { +obj* l_Lean_toBaseDir(obj* x_1, obj* x_2) { _start: { -obj* x_6; -x_6 = l_Lean_processHeaderAux(x_1, x_4, x_5); -if (lean::obj_tag(x_6) == 0) +if (lean::obj_tag(x_1) == 0) +{ +uint8 x_3; +x_3 = !lean::is_exclusive(x_2); +if (x_3 == 0) +{ +obj* x_4; +x_4 = lean::cnstr_get(x_2, 0); +lean::dec(x_4); +lean::cnstr_set(x_2, 0, x_1); +return x_2; +} +else +{ +obj* x_5; obj* x_6; +x_5 = lean::cnstr_get(x_2, 1); +lean::inc(x_5); +lean::dec(x_2); +x_6 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_6, 0, x_1); +lean::cnstr_set(x_6, 1, x_5); +return x_6; +} +} +else { uint8 x_7; -x_7 = !lean::is_exclusive(x_6); +x_7 = !lean::is_exclusive(x_1); if (x_7 == 0) { obj* x_8; obj* x_9; -x_8 = lean::cnstr_get(x_6, 0); -x_9 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_9, 0, x_8); -lean::cnstr_set(x_9, 1, x_2); -lean::cnstr_set(x_6, 0, x_9); -return x_6; +x_8 = lean::cnstr_get(x_1, 0); +x_9 = lean_io_realpath(x_8, x_2); +if (lean::obj_tag(x_9) == 0) +{ +uint8 x_10; +x_10 = !lean::is_exclusive(x_9); +if (x_10 == 0) +{ +obj* x_11; obj* x_12; +x_11 = lean::cnstr_get(x_9, 0); +x_12 = l_System_FilePath_dirName(x_11); +lean::dec(x_11); +lean::cnstr_set(x_1, 0, x_12); +lean::cnstr_set(x_9, 0, x_1); +return x_9; } else { -obj* x_10; obj* x_11; obj* x_12; obj* x_13; -x_10 = lean::cnstr_get(x_6, 0); -x_11 = lean::cnstr_get(x_6, 1); -lean::inc(x_11); -lean::inc(x_10); -lean::dec(x_6); -x_12 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_12, 0, x_10); -lean::cnstr_set(x_12, 1, x_2); -x_13 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_13, 0, x_12); -lean::cnstr_set(x_13, 1, x_11); -return x_13; +obj* x_13; obj* x_14; obj* x_15; obj* x_16; +x_13 = lean::cnstr_get(x_9, 0); +x_14 = lean::cnstr_get(x_9, 1); +lean::inc(x_14); +lean::inc(x_13); +lean::dec(x_9); +x_15 = l_System_FilePath_dirName(x_13); +lean::dec(x_13); +lean::cnstr_set(x_1, 0, x_15); +x_16 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_16, 0, x_1); +lean::cnstr_set(x_16, 1, x_14); +return x_16; } } else { -uint8 x_14; -x_14 = !lean::is_exclusive(x_6); -if (x_14 == 0) +uint8 x_17; +lean::free_heap_obj(x_1); +x_17 = !lean::is_exclusive(x_9); +if (x_17 == 0) { -obj* x_15; obj* x_16; uint32 x_17; obj* x_18; -x_15 = lean::cnstr_get(x_6, 0); -x_16 = lean::box(0); -lean::cnstr_set_tag(x_6, 0); -lean::cnstr_set(x_6, 0, x_16); -x_17 = 0; -x_18 = lean::mk_empty_environment_core(x_17, x_6); -if (lean::obj_tag(x_18) == 0) -{ -uint8 x_19; -x_19 = !lean::is_exclusive(x_18); -if (x_19 == 0) -{ -obj* x_20; obj* x_21; obj* x_22; obj* x_23; obj* x_24; -x_20 = lean::cnstr_get(x_18, 0); -x_21 = l_Lean_Syntax_getPos___rarg(x_1); -x_22 = lean::cnstr_get(x_3, 2); -x_23 = lean::cnstr_get(x_3, 1); -x_24 = lean::box(0); -if (lean::obj_tag(x_21) == 0) -{ -obj* x_25; obj* x_26; uint8 x_27; obj* x_28; obj* x_29; obj* x_30; obj* x_31; -x_25 = lean::mk_nat_obj(0u); -x_26 = l_Lean_FileMap_toPosition___main(x_22, x_25); -x_27 = 2; -x_28 = l_String_splitAux___main___closed__1; -lean::inc(x_23); -x_29 = lean::alloc_cnstr(0, 5, 1); -lean::cnstr_set(x_29, 0, x_23); -lean::cnstr_set(x_29, 1, x_26); -lean::cnstr_set(x_29, 2, x_24); -lean::cnstr_set(x_29, 3, x_28); -lean::cnstr_set(x_29, 4, x_15); -lean::cnstr_set_scalar(x_29, sizeof(void*)*5, x_27); -x_30 = lean::alloc_cnstr(1, 2, 0); -lean::cnstr_set(x_30, 0, x_29); -lean::cnstr_set(x_30, 1, x_2); -x_31 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_31, 0, x_20); -lean::cnstr_set(x_31, 1, x_30); -lean::cnstr_set(x_18, 0, x_31); -return x_18; +return x_9; } else { -obj* x_32; obj* x_33; uint8 x_34; obj* x_35; obj* x_36; obj* x_37; obj* x_38; -x_32 = lean::cnstr_get(x_21, 0); -lean::inc(x_32); -lean::dec(x_21); -x_33 = l_Lean_FileMap_toPosition___main(x_22, x_32); -lean::dec(x_32); -x_34 = 2; -x_35 = l_String_splitAux___main___closed__1; -lean::inc(x_23); -x_36 = lean::alloc_cnstr(0, 5, 1); -lean::cnstr_set(x_36, 0, x_23); -lean::cnstr_set(x_36, 1, x_33); -lean::cnstr_set(x_36, 2, x_24); -lean::cnstr_set(x_36, 3, x_35); -lean::cnstr_set(x_36, 4, x_15); -lean::cnstr_set_scalar(x_36, sizeof(void*)*5, x_34); -x_37 = lean::alloc_cnstr(1, 2, 0); -lean::cnstr_set(x_37, 0, x_36); -lean::cnstr_set(x_37, 1, x_2); -x_38 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_38, 0, x_20); -lean::cnstr_set(x_38, 1, x_37); -lean::cnstr_set(x_18, 0, x_38); -return x_18; -} -} -else -{ -obj* x_39; obj* x_40; obj* x_41; obj* x_42; obj* x_43; obj* x_44; -x_39 = lean::cnstr_get(x_18, 0); -x_40 = lean::cnstr_get(x_18, 1); -lean::inc(x_40); -lean::inc(x_39); -lean::dec(x_18); -x_41 = l_Lean_Syntax_getPos___rarg(x_1); -x_42 = lean::cnstr_get(x_3, 2); -x_43 = lean::cnstr_get(x_3, 1); -x_44 = lean::box(0); -if (lean::obj_tag(x_41) == 0) -{ -obj* x_45; obj* x_46; uint8 x_47; obj* x_48; obj* x_49; obj* x_50; obj* x_51; obj* x_52; -x_45 = lean::mk_nat_obj(0u); -x_46 = l_Lean_FileMap_toPosition___main(x_42, x_45); -x_47 = 2; -x_48 = l_String_splitAux___main___closed__1; -lean::inc(x_43); -x_49 = lean::alloc_cnstr(0, 5, 1); -lean::cnstr_set(x_49, 0, x_43); -lean::cnstr_set(x_49, 1, x_46); -lean::cnstr_set(x_49, 2, x_44); -lean::cnstr_set(x_49, 3, x_48); -lean::cnstr_set(x_49, 4, x_15); -lean::cnstr_set_scalar(x_49, sizeof(void*)*5, x_47); -x_50 = lean::alloc_cnstr(1, 2, 0); -lean::cnstr_set(x_50, 0, x_49); -lean::cnstr_set(x_50, 1, x_2); -x_51 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_51, 0, x_39); -lean::cnstr_set(x_51, 1, x_50); -x_52 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_52, 0, x_51); -lean::cnstr_set(x_52, 1, x_40); -return x_52; -} -else -{ -obj* x_53; obj* x_54; uint8 x_55; obj* x_56; obj* x_57; obj* x_58; obj* x_59; obj* x_60; -x_53 = lean::cnstr_get(x_41, 0); -lean::inc(x_53); -lean::dec(x_41); -x_54 = l_Lean_FileMap_toPosition___main(x_42, x_53); -lean::dec(x_53); -x_55 = 2; -x_56 = l_String_splitAux___main___closed__1; -lean::inc(x_43); -x_57 = lean::alloc_cnstr(0, 5, 1); -lean::cnstr_set(x_57, 0, x_43); -lean::cnstr_set(x_57, 1, x_54); -lean::cnstr_set(x_57, 2, x_44); -lean::cnstr_set(x_57, 3, x_56); -lean::cnstr_set(x_57, 4, x_15); -lean::cnstr_set_scalar(x_57, sizeof(void*)*5, x_55); -x_58 = lean::alloc_cnstr(1, 2, 0); -lean::cnstr_set(x_58, 0, x_57); -lean::cnstr_set(x_58, 1, x_2); -x_59 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_59, 0, x_39); -lean::cnstr_set(x_59, 1, x_58); -x_60 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_60, 0, x_59); -lean::cnstr_set(x_60, 1, x_40); -return x_60; +obj* x_18; obj* x_19; obj* x_20; +x_18 = lean::cnstr_get(x_9, 0); +x_19 = lean::cnstr_get(x_9, 1); +lean::inc(x_19); +lean::inc(x_18); +lean::dec(x_9); +x_20 = lean::alloc_cnstr(1, 2, 0); +lean::cnstr_set(x_20, 0, x_18); +lean::cnstr_set(x_20, 1, x_19); +return x_20; } } } else { -uint8 x_61; -lean::dec(x_15); -lean::dec(x_2); -x_61 = !lean::is_exclusive(x_18); -if (x_61 == 0) -{ -return x_18; -} -else -{ -obj* x_62; obj* x_63; obj* x_64; -x_62 = lean::cnstr_get(x_18, 0); -x_63 = lean::cnstr_get(x_18, 1); -lean::inc(x_63); -lean::inc(x_62); -lean::dec(x_18); -x_64 = lean::alloc_cnstr(1, 2, 0); -lean::cnstr_set(x_64, 0, x_62); -lean::cnstr_set(x_64, 1, x_63); -return x_64; -} -} -} -else -{ -obj* x_65; obj* x_66; obj* x_67; obj* x_68; uint32 x_69; obj* x_70; -x_65 = lean::cnstr_get(x_6, 0); -x_66 = lean::cnstr_get(x_6, 1); -lean::inc(x_66); -lean::inc(x_65); -lean::dec(x_6); -x_67 = lean::box(0); -x_68 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_68, 0, x_67); -lean::cnstr_set(x_68, 1, x_66); -x_69 = 0; -x_70 = lean::mk_empty_environment_core(x_69, x_68); -if (lean::obj_tag(x_70) == 0) -{ -obj* x_71; obj* x_72; obj* x_73; obj* x_74; obj* x_75; obj* x_76; obj* x_77; -x_71 = lean::cnstr_get(x_70, 0); -lean::inc(x_71); -x_72 = lean::cnstr_get(x_70, 1); -lean::inc(x_72); -if (lean::is_exclusive(x_70)) { - lean::cnstr_release(x_70, 0); - lean::cnstr_release(x_70, 1); - x_73 = x_70; -} else { - lean::dec_ref(x_70); - x_73 = lean::box(0); -} -x_74 = l_Lean_Syntax_getPos___rarg(x_1); -x_75 = lean::cnstr_get(x_3, 2); -x_76 = lean::cnstr_get(x_3, 1); -x_77 = lean::box(0); -if (lean::obj_tag(x_74) == 0) -{ -obj* x_78; obj* x_79; uint8 x_80; obj* x_81; obj* x_82; obj* x_83; obj* x_84; obj* x_85; -x_78 = lean::mk_nat_obj(0u); -x_79 = l_Lean_FileMap_toPosition___main(x_75, x_78); -x_80 = 2; -x_81 = l_String_splitAux___main___closed__1; -lean::inc(x_76); -x_82 = lean::alloc_cnstr(0, 5, 1); -lean::cnstr_set(x_82, 0, x_76); -lean::cnstr_set(x_82, 1, x_79); -lean::cnstr_set(x_82, 2, x_77); -lean::cnstr_set(x_82, 3, x_81); -lean::cnstr_set(x_82, 4, x_65); -lean::cnstr_set_scalar(x_82, sizeof(void*)*5, x_80); -x_83 = lean::alloc_cnstr(1, 2, 0); -lean::cnstr_set(x_83, 0, x_82); -lean::cnstr_set(x_83, 1, x_2); -x_84 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_84, 0, x_71); -lean::cnstr_set(x_84, 1, x_83); -if (lean::is_scalar(x_73)) { - x_85 = lean::alloc_cnstr(0, 2, 0); -} else { - x_85 = x_73; -} -lean::cnstr_set(x_85, 0, x_84); -lean::cnstr_set(x_85, 1, x_72); -return x_85; -} -else -{ -obj* x_86; obj* x_87; uint8 x_88; obj* x_89; obj* x_90; obj* x_91; obj* x_92; obj* x_93; -x_86 = lean::cnstr_get(x_74, 0); -lean::inc(x_86); -lean::dec(x_74); -x_87 = l_Lean_FileMap_toPosition___main(x_75, x_86); -lean::dec(x_86); -x_88 = 2; -x_89 = l_String_splitAux___main___closed__1; -lean::inc(x_76); -x_90 = lean::alloc_cnstr(0, 5, 1); -lean::cnstr_set(x_90, 0, x_76); -lean::cnstr_set(x_90, 1, x_87); -lean::cnstr_set(x_90, 2, x_77); -lean::cnstr_set(x_90, 3, x_89); -lean::cnstr_set(x_90, 4, x_65); -lean::cnstr_set_scalar(x_90, sizeof(void*)*5, x_88); -x_91 = lean::alloc_cnstr(1, 2, 0); -lean::cnstr_set(x_91, 0, x_90); -lean::cnstr_set(x_91, 1, x_2); -x_92 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_92, 0, x_71); -lean::cnstr_set(x_92, 1, x_91); -if (lean::is_scalar(x_73)) { - x_93 = lean::alloc_cnstr(0, 2, 0); -} else { - x_93 = x_73; -} -lean::cnstr_set(x_93, 0, x_92); -lean::cnstr_set(x_93, 1, x_72); -return x_93; -} -} -else -{ -obj* x_94; obj* x_95; obj* x_96; obj* x_97; -lean::dec(x_65); -lean::dec(x_2); -x_94 = lean::cnstr_get(x_70, 0); -lean::inc(x_94); -x_95 = lean::cnstr_get(x_70, 1); -lean::inc(x_95); -if (lean::is_exclusive(x_70)) { - lean::cnstr_release(x_70, 0); - lean::cnstr_release(x_70, 1); - x_96 = x_70; -} else { - lean::dec_ref(x_70); - x_96 = lean::box(0); -} -if (lean::is_scalar(x_96)) { - x_97 = lean::alloc_cnstr(1, 2, 0); -} else { - x_97 = x_96; -} -lean::cnstr_set(x_97, 0, x_94); -lean::cnstr_set(x_97, 1, x_95); -return x_97; -} -} -} -} -} -obj* l_Lean_processHeader___boxed(obj* x_1, obj* x_2, obj* x_3, obj* x_4, obj* x_5) { -_start: -{ -uint32 x_6; obj* x_7; -x_6 = lean::unbox_uint32(x_4); -lean::dec(x_4); -x_7 = l_Lean_processHeader(x_1, x_2, x_3, x_6, x_5); -lean::dec(x_3); +obj* x_21; obj* x_22; +x_21 = lean::cnstr_get(x_1, 0); +lean::inc(x_21); lean::dec(x_1); -return x_7; -} -} -obj* l_Lean_setSearchPathOld___boxed(obj* x_1) { -_start: +x_22 = lean_io_realpath(x_21, x_2); +if (lean::obj_tag(x_22) == 0) { -obj* x_2; -x_2 = lean_set_search_path(x_1); -return x_2; +obj* x_23; obj* x_24; obj* x_25; obj* x_26; obj* x_27; obj* x_28; +x_23 = lean::cnstr_get(x_22, 0); +lean::inc(x_23); +x_24 = lean::cnstr_get(x_22, 1); +lean::inc(x_24); +if (lean::is_exclusive(x_22)) { + lean::cnstr_release(x_22, 0); + lean::cnstr_release(x_22, 1); + x_25 = x_22; +} else { + lean::dec_ref(x_22); + x_25 = lean::box(0); +} +x_26 = l_System_FilePath_dirName(x_23); +lean::dec(x_23); +x_27 = lean::alloc_cnstr(1, 1, 0); +lean::cnstr_set(x_27, 0, x_26); +if (lean::is_scalar(x_25)) { + x_28 = lean::alloc_cnstr(0, 2, 0); +} else { + x_28 = x_25; +} +lean::cnstr_set(x_28, 0, x_27); +lean::cnstr_set(x_28, 1, x_24); +return x_28; +} +else +{ +obj* x_29; obj* x_30; obj* x_31; obj* x_32; +x_29 = lean::cnstr_get(x_22, 0); +lean::inc(x_29); +x_30 = lean::cnstr_get(x_22, 1); +lean::inc(x_30); +if (lean::is_exclusive(x_22)) { + lean::cnstr_release(x_22, 0); + lean::cnstr_release(x_22, 1); + x_31 = x_22; +} else { + lean::dec_ref(x_22); + x_31 = lean::box(0); +} +if (lean::is_scalar(x_31)) { + x_32 = lean::alloc_cnstr(1, 2, 0); +} else { + x_32 = x_31; +} +lean::cnstr_set(x_32, 0, x_29); +lean::cnstr_set(x_32, 1, x_30); +return x_32; +} +} +} } } obj* _init_l_Lean_testFrontend___closed__1() { @@ -17204,21 +17395,21 @@ return x_1; obj* l_Lean_testFrontend(obj* x_1, obj* x_2, obj* x_3) { _start: { -obj* x_4; -x_4 = lean_set_search_path(x_3); -if (lean::obj_tag(x_4) == 0) +uint32 x_4; obj* x_5; +x_4 = 0; +x_5 = lean::mk_empty_environment_core(x_4, x_3); +if (lean::obj_tag(x_5) == 0) { -uint8 x_5; -x_5 = !lean::is_exclusive(x_4); -if (x_5 == 0) +uint8 x_6; +x_6 = !lean::is_exclusive(x_5); +if (x_6 == 0) { -obj* x_6; obj* x_7; uint32 x_8; obj* x_9; -x_6 = lean::cnstr_get(x_4, 0); -lean::dec(x_6); -x_7 = lean::box(0); -lean::cnstr_set(x_4, 0, x_7); -x_8 = 0; -x_9 = lean::mk_empty_environment_core(x_8, x_4); +obj* x_7; obj* x_8; obj* x_9; +x_7 = lean::cnstr_get(x_5, 0); +x_8 = lean::box(0); +lean::cnstr_set(x_5, 0, x_8); +lean::inc(x_2); +x_9 = l_Lean_toBaseDir(x_2, x_5); if (lean::obj_tag(x_9) == 0) { uint8 x_10; @@ -17227,7 +17418,7 @@ if (x_10 == 0) { obj* x_11; obj* x_12; x_11 = lean::cnstr_get(x_9, 0); -lean::cnstr_set(x_9, 0, x_7); +lean::cnstr_set(x_9, 0, x_8); if (lean::obj_tag(x_2) == 0) { obj* x_108; @@ -17247,9 +17438,9 @@ goto block_107; block_107: { obj* x_13; obj* x_14; obj* x_15; obj* x_16; obj* x_17; obj* x_18; obj* x_19; -x_13 = l_Lean_Parser_mkParserContextCore(x_11, x_1, x_12); +x_13 = l_Lean_Parser_mkParserContextCore(x_7, x_1, x_12); lean::inc(x_13); -x_14 = l_Lean_Parser_parseHeader(x_11, x_13); +x_14 = l_Lean_Parser_parseHeader(x_7, x_13); x_15 = lean::cnstr_get(x_14, 1); lean::inc(x_15); x_16 = lean::cnstr_get(x_14, 0); @@ -17260,7 +17451,7 @@ lean::inc(x_17); x_18 = lean::cnstr_get(x_15, 1); lean::inc(x_18); lean::dec(x_15); -x_19 = l_Lean_processHeader(x_16, x_18, x_13, x_8, x_9); +x_19 = l_Lean_processHeader(x_11, x_16, x_18, x_13, x_4, x_9); lean::dec(x_16); if (lean::obj_tag(x_19) == 0) { @@ -17290,7 +17481,7 @@ x_30 = lean::alloc_cnstr(0, 2, 0); lean::cnstr_set(x_30, 0, x_29); lean::cnstr_set(x_30, 1, x_17); lean::cnstr_set(x_19, 1, x_30); -lean::cnstr_set(x_19, 0, x_7); +lean::cnstr_set(x_19, 0, x_8); x_31 = l_Lean_processCommandsAux___main___rarg(x_13, x_19); if (lean::obj_tag(x_31) == 0) { @@ -17408,7 +17599,7 @@ x_61 = lean::alloc_cnstr(0, 2, 0); lean::cnstr_set(x_61, 0, x_60); lean::cnstr_set(x_61, 1, x_17); lean::cnstr_set(x_19, 1, x_61); -lean::cnstr_set(x_19, 0, x_7); +lean::cnstr_set(x_19, 0, x_8); x_62 = l_Lean_processCommandsAux___main___rarg(x_13, x_19); if (lean::obj_tag(x_62) == 0) { @@ -17512,7 +17703,7 @@ x_86 = lean::alloc_cnstr(0, 2, 0); lean::cnstr_set(x_86, 0, x_85); lean::cnstr_set(x_86, 1, x_17); x_87 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_87, 0, x_7); +lean::cnstr_set(x_87, 0, x_8); lean::cnstr_set(x_87, 1, x_86); x_88 = l_Lean_processCommandsAux___main___rarg(x_13, x_87); if (lean::obj_tag(x_88) == 0) @@ -17627,7 +17818,7 @@ lean::inc(x_111); lean::inc(x_110); lean::dec(x_9); x_112 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_112, 0, x_7); +lean::cnstr_set(x_112, 0, x_8); lean::cnstr_set(x_112, 1, x_111); if (lean::obj_tag(x_2) == 0) { @@ -17648,9 +17839,9 @@ goto block_152; block_152: { obj* x_114; obj* x_115; obj* x_116; obj* x_117; obj* x_118; obj* x_119; obj* x_120; -x_114 = l_Lean_Parser_mkParserContextCore(x_110, x_1, x_113); +x_114 = l_Lean_Parser_mkParserContextCore(x_7, x_1, x_113); lean::inc(x_114); -x_115 = l_Lean_Parser_parseHeader(x_110, x_114); +x_115 = l_Lean_Parser_parseHeader(x_7, x_114); x_116 = lean::cnstr_get(x_115, 1); lean::inc(x_116); x_117 = lean::cnstr_get(x_115, 0); @@ -17661,7 +17852,7 @@ lean::inc(x_118); x_119 = lean::cnstr_get(x_116, 1); lean::inc(x_119); lean::dec(x_116); -x_120 = l_Lean_processHeader(x_117, x_119, x_114, x_8, x_112); +x_120 = l_Lean_processHeader(x_110, x_117, x_119, x_114, x_4, x_112); lean::dec(x_117); if (lean::obj_tag(x_120) == 0) { @@ -17707,7 +17898,7 @@ if (lean::is_scalar(x_123)) { } else { x_132 = x_123; } -lean::cnstr_set(x_132, 0, x_7); +lean::cnstr_set(x_132, 0, x_8); lean::cnstr_set(x_132, 1, x_131); x_133 = l_Lean_processCommandsAux___main___rarg(x_114, x_132); if (lean::obj_tag(x_133) == 0) @@ -17818,6 +18009,7 @@ return x_151; else { uint8 x_155; +lean::dec(x_7); lean::dec(x_2); lean::dec(x_1); x_155 = !lean::is_exclusive(x_9); @@ -17842,16 +18034,18 @@ return x_158; } else { -obj* x_159; obj* x_160; obj* x_161; uint32 x_162; obj* x_163; -x_159 = lean::cnstr_get(x_4, 1); +obj* x_159; obj* x_160; obj* x_161; obj* x_162; obj* x_163; +x_159 = lean::cnstr_get(x_5, 0); +x_160 = lean::cnstr_get(x_5, 1); +lean::inc(x_160); lean::inc(x_159); -lean::dec(x_4); -x_160 = lean::box(0); -x_161 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_161, 0, x_160); -lean::cnstr_set(x_161, 1, x_159); -x_162 = 0; -x_163 = lean::mk_empty_environment_core(x_162, x_161); +lean::dec(x_5); +x_161 = lean::box(0); +x_162 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_162, 0, x_161); +lean::cnstr_set(x_162, 1, x_160); +lean::inc(x_2); +x_163 = l_Lean_toBaseDir(x_2, x_162); if (lean::obj_tag(x_163) == 0) { obj* x_164; obj* x_165; obj* x_166; obj* x_167; obj* x_168; @@ -17872,7 +18066,7 @@ if (lean::is_scalar(x_166)) { } else { x_167 = x_166; } -lean::cnstr_set(x_167, 0, x_160); +lean::cnstr_set(x_167, 0, x_161); lean::cnstr_set(x_167, 1, x_165); if (lean::obj_tag(x_2) == 0) { @@ -17893,9 +18087,9 @@ goto block_207; block_207: { obj* x_169; obj* x_170; obj* x_171; obj* x_172; obj* x_173; obj* x_174; obj* x_175; -x_169 = l_Lean_Parser_mkParserContextCore(x_164, x_1, x_168); +x_169 = l_Lean_Parser_mkParserContextCore(x_159, x_1, x_168); lean::inc(x_169); -x_170 = l_Lean_Parser_parseHeader(x_164, x_169); +x_170 = l_Lean_Parser_parseHeader(x_159, x_169); x_171 = lean::cnstr_get(x_170, 1); lean::inc(x_171); x_172 = lean::cnstr_get(x_170, 0); @@ -17906,7 +18100,7 @@ lean::inc(x_173); x_174 = lean::cnstr_get(x_171, 1); lean::inc(x_174); lean::dec(x_171); -x_175 = l_Lean_processHeader(x_172, x_174, x_169, x_162, x_167); +x_175 = l_Lean_processHeader(x_164, x_172, x_174, x_169, x_4, x_167); lean::dec(x_172); if (lean::obj_tag(x_175) == 0) { @@ -17952,7 +18146,7 @@ if (lean::is_scalar(x_178)) { } else { x_187 = x_178; } -lean::cnstr_set(x_187, 0, x_160); +lean::cnstr_set(x_187, 0, x_161); lean::cnstr_set(x_187, 1, x_186); x_188 = l_Lean_processCommandsAux___main___rarg(x_169, x_187); if (lean::obj_tag(x_188) == 0) @@ -18062,6 +18256,7 @@ return x_206; else { obj* x_210; obj* x_211; obj* x_212; obj* x_213; +lean::dec(x_159); lean::dec(x_2); lean::dec(x_1); x_210 = lean::cnstr_get(x_163, 0); @@ -18092,19 +18287,19 @@ else uint8 x_214; lean::dec(x_2); lean::dec(x_1); -x_214 = !lean::is_exclusive(x_4); +x_214 = !lean::is_exclusive(x_5); if (x_214 == 0) { -return x_4; +return x_5; } else { obj* x_215; obj* x_216; obj* x_217; -x_215 = lean::cnstr_get(x_4, 0); -x_216 = lean::cnstr_get(x_4, 1); +x_215 = lean::cnstr_get(x_5, 0); +x_216 = lean::cnstr_get(x_5, 1); lean::inc(x_216); lean::inc(x_215); -lean::dec(x_4); +lean::dec(x_5); x_217 = lean::alloc_cnstr(1, 2, 0); lean::cnstr_set(x_217, 0, x_215); lean::cnstr_set(x_217, 1, x_216); @@ -19121,8 +19316,8 @@ l_Lean_elabCommand___closed__2 = _init_l_Lean_elabCommand___closed__2(); lean::mark_persistent(l_Lean_elabCommand___closed__2); l_Lean_elabCommand___closed__3 = _init_l_Lean_elabCommand___closed__3(); lean::mark_persistent(l_Lean_elabCommand___closed__3); -l_Lean_absolutizeModuleNameAux___closed__1 = _init_l_Lean_absolutizeModuleNameAux___closed__1(); -lean::mark_persistent(l_Lean_absolutizeModuleNameAux___closed__1); +l_Lean_absolutizeModuleName___closed__1 = _init_l_Lean_absolutizeModuleName___closed__1(); +lean::mark_persistent(l_Lean_absolutizeModuleName___closed__1); l_Lean_processHeaderAux___closed__1 = _init_l_Lean_processHeaderAux___closed__1(); lean::mark_persistent(l_Lean_processHeaderAux___closed__1); l_Lean_processHeaderAux___closed__2 = _init_l_Lean_processHeaderAux___closed__2(); diff --git a/src/stage0/init/lean/environment.cpp b/src/stage0/init/lean/environment.cpp index 21db140b7b..586e20d497 100644 --- a/src/stage0/init/lean/environment.cpp +++ b/src/stage0/init/lean/environment.cpp @@ -80,7 +80,6 @@ obj* l_HashMapImp_insert___at_Lean_Environment_addAux___spec__4(obj*, obj*, obj* namespace lean { obj* environment_add_modification_core(obj*, obj*); } -obj* l_Lean_findOLean(obj*, obj*); obj* l_Lean_EnvExtension_Inhabited___rarg___closed__1; obj* l_List_lengthAux___main___rarg(obj*, obj*); obj* l_Lean_Environment_displayStats___closed__5; @@ -102,6 +101,7 @@ obj* l_Lean_PersistentEnvExtension_inhabited___rarg___closed__3; obj* l_Nat_foldAux___main___at_Lean_mkModuleData___spec__1(obj*, obj*, obj*, obj*, obj*); obj* l_Lean_mkStateFromImportedEntries(obj*, obj*); uint8 l_Lean_SMap_contains___main___at_Lean_Environment_contains___spec__1(obj*, obj*); +extern obj* l_Lean_findOLean___closed__1; obj* l_Lean_EnvExtension_modifyStateUnsafe(obj*); uint8 l_HashMapImp_contains___at_Lean_Environment_contains___spec__2(obj*, obj*); obj* l_Array_anyMAux___main___at_Lean_registerPersistentEnvExtensionUnsafe___spec__1___rarg___boxed(obj*, obj*, obj*); @@ -276,6 +276,7 @@ obj* l_Lean_PersistentEnvExtension_getModuleEntries___rarg(obj*, obj*, obj*); extern obj* l_RBMap_maxDepth___rarg___closed__1; obj* l_Array_ummapAux___main___at___private_init_lean_environment_6__mkInitialExtensionStates___spec__1(obj*, obj*, obj*); obj* l_Lean_getNamespaceSet___boxed(obj*); +obj* l_Lean_findLeanFile(obj*, obj*, obj*); obj* l_Lean_SMap_empty___at_Lean_Environment_Inhabited___spec__2___closed__3; obj* l_Array_miterateAux___main___at___private_init_lean_environment_10__setImportedEntries___spec__2___boxed(obj*, obj*, obj*, obj*, obj*); obj* l_Lean_ModuleIdx_inhabited; @@ -13035,7 +13036,7 @@ uint8 x_13; x_13 = !lean::is_exclusive(x_2); if (x_13 == 0) { -obj* x_14; obj* x_15; obj* x_16; obj* x_17; obj* x_18; +obj* x_14; obj* x_15; obj* x_16; obj* x_17; obj* x_18; obj* x_19; x_14 = lean::cnstr_get(x_2, 1); lean::dec(x_14); x_15 = lean::cnstr_get(x_2, 0); @@ -13043,615 +13044,617 @@ lean::dec(x_15); x_16 = lean::box(0); lean::inc(x_8); x_17 = l_RBNode_insert___at_Lean_NameSet_insert___spec__1(x_10, x_8, x_16); -x_18 = l_Lean_findOLean(x_8, x_3); -if (lean::obj_tag(x_18) == 0) +x_18 = l_Lean_findOLean___closed__1; +x_19 = l_Lean_findLeanFile(x_8, x_18, x_3); +if (lean::obj_tag(x_19) == 0) { -uint8 x_19; -x_19 = !lean::is_exclusive(x_18); -if (x_19 == 0) +uint8 x_20; +x_20 = !lean::is_exclusive(x_19); +if (x_20 == 0) { -obj* x_20; obj* x_21; -x_20 = lean::cnstr_get(x_18, 0); -lean::cnstr_set(x_18, 0, x_16); -x_21 = lean_read_module_data(x_20, x_18); -lean::dec(x_20); -if (lean::obj_tag(x_21) == 0) -{ -uint8 x_22; -x_22 = !lean::is_exclusive(x_21); -if (x_22 == 0) -{ -obj* x_23; obj* x_24; obj* x_25; obj* x_26; -x_23 = lean::cnstr_get(x_21, 0); -lean::cnstr_set(x_21, 0, x_16); -x_24 = lean::cnstr_get(x_23, 0); -lean::inc(x_24); -x_25 = l_Array_toList___rarg(x_24); -lean::dec(x_24); -lean::cnstr_set(x_2, 0, x_17); -x_26 = l_Lean_importModulesAux___main(x_25, x_2, x_21); -if (lean::obj_tag(x_26) == 0) -{ -uint8 x_27; -x_27 = !lean::is_exclusive(x_26); -if (x_27 == 0) -{ -obj* x_28; uint8 x_29; -x_28 = lean::cnstr_get(x_26, 0); -lean::cnstr_set(x_26, 0, x_16); -x_29 = !lean::is_exclusive(x_28); -if (x_29 == 0) -{ -obj* x_30; obj* x_31; -x_30 = lean::cnstr_get(x_28, 1); -x_31 = lean::array_push(x_30, x_23); -lean::cnstr_set(x_28, 1, x_31); -x_1 = x_9; -x_2 = x_28; -x_3 = x_26; -goto _start; -} -else -{ -obj* x_33; obj* x_34; obj* x_35; obj* x_36; -x_33 = lean::cnstr_get(x_28, 0); -x_34 = lean::cnstr_get(x_28, 1); -lean::inc(x_34); -lean::inc(x_33); -lean::dec(x_28); -x_35 = lean::array_push(x_34, x_23); -x_36 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_36, 0, x_33); -lean::cnstr_set(x_36, 1, x_35); -x_1 = x_9; -x_2 = x_36; -x_3 = x_26; -goto _start; -} -} -else -{ -obj* x_38; obj* x_39; obj* x_40; obj* x_41; obj* x_42; obj* x_43; obj* x_44; obj* x_45; -x_38 = lean::cnstr_get(x_26, 0); -x_39 = lean::cnstr_get(x_26, 1); -lean::inc(x_39); -lean::inc(x_38); -lean::dec(x_26); -x_40 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_40, 0, x_16); -lean::cnstr_set(x_40, 1, x_39); -x_41 = lean::cnstr_get(x_38, 0); -lean::inc(x_41); -x_42 = lean::cnstr_get(x_38, 1); -lean::inc(x_42); -if (lean::is_exclusive(x_38)) { - lean::cnstr_release(x_38, 0); - lean::cnstr_release(x_38, 1); - x_43 = x_38; -} else { - lean::dec_ref(x_38); - x_43 = lean::box(0); -} -x_44 = lean::array_push(x_42, x_23); -if (lean::is_scalar(x_43)) { - x_45 = lean::alloc_cnstr(0, 2, 0); -} else { - x_45 = x_43; -} -lean::cnstr_set(x_45, 0, x_41); -lean::cnstr_set(x_45, 1, x_44); -x_1 = x_9; -x_2 = x_45; -x_3 = x_40; -goto _start; -} -} -else -{ -uint8 x_47; -lean::dec(x_23); -lean::dec(x_9); -x_47 = !lean::is_exclusive(x_26); -if (x_47 == 0) -{ -return x_26; -} -else -{ -obj* x_48; obj* x_49; obj* x_50; -x_48 = lean::cnstr_get(x_26, 0); -x_49 = lean::cnstr_get(x_26, 1); -lean::inc(x_49); -lean::inc(x_48); -lean::dec(x_26); -x_50 = lean::alloc_cnstr(1, 2, 0); -lean::cnstr_set(x_50, 0, x_48); -lean::cnstr_set(x_50, 1, x_49); -return x_50; -} -} -} -else -{ -obj* x_51; obj* x_52; obj* x_53; obj* x_54; obj* x_55; obj* x_56; -x_51 = lean::cnstr_get(x_21, 0); -x_52 = lean::cnstr_get(x_21, 1); -lean::inc(x_52); -lean::inc(x_51); +obj* x_21; obj* x_22; +x_21 = lean::cnstr_get(x_19, 0); +lean::cnstr_set(x_19, 0, x_16); +x_22 = lean_read_module_data(x_21, x_19); lean::dec(x_21); -x_53 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_53, 0, x_16); -lean::cnstr_set(x_53, 1, x_52); -x_54 = lean::cnstr_get(x_51, 0); -lean::inc(x_54); -x_55 = l_Array_toList___rarg(x_54); -lean::dec(x_54); -lean::cnstr_set(x_2, 0, x_17); -x_56 = l_Lean_importModulesAux___main(x_55, x_2, x_53); -if (lean::obj_tag(x_56) == 0) +if (lean::obj_tag(x_22) == 0) { -obj* x_57; obj* x_58; obj* x_59; obj* x_60; obj* x_61; obj* x_62; obj* x_63; obj* x_64; obj* x_65; -x_57 = lean::cnstr_get(x_56, 0); -lean::inc(x_57); -x_58 = lean::cnstr_get(x_56, 1); +uint8 x_23; +x_23 = !lean::is_exclusive(x_22); +if (x_23 == 0) +{ +obj* x_24; obj* x_25; obj* x_26; obj* x_27; +x_24 = lean::cnstr_get(x_22, 0); +lean::cnstr_set(x_22, 0, x_16); +x_25 = lean::cnstr_get(x_24, 0); +lean::inc(x_25); +x_26 = l_Array_toList___rarg(x_25); +lean::dec(x_25); +lean::cnstr_set(x_2, 0, x_17); +x_27 = l_Lean_importModulesAux___main(x_26, x_2, x_22); +if (lean::obj_tag(x_27) == 0) +{ +uint8 x_28; +x_28 = !lean::is_exclusive(x_27); +if (x_28 == 0) +{ +obj* x_29; uint8 x_30; +x_29 = lean::cnstr_get(x_27, 0); +lean::cnstr_set(x_27, 0, x_16); +x_30 = !lean::is_exclusive(x_29); +if (x_30 == 0) +{ +obj* x_31; obj* x_32; +x_31 = lean::cnstr_get(x_29, 1); +x_32 = lean::array_push(x_31, x_24); +lean::cnstr_set(x_29, 1, x_32); +x_1 = x_9; +x_2 = x_29; +x_3 = x_27; +goto _start; +} +else +{ +obj* x_34; obj* x_35; obj* x_36; obj* x_37; +x_34 = lean::cnstr_get(x_29, 0); +x_35 = lean::cnstr_get(x_29, 1); +lean::inc(x_35); +lean::inc(x_34); +lean::dec(x_29); +x_36 = lean::array_push(x_35, x_24); +x_37 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_37, 0, x_34); +lean::cnstr_set(x_37, 1, x_36); +x_1 = x_9; +x_2 = x_37; +x_3 = x_27; +goto _start; +} +} +else +{ +obj* x_39; obj* x_40; obj* x_41; obj* x_42; obj* x_43; obj* x_44; obj* x_45; obj* x_46; +x_39 = lean::cnstr_get(x_27, 0); +x_40 = lean::cnstr_get(x_27, 1); +lean::inc(x_40); +lean::inc(x_39); +lean::dec(x_27); +x_41 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_41, 0, x_16); +lean::cnstr_set(x_41, 1, x_40); +x_42 = lean::cnstr_get(x_39, 0); +lean::inc(x_42); +x_43 = lean::cnstr_get(x_39, 1); +lean::inc(x_43); +if (lean::is_exclusive(x_39)) { + lean::cnstr_release(x_39, 0); + lean::cnstr_release(x_39, 1); + x_44 = x_39; +} else { + lean::dec_ref(x_39); + x_44 = lean::box(0); +} +x_45 = lean::array_push(x_43, x_24); +if (lean::is_scalar(x_44)) { + x_46 = lean::alloc_cnstr(0, 2, 0); +} else { + x_46 = x_44; +} +lean::cnstr_set(x_46, 0, x_42); +lean::cnstr_set(x_46, 1, x_45); +x_1 = x_9; +x_2 = x_46; +x_3 = x_41; +goto _start; +} +} +else +{ +uint8 x_48; +lean::dec(x_24); +lean::dec(x_9); +x_48 = !lean::is_exclusive(x_27); +if (x_48 == 0) +{ +return x_27; +} +else +{ +obj* x_49; obj* x_50; obj* x_51; +x_49 = lean::cnstr_get(x_27, 0); +x_50 = lean::cnstr_get(x_27, 1); +lean::inc(x_50); +lean::inc(x_49); +lean::dec(x_27); +x_51 = lean::alloc_cnstr(1, 2, 0); +lean::cnstr_set(x_51, 0, x_49); +lean::cnstr_set(x_51, 1, x_50); +return x_51; +} +} +} +else +{ +obj* x_52; obj* x_53; obj* x_54; obj* x_55; obj* x_56; obj* x_57; +x_52 = lean::cnstr_get(x_22, 0); +x_53 = lean::cnstr_get(x_22, 1); +lean::inc(x_53); +lean::inc(x_52); +lean::dec(x_22); +x_54 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_54, 0, x_16); +lean::cnstr_set(x_54, 1, x_53); +x_55 = lean::cnstr_get(x_52, 0); +lean::inc(x_55); +x_56 = l_Array_toList___rarg(x_55); +lean::dec(x_55); +lean::cnstr_set(x_2, 0, x_17); +x_57 = l_Lean_importModulesAux___main(x_56, x_2, x_54); +if (lean::obj_tag(x_57) == 0) +{ +obj* x_58; obj* x_59; obj* x_60; obj* x_61; obj* x_62; obj* x_63; obj* x_64; obj* x_65; obj* x_66; +x_58 = lean::cnstr_get(x_57, 0); lean::inc(x_58); -if (lean::is_exclusive(x_56)) { - lean::cnstr_release(x_56, 0); - lean::cnstr_release(x_56, 1); - x_59 = x_56; -} else { - lean::dec_ref(x_56); - x_59 = lean::box(0); -} -if (lean::is_scalar(x_59)) { - x_60 = lean::alloc_cnstr(0, 2, 0); -} else { - x_60 = x_59; -} -lean::cnstr_set(x_60, 0, x_16); -lean::cnstr_set(x_60, 1, x_58); -x_61 = lean::cnstr_get(x_57, 0); -lean::inc(x_61); -x_62 = lean::cnstr_get(x_57, 1); -lean::inc(x_62); +x_59 = lean::cnstr_get(x_57, 1); +lean::inc(x_59); if (lean::is_exclusive(x_57)) { lean::cnstr_release(x_57, 0); lean::cnstr_release(x_57, 1); - x_63 = x_57; + x_60 = x_57; } else { lean::dec_ref(x_57); - x_63 = lean::box(0); + x_60 = lean::box(0); } -x_64 = lean::array_push(x_62, x_51); -if (lean::is_scalar(x_63)) { - x_65 = lean::alloc_cnstr(0, 2, 0); +if (lean::is_scalar(x_60)) { + x_61 = lean::alloc_cnstr(0, 2, 0); } else { - x_65 = x_63; + x_61 = x_60; } -lean::cnstr_set(x_65, 0, x_61); -lean::cnstr_set(x_65, 1, x_64); +lean::cnstr_set(x_61, 0, x_16); +lean::cnstr_set(x_61, 1, x_59); +x_62 = lean::cnstr_get(x_58, 0); +lean::inc(x_62); +x_63 = lean::cnstr_get(x_58, 1); +lean::inc(x_63); +if (lean::is_exclusive(x_58)) { + lean::cnstr_release(x_58, 0); + lean::cnstr_release(x_58, 1); + x_64 = x_58; +} else { + lean::dec_ref(x_58); + x_64 = lean::box(0); +} +x_65 = lean::array_push(x_63, x_52); +if (lean::is_scalar(x_64)) { + x_66 = lean::alloc_cnstr(0, 2, 0); +} else { + x_66 = x_64; +} +lean::cnstr_set(x_66, 0, x_62); +lean::cnstr_set(x_66, 1, x_65); x_1 = x_9; -x_2 = x_65; -x_3 = x_60; +x_2 = x_66; +x_3 = x_61; goto _start; } else { -obj* x_67; obj* x_68; obj* x_69; obj* x_70; -lean::dec(x_51); +obj* x_68; obj* x_69; obj* x_70; obj* x_71; +lean::dec(x_52); lean::dec(x_9); -x_67 = lean::cnstr_get(x_56, 0); -lean::inc(x_67); -x_68 = lean::cnstr_get(x_56, 1); +x_68 = lean::cnstr_get(x_57, 0); lean::inc(x_68); -if (lean::is_exclusive(x_56)) { - lean::cnstr_release(x_56, 0); - lean::cnstr_release(x_56, 1); - x_69 = x_56; +x_69 = lean::cnstr_get(x_57, 1); +lean::inc(x_69); +if (lean::is_exclusive(x_57)) { + lean::cnstr_release(x_57, 0); + lean::cnstr_release(x_57, 1); + x_70 = x_57; } else { - lean::dec_ref(x_56); - x_69 = lean::box(0); + lean::dec_ref(x_57); + x_70 = lean::box(0); } -if (lean::is_scalar(x_69)) { - x_70 = lean::alloc_cnstr(1, 2, 0); +if (lean::is_scalar(x_70)) { + x_71 = lean::alloc_cnstr(1, 2, 0); } else { - x_70 = x_69; + x_71 = x_70; } -lean::cnstr_set(x_70, 0, x_67); -lean::cnstr_set(x_70, 1, x_68); -return x_70; +lean::cnstr_set(x_71, 0, x_68); +lean::cnstr_set(x_71, 1, x_69); +return x_71; } } } else { -uint8 x_71; +uint8 x_72; lean::dec(x_17); lean::free_heap_obj(x_2); lean::dec(x_11); lean::dec(x_9); -x_71 = !lean::is_exclusive(x_21); -if (x_71 == 0) +x_72 = !lean::is_exclusive(x_22); +if (x_72 == 0) { -return x_21; +return x_22; } else { -obj* x_72; obj* x_73; obj* x_74; -x_72 = lean::cnstr_get(x_21, 0); -x_73 = lean::cnstr_get(x_21, 1); +obj* x_73; obj* x_74; obj* x_75; +x_73 = lean::cnstr_get(x_22, 0); +x_74 = lean::cnstr_get(x_22, 1); +lean::inc(x_74); lean::inc(x_73); -lean::inc(x_72); -lean::dec(x_21); -x_74 = lean::alloc_cnstr(1, 2, 0); -lean::cnstr_set(x_74, 0, x_72); -lean::cnstr_set(x_74, 1, x_73); -return x_74; +lean::dec(x_22); +x_75 = lean::alloc_cnstr(1, 2, 0); +lean::cnstr_set(x_75, 0, x_73); +lean::cnstr_set(x_75, 1, x_74); +return x_75; } } } else { -obj* x_75; obj* x_76; obj* x_77; obj* x_78; -x_75 = lean::cnstr_get(x_18, 0); -x_76 = lean::cnstr_get(x_18, 1); +obj* x_76; obj* x_77; obj* x_78; obj* x_79; +x_76 = lean::cnstr_get(x_19, 0); +x_77 = lean::cnstr_get(x_19, 1); +lean::inc(x_77); lean::inc(x_76); -lean::inc(x_75); -lean::dec(x_18); -x_77 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_77, 0, x_16); -lean::cnstr_set(x_77, 1, x_76); -x_78 = lean_read_module_data(x_75, x_77); -lean::dec(x_75); -if (lean::obj_tag(x_78) == 0) +lean::dec(x_19); +x_78 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_78, 0, x_16); +lean::cnstr_set(x_78, 1, x_77); +x_79 = lean_read_module_data(x_76, x_78); +lean::dec(x_76); +if (lean::obj_tag(x_79) == 0) { -obj* x_79; obj* x_80; obj* x_81; obj* x_82; obj* x_83; obj* x_84; obj* x_85; -x_79 = lean::cnstr_get(x_78, 0); -lean::inc(x_79); -x_80 = lean::cnstr_get(x_78, 1); +obj* x_80; obj* x_81; obj* x_82; obj* x_83; obj* x_84; obj* x_85; obj* x_86; +x_80 = lean::cnstr_get(x_79, 0); lean::inc(x_80); -if (lean::is_exclusive(x_78)) { - lean::cnstr_release(x_78, 0); - lean::cnstr_release(x_78, 1); - x_81 = x_78; +x_81 = lean::cnstr_get(x_79, 1); +lean::inc(x_81); +if (lean::is_exclusive(x_79)) { + lean::cnstr_release(x_79, 0); + lean::cnstr_release(x_79, 1); + x_82 = x_79; } else { - lean::dec_ref(x_78); - x_81 = lean::box(0); + lean::dec_ref(x_79); + x_82 = lean::box(0); } -if (lean::is_scalar(x_81)) { - x_82 = lean::alloc_cnstr(0, 2, 0); +if (lean::is_scalar(x_82)) { + x_83 = lean::alloc_cnstr(0, 2, 0); } else { - x_82 = x_81; + x_83 = x_82; } -lean::cnstr_set(x_82, 0, x_16); -lean::cnstr_set(x_82, 1, x_80); -x_83 = lean::cnstr_get(x_79, 0); -lean::inc(x_83); -x_84 = l_Array_toList___rarg(x_83); -lean::dec(x_83); +lean::cnstr_set(x_83, 0, x_16); +lean::cnstr_set(x_83, 1, x_81); +x_84 = lean::cnstr_get(x_80, 0); +lean::inc(x_84); +x_85 = l_Array_toList___rarg(x_84); +lean::dec(x_84); lean::cnstr_set(x_2, 0, x_17); -x_85 = l_Lean_importModulesAux___main(x_84, x_2, x_82); -if (lean::obj_tag(x_85) == 0) +x_86 = l_Lean_importModulesAux___main(x_85, x_2, x_83); +if (lean::obj_tag(x_86) == 0) { -obj* x_86; obj* x_87; obj* x_88; obj* x_89; obj* x_90; obj* x_91; obj* x_92; obj* x_93; obj* x_94; -x_86 = lean::cnstr_get(x_85, 0); -lean::inc(x_86); -x_87 = lean::cnstr_get(x_85, 1); +obj* x_87; obj* x_88; obj* x_89; obj* x_90; obj* x_91; obj* x_92; obj* x_93; obj* x_94; obj* x_95; +x_87 = lean::cnstr_get(x_86, 0); lean::inc(x_87); -if (lean::is_exclusive(x_85)) { - lean::cnstr_release(x_85, 0); - lean::cnstr_release(x_85, 1); - x_88 = x_85; -} else { - lean::dec_ref(x_85); - x_88 = lean::box(0); -} -if (lean::is_scalar(x_88)) { - x_89 = lean::alloc_cnstr(0, 2, 0); -} else { - x_89 = x_88; -} -lean::cnstr_set(x_89, 0, x_16); -lean::cnstr_set(x_89, 1, x_87); -x_90 = lean::cnstr_get(x_86, 0); -lean::inc(x_90); -x_91 = lean::cnstr_get(x_86, 1); -lean::inc(x_91); +x_88 = lean::cnstr_get(x_86, 1); +lean::inc(x_88); if (lean::is_exclusive(x_86)) { lean::cnstr_release(x_86, 0); lean::cnstr_release(x_86, 1); - x_92 = x_86; + x_89 = x_86; } else { lean::dec_ref(x_86); - x_92 = lean::box(0); + x_89 = lean::box(0); } -x_93 = lean::array_push(x_91, x_79); -if (lean::is_scalar(x_92)) { - x_94 = lean::alloc_cnstr(0, 2, 0); +if (lean::is_scalar(x_89)) { + x_90 = lean::alloc_cnstr(0, 2, 0); } else { - x_94 = x_92; + x_90 = x_89; } -lean::cnstr_set(x_94, 0, x_90); -lean::cnstr_set(x_94, 1, x_93); +lean::cnstr_set(x_90, 0, x_16); +lean::cnstr_set(x_90, 1, x_88); +x_91 = lean::cnstr_get(x_87, 0); +lean::inc(x_91); +x_92 = lean::cnstr_get(x_87, 1); +lean::inc(x_92); +if (lean::is_exclusive(x_87)) { + lean::cnstr_release(x_87, 0); + lean::cnstr_release(x_87, 1); + x_93 = x_87; +} else { + lean::dec_ref(x_87); + x_93 = lean::box(0); +} +x_94 = lean::array_push(x_92, x_80); +if (lean::is_scalar(x_93)) { + x_95 = lean::alloc_cnstr(0, 2, 0); +} else { + x_95 = x_93; +} +lean::cnstr_set(x_95, 0, x_91); +lean::cnstr_set(x_95, 1, x_94); x_1 = x_9; -x_2 = x_94; -x_3 = x_89; +x_2 = x_95; +x_3 = x_90; goto _start; } else { -obj* x_96; obj* x_97; obj* x_98; obj* x_99; -lean::dec(x_79); +obj* x_97; obj* x_98; obj* x_99; obj* x_100; +lean::dec(x_80); lean::dec(x_9); -x_96 = lean::cnstr_get(x_85, 0); -lean::inc(x_96); -x_97 = lean::cnstr_get(x_85, 1); +x_97 = lean::cnstr_get(x_86, 0); lean::inc(x_97); -if (lean::is_exclusive(x_85)) { - lean::cnstr_release(x_85, 0); - lean::cnstr_release(x_85, 1); - x_98 = x_85; +x_98 = lean::cnstr_get(x_86, 1); +lean::inc(x_98); +if (lean::is_exclusive(x_86)) { + lean::cnstr_release(x_86, 0); + lean::cnstr_release(x_86, 1); + x_99 = x_86; } else { - lean::dec_ref(x_85); - x_98 = lean::box(0); + lean::dec_ref(x_86); + x_99 = lean::box(0); } -if (lean::is_scalar(x_98)) { - x_99 = lean::alloc_cnstr(1, 2, 0); +if (lean::is_scalar(x_99)) { + x_100 = lean::alloc_cnstr(1, 2, 0); } else { - x_99 = x_98; + x_100 = x_99; } -lean::cnstr_set(x_99, 0, x_96); -lean::cnstr_set(x_99, 1, x_97); -return x_99; +lean::cnstr_set(x_100, 0, x_97); +lean::cnstr_set(x_100, 1, x_98); +return x_100; } } else { -obj* x_100; obj* x_101; obj* x_102; obj* x_103; +obj* x_101; obj* x_102; obj* x_103; obj* x_104; lean::dec(x_17); lean::free_heap_obj(x_2); lean::dec(x_11); lean::dec(x_9); -x_100 = lean::cnstr_get(x_78, 0); -lean::inc(x_100); -x_101 = lean::cnstr_get(x_78, 1); +x_101 = lean::cnstr_get(x_79, 0); lean::inc(x_101); -if (lean::is_exclusive(x_78)) { - lean::cnstr_release(x_78, 0); - lean::cnstr_release(x_78, 1); - x_102 = x_78; +x_102 = lean::cnstr_get(x_79, 1); +lean::inc(x_102); +if (lean::is_exclusive(x_79)) { + lean::cnstr_release(x_79, 0); + lean::cnstr_release(x_79, 1); + x_103 = x_79; } else { - lean::dec_ref(x_78); - x_102 = lean::box(0); + lean::dec_ref(x_79); + x_103 = lean::box(0); } -if (lean::is_scalar(x_102)) { - x_103 = lean::alloc_cnstr(1, 2, 0); +if (lean::is_scalar(x_103)) { + x_104 = lean::alloc_cnstr(1, 2, 0); } else { - x_103 = x_102; + x_104 = x_103; } -lean::cnstr_set(x_103, 0, x_100); -lean::cnstr_set(x_103, 1, x_101); -return x_103; +lean::cnstr_set(x_104, 0, x_101); +lean::cnstr_set(x_104, 1, x_102); +return x_104; } } } else { -uint8 x_104; +uint8 x_105; lean::dec(x_17); lean::free_heap_obj(x_2); lean::dec(x_11); lean::dec(x_9); -x_104 = !lean::is_exclusive(x_18); -if (x_104 == 0) +x_105 = !lean::is_exclusive(x_19); +if (x_105 == 0) { -return x_18; +return x_19; } else { -obj* x_105; obj* x_106; obj* x_107; -x_105 = lean::cnstr_get(x_18, 0); -x_106 = lean::cnstr_get(x_18, 1); +obj* x_106; obj* x_107; obj* x_108; +x_106 = lean::cnstr_get(x_19, 0); +x_107 = lean::cnstr_get(x_19, 1); +lean::inc(x_107); lean::inc(x_106); -lean::inc(x_105); -lean::dec(x_18); -x_107 = lean::alloc_cnstr(1, 2, 0); -lean::cnstr_set(x_107, 0, x_105); -lean::cnstr_set(x_107, 1, x_106); -return x_107; +lean::dec(x_19); +x_108 = lean::alloc_cnstr(1, 2, 0); +lean::cnstr_set(x_108, 0, x_106); +lean::cnstr_set(x_108, 1, x_107); +return x_108; } } } else { -obj* x_108; obj* x_109; obj* x_110; +obj* x_109; obj* x_110; obj* x_111; obj* x_112; lean::dec(x_2); -x_108 = lean::box(0); +x_109 = lean::box(0); lean::inc(x_8); -x_109 = l_RBNode_insert___at_Lean_NameSet_insert___spec__1(x_10, x_8, x_108); -x_110 = l_Lean_findOLean(x_8, x_3); -if (lean::obj_tag(x_110) == 0) +x_110 = l_RBNode_insert___at_Lean_NameSet_insert___spec__1(x_10, x_8, x_109); +x_111 = l_Lean_findOLean___closed__1; +x_112 = l_Lean_findLeanFile(x_8, x_111, x_3); +if (lean::obj_tag(x_112) == 0) { -obj* x_111; obj* x_112; obj* x_113; obj* x_114; obj* x_115; -x_111 = lean::cnstr_get(x_110, 0); -lean::inc(x_111); -x_112 = lean::cnstr_get(x_110, 1); -lean::inc(x_112); -if (lean::is_exclusive(x_110)) { - lean::cnstr_release(x_110, 0); - lean::cnstr_release(x_110, 1); - x_113 = x_110; +obj* x_113; obj* x_114; obj* x_115; obj* x_116; obj* x_117; +x_113 = lean::cnstr_get(x_112, 0); +lean::inc(x_113); +x_114 = lean::cnstr_get(x_112, 1); +lean::inc(x_114); +if (lean::is_exclusive(x_112)) { + lean::cnstr_release(x_112, 0); + lean::cnstr_release(x_112, 1); + x_115 = x_112; } else { - lean::dec_ref(x_110); - x_113 = lean::box(0); + lean::dec_ref(x_112); + x_115 = lean::box(0); } -if (lean::is_scalar(x_113)) { - x_114 = lean::alloc_cnstr(0, 2, 0); +if (lean::is_scalar(x_115)) { + x_116 = lean::alloc_cnstr(0, 2, 0); } else { - x_114 = x_113; + x_116 = x_115; } -lean::cnstr_set(x_114, 0, x_108); -lean::cnstr_set(x_114, 1, x_112); -x_115 = lean_read_module_data(x_111, x_114); -lean::dec(x_111); -if (lean::obj_tag(x_115) == 0) +lean::cnstr_set(x_116, 0, x_109); +lean::cnstr_set(x_116, 1, x_114); +x_117 = lean_read_module_data(x_113, x_116); +lean::dec(x_113); +if (lean::obj_tag(x_117) == 0) { -obj* x_116; obj* x_117; obj* x_118; obj* x_119; obj* x_120; obj* x_121; obj* x_122; obj* x_123; -x_116 = lean::cnstr_get(x_115, 0); -lean::inc(x_116); -x_117 = lean::cnstr_get(x_115, 1); -lean::inc(x_117); -if (lean::is_exclusive(x_115)) { - lean::cnstr_release(x_115, 0); - lean::cnstr_release(x_115, 1); - x_118 = x_115; +obj* x_118; obj* x_119; obj* x_120; obj* x_121; obj* x_122; obj* x_123; obj* x_124; obj* x_125; +x_118 = lean::cnstr_get(x_117, 0); +lean::inc(x_118); +x_119 = lean::cnstr_get(x_117, 1); +lean::inc(x_119); +if (lean::is_exclusive(x_117)) { + lean::cnstr_release(x_117, 0); + lean::cnstr_release(x_117, 1); + x_120 = x_117; } else { - lean::dec_ref(x_115); - x_118 = lean::box(0); + lean::dec_ref(x_117); + x_120 = lean::box(0); } -if (lean::is_scalar(x_118)) { - x_119 = lean::alloc_cnstr(0, 2, 0); +if (lean::is_scalar(x_120)) { + x_121 = lean::alloc_cnstr(0, 2, 0); } else { - x_119 = x_118; + x_121 = x_120; } -lean::cnstr_set(x_119, 0, x_108); -lean::cnstr_set(x_119, 1, x_117); -x_120 = lean::cnstr_get(x_116, 0); -lean::inc(x_120); -x_121 = l_Array_toList___rarg(x_120); -lean::dec(x_120); -x_122 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_122, 0, x_109); -lean::cnstr_set(x_122, 1, x_11); -x_123 = l_Lean_importModulesAux___main(x_121, x_122, x_119); -if (lean::obj_tag(x_123) == 0) +lean::cnstr_set(x_121, 0, x_109); +lean::cnstr_set(x_121, 1, x_119); +x_122 = lean::cnstr_get(x_118, 0); +lean::inc(x_122); +x_123 = l_Array_toList___rarg(x_122); +lean::dec(x_122); +x_124 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_124, 0, x_110); +lean::cnstr_set(x_124, 1, x_11); +x_125 = l_Lean_importModulesAux___main(x_123, x_124, x_121); +if (lean::obj_tag(x_125) == 0) { -obj* x_124; obj* x_125; obj* x_126; obj* x_127; obj* x_128; obj* x_129; obj* x_130; obj* x_131; obj* x_132; -x_124 = lean::cnstr_get(x_123, 0); -lean::inc(x_124); -x_125 = lean::cnstr_get(x_123, 1); -lean::inc(x_125); -if (lean::is_exclusive(x_123)) { - lean::cnstr_release(x_123, 0); - lean::cnstr_release(x_123, 1); - x_126 = x_123; +obj* x_126; obj* x_127; obj* x_128; obj* x_129; obj* x_130; obj* x_131; obj* x_132; obj* x_133; obj* x_134; +x_126 = lean::cnstr_get(x_125, 0); +lean::inc(x_126); +x_127 = lean::cnstr_get(x_125, 1); +lean::inc(x_127); +if (lean::is_exclusive(x_125)) { + lean::cnstr_release(x_125, 0); + lean::cnstr_release(x_125, 1); + x_128 = x_125; } else { - lean::dec_ref(x_123); - x_126 = lean::box(0); + lean::dec_ref(x_125); + x_128 = lean::box(0); } -if (lean::is_scalar(x_126)) { - x_127 = lean::alloc_cnstr(0, 2, 0); +if (lean::is_scalar(x_128)) { + x_129 = lean::alloc_cnstr(0, 2, 0); } else { - x_127 = x_126; + x_129 = x_128; } -lean::cnstr_set(x_127, 0, x_108); -lean::cnstr_set(x_127, 1, x_125); -x_128 = lean::cnstr_get(x_124, 0); -lean::inc(x_128); -x_129 = lean::cnstr_get(x_124, 1); -lean::inc(x_129); -if (lean::is_exclusive(x_124)) { - lean::cnstr_release(x_124, 0); - lean::cnstr_release(x_124, 1); - x_130 = x_124; +lean::cnstr_set(x_129, 0, x_109); +lean::cnstr_set(x_129, 1, x_127); +x_130 = lean::cnstr_get(x_126, 0); +lean::inc(x_130); +x_131 = lean::cnstr_get(x_126, 1); +lean::inc(x_131); +if (lean::is_exclusive(x_126)) { + lean::cnstr_release(x_126, 0); + lean::cnstr_release(x_126, 1); + x_132 = x_126; } else { - lean::dec_ref(x_124); - x_130 = lean::box(0); + lean::dec_ref(x_126); + x_132 = lean::box(0); } -x_131 = lean::array_push(x_129, x_116); -if (lean::is_scalar(x_130)) { - x_132 = lean::alloc_cnstr(0, 2, 0); +x_133 = lean::array_push(x_131, x_118); +if (lean::is_scalar(x_132)) { + x_134 = lean::alloc_cnstr(0, 2, 0); } else { - x_132 = x_130; + x_134 = x_132; } -lean::cnstr_set(x_132, 0, x_128); -lean::cnstr_set(x_132, 1, x_131); +lean::cnstr_set(x_134, 0, x_130); +lean::cnstr_set(x_134, 1, x_133); x_1 = x_9; -x_2 = x_132; -x_3 = x_127; +x_2 = x_134; +x_3 = x_129; goto _start; } else { -obj* x_134; obj* x_135; obj* x_136; obj* x_137; -lean::dec(x_116); +obj* x_136; obj* x_137; obj* x_138; obj* x_139; +lean::dec(x_118); lean::dec(x_9); -x_134 = lean::cnstr_get(x_123, 0); -lean::inc(x_134); -x_135 = lean::cnstr_get(x_123, 1); -lean::inc(x_135); -if (lean::is_exclusive(x_123)) { - lean::cnstr_release(x_123, 0); - lean::cnstr_release(x_123, 1); - x_136 = x_123; +x_136 = lean::cnstr_get(x_125, 0); +lean::inc(x_136); +x_137 = lean::cnstr_get(x_125, 1); +lean::inc(x_137); +if (lean::is_exclusive(x_125)) { + lean::cnstr_release(x_125, 0); + lean::cnstr_release(x_125, 1); + x_138 = x_125; } else { - lean::dec_ref(x_123); - x_136 = lean::box(0); + lean::dec_ref(x_125); + x_138 = lean::box(0); } -if (lean::is_scalar(x_136)) { - x_137 = lean::alloc_cnstr(1, 2, 0); +if (lean::is_scalar(x_138)) { + x_139 = lean::alloc_cnstr(1, 2, 0); } else { - x_137 = x_136; + x_139 = x_138; } -lean::cnstr_set(x_137, 0, x_134); -lean::cnstr_set(x_137, 1, x_135); -return x_137; +lean::cnstr_set(x_139, 0, x_136); +lean::cnstr_set(x_139, 1, x_137); +return x_139; } } else { -obj* x_138; obj* x_139; obj* x_140; obj* x_141; -lean::dec(x_109); +obj* x_140; obj* x_141; obj* x_142; obj* x_143; +lean::dec(x_110); lean::dec(x_11); lean::dec(x_9); -x_138 = lean::cnstr_get(x_115, 0); -lean::inc(x_138); -x_139 = lean::cnstr_get(x_115, 1); -lean::inc(x_139); -if (lean::is_exclusive(x_115)) { - lean::cnstr_release(x_115, 0); - lean::cnstr_release(x_115, 1); - x_140 = x_115; +x_140 = lean::cnstr_get(x_117, 0); +lean::inc(x_140); +x_141 = lean::cnstr_get(x_117, 1); +lean::inc(x_141); +if (lean::is_exclusive(x_117)) { + lean::cnstr_release(x_117, 0); + lean::cnstr_release(x_117, 1); + x_142 = x_117; } else { - lean::dec_ref(x_115); - x_140 = lean::box(0); + lean::dec_ref(x_117); + x_142 = lean::box(0); } -if (lean::is_scalar(x_140)) { - x_141 = lean::alloc_cnstr(1, 2, 0); +if (lean::is_scalar(x_142)) { + x_143 = lean::alloc_cnstr(1, 2, 0); } else { - x_141 = x_140; + x_143 = x_142; } -lean::cnstr_set(x_141, 0, x_138); -lean::cnstr_set(x_141, 1, x_139); -return x_141; +lean::cnstr_set(x_143, 0, x_140); +lean::cnstr_set(x_143, 1, x_141); +return x_143; } } else { -obj* x_142; obj* x_143; obj* x_144; obj* x_145; -lean::dec(x_109); +obj* x_144; obj* x_145; obj* x_146; obj* x_147; +lean::dec(x_110); lean::dec(x_11); lean::dec(x_9); -x_142 = lean::cnstr_get(x_110, 0); -lean::inc(x_142); -x_143 = lean::cnstr_get(x_110, 1); -lean::inc(x_143); -if (lean::is_exclusive(x_110)) { - lean::cnstr_release(x_110, 0); - lean::cnstr_release(x_110, 1); - x_144 = x_110; +x_144 = lean::cnstr_get(x_112, 0); +lean::inc(x_144); +x_145 = lean::cnstr_get(x_112, 1); +lean::inc(x_145); +if (lean::is_exclusive(x_112)) { + lean::cnstr_release(x_112, 0); + lean::cnstr_release(x_112, 1); + x_146 = x_112; } else { - lean::dec_ref(x_110); - x_144 = lean::box(0); + lean::dec_ref(x_112); + x_146 = lean::box(0); } -if (lean::is_scalar(x_144)) { - x_145 = lean::alloc_cnstr(1, 2, 0); +if (lean::is_scalar(x_146)) { + x_147 = lean::alloc_cnstr(1, 2, 0); } else { - x_145 = x_144; + x_147 = x_146; } -lean::cnstr_set(x_145, 0, x_142); -lean::cnstr_set(x_145, 1, x_143); -return x_145; +lean::cnstr_set(x_147, 0, x_144); +lean::cnstr_set(x_147, 1, x_145); +return x_147; } } } diff --git a/src/stage0/init/lean/path.cpp b/src/stage0/init/lean/path.cpp index 5933d9304c..1a2c18b5e7 100644 --- a/src/stage0/init/lean/path.cpp +++ b/src/stage0/init/lean/path.cpp @@ -15,21 +15,25 @@ typedef lean::uint32 uint32; typedef lean::uint64 uint64; #pragma GCC diagnostic ignored "-Wunused-but-set-variable" #endif obj* l_Lean_findLeanFile___closed__3; +obj* l_String_revPosOf(obj*, uint32); obj* l_Lean_getBuiltinSearchPath___closed__2; extern "C" uint8 lean_name_dec_eq(obj*, obj*); obj* l_List_mmap___main___at_Lean_setSearchPath___spec__1(obj*, obj*); obj* l_IO_appDir___at_Lean_getBuiltinSearchPath___spec__1(obj*); extern "C" obj* lean_io_realpath(obj*, obj*); obj* l_IO_fileExists___at_Lean_findFile___spec__1(obj*, obj*); +obj* l_Lean_moduleNameOfFileName___closed__5; namespace lean { obj* nat_sub(obj*, obj*); } obj* l_IO_isDir___at_Lean_getBuiltinSearchPath___spec__3___boxed(obj*, obj*); obj* l_Lean_getSearchPathFromEnv___closed__1; obj* l_Array_mkArray(obj*, obj*, obj*); +obj* l_Lean_moduleNameOfFileName___closed__4; obj* l_Lean_findOLean(obj*, obj*); obj* l_Lean_setSearchPath(obj*, obj*); obj* l_Lean_modNameToFileName(obj*); +uint8 l_String_isPrefixOf(obj*, obj*); obj* l_Lean_findOLean___closed__1; extern "C" obj* lean_io_is_dir(obj*, obj*); extern "C" obj* lean_io_app_dir(obj*); @@ -42,11 +46,12 @@ obj* l_Lean_addRel___main(obj*, obj*); obj* l_List_redLength___main___rarg(obj*); obj* l_IO_Prim_Ref_set(obj*, obj*, obj*, obj*); obj* l_Lean_setSearchPathFromString(obj*, obj*); +obj* l_Lean_moduleNameOfFileName___closed__2; obj* l_Array_mkEmpty(obj*, obj*); namespace lean { obj* string_push(obj*, uint32); } -obj* l_Lean_findLeanFile___boxed(obj*, obj*, obj*, obj*); +obj* l_Lean_findLeanFile___boxed(obj*, obj*, obj*); obj* l_Lean_getBuiltinSearchPath___closed__5; extern "C" obj* lean_io_getenv(obj*, obj*); extern uint32 l_System_FilePath_searchPathSeparator; @@ -57,54 +62,85 @@ obj* l_Lean_modNameToFileName___boxed(obj*); namespace lean { obj* string_append(obj*, obj*); } +obj* l_Lean_findAtSearchPath___closed__1; obj* l_IO_appPath___at_Lean_getBuiltinSearchPath___spec__2(obj*); namespace lean { uint8 nat_dec_lt(obj*, obj*); } +namespace lean { +obj* module_name_of_file_core(obj*, obj*); +} +obj* l_String_drop(obj*, obj*); +extern obj* l_Char_HasRepr___closed__1; obj* l_System_FilePath_dirName(obj*); obj* l_Lean_getBuiltinSearchPath___closed__1; obj* l_Array_fget(obj*, obj*, obj*); +extern "C" obj* lean_name_mk_string(obj*, obj*); +obj* l_List_foldl___main___at_Lean_moduleNameOfFileName___spec__1(obj*, obj*); namespace lean { obj* nat_add(obj*, obj*); } obj* l_Lean_findLeanFile___closed__2; obj* l_IO_getEnv___at_Lean_getSearchPathFromEnv___spec__1___boxed(obj*, obj*); -obj* l_Lean_findLeanFile(obj*, obj*, obj*, obj*); +obj* l_Lean_findLeanFile(obj*, obj*, obj*); namespace lean { uint8 nat_dec_eq(obj*, obj*); } +obj* l_Lean_findAtSearchPath___closed__2; obj* l_Lean_searchPathRef; obj* l_IO_getEnv___at_Lean_getSearchPathFromEnv___spec__1(obj*, obj*); obj* l_Lean_modNameToFileName___main(obj*); -obj* l_Lean_findLean___boxed(obj*, obj*, obj*); obj* l_IO_isDir___at_Lean_getBuiltinSearchPath___spec__3(obj*, obj*); +namespace lean { +uint32 string_utf8_get(obj*, obj*); +} obj* l___private_init_lean_path_1__pathSep___closed__1; obj* l_IO_fileExists___at_Lean_findFile___spec__1___boxed(obj*, obj*); +namespace lean { +uint8 string_dec_eq(obj*, obj*); +} obj* l_IO_Prim_mkRef(obj*, obj*, obj*); +uint8 l_UInt32_decEq(uint32, uint32); obj* l_Lean_addRel___main___boxed(obj*, obj*); obj* l_Lean_modNameToFileName___main___boxed(obj*); +obj* l_Lean_moduleNameOfFileName___closed__1; obj* l_String_split(obj*, obj*); obj* l_IO_Prim_Ref_get(obj*, obj*, obj*); +obj* l_Lean_findAtSearchPath(obj*, obj*); +obj* l_Lean_moduleNameOfFileName___closed__3; obj* l___private_init_lean_path_2__searchPathSep___closed__1; obj* l_Array_size(obj*, obj*); extern uint32 l_System_FilePath_extSeparator; obj* l___private_init_lean_path_1__pathSep; obj* l_Lean_findFile___boxed(obj*, obj*); +obj* l_Array_mfindAux___main___at_Lean_findAtSearchPath___spec__1(obj*, obj*, obj*); obj* l_Lean_getSearchPathFromEnv(obj*); namespace lean { obj* init_search_path_core(obj*, obj*); } extern uint32 l_System_FilePath_pathSeparator; extern obj* l_Lean_Name_toString___closed__1; +namespace lean { +obj* string_utf8_extract(obj*, obj*, obj*); +} obj* l_Lean_findLeanFile___closed__1; +namespace lean { +obj* string_utf8_byte_size(obj*); +} obj* l_Array_mfindAux___main___at_Lean_findFile___spec__2(obj*, obj*, obj*, obj*); -obj* l_Lean_findLean(obj*, obj*, obj*); +namespace lean { +obj* find_lean_core(obj*, obj*); +} obj* l_Lean_addRel(obj*, obj*); obj* l_Lean_mkSearchPathRef(obj*); obj* l_Lean_getBuiltinSearchPath___closed__3; obj* l_Lean_getBuiltinSearchPath(obj*); extern obj* l_String_splitAux___main___closed__1; obj* l_IO_realPath___at_Lean_mkSearchPathRef___spec__1(obj*, obj*); +obj* l_Array_mfindAux___main___at_Lean_findAtSearchPath___spec__1___boxed(obj*, obj*, obj*); +namespace lean { +obj* string_length(obj*); +} obj* _init_l___private_init_lean_path_1__pathSep___closed__1() { _start: { @@ -1778,7 +1814,6 @@ obj* x_13; obj* x_14; obj* x_15; obj* x_16; obj* x_17; x_13 = lean::array_fget(x_2, x_3); x_14 = l___private_init_lean_path_1__pathSep; x_15 = lean::string_append(x_13, x_14); -lean::inc(x_15); x_16 = lean::string_append(x_15, x_1); x_17 = lean_io_file_exists(x_16, x_4); if (lean::obj_tag(x_17) == 0) @@ -1792,7 +1827,6 @@ if (x_19 == 0) { uint8 x_20; lean::dec(x_16); -lean::dec(x_15); x_20 = !lean::is_exclusive(x_17); if (x_20 == 0) { @@ -1833,58 +1867,51 @@ lean::dec(x_3); x_32 = !lean::is_exclusive(x_17); if (x_32 == 0) { -obj* x_33; obj* x_34; obj* x_35; +obj* x_33; obj* x_34; x_33 = lean::cnstr_get(x_17, 0); lean::dec(x_33); -x_34 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_34, 0, x_15); -lean::cnstr_set(x_34, 1, x_16); -x_35 = lean::alloc_cnstr(1, 1, 0); -lean::cnstr_set(x_35, 0, x_34); -lean::cnstr_set(x_17, 0, x_35); +x_34 = lean::alloc_cnstr(1, 1, 0); +lean::cnstr_set(x_34, 0, x_16); +lean::cnstr_set(x_17, 0, x_34); return x_17; } else { -obj* x_36; obj* x_37; obj* x_38; obj* x_39; -x_36 = lean::cnstr_get(x_17, 1); -lean::inc(x_36); +obj* x_35; obj* x_36; obj* x_37; +x_35 = lean::cnstr_get(x_17, 1); +lean::inc(x_35); lean::dec(x_17); +x_36 = lean::alloc_cnstr(1, 1, 0); +lean::cnstr_set(x_36, 0, x_16); x_37 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_37, 0, x_15); -lean::cnstr_set(x_37, 1, x_16); -x_38 = lean::alloc_cnstr(1, 1, 0); -lean::cnstr_set(x_38, 0, x_37); -x_39 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_39, 0, x_38); -lean::cnstr_set(x_39, 1, x_36); -return x_39; +lean::cnstr_set(x_37, 0, x_36); +lean::cnstr_set(x_37, 1, x_35); +return x_37; } } } else { -uint8 x_40; +uint8 x_38; lean::dec(x_16); -lean::dec(x_15); lean::dec(x_3); -x_40 = !lean::is_exclusive(x_17); -if (x_40 == 0) +x_38 = !lean::is_exclusive(x_17); +if (x_38 == 0) { return x_17; } else { -obj* x_41; obj* x_42; obj* x_43; -x_41 = lean::cnstr_get(x_17, 0); -x_42 = lean::cnstr_get(x_17, 1); -lean::inc(x_42); -lean::inc(x_41); +obj* x_39; obj* x_40; obj* x_41; +x_39 = lean::cnstr_get(x_17, 0); +x_40 = lean::cnstr_get(x_17, 1); +lean::inc(x_40); +lean::inc(x_39); lean::dec(x_17); -x_43 = lean::alloc_cnstr(1, 2, 0); -lean::cnstr_set(x_43, 0, x_41); -lean::cnstr_set(x_43, 1, x_42); -return x_43; +x_41 = lean::alloc_cnstr(1, 2, 0); +lean::cnstr_set(x_41, 0, x_39); +lean::cnstr_set(x_41, 1, x_40); +return x_41; } } } @@ -2129,732 +2156,128 @@ x_1 = lean::mk_string("' not found"); return x_1; } } -obj* l_Lean_findLeanFile(obj* x_1, obj* x_2, obj* x_3, obj* x_4) { +obj* l_Lean_findLeanFile(obj* x_1, obj* x_2, obj* x_3) { _start: { -obj* x_5; obj* x_6; obj* x_7; obj* x_8; -x_5 = l_Lean_modNameToFileName___main(x_2); -x_6 = l_Lean_findLeanFile___closed__1; -x_7 = lean::string_append(x_5, x_6); -x_8 = lean::string_append(x_7, x_3); -if (lean::obj_tag(x_1) == 0) +obj* x_4; obj* x_5; obj* x_6; obj* x_7; obj* x_8; +x_4 = l_Lean_modNameToFileName___main(x_1); +x_5 = l_Lean_findLeanFile___closed__1; +x_6 = lean::string_append(x_4, x_5); +x_7 = lean::string_append(x_6, x_2); +x_8 = l_Lean_findFile(x_7, x_3); +lean::dec(x_7); +if (lean::obj_tag(x_8) == 0) { obj* x_9; -x_9 = l_Lean_findFile(x_8, x_4); -lean::dec(x_8); +x_9 = lean::cnstr_get(x_8, 0); +lean::inc(x_9); if (lean::obj_tag(x_9) == 0) { -obj* x_10; -x_10 = lean::cnstr_get(x_9, 0); -lean::inc(x_10); -if (lean::obj_tag(x_10) == 0) +uint8 x_10; +x_10 = !lean::is_exclusive(x_8); +if (x_10 == 0) { -uint8 x_11; -x_11 = !lean::is_exclusive(x_9); -if (x_11 == 0) -{ -obj* x_12; obj* x_13; obj* x_14; obj* x_15; obj* x_16; obj* x_17; obj* x_18; -x_12 = lean::cnstr_get(x_9, 0); -lean::dec(x_12); -x_13 = l_Lean_Name_toString___closed__1; -x_14 = l_Lean_Name_toStringWithSep___main(x_13, x_2); -x_15 = l_Lean_findLeanFile___closed__2; -x_16 = lean::string_append(x_15, x_14); -lean::dec(x_14); -x_17 = l_Lean_findLeanFile___closed__3; -x_18 = lean::string_append(x_16, x_17); -lean::cnstr_set_tag(x_9, 1); -lean::cnstr_set(x_9, 0, x_18); -return x_9; +obj* x_11; obj* x_12; obj* x_13; obj* x_14; obj* x_15; obj* x_16; obj* x_17; +x_11 = lean::cnstr_get(x_8, 0); +lean::dec(x_11); +x_12 = l_Lean_Name_toString___closed__1; +x_13 = l_Lean_Name_toStringWithSep___main(x_12, x_1); +x_14 = l_Lean_findLeanFile___closed__2; +x_15 = lean::string_append(x_14, x_13); +lean::dec(x_13); +x_16 = l_Lean_findLeanFile___closed__3; +x_17 = lean::string_append(x_15, x_16); +lean::cnstr_set_tag(x_8, 1); +lean::cnstr_set(x_8, 0, x_17); +return x_8; } else { -obj* x_19; obj* x_20; obj* x_21; obj* x_22; obj* x_23; obj* x_24; obj* x_25; obj* x_26; -x_19 = lean::cnstr_get(x_9, 1); -lean::inc(x_19); -lean::dec(x_9); -x_20 = l_Lean_Name_toString___closed__1; -x_21 = l_Lean_Name_toStringWithSep___main(x_20, x_2); -x_22 = l_Lean_findLeanFile___closed__2; -x_23 = lean::string_append(x_22, x_21); -lean::dec(x_21); -x_24 = l_Lean_findLeanFile___closed__3; -x_25 = lean::string_append(x_23, x_24); -x_26 = lean::alloc_cnstr(1, 2, 0); -lean::cnstr_set(x_26, 0, x_25); -lean::cnstr_set(x_26, 1, x_19); -return x_26; +obj* x_18; obj* x_19; obj* x_20; obj* x_21; obj* x_22; obj* x_23; obj* x_24; obj* x_25; +x_18 = lean::cnstr_get(x_8, 1); +lean::inc(x_18); +lean::dec(x_8); +x_19 = l_Lean_Name_toString___closed__1; +x_20 = l_Lean_Name_toStringWithSep___main(x_19, x_1); +x_21 = l_Lean_findLeanFile___closed__2; +x_22 = lean::string_append(x_21, x_20); +lean::dec(x_20); +x_23 = l_Lean_findLeanFile___closed__3; +x_24 = lean::string_append(x_22, x_23); +x_25 = lean::alloc_cnstr(1, 2, 0); +lean::cnstr_set(x_25, 0, x_24); +lean::cnstr_set(x_25, 1, x_18); +return x_25; } } else { -uint8 x_27; -lean::dec(x_2); -x_27 = !lean::is_exclusive(x_9); -if (x_27 == 0) +uint8 x_26; +lean::dec(x_1); +x_26 = !lean::is_exclusive(x_8); +if (x_26 == 0) { -obj* x_28; obj* x_29; obj* x_30; uint8 x_31; +obj* x_27; obj* x_28; obj* x_29; obj* x_30; +x_27 = lean::cnstr_get(x_8, 0); +lean::dec(x_27); x_28 = lean::cnstr_get(x_9, 0); -lean::dec(x_28); -x_29 = lean::cnstr_get(x_10, 0); -lean::inc(x_29); -lean::dec(x_10); -x_30 = lean::box(0); -lean::cnstr_set(x_9, 0, x_30); -x_31 = !lean::is_exclusive(x_29); -if (x_31 == 0) +lean::inc(x_28); +lean::dec(x_9); +x_29 = lean::box(0); +lean::cnstr_set(x_8, 0, x_29); +x_30 = lean_io_realpath(x_28, x_8); +return x_30; +} +else { -obj* x_32; obj* x_33; obj* x_34; -x_32 = lean::cnstr_get(x_29, 0); -x_33 = lean::cnstr_get(x_29, 1); -x_34 = lean_io_realpath(x_33, x_9); -if (lean::obj_tag(x_34) == 0) +obj* x_31; obj* x_32; obj* x_33; obj* x_34; obj* x_35; +x_31 = lean::cnstr_get(x_8, 1); +lean::inc(x_31); +lean::dec(x_8); +x_32 = lean::cnstr_get(x_9, 0); +lean::inc(x_32); +lean::dec(x_9); +x_33 = lean::box(0); +x_34 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_34, 0, x_33); +lean::cnstr_set(x_34, 1, x_31); +x_35 = lean_io_realpath(x_32, x_34); +return x_35; +} +} +} +else { -uint8 x_35; -x_35 = !lean::is_exclusive(x_34); -if (x_35 == 0) +uint8 x_36; +lean::dec(x_1); +x_36 = !lean::is_exclusive(x_8); +if (x_36 == 0) { -obj* x_36; -x_36 = lean::cnstr_get(x_34, 0); -lean::cnstr_set(x_29, 1, x_36); -lean::cnstr_set(x_34, 0, x_29); -return x_34; +return x_8; } else { obj* x_37; obj* x_38; obj* x_39; -x_37 = lean::cnstr_get(x_34, 0); -x_38 = lean::cnstr_get(x_34, 1); +x_37 = lean::cnstr_get(x_8, 0); +x_38 = lean::cnstr_get(x_8, 1); lean::inc(x_38); lean::inc(x_37); -lean::dec(x_34); -lean::cnstr_set(x_29, 1, x_37); -x_39 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_39, 0, x_29); +lean::dec(x_8); +x_39 = lean::alloc_cnstr(1, 2, 0); +lean::cnstr_set(x_39, 0, x_37); lean::cnstr_set(x_39, 1, x_38); return x_39; } } -else -{ -uint8 x_40; -lean::free_heap_obj(x_29); -lean::dec(x_32); -x_40 = !lean::is_exclusive(x_34); -if (x_40 == 0) -{ -return x_34; } -else -{ -obj* x_41; obj* x_42; obj* x_43; -x_41 = lean::cnstr_get(x_34, 0); -x_42 = lean::cnstr_get(x_34, 1); -lean::inc(x_42); -lean::inc(x_41); -lean::dec(x_34); -x_43 = lean::alloc_cnstr(1, 2, 0); -lean::cnstr_set(x_43, 0, x_41); -lean::cnstr_set(x_43, 1, x_42); -return x_43; } -} -} -else -{ -obj* x_44; obj* x_45; obj* x_46; -x_44 = lean::cnstr_get(x_29, 0); -x_45 = lean::cnstr_get(x_29, 1); -lean::inc(x_45); -lean::inc(x_44); -lean::dec(x_29); -x_46 = lean_io_realpath(x_45, x_9); -if (lean::obj_tag(x_46) == 0) -{ -obj* x_47; obj* x_48; obj* x_49; obj* x_50; obj* x_51; -x_47 = lean::cnstr_get(x_46, 0); -lean::inc(x_47); -x_48 = lean::cnstr_get(x_46, 1); -lean::inc(x_48); -if (lean::is_exclusive(x_46)) { - lean::cnstr_release(x_46, 0); - lean::cnstr_release(x_46, 1); - x_49 = x_46; -} else { - lean::dec_ref(x_46); - x_49 = lean::box(0); -} -x_50 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_50, 0, x_44); -lean::cnstr_set(x_50, 1, x_47); -if (lean::is_scalar(x_49)) { - x_51 = lean::alloc_cnstr(0, 2, 0); -} else { - x_51 = x_49; -} -lean::cnstr_set(x_51, 0, x_50); -lean::cnstr_set(x_51, 1, x_48); -return x_51; -} -else -{ -obj* x_52; obj* x_53; obj* x_54; obj* x_55; -lean::dec(x_44); -x_52 = lean::cnstr_get(x_46, 0); -lean::inc(x_52); -x_53 = lean::cnstr_get(x_46, 1); -lean::inc(x_53); -if (lean::is_exclusive(x_46)) { - lean::cnstr_release(x_46, 0); - lean::cnstr_release(x_46, 1); - x_54 = x_46; -} else { - lean::dec_ref(x_46); - x_54 = lean::box(0); -} -if (lean::is_scalar(x_54)) { - x_55 = lean::alloc_cnstr(1, 2, 0); -} else { - x_55 = x_54; -} -lean::cnstr_set(x_55, 0, x_52); -lean::cnstr_set(x_55, 1, x_53); -return x_55; -} -} -} -else -{ -obj* x_56; obj* x_57; obj* x_58; obj* x_59; obj* x_60; obj* x_61; obj* x_62; obj* x_63; -x_56 = lean::cnstr_get(x_9, 1); -lean::inc(x_56); -lean::dec(x_9); -x_57 = lean::cnstr_get(x_10, 0); -lean::inc(x_57); -lean::dec(x_10); -x_58 = lean::box(0); -x_59 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_59, 0, x_58); -lean::cnstr_set(x_59, 1, x_56); -x_60 = lean::cnstr_get(x_57, 0); -lean::inc(x_60); -x_61 = lean::cnstr_get(x_57, 1); -lean::inc(x_61); -if (lean::is_exclusive(x_57)) { - lean::cnstr_release(x_57, 0); - lean::cnstr_release(x_57, 1); - x_62 = x_57; -} else { - lean::dec_ref(x_57); - x_62 = lean::box(0); -} -x_63 = lean_io_realpath(x_61, x_59); -if (lean::obj_tag(x_63) == 0) -{ -obj* x_64; obj* x_65; obj* x_66; obj* x_67; obj* x_68; -x_64 = lean::cnstr_get(x_63, 0); -lean::inc(x_64); -x_65 = lean::cnstr_get(x_63, 1); -lean::inc(x_65); -if (lean::is_exclusive(x_63)) { - lean::cnstr_release(x_63, 0); - lean::cnstr_release(x_63, 1); - x_66 = x_63; -} else { - lean::dec_ref(x_63); - x_66 = lean::box(0); -} -if (lean::is_scalar(x_62)) { - x_67 = lean::alloc_cnstr(0, 2, 0); -} else { - x_67 = x_62; -} -lean::cnstr_set(x_67, 0, x_60); -lean::cnstr_set(x_67, 1, x_64); -if (lean::is_scalar(x_66)) { - x_68 = lean::alloc_cnstr(0, 2, 0); -} else { - x_68 = x_66; -} -lean::cnstr_set(x_68, 0, x_67); -lean::cnstr_set(x_68, 1, x_65); -return x_68; -} -else -{ -obj* x_69; obj* x_70; obj* x_71; obj* x_72; -lean::dec(x_62); -lean::dec(x_60); -x_69 = lean::cnstr_get(x_63, 0); -lean::inc(x_69); -x_70 = lean::cnstr_get(x_63, 1); -lean::inc(x_70); -if (lean::is_exclusive(x_63)) { - lean::cnstr_release(x_63, 0); - lean::cnstr_release(x_63, 1); - x_71 = x_63; -} else { - lean::dec_ref(x_63); - x_71 = lean::box(0); -} -if (lean::is_scalar(x_71)) { - x_72 = lean::alloc_cnstr(1, 2, 0); -} else { - x_72 = x_71; -} -lean::cnstr_set(x_72, 0, x_69); -lean::cnstr_set(x_72, 1, x_70); -return x_72; -} -} -} -} -else -{ -uint8 x_73; -lean::dec(x_2); -x_73 = !lean::is_exclusive(x_9); -if (x_73 == 0) -{ -return x_9; -} -else -{ -obj* x_74; obj* x_75; obj* x_76; -x_74 = lean::cnstr_get(x_9, 0); -x_75 = lean::cnstr_get(x_9, 1); -lean::inc(x_75); -lean::inc(x_74); -lean::dec(x_9); -x_76 = lean::alloc_cnstr(1, 2, 0); -lean::cnstr_set(x_76, 0, x_74); -lean::cnstr_set(x_76, 1, x_75); -return x_76; -} -} -} -else -{ -obj* x_77; obj* x_78; obj* x_79; -x_77 = lean::cnstr_get(x_1, 0); -x_78 = l_Lean_Name_toString___closed__1; -x_79 = lean_io_realpath(x_78, x_4); -if (lean::obj_tag(x_79) == 0) -{ -uint8 x_80; -x_80 = !lean::is_exclusive(x_79); -if (x_80 == 0) -{ -obj* x_81; obj* x_82; obj* x_83; obj* x_84; obj* x_85; obj* x_86; obj* x_87; -x_81 = lean::cnstr_get(x_79, 0); -x_82 = lean::box(0); -lean::cnstr_set(x_79, 0, x_82); -x_83 = l_Lean_addRel___main(x_81, x_77); -x_84 = l___private_init_lean_path_1__pathSep; -x_85 = lean::string_append(x_83, x_84); -x_86 = lean::string_append(x_85, x_8); -lean::dec(x_8); -x_87 = lean_io_file_exists(x_86, x_79); -if (lean::obj_tag(x_87) == 0) -{ -obj* x_88; uint8 x_89; -x_88 = lean::cnstr_get(x_87, 0); -lean::inc(x_88); -x_89 = lean::unbox(x_88); -lean::dec(x_88); -if (x_89 == 0) -{ -uint8 x_90; -lean::dec(x_86); -lean::dec(x_81); -x_90 = !lean::is_exclusive(x_87); -if (x_90 == 0) -{ -obj* x_91; obj* x_92; obj* x_93; obj* x_94; obj* x_95; obj* x_96; -x_91 = lean::cnstr_get(x_87, 0); -lean::dec(x_91); -x_92 = l_Lean_Name_toStringWithSep___main(x_78, x_2); -x_93 = l_Lean_findLeanFile___closed__2; -x_94 = lean::string_append(x_93, x_92); -lean::dec(x_92); -x_95 = l_Lean_findLeanFile___closed__3; -x_96 = lean::string_append(x_94, x_95); -lean::cnstr_set_tag(x_87, 1); -lean::cnstr_set(x_87, 0, x_96); -return x_87; -} -else -{ -obj* x_97; obj* x_98; obj* x_99; obj* x_100; obj* x_101; obj* x_102; obj* x_103; -x_97 = lean::cnstr_get(x_87, 1); -lean::inc(x_97); -lean::dec(x_87); -x_98 = l_Lean_Name_toStringWithSep___main(x_78, x_2); -x_99 = l_Lean_findLeanFile___closed__2; -x_100 = lean::string_append(x_99, x_98); -lean::dec(x_98); -x_101 = l_Lean_findLeanFile___closed__3; -x_102 = lean::string_append(x_100, x_101); -x_103 = lean::alloc_cnstr(1, 2, 0); -lean::cnstr_set(x_103, 0, x_102); -lean::cnstr_set(x_103, 1, x_97); -return x_103; -} -} -else -{ -uint8 x_104; -lean::dec(x_2); -x_104 = !lean::is_exclusive(x_87); -if (x_104 == 0) -{ -obj* x_105; obj* x_106; -x_105 = lean::cnstr_get(x_87, 0); -lean::dec(x_105); -lean::cnstr_set(x_87, 0, x_82); -x_106 = lean_io_realpath(x_86, x_87); -if (lean::obj_tag(x_106) == 0) -{ -uint8 x_107; -x_107 = !lean::is_exclusive(x_106); -if (x_107 == 0) -{ -obj* x_108; obj* x_109; -x_108 = lean::cnstr_get(x_106, 0); -x_109 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_109, 0, x_81); -lean::cnstr_set(x_109, 1, x_108); -lean::cnstr_set(x_106, 0, x_109); -return x_106; -} -else -{ -obj* x_110; obj* x_111; obj* x_112; obj* x_113; -x_110 = lean::cnstr_get(x_106, 0); -x_111 = lean::cnstr_get(x_106, 1); -lean::inc(x_111); -lean::inc(x_110); -lean::dec(x_106); -x_112 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_112, 0, x_81); -lean::cnstr_set(x_112, 1, x_110); -x_113 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_113, 0, x_112); -lean::cnstr_set(x_113, 1, x_111); -return x_113; -} -} -else -{ -uint8 x_114; -lean::dec(x_81); -x_114 = !lean::is_exclusive(x_106); -if (x_114 == 0) -{ -return x_106; -} -else -{ -obj* x_115; obj* x_116; obj* x_117; -x_115 = lean::cnstr_get(x_106, 0); -x_116 = lean::cnstr_get(x_106, 1); -lean::inc(x_116); -lean::inc(x_115); -lean::dec(x_106); -x_117 = lean::alloc_cnstr(1, 2, 0); -lean::cnstr_set(x_117, 0, x_115); -lean::cnstr_set(x_117, 1, x_116); -return x_117; -} -} -} -else -{ -obj* x_118; obj* x_119; obj* x_120; -x_118 = lean::cnstr_get(x_87, 1); -lean::inc(x_118); -lean::dec(x_87); -x_119 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_119, 0, x_82); -lean::cnstr_set(x_119, 1, x_118); -x_120 = lean_io_realpath(x_86, x_119); -if (lean::obj_tag(x_120) == 0) -{ -obj* x_121; obj* x_122; obj* x_123; obj* x_124; obj* x_125; -x_121 = lean::cnstr_get(x_120, 0); -lean::inc(x_121); -x_122 = lean::cnstr_get(x_120, 1); -lean::inc(x_122); -if (lean::is_exclusive(x_120)) { - lean::cnstr_release(x_120, 0); - lean::cnstr_release(x_120, 1); - x_123 = x_120; -} else { - lean::dec_ref(x_120); - x_123 = lean::box(0); -} -x_124 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_124, 0, x_81); -lean::cnstr_set(x_124, 1, x_121); -if (lean::is_scalar(x_123)) { - x_125 = lean::alloc_cnstr(0, 2, 0); -} else { - x_125 = x_123; -} -lean::cnstr_set(x_125, 0, x_124); -lean::cnstr_set(x_125, 1, x_122); -return x_125; -} -else -{ -obj* x_126; obj* x_127; obj* x_128; obj* x_129; -lean::dec(x_81); -x_126 = lean::cnstr_get(x_120, 0); -lean::inc(x_126); -x_127 = lean::cnstr_get(x_120, 1); -lean::inc(x_127); -if (lean::is_exclusive(x_120)) { - lean::cnstr_release(x_120, 0); - lean::cnstr_release(x_120, 1); - x_128 = x_120; -} else { - lean::dec_ref(x_120); - x_128 = lean::box(0); -} -if (lean::is_scalar(x_128)) { - x_129 = lean::alloc_cnstr(1, 2, 0); -} else { - x_129 = x_128; -} -lean::cnstr_set(x_129, 0, x_126); -lean::cnstr_set(x_129, 1, x_127); -return x_129; -} -} -} -} -else -{ -uint8 x_130; -lean::dec(x_86); -lean::dec(x_81); -lean::dec(x_2); -x_130 = !lean::is_exclusive(x_87); -if (x_130 == 0) -{ -return x_87; -} -else -{ -obj* x_131; obj* x_132; obj* x_133; -x_131 = lean::cnstr_get(x_87, 0); -x_132 = lean::cnstr_get(x_87, 1); -lean::inc(x_132); -lean::inc(x_131); -lean::dec(x_87); -x_133 = lean::alloc_cnstr(1, 2, 0); -lean::cnstr_set(x_133, 0, x_131); -lean::cnstr_set(x_133, 1, x_132); -return x_133; -} -} -} -else -{ -obj* x_134; obj* x_135; obj* x_136; obj* x_137; obj* x_138; obj* x_139; obj* x_140; obj* x_141; obj* x_142; -x_134 = lean::cnstr_get(x_79, 0); -x_135 = lean::cnstr_get(x_79, 1); -lean::inc(x_135); -lean::inc(x_134); -lean::dec(x_79); -x_136 = lean::box(0); -x_137 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_137, 0, x_136); -lean::cnstr_set(x_137, 1, x_135); -x_138 = l_Lean_addRel___main(x_134, x_77); -x_139 = l___private_init_lean_path_1__pathSep; -x_140 = lean::string_append(x_138, x_139); -x_141 = lean::string_append(x_140, x_8); -lean::dec(x_8); -x_142 = lean_io_file_exists(x_141, x_137); -if (lean::obj_tag(x_142) == 0) -{ -obj* x_143; uint8 x_144; -x_143 = lean::cnstr_get(x_142, 0); -lean::inc(x_143); -x_144 = lean::unbox(x_143); -lean::dec(x_143); -if (x_144 == 0) -{ -obj* x_145; obj* x_146; obj* x_147; obj* x_148; obj* x_149; obj* x_150; obj* x_151; obj* x_152; -lean::dec(x_141); -lean::dec(x_134); -x_145 = lean::cnstr_get(x_142, 1); -lean::inc(x_145); -if (lean::is_exclusive(x_142)) { - lean::cnstr_release(x_142, 0); - lean::cnstr_release(x_142, 1); - x_146 = x_142; -} else { - lean::dec_ref(x_142); - x_146 = lean::box(0); -} -x_147 = l_Lean_Name_toStringWithSep___main(x_78, x_2); -x_148 = l_Lean_findLeanFile___closed__2; -x_149 = lean::string_append(x_148, x_147); -lean::dec(x_147); -x_150 = l_Lean_findLeanFile___closed__3; -x_151 = lean::string_append(x_149, x_150); -if (lean::is_scalar(x_146)) { - x_152 = lean::alloc_cnstr(1, 2, 0); -} else { - x_152 = x_146; - lean::cnstr_set_tag(x_152, 1); -} -lean::cnstr_set(x_152, 0, x_151); -lean::cnstr_set(x_152, 1, x_145); -return x_152; -} -else -{ -obj* x_153; obj* x_154; obj* x_155; obj* x_156; -lean::dec(x_2); -x_153 = lean::cnstr_get(x_142, 1); -lean::inc(x_153); -if (lean::is_exclusive(x_142)) { - lean::cnstr_release(x_142, 0); - lean::cnstr_release(x_142, 1); - x_154 = x_142; -} else { - lean::dec_ref(x_142); - x_154 = lean::box(0); -} -if (lean::is_scalar(x_154)) { - x_155 = lean::alloc_cnstr(0, 2, 0); -} else { - x_155 = x_154; -} -lean::cnstr_set(x_155, 0, x_136); -lean::cnstr_set(x_155, 1, x_153); -x_156 = lean_io_realpath(x_141, x_155); -if (lean::obj_tag(x_156) == 0) -{ -obj* x_157; obj* x_158; obj* x_159; obj* x_160; obj* x_161; -x_157 = lean::cnstr_get(x_156, 0); -lean::inc(x_157); -x_158 = lean::cnstr_get(x_156, 1); -lean::inc(x_158); -if (lean::is_exclusive(x_156)) { - lean::cnstr_release(x_156, 0); - lean::cnstr_release(x_156, 1); - x_159 = x_156; -} else { - lean::dec_ref(x_156); - x_159 = lean::box(0); -} -x_160 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_160, 0, x_134); -lean::cnstr_set(x_160, 1, x_157); -if (lean::is_scalar(x_159)) { - x_161 = lean::alloc_cnstr(0, 2, 0); -} else { - x_161 = x_159; -} -lean::cnstr_set(x_161, 0, x_160); -lean::cnstr_set(x_161, 1, x_158); -return x_161; -} -else -{ -obj* x_162; obj* x_163; obj* x_164; obj* x_165; -lean::dec(x_134); -x_162 = lean::cnstr_get(x_156, 0); -lean::inc(x_162); -x_163 = lean::cnstr_get(x_156, 1); -lean::inc(x_163); -if (lean::is_exclusive(x_156)) { - lean::cnstr_release(x_156, 0); - lean::cnstr_release(x_156, 1); - x_164 = x_156; -} else { - lean::dec_ref(x_156); - x_164 = lean::box(0); -} -if (lean::is_scalar(x_164)) { - x_165 = lean::alloc_cnstr(1, 2, 0); -} else { - x_165 = x_164; -} -lean::cnstr_set(x_165, 0, x_162); -lean::cnstr_set(x_165, 1, x_163); -return x_165; -} -} -} -else -{ -obj* x_166; obj* x_167; obj* x_168; obj* x_169; -lean::dec(x_141); -lean::dec(x_134); -lean::dec(x_2); -x_166 = lean::cnstr_get(x_142, 0); -lean::inc(x_166); -x_167 = lean::cnstr_get(x_142, 1); -lean::inc(x_167); -if (lean::is_exclusive(x_142)) { - lean::cnstr_release(x_142, 0); - lean::cnstr_release(x_142, 1); - x_168 = x_142; -} else { - lean::dec_ref(x_142); - x_168 = lean::box(0); -} -if (lean::is_scalar(x_168)) { - x_169 = lean::alloc_cnstr(1, 2, 0); -} else { - x_169 = x_168; -} -lean::cnstr_set(x_169, 0, x_166); -lean::cnstr_set(x_169, 1, x_167); -return x_169; -} -} -} -else -{ -uint8 x_170; -lean::dec(x_8); -lean::dec(x_2); -x_170 = !lean::is_exclusive(x_79); -if (x_170 == 0) -{ -return x_79; -} -else -{ -obj* x_171; obj* x_172; obj* x_173; -x_171 = lean::cnstr_get(x_79, 0); -x_172 = lean::cnstr_get(x_79, 1); -lean::inc(x_172); -lean::inc(x_171); -lean::dec(x_79); -x_173 = lean::alloc_cnstr(1, 2, 0); -lean::cnstr_set(x_173, 0, x_171); -lean::cnstr_set(x_173, 1, x_172); -return x_173; -} -} -} -} -} -obj* l_Lean_findLeanFile___boxed(obj* x_1, obj* x_2, obj* x_3, obj* x_4) { +obj* l_Lean_findLeanFile___boxed(obj* x_1, obj* x_2, obj* x_3) { _start: { -obj* x_5; -x_5 = l_Lean_findLeanFile(x_1, x_2, x_3, x_4); -lean::dec(x_3); -lean::dec(x_1); -return x_5; +obj* x_4; +x_4 = l_Lean_findLeanFile(x_1, x_2, x_3); +lean::dec(x_2); +return x_4; } } obj* _init_l_Lean_findOLean___closed__1() { @@ -2868,135 +2291,920 @@ return x_1; obj* l_Lean_findOLean(obj* x_1, obj* x_2) { _start: { -obj* x_3; obj* x_4; obj* x_5; -x_3 = lean::box(0); -x_4 = l_Lean_findOLean___closed__1; -x_5 = l_Lean_findLeanFile(x_3, x_1, x_4, x_2); -if (lean::obj_tag(x_5) == 0) -{ -uint8 x_6; -x_6 = !lean::is_exclusive(x_5); -if (x_6 == 0) -{ -obj* x_7; obj* x_8; -x_7 = lean::cnstr_get(x_5, 0); -x_8 = lean::cnstr_get(x_7, 1); -lean::inc(x_8); -lean::dec(x_7); -lean::cnstr_set(x_5, 0, x_8); -return x_5; -} -else -{ -obj* x_9; obj* x_10; obj* x_11; obj* x_12; -x_9 = lean::cnstr_get(x_5, 0); -x_10 = lean::cnstr_get(x_5, 1); -lean::inc(x_10); -lean::inc(x_9); -lean::dec(x_5); -x_11 = lean::cnstr_get(x_9, 1); -lean::inc(x_11); -lean::dec(x_9); -x_12 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_12, 0, x_11); -lean::cnstr_set(x_12, 1, x_10); -return x_12; +obj* x_3; obj* x_4; +x_3 = l_Lean_findOLean___closed__1; +x_4 = l_Lean_findLeanFile(x_1, x_3, x_2); +return x_4; } } -else -{ -uint8 x_13; -x_13 = !lean::is_exclusive(x_5); -if (x_13 == 0) -{ -return x_5; -} -else -{ -obj* x_14; obj* x_15; obj* x_16; -x_14 = lean::cnstr_get(x_5, 0); -x_15 = lean::cnstr_get(x_5, 1); -lean::inc(x_15); -lean::inc(x_14); -lean::dec(x_5); -x_16 = lean::alloc_cnstr(1, 2, 0); -lean::cnstr_set(x_16, 0, x_14); -lean::cnstr_set(x_16, 1, x_15); -return x_16; -} -} -} -} -obj* l_Lean_findLean(obj* x_1, obj* x_2, obj* x_3) { +namespace lean { +obj* find_lean_core(obj* x_1, obj* x_2) { _start: { -obj* x_4; obj* x_5; -x_4 = l_Lean_getBuiltinSearchPath___closed__4; -x_5 = l_Lean_findLeanFile(x_1, x_2, x_4, x_3); -if (lean::obj_tag(x_5) == 0) +obj* x_3; obj* x_4; +x_3 = l_Lean_getBuiltinSearchPath___closed__4; +x_4 = l_Lean_findLeanFile(x_1, x_3, x_2); +return x_4; +} +} +} +obj* l_Array_mfindAux___main___at_Lean_findAtSearchPath___spec__1(obj* x_1, obj* x_2, obj* x_3) { +_start: { -uint8 x_6; -x_6 = !lean::is_exclusive(x_5); -if (x_6 == 0) +obj* x_4; uint8 x_5; +x_4 = lean::array_get_size(x_2); +x_5 = lean::nat_dec_lt(x_3, x_4); +lean::dec(x_4); +if (x_5 == 0) { -obj* x_7; obj* x_8; -x_7 = lean::cnstr_get(x_5, 0); -x_8 = lean::cnstr_get(x_7, 1); -lean::inc(x_8); -lean::dec(x_7); -lean::cnstr_set(x_5, 0, x_8); -return x_5; +obj* x_6; +lean::dec(x_3); +x_6 = lean::box(0); +return x_6; } else { -obj* x_9; obj* x_10; obj* x_11; obj* x_12; -x_9 = lean::cnstr_get(x_5, 0); -x_10 = lean::cnstr_get(x_5, 1); -lean::inc(x_10); -lean::inc(x_9); -lean::dec(x_5); -x_11 = lean::cnstr_get(x_9, 1); -lean::inc(x_11); -lean::dec(x_9); -x_12 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_12, 0, x_11); -lean::cnstr_set(x_12, 1, x_10); +obj* x_7; uint8 x_8; +x_7 = lean::array_fget(x_2, x_3); +x_8 = l_String_isPrefixOf(x_7, x_1); +if (x_8 == 0) +{ +obj* x_9; obj* x_10; +lean::dec(x_7); +x_9 = lean::mk_nat_obj(1u); +x_10 = lean::nat_add(x_3, x_9); +lean::dec(x_3); +x_3 = x_10; +goto _start; +} +else +{ +obj* x_12; +lean::dec(x_3); +x_12 = lean::alloc_cnstr(1, 1, 0); +lean::cnstr_set(x_12, 0, x_7); return x_12; } } -else -{ -uint8 x_13; -x_13 = !lean::is_exclusive(x_5); -if (x_13 == 0) -{ -return x_5; } -else +} +obj* _init_l_Lean_findAtSearchPath___closed__1() { +_start: { -obj* x_14; obj* x_15; obj* x_16; -x_14 = lean::cnstr_get(x_5, 0); -x_15 = lean::cnstr_get(x_5, 1); -lean::inc(x_15); -lean::inc(x_14); +obj* x_1; +x_1 = lean::mk_string("file '"); +return x_1; +} +} +obj* _init_l_Lean_findAtSearchPath___closed__2() { +_start: +{ +obj* x_1; +x_1 = lean::mk_string("' not in the search path"); +return x_1; +} +} +obj* l_Lean_findAtSearchPath(obj* x_1, obj* x_2) { +_start: +{ +obj* x_3; +x_3 = lean_io_realpath(x_1, x_2); +if (lean::obj_tag(x_3) == 0) +{ +uint8 x_4; +x_4 = !lean::is_exclusive(x_3); +if (x_4 == 0) +{ +obj* x_5; obj* x_6; obj* x_7; obj* x_8; +x_5 = lean::cnstr_get(x_3, 0); +x_6 = lean::box(0); +lean::cnstr_set(x_3, 0, x_6); +x_7 = l_Lean_searchPathRef; +x_8 = lean::io_ref_get(x_7, x_3); +if (lean::obj_tag(x_8) == 0) +{ +uint8 x_9; +x_9 = !lean::is_exclusive(x_8); +if (x_9 == 0) +{ +obj* x_10; obj* x_11; obj* x_12; +x_10 = lean::cnstr_get(x_8, 0); +x_11 = lean::mk_nat_obj(0u); +x_12 = l_Array_mfindAux___main___at_Lean_findAtSearchPath___spec__1(x_5, x_10, x_11); +lean::dec(x_10); +if (lean::obj_tag(x_12) == 0) +{ +obj* x_13; obj* x_14; obj* x_15; obj* x_16; +x_13 = l_Lean_findAtSearchPath___closed__1; +x_14 = lean::string_append(x_13, x_5); lean::dec(x_5); -x_16 = lean::alloc_cnstr(1, 2, 0); -lean::cnstr_set(x_16, 0, x_14); -lean::cnstr_set(x_16, 1, x_15); -return x_16; +x_15 = l_Lean_findAtSearchPath___closed__2; +x_16 = lean::string_append(x_14, x_15); +lean::cnstr_set_tag(x_8, 1); +lean::cnstr_set(x_8, 0, x_16); +return x_8; +} +else +{ +obj* x_17; +lean::dec(x_5); +x_17 = lean::cnstr_get(x_12, 0); +lean::inc(x_17); +lean::dec(x_12); +lean::cnstr_set(x_8, 0, x_17); +return x_8; +} +} +else +{ +obj* x_18; obj* x_19; obj* x_20; obj* x_21; +x_18 = lean::cnstr_get(x_8, 0); +x_19 = lean::cnstr_get(x_8, 1); +lean::inc(x_19); +lean::inc(x_18); +lean::dec(x_8); +x_20 = lean::mk_nat_obj(0u); +x_21 = l_Array_mfindAux___main___at_Lean_findAtSearchPath___spec__1(x_5, x_18, x_20); +lean::dec(x_18); +if (lean::obj_tag(x_21) == 0) +{ +obj* x_22; obj* x_23; obj* x_24; obj* x_25; obj* x_26; +x_22 = l_Lean_findAtSearchPath___closed__1; +x_23 = lean::string_append(x_22, x_5); +lean::dec(x_5); +x_24 = l_Lean_findAtSearchPath___closed__2; +x_25 = lean::string_append(x_23, x_24); +x_26 = lean::alloc_cnstr(1, 2, 0); +lean::cnstr_set(x_26, 0, x_25); +lean::cnstr_set(x_26, 1, x_19); +return x_26; +} +else +{ +obj* x_27; obj* x_28; +lean::dec(x_5); +x_27 = lean::cnstr_get(x_21, 0); +lean::inc(x_27); +lean::dec(x_21); +x_28 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_28, 0, x_27); +lean::cnstr_set(x_28, 1, x_19); +return x_28; +} +} +} +else +{ +uint8 x_29; +lean::dec(x_5); +x_29 = !lean::is_exclusive(x_8); +if (x_29 == 0) +{ +return x_8; +} +else +{ +obj* x_30; obj* x_31; obj* x_32; +x_30 = lean::cnstr_get(x_8, 0); +x_31 = lean::cnstr_get(x_8, 1); +lean::inc(x_31); +lean::inc(x_30); +lean::dec(x_8); +x_32 = lean::alloc_cnstr(1, 2, 0); +lean::cnstr_set(x_32, 0, x_30); +lean::cnstr_set(x_32, 1, x_31); +return x_32; +} +} +} +else +{ +obj* x_33; obj* x_34; obj* x_35; obj* x_36; obj* x_37; obj* x_38; +x_33 = lean::cnstr_get(x_3, 0); +x_34 = lean::cnstr_get(x_3, 1); +lean::inc(x_34); +lean::inc(x_33); +lean::dec(x_3); +x_35 = lean::box(0); +x_36 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_36, 0, x_35); +lean::cnstr_set(x_36, 1, x_34); +x_37 = l_Lean_searchPathRef; +x_38 = lean::io_ref_get(x_37, x_36); +if (lean::obj_tag(x_38) == 0) +{ +obj* x_39; obj* x_40; obj* x_41; obj* x_42; obj* x_43; +x_39 = lean::cnstr_get(x_38, 0); +lean::inc(x_39); +x_40 = lean::cnstr_get(x_38, 1); +lean::inc(x_40); +if (lean::is_exclusive(x_38)) { + lean::cnstr_release(x_38, 0); + lean::cnstr_release(x_38, 1); + x_41 = x_38; +} else { + lean::dec_ref(x_38); + x_41 = lean::box(0); +} +x_42 = lean::mk_nat_obj(0u); +x_43 = l_Array_mfindAux___main___at_Lean_findAtSearchPath___spec__1(x_33, x_39, x_42); +lean::dec(x_39); +if (lean::obj_tag(x_43) == 0) +{ +obj* x_44; obj* x_45; obj* x_46; obj* x_47; obj* x_48; +x_44 = l_Lean_findAtSearchPath___closed__1; +x_45 = lean::string_append(x_44, x_33); +lean::dec(x_33); +x_46 = l_Lean_findAtSearchPath___closed__2; +x_47 = lean::string_append(x_45, x_46); +if (lean::is_scalar(x_41)) { + x_48 = lean::alloc_cnstr(1, 2, 0); +} else { + x_48 = x_41; + lean::cnstr_set_tag(x_48, 1); +} +lean::cnstr_set(x_48, 0, x_47); +lean::cnstr_set(x_48, 1, x_40); +return x_48; +} +else +{ +obj* x_49; obj* x_50; +lean::dec(x_33); +x_49 = lean::cnstr_get(x_43, 0); +lean::inc(x_49); +lean::dec(x_43); +if (lean::is_scalar(x_41)) { + x_50 = lean::alloc_cnstr(0, 2, 0); +} else { + x_50 = x_41; +} +lean::cnstr_set(x_50, 0, x_49); +lean::cnstr_set(x_50, 1, x_40); +return x_50; +} +} +else +{ +obj* x_51; obj* x_52; obj* x_53; obj* x_54; +lean::dec(x_33); +x_51 = lean::cnstr_get(x_38, 0); +lean::inc(x_51); +x_52 = lean::cnstr_get(x_38, 1); +lean::inc(x_52); +if (lean::is_exclusive(x_38)) { + lean::cnstr_release(x_38, 0); + lean::cnstr_release(x_38, 1); + x_53 = x_38; +} else { + lean::dec_ref(x_38); + x_53 = lean::box(0); +} +if (lean::is_scalar(x_53)) { + x_54 = lean::alloc_cnstr(1, 2, 0); +} else { + x_54 = x_53; +} +lean::cnstr_set(x_54, 0, x_51); +lean::cnstr_set(x_54, 1, x_52); +return x_54; +} +} +} +else +{ +uint8 x_55; +x_55 = !lean::is_exclusive(x_3); +if (x_55 == 0) +{ +return x_3; +} +else +{ +obj* x_56; obj* x_57; obj* x_58; +x_56 = lean::cnstr_get(x_3, 0); +x_57 = lean::cnstr_get(x_3, 1); +lean::inc(x_57); +lean::inc(x_56); +lean::dec(x_3); +x_58 = lean::alloc_cnstr(1, 2, 0); +lean::cnstr_set(x_58, 0, x_56); +lean::cnstr_set(x_58, 1, x_57); +return x_58; } } } } -obj* l_Lean_findLean___boxed(obj* x_1, obj* x_2, obj* x_3) { +obj* l_Array_mfindAux___main___at_Lean_findAtSearchPath___spec__1___boxed(obj* x_1, obj* x_2, obj* x_3) { _start: { obj* x_4; -x_4 = l_Lean_findLean(x_1, x_2, x_3); +x_4 = l_Array_mfindAux___main___at_Lean_findAtSearchPath___spec__1(x_1, x_2, x_3); +lean::dec(x_2); lean::dec(x_1); return x_4; } } +obj* l_List_foldl___main___at_Lean_moduleNameOfFileName___spec__1(obj* x_1, obj* x_2) { +_start: +{ +if (lean::obj_tag(x_2) == 0) +{ +return x_1; +} +else +{ +obj* x_3; obj* x_4; obj* x_5; +x_3 = lean::cnstr_get(x_2, 0); +lean::inc(x_3); +x_4 = lean::cnstr_get(x_2, 1); +lean::inc(x_4); +lean::dec(x_2); +x_5 = lean_name_mk_string(x_1, x_3); +x_1 = x_5; +x_2 = x_4; +goto _start; +} +} +} +obj* _init_l_Lean_moduleNameOfFileName___closed__1() { +_start: +{ +obj* x_1; +x_1 = lean::mk_string("failed to convert file '"); +return x_1; +} +} +obj* _init_l_Lean_moduleNameOfFileName___closed__2() { +_start: +{ +obj* x_1; +x_1 = lean::mk_string("' to module name, path is not a prefix of the given file"); +return x_1; +} +} +obj* _init_l_Lean_moduleNameOfFileName___closed__3() { +_start: +{ +obj* x_1; +x_1 = lean::mk_string("' to module name, extension is missing"); +return x_1; +} +} +obj* _init_l_Lean_moduleNameOfFileName___closed__4() { +_start: +{ +obj* x_1; +x_1 = lean::mk_string("' to module name, module name '"); +return x_1; +} +} +obj* _init_l_Lean_moduleNameOfFileName___closed__5() { +_start: +{ +obj* x_1; +x_1 = lean::mk_string("' resolves to '"); +return x_1; +} +} +namespace lean { +obj* module_name_of_file_core(obj* x_1, obj* x_2) { +_start: +{ +obj* x_3; +lean::inc(x_1); +x_3 = l_Lean_findAtSearchPath(x_1, x_2); +if (lean::obj_tag(x_3) == 0) +{ +uint8 x_4; +x_4 = !lean::is_exclusive(x_3); +if (x_4 == 0) +{ +obj* x_5; obj* x_6; obj* x_7; +x_5 = lean::cnstr_get(x_3, 0); +x_6 = lean::box(0); +lean::cnstr_set(x_3, 0, x_6); +x_7 = lean_io_realpath(x_1, x_3); +if (lean::obj_tag(x_7) == 0) +{ +obj* x_8; obj* x_9; obj* x_10; obj* x_11; obj* x_12; obj* x_13; uint32 x_14; uint32 x_15; uint8 x_16; obj* x_17; obj* x_18; obj* x_19; +x_8 = lean::cnstr_get(x_7, 0); +lean::inc(x_8); +x_9 = lean::cnstr_get(x_7, 1); +lean::inc(x_9); +if (lean::is_exclusive(x_7)) { + lean::cnstr_release(x_7, 0); + lean::cnstr_release(x_7, 1); + x_10 = x_7; +} else { + lean::dec_ref(x_7); + x_10 = lean::box(0); +} +x_11 = lean::string_length(x_5); +x_12 = l_String_drop(x_8, x_11); +lean::dec(x_11); +x_13 = lean::mk_nat_obj(0u); +x_14 = lean::string_utf8_get(x_12, x_13); +x_15 = l_System_FilePath_pathSeparator; +x_16 = x_14 == x_15; +x_17 = l___private_init_lean_path_1__pathSep; +x_18 = lean::string_append(x_5, x_17); +if (x_16 == 0) +{ +x_19 = x_12; +goto block_81; +} +else +{ +obj* x_82; obj* x_83; +x_82 = lean::mk_nat_obj(1u); +x_83 = l_String_drop(x_12, x_82); +lean::dec(x_12); +x_19 = x_83; +goto block_81; +} +block_81: +{ +obj* x_20; uint8 x_21; +x_20 = lean::string_append(x_18, x_19); +x_21 = lean::string_dec_eq(x_20, x_8); +lean::dec(x_20); +if (x_21 == 0) +{ +obj* x_22; obj* x_23; obj* x_24; obj* x_25; obj* x_26; +lean::dec(x_19); +x_22 = l_Lean_moduleNameOfFileName___closed__1; +x_23 = lean::string_append(x_22, x_8); +lean::dec(x_8); +x_24 = l_Lean_moduleNameOfFileName___closed__2; +x_25 = lean::string_append(x_23, x_24); +if (lean::is_scalar(x_10)) { + x_26 = lean::alloc_cnstr(1, 2, 0); +} else { + x_26 = x_10; + lean::cnstr_set_tag(x_26, 1); +} +lean::cnstr_set(x_26, 0, x_25); +lean::cnstr_set(x_26, 1, x_9); +return x_26; +} +else +{ +uint32 x_27; obj* x_28; +x_27 = 46; +x_28 = l_String_revPosOf(x_19, x_27); +if (lean::obj_tag(x_28) == 0) +{ +obj* x_29; obj* x_30; obj* x_31; obj* x_32; obj* x_33; +lean::dec(x_19); +x_29 = l_Lean_moduleNameOfFileName___closed__1; +x_30 = lean::string_append(x_29, x_8); +lean::dec(x_8); +x_31 = l_Lean_moduleNameOfFileName___closed__3; +x_32 = lean::string_append(x_30, x_31); +if (lean::is_scalar(x_10)) { + x_33 = lean::alloc_cnstr(1, 2, 0); +} else { + x_33 = x_10; + lean::cnstr_set_tag(x_33, 1); +} +lean::cnstr_set(x_33, 0, x_32); +lean::cnstr_set(x_33, 1, x_9); +return x_33; +} +else +{ +obj* x_34; obj* x_35; obj* x_36; obj* x_37; obj* x_38; obj* x_39; obj* x_40; obj* x_41; obj* x_42; obj* x_43; obj* x_44; +x_34 = lean::cnstr_get(x_28, 0); +lean::inc(x_34); +lean::dec(x_28); +if (lean::is_scalar(x_10)) { + x_35 = lean::alloc_cnstr(0, 2, 0); +} else { + x_35 = x_10; +} +lean::cnstr_set(x_35, 0, x_6); +lean::cnstr_set(x_35, 1, x_9); +x_36 = lean::string_utf8_extract(x_19, x_13, x_34); +x_37 = lean::mk_nat_obj(1u); +x_38 = lean::nat_add(x_34, x_37); +lean::dec(x_34); +x_39 = lean::string_utf8_byte_size(x_19); +x_40 = lean::string_utf8_extract(x_19, x_38, x_39); +lean::dec(x_39); +lean::dec(x_38); +lean::dec(x_19); +x_41 = l_String_split(x_36, x_17); +x_42 = lean::box(0); +x_43 = l_List_foldl___main___at_Lean_moduleNameOfFileName___spec__1(x_42, x_41); +lean::inc(x_43); +x_44 = l_Lean_findLeanFile(x_43, x_40, x_35); +lean::dec(x_40); +if (lean::obj_tag(x_44) == 0) +{ +uint8 x_45; +x_45 = !lean::is_exclusive(x_44); +if (x_45 == 0) +{ +obj* x_46; uint8 x_47; +x_46 = lean::cnstr_get(x_44, 0); +x_47 = lean::string_dec_eq(x_8, x_46); +if (x_47 == 0) +{ +obj* x_48; obj* x_49; obj* x_50; obj* x_51; obj* x_52; obj* x_53; obj* x_54; obj* x_55; obj* x_56; obj* x_57; obj* x_58; obj* x_59; +x_48 = l_Lean_moduleNameOfFileName___closed__1; +x_49 = lean::string_append(x_48, x_8); +lean::dec(x_8); +x_50 = l_Lean_moduleNameOfFileName___closed__4; +x_51 = lean::string_append(x_49, x_50); +x_52 = l_Lean_Name_toString___closed__1; +x_53 = l_Lean_Name_toStringWithSep___main(x_52, x_43); +x_54 = lean::string_append(x_51, x_53); +lean::dec(x_53); +x_55 = l_Lean_moduleNameOfFileName___closed__5; +x_56 = lean::string_append(x_54, x_55); +x_57 = lean::string_append(x_56, x_46); +lean::dec(x_46); +x_58 = l_Char_HasRepr___closed__1; +x_59 = lean::string_append(x_57, x_58); +lean::cnstr_set_tag(x_44, 1); +lean::cnstr_set(x_44, 0, x_59); +return x_44; +} +else +{ +lean::dec(x_46); +lean::dec(x_8); +lean::cnstr_set(x_44, 0, x_43); +return x_44; +} +} +else +{ +obj* x_60; obj* x_61; uint8 x_62; +x_60 = lean::cnstr_get(x_44, 0); +x_61 = lean::cnstr_get(x_44, 1); +lean::inc(x_61); +lean::inc(x_60); +lean::dec(x_44); +x_62 = lean::string_dec_eq(x_8, x_60); +if (x_62 == 0) +{ +obj* x_63; obj* x_64; obj* x_65; obj* x_66; obj* x_67; obj* x_68; obj* x_69; obj* x_70; obj* x_71; obj* x_72; obj* x_73; obj* x_74; obj* x_75; +x_63 = l_Lean_moduleNameOfFileName___closed__1; +x_64 = lean::string_append(x_63, x_8); +lean::dec(x_8); +x_65 = l_Lean_moduleNameOfFileName___closed__4; +x_66 = lean::string_append(x_64, x_65); +x_67 = l_Lean_Name_toString___closed__1; +x_68 = l_Lean_Name_toStringWithSep___main(x_67, x_43); +x_69 = lean::string_append(x_66, x_68); +lean::dec(x_68); +x_70 = l_Lean_moduleNameOfFileName___closed__5; +x_71 = lean::string_append(x_69, x_70); +x_72 = lean::string_append(x_71, x_60); +lean::dec(x_60); +x_73 = l_Char_HasRepr___closed__1; +x_74 = lean::string_append(x_72, x_73); +x_75 = lean::alloc_cnstr(1, 2, 0); +lean::cnstr_set(x_75, 0, x_74); +lean::cnstr_set(x_75, 1, x_61); +return x_75; +} +else +{ +obj* x_76; +lean::dec(x_60); +lean::dec(x_8); +x_76 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_76, 0, x_43); +lean::cnstr_set(x_76, 1, x_61); +return x_76; +} +} +} +else +{ +uint8 x_77; +lean::dec(x_43); +lean::dec(x_8); +x_77 = !lean::is_exclusive(x_44); +if (x_77 == 0) +{ +return x_44; +} +else +{ +obj* x_78; obj* x_79; obj* x_80; +x_78 = lean::cnstr_get(x_44, 0); +x_79 = lean::cnstr_get(x_44, 1); +lean::inc(x_79); +lean::inc(x_78); +lean::dec(x_44); +x_80 = lean::alloc_cnstr(1, 2, 0); +lean::cnstr_set(x_80, 0, x_78); +lean::cnstr_set(x_80, 1, x_79); +return x_80; +} +} +} +} +} +} +else +{ +uint8 x_84; +lean::dec(x_5); +x_84 = !lean::is_exclusive(x_7); +if (x_84 == 0) +{ +return x_7; +} +else +{ +obj* x_85; obj* x_86; obj* x_87; +x_85 = lean::cnstr_get(x_7, 0); +x_86 = lean::cnstr_get(x_7, 1); +lean::inc(x_86); +lean::inc(x_85); +lean::dec(x_7); +x_87 = lean::alloc_cnstr(1, 2, 0); +lean::cnstr_set(x_87, 0, x_85); +lean::cnstr_set(x_87, 1, x_86); +return x_87; +} +} +} +else +{ +obj* x_88; obj* x_89; obj* x_90; obj* x_91; obj* x_92; +x_88 = lean::cnstr_get(x_3, 0); +x_89 = lean::cnstr_get(x_3, 1); +lean::inc(x_89); +lean::inc(x_88); +lean::dec(x_3); +x_90 = lean::box(0); +x_91 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_91, 0, x_90); +lean::cnstr_set(x_91, 1, x_89); +x_92 = lean_io_realpath(x_1, x_91); +if (lean::obj_tag(x_92) == 0) +{ +obj* x_93; obj* x_94; obj* x_95; obj* x_96; obj* x_97; obj* x_98; uint32 x_99; uint32 x_100; uint8 x_101; obj* x_102; obj* x_103; obj* x_104; +x_93 = lean::cnstr_get(x_92, 0); +lean::inc(x_93); +x_94 = lean::cnstr_get(x_92, 1); +lean::inc(x_94); +if (lean::is_exclusive(x_92)) { + lean::cnstr_release(x_92, 0); + lean::cnstr_release(x_92, 1); + x_95 = x_92; +} else { + lean::dec_ref(x_92); + x_95 = lean::box(0); +} +x_96 = lean::string_length(x_88); +x_97 = l_String_drop(x_93, x_96); +lean::dec(x_96); +x_98 = lean::mk_nat_obj(0u); +x_99 = lean::string_utf8_get(x_97, x_98); +x_100 = l_System_FilePath_pathSeparator; +x_101 = x_99 == x_100; +x_102 = l___private_init_lean_path_1__pathSep; +x_103 = lean::string_append(x_88, x_102); +if (x_101 == 0) +{ +x_104 = x_97; +goto block_152; +} +else +{ +obj* x_153; obj* x_154; +x_153 = lean::mk_nat_obj(1u); +x_154 = l_String_drop(x_97, x_153); +lean::dec(x_97); +x_104 = x_154; +goto block_152; +} +block_152: +{ +obj* x_105; uint8 x_106; +x_105 = lean::string_append(x_103, x_104); +x_106 = lean::string_dec_eq(x_105, x_93); +lean::dec(x_105); +if (x_106 == 0) +{ +obj* x_107; obj* x_108; obj* x_109; obj* x_110; obj* x_111; +lean::dec(x_104); +x_107 = l_Lean_moduleNameOfFileName___closed__1; +x_108 = lean::string_append(x_107, x_93); +lean::dec(x_93); +x_109 = l_Lean_moduleNameOfFileName___closed__2; +x_110 = lean::string_append(x_108, x_109); +if (lean::is_scalar(x_95)) { + x_111 = lean::alloc_cnstr(1, 2, 0); +} else { + x_111 = x_95; + lean::cnstr_set_tag(x_111, 1); +} +lean::cnstr_set(x_111, 0, x_110); +lean::cnstr_set(x_111, 1, x_94); +return x_111; +} +else +{ +uint32 x_112; obj* x_113; +x_112 = 46; +x_113 = l_String_revPosOf(x_104, x_112); +if (lean::obj_tag(x_113) == 0) +{ +obj* x_114; obj* x_115; obj* x_116; obj* x_117; obj* x_118; +lean::dec(x_104); +x_114 = l_Lean_moduleNameOfFileName___closed__1; +x_115 = lean::string_append(x_114, x_93); +lean::dec(x_93); +x_116 = l_Lean_moduleNameOfFileName___closed__3; +x_117 = lean::string_append(x_115, x_116); +if (lean::is_scalar(x_95)) { + x_118 = lean::alloc_cnstr(1, 2, 0); +} else { + x_118 = x_95; + lean::cnstr_set_tag(x_118, 1); +} +lean::cnstr_set(x_118, 0, x_117); +lean::cnstr_set(x_118, 1, x_94); +return x_118; +} +else +{ +obj* x_119; obj* x_120; obj* x_121; obj* x_122; obj* x_123; obj* x_124; obj* x_125; obj* x_126; obj* x_127; obj* x_128; obj* x_129; +x_119 = lean::cnstr_get(x_113, 0); +lean::inc(x_119); +lean::dec(x_113); +if (lean::is_scalar(x_95)) { + x_120 = lean::alloc_cnstr(0, 2, 0); +} else { + x_120 = x_95; +} +lean::cnstr_set(x_120, 0, x_90); +lean::cnstr_set(x_120, 1, x_94); +x_121 = lean::string_utf8_extract(x_104, x_98, x_119); +x_122 = lean::mk_nat_obj(1u); +x_123 = lean::nat_add(x_119, x_122); +lean::dec(x_119); +x_124 = lean::string_utf8_byte_size(x_104); +x_125 = lean::string_utf8_extract(x_104, x_123, x_124); +lean::dec(x_124); +lean::dec(x_123); +lean::dec(x_104); +x_126 = l_String_split(x_121, x_102); +x_127 = lean::box(0); +x_128 = l_List_foldl___main___at_Lean_moduleNameOfFileName___spec__1(x_127, x_126); +lean::inc(x_128); +x_129 = l_Lean_findLeanFile(x_128, x_125, x_120); +lean::dec(x_125); +if (lean::obj_tag(x_129) == 0) +{ +obj* x_130; obj* x_131; obj* x_132; uint8 x_133; +x_130 = lean::cnstr_get(x_129, 0); +lean::inc(x_130); +x_131 = lean::cnstr_get(x_129, 1); +lean::inc(x_131); +if (lean::is_exclusive(x_129)) { + lean::cnstr_release(x_129, 0); + lean::cnstr_release(x_129, 1); + x_132 = x_129; +} else { + lean::dec_ref(x_129); + x_132 = lean::box(0); +} +x_133 = lean::string_dec_eq(x_93, x_130); +if (x_133 == 0) +{ +obj* x_134; obj* x_135; obj* x_136; obj* x_137; obj* x_138; obj* x_139; obj* x_140; obj* x_141; obj* x_142; obj* x_143; obj* x_144; obj* x_145; obj* x_146; +x_134 = l_Lean_moduleNameOfFileName___closed__1; +x_135 = lean::string_append(x_134, x_93); +lean::dec(x_93); +x_136 = l_Lean_moduleNameOfFileName___closed__4; +x_137 = lean::string_append(x_135, x_136); +x_138 = l_Lean_Name_toString___closed__1; +x_139 = l_Lean_Name_toStringWithSep___main(x_138, x_128); +x_140 = lean::string_append(x_137, x_139); +lean::dec(x_139); +x_141 = l_Lean_moduleNameOfFileName___closed__5; +x_142 = lean::string_append(x_140, x_141); +x_143 = lean::string_append(x_142, x_130); +lean::dec(x_130); +x_144 = l_Char_HasRepr___closed__1; +x_145 = lean::string_append(x_143, x_144); +if (lean::is_scalar(x_132)) { + x_146 = lean::alloc_cnstr(1, 2, 0); +} else { + x_146 = x_132; + lean::cnstr_set_tag(x_146, 1); +} +lean::cnstr_set(x_146, 0, x_145); +lean::cnstr_set(x_146, 1, x_131); +return x_146; +} +else +{ +obj* x_147; +lean::dec(x_130); +lean::dec(x_93); +if (lean::is_scalar(x_132)) { + x_147 = lean::alloc_cnstr(0, 2, 0); +} else { + x_147 = x_132; +} +lean::cnstr_set(x_147, 0, x_128); +lean::cnstr_set(x_147, 1, x_131); +return x_147; +} +} +else +{ +obj* x_148; obj* x_149; obj* x_150; obj* x_151; +lean::dec(x_128); +lean::dec(x_93); +x_148 = lean::cnstr_get(x_129, 0); +lean::inc(x_148); +x_149 = lean::cnstr_get(x_129, 1); +lean::inc(x_149); +if (lean::is_exclusive(x_129)) { + lean::cnstr_release(x_129, 0); + lean::cnstr_release(x_129, 1); + x_150 = x_129; +} else { + lean::dec_ref(x_129); + x_150 = lean::box(0); +} +if (lean::is_scalar(x_150)) { + x_151 = lean::alloc_cnstr(1, 2, 0); +} else { + x_151 = x_150; +} +lean::cnstr_set(x_151, 0, x_148); +lean::cnstr_set(x_151, 1, x_149); +return x_151; +} +} +} +} +} +else +{ +obj* x_155; obj* x_156; obj* x_157; obj* x_158; +lean::dec(x_88); +x_155 = lean::cnstr_get(x_92, 0); +lean::inc(x_155); +x_156 = lean::cnstr_get(x_92, 1); +lean::inc(x_156); +if (lean::is_exclusive(x_92)) { + lean::cnstr_release(x_92, 0); + lean::cnstr_release(x_92, 1); + x_157 = x_92; +} else { + lean::dec_ref(x_92); + x_157 = lean::box(0); +} +if (lean::is_scalar(x_157)) { + x_158 = lean::alloc_cnstr(1, 2, 0); +} else { + x_158 = x_157; +} +lean::cnstr_set(x_158, 0, x_155); +lean::cnstr_set(x_158, 1, x_156); +return x_158; +} +} +} +else +{ +uint8 x_159; +lean::dec(x_1); +x_159 = !lean::is_exclusive(x_3); +if (x_159 == 0) +{ +return x_3; +} +else +{ +obj* x_160; obj* x_161; obj* x_162; +x_160 = lean::cnstr_get(x_3, 0); +x_161 = lean::cnstr_get(x_3, 1); +lean::inc(x_161); +lean::inc(x_160); +lean::dec(x_3); +x_162 = lean::alloc_cnstr(1, 2, 0); +lean::cnstr_set(x_162, 0, x_160); +lean::cnstr_set(x_162, 1, x_161); +return x_162; +} +} +} +} +} obj* initialize_init_system_io(obj*); obj* initialize_init_system_filepath(obj*); obj* initialize_init_data_array_default(obj*); @@ -3049,5 +3257,19 @@ l_Lean_findLeanFile___closed__3 = _init_l_Lean_findLeanFile___closed__3(); lean::mark_persistent(l_Lean_findLeanFile___closed__3); l_Lean_findOLean___closed__1 = _init_l_Lean_findOLean___closed__1(); lean::mark_persistent(l_Lean_findOLean___closed__1); +l_Lean_findAtSearchPath___closed__1 = _init_l_Lean_findAtSearchPath___closed__1(); +lean::mark_persistent(l_Lean_findAtSearchPath___closed__1); +l_Lean_findAtSearchPath___closed__2 = _init_l_Lean_findAtSearchPath___closed__2(); +lean::mark_persistent(l_Lean_findAtSearchPath___closed__2); +l_Lean_moduleNameOfFileName___closed__1 = _init_l_Lean_moduleNameOfFileName___closed__1(); +lean::mark_persistent(l_Lean_moduleNameOfFileName___closed__1); +l_Lean_moduleNameOfFileName___closed__2 = _init_l_Lean_moduleNameOfFileName___closed__2(); +lean::mark_persistent(l_Lean_moduleNameOfFileName___closed__2); +l_Lean_moduleNameOfFileName___closed__3 = _init_l_Lean_moduleNameOfFileName___closed__3(); +lean::mark_persistent(l_Lean_moduleNameOfFileName___closed__3); +l_Lean_moduleNameOfFileName___closed__4 = _init_l_Lean_moduleNameOfFileName___closed__4(); +lean::mark_persistent(l_Lean_moduleNameOfFileName___closed__4); +l_Lean_moduleNameOfFileName___closed__5 = _init_l_Lean_moduleNameOfFileName___closed__5(); +lean::mark_persistent(l_Lean_moduleNameOfFileName___closed__5); return w; }