From 20c5f4cde910679ff1b017043d96db2c23fa198e Mon Sep 17 00:00:00 2001 From: Sebastian Ullrich Date: Tue, 18 Aug 2020 16:03:31 +0200 Subject: [PATCH] chore: update stage0 --- stage0/src/Lean/Parser/Extension.lean | 44 +- stage0/src/Lean/Parser/Level.lean | 1 + stage0/src/Lean/PrettyPrinter/Formatter.lean | 7 +- .../src/Lean/PrettyPrinter/Parenthesizer.lean | 19 +- stage0/stdlib/Lean/Elab/Syntax.c | 16 +- stage0/stdlib/Lean/Elab/Util.c | 23 +- stage0/stdlib/Lean/Parser/Extension.c | 1748 +++++++++-------- stage0/stdlib/Lean/Parser/Level.c | 6 +- stage0/stdlib/Lean/PrettyPrinter/Formatter.c | 4 +- .../stdlib/Lean/PrettyPrinter/Parenthesizer.c | 302 +-- 10 files changed, 1210 insertions(+), 960 deletions(-) diff --git a/stage0/src/Lean/Parser/Extension.lean b/stage0/src/Lean/Parser/Extension.lean index b11818bf21..ab8f93cb8b 100644 --- a/stage0/src/Lean/Parser/Extension.lean +++ b/stage0/src/Lean/Parser/Extension.lean @@ -7,7 +7,7 @@ Authors: Leonardo de Moura, Sebastian Ullrich /-! Extensible parsing via attributes -/ import Lean.Parser.Basic -import Lean.PrettyPrinter.Parenthesizer +import Lean.KeyedDeclsAttribute namespace Lean namespace Parser @@ -223,6 +223,16 @@ partial def compileParserDescr (env : Environment) (categories : ParserCategorie def mkParserOfConstant (env : Environment) (categories : ParserCategories) (constName : Name) : Except String (Bool × Parser) := mkParserOfConstantAux env categories constName (compileParserDescr env categories) +structure ParserAttributeHook := +/- Called after a parser attribute is applied to a declaration. -/ +(postAdd : forall (catName : Name) (env : Environment) (declName : Name) (builtin : Bool), IO Environment) + +def mkParserAttributeHooks : IO (IO.Ref (List ParserAttributeHook)) := IO.mkRef {} +@[init mkParserAttributeHooks] constant parserAttributeHooks : IO.Ref (List ParserAttributeHook) := arbitrary _ + +def registerParserAttributeHook (hook : ParserAttributeHook) : IO Unit := do +parserAttributeHooks.modify fun hooks => hook::hooks + private def ParserExtension.addImported (env : Environment) (es : Array (Array ParserExtensionOleanEntry)) : IO ParserExtensionState := do s ← ParserExtension.mkInitial; es.foldlM @@ -241,8 +251,9 @@ es.foldlM | ParserExtensionOleanEntry.parser catName declName => do p ← IO.ofExcept $ mkParserOfConstant env s.categories declName; categories ← IO.ofExcept $ addParser s.categories catName declName p.1 p.2; - -- discard result env; all imported parenthesizers should already be compiled - _ ← PrettyPrinter.Parenthesizer.addParenthesizerFromConstant env declName; + hooks ← parserAttributeHooks.get; + -- discard result env; all environment side effects should already have happened when the parser was declared initially + _ ← hooks.foldlM (fun env hook => hook.postAdd catName env declName /- builtin -/ false) env; pure { s with categories := categories }) s) s @@ -260,7 +271,6 @@ registerPersistentEnvExtension { @[init mkParserExtension] constant parserExtension : ParserExtension := arbitrary _ -@[export lean_is_parser_category] def isParserCategory (env : Environment) (catName : Name) : Bool := (parserExtension.getState env).categories.contains catName @@ -301,7 +311,6 @@ pure $ parserExtension.addEntry env $ ParserExtensionEntry.token tk def addSyntaxNodeKind (env : Environment) (k : SyntaxNodeKind) : Environment := parserExtension.addEntry env $ ParserExtensionEntry.kind k -@[export lean_is_valid_syntax_node_kind] def isValidSyntaxNodeKind (env : Environment) (k : SyntaxNodeKind) : Bool := let kinds := (parserExtension.getState env).kinds; kinds.contains k @@ -338,25 +347,6 @@ if s.hasError then else Except.ok s.stxStack.back -structure ParserAttributeHook := -/- Called after a parser attribute is applied to a declaration. -/ -(postAdd : forall (attr catName : Name) (env : Environment) (declName : Name) (builtin : Bool), IO Environment) - -def mkParserAttributeHooks : IO (IO.Ref (List ParserAttributeHook)) := IO.mkRef {} -@[init mkParserAttributeHooks] constant parserAttributeHooks : IO.Ref (List ParserAttributeHook) := arbitrary _ - -unsafe def mkParserAttributeHookAttribute : IO (KeyedDeclsAttribute ParserAttributeHook) := -KeyedDeclsAttribute.init { - builtinName := `builtinParserAttributeHook, - name := `parserAttributeHook, - descr := "Add a hook of type `ParserAttributeHook`, which is executed whenever a parser attribute is applied.", - valueTypeName := `Lean.PrettyPrinter.ParserAttributeHook, - evalKey := fun builtin env args => do - when args.hasArgs $ throw "invalid attribute 'parserAttributeHook', unexpected argument"; - pure "" -} `Lean.Parser.parserAttributeHookAttribute -@[init mkParserAttributeHookAttribute] constant parserAttributeHookAttribute : KeyedDeclsAttribute ParserAttributeHook := arbitrary _ - def declareBuiltinParser (env : Environment) (addFnName : Name) (catName : Name) (declName : Name) : IO Environment := let name := `_regBuiltinParser ++ declName; let type := mkApp (mkConst `IO) (mkConst `Unit); @@ -387,7 +377,8 @@ env ← match env.find? declName with declareLeadingBuiltinParser env catName declName | _ => throw (IO.userError ("unexpected parser type at '" ++ toString declName ++ "' (`Parser` or `TrailingParser` expected")); -PrettyPrinter.Parenthesizer.compileParser env declName /- builtin -/ true +hooks ← parserAttributeHooks.get; +hooks.foldlM (fun env hook => hook.postAdd catName env declName /- builtin -/ true) env /- The parsing tables for builtin parsers are "stored" in the extracted source code. @@ -421,7 +412,8 @@ match mkParserOfConstant env categories declName with env ← match addParser categories catName declName leading parser with | Except.ok _ => pure $ parserExtension.addEntry env $ ParserExtensionEntry.parser catName declName leading parser | Except.error ex => throw (IO.userError ex); - PrettyPrinter.Parenthesizer.addParenthesizerFromConstant env declName + hooks ← parserAttributeHooks.get; + hooks.foldlM (fun env hook => hook.postAdd catName env declName /- builtin -/ false) env def mkParserAttributeImpl (attrName : Name) (catName : Name) : AttributeImpl := { name := attrName, diff --git a/stage0/src/Lean/Parser/Level.lean b/stage0/src/Lean/Parser/Level.lean index dce2614d13..a92094d3fd 100644 --- a/stage0/src/Lean/Parser/Level.lean +++ b/stage0/src/Lean/Parser/Level.lean @@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Sebastian Ullrich -/ import Lean.Parser.Extension +import Lean.PrettyPrinter.Parenthesizer -- necessary for auto-generation namespace Lean namespace Parser diff --git a/stage0/src/Lean/PrettyPrinter/Formatter.lean b/stage0/src/Lean/PrettyPrinter/Formatter.lean index 42e9741b8d..371fbff579 100644 --- a/stage0/src/Lean/PrettyPrinter/Formatter.lean +++ b/stage0/src/Lean/PrettyPrinter/Formatter.lean @@ -8,9 +8,10 @@ Authors: Sebastian Ullrich The formatter turns a `Syntax` tree into a `Format` object, inserting both mandatory whitespace (to separate adjacent tokens) as well as "pretty" optional whitespace. -The basic approach works much like the parenthesizer: A right-to-left traversal over the syntax tree, driven by -parser-specific handlers registered via attributes. The traversal is right-to-left so that when emitting a token, we -already know the text following it and can decide whether or not whitespace between the two is necessary. +The basic approach works much like the parenthesizer: A right-to-left traversal over the syntax tree and the parser that +produced it, driven by parser-specific handlers registered via an attribute. The traversal is right-to-left so that when +emitting a token, we already know the text following it and can decide whether or not whitespace between the two is +necessary. -/ import Lean.Parser import Lean.Meta.ReduceEval diff --git a/stage0/src/Lean/PrettyPrinter/Parenthesizer.lean b/stage0/src/Lean/PrettyPrinter/Parenthesizer.lean index 37487bf03a..d3e208a7c6 100644 --- a/stage0/src/Lean/PrettyPrinter/Parenthesizer.lean +++ b/stage0/src/Lean/PrettyPrinter/Parenthesizer.lean @@ -74,7 +74,7 @@ import Lean.Util.ReplaceExpr import Lean.Meta.Basic import Lean.Meta.WHNF import Lean.KeyedDeclsAttribute -import Lean.Parser.Basic +import Lean.Parser.Extension import Lean.ParserCompiler namespace Lean @@ -103,9 +103,6 @@ abbrev ParenthesizerM := ReaderT Parenthesizer.Context $ StateT Parenthesizer.St abbrev Parenthesizer := ParenthesizerM Unit -@[extern "lean_is_valid_syntax_node_kind"] -constant isValidSyntaxNodeKind (env : Environment) (k : SyntaxNodeKind) : Bool := arbitrary _ - unsafe def mkParenthesizerAttribute : IO (KeyedDeclsAttribute Parenthesizer) := KeyedDeclsAttribute.init { builtinName := `builtinParenthesizer, @@ -118,7 +115,7 @@ KeyedDeclsAttribute.init { | some id => -- `isValidSyntaxNodeKind` is updated only in the next stage for new `[builtin*Parser]`s, but we try to -- synthesize a parenthesizer for it immediately, so we just check for a declaration in this case - if (builtin && (env.find? id).isSome) || isValidSyntaxNodeKind env id then pure id + if (builtin && (env.find? id).isSome) || Parser.isValidSyntaxNodeKind env id then pure id else throw ("invalid [parenthesizer] argument, unknown syntax kind '" ++ toString id ++ "'") | none => throw "invalid [parenthesizer] argument, expected identifier" } `Lean.PrettyPrinter.parenthesizerAttribute @@ -126,9 +123,6 @@ KeyedDeclsAttribute.init { abbrev CategoryParenthesizer := forall (prec : Nat), Parenthesizer -@[extern "lean_is_parser_category"] -constant isParserCategory (env : Environment) (k : SyntaxNodeKind) : Bool := arbitrary _ - unsafe def mkCategoryParenthesizerAttribute : IO (KeyedDeclsAttribute CategoryParenthesizer) := KeyedDeclsAttribute.init { builtinName := `builtinCategoryParenthesizer, @@ -142,7 +136,7 @@ parenthesized, but still be traversed for parenthesizing nested categories.", valueTypeName := `Lean.PrettyPrinter.CategoryParenthesizer, evalKey := fun _ env args => match attrParamSyntaxToIdentifier args with | some id => - if isParserCategory env id then pure id + if Parser.isParserCategory env id then pure id else throw ("invalid [parenthesizer] argument, unknown parser category '" ++ toString id ++ "'") | none => throw "invalid [parenthesizer] argument, expected identifier" } `Lean.PrettyPrinter.categoryParenthesizerAttribute @@ -592,6 +586,13 @@ def parenthesizeCommand := parenthesize $ categoryParser.parenthesizer `command @[init] private def regTraceClasses : IO Unit := do registerTraceClass `PrettyPrinter.parenthesize; +Parser.registerParserAttributeHook { + postAdd := fun catName env declName builtin => + if builtin then + compileParser env declName builtin + else + addParenthesizerFromConstant env declName +}; pure () end PrettyPrinter diff --git a/stage0/stdlib/Lean/Elab/Syntax.c b/stage0/stdlib/Lean/Elab/Syntax.c index b0b322ca3e..05fa629040 100644 --- a/stage0/stdlib/Lean/Elab/Syntax.c +++ b/stage0/stdlib/Lean/Elab/Syntax.c @@ -78,7 +78,6 @@ lean_object* l___regBuiltin_Lean_Elab_Command_elabDeclareSyntaxCat___closed__1; lean_object* l___private_Lean_Elab_Syntax_6__declareSyntaxCatQuotParser___closed__36; lean_object* l_Array_filterSepElemsM___at_Lean_Elab_Command_elabNoKindMacroRulesAux___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__1; -extern lean_object* l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__8; lean_object* l_Lean_Elab_Command_elabMacroRulesAux___closed__30; lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__36; lean_object* l___private_Lean_Elab_Syntax_1__mkParserSeq(lean_object*, lean_object*, lean_object*); @@ -504,7 +503,7 @@ lean_object* l___private_Lean_Elab_Syntax_9__expandNotationAux___closed__4; uint8_t l_Lean_Syntax_hasArgs(lean_object*); extern lean_object* l_Lean_Parser_Syntax_sepBy1___elambda__1___closed__1; lean_object* l___private_Lean_Elab_Command_7__mkTermState(lean_object*); -uint8_t lean_is_parser_category(lean_object*, lean_object*); +uint8_t l_Lean_Parser_isParserCategory(lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__125; lean_object* l_Lean_Elab_Command_expandElab___closed__63; lean_object* l_Lean_Elab_Command_getCurrMacroScope(lean_object*, lean_object*); @@ -703,6 +702,7 @@ extern lean_object* l_Lean_Parser_Syntax_cat___elambda__1___closed__1; lean_object* l_Lean_Elab_Command_expandElab___closed__47; extern lean_object* l_Lean_Parser_mkParserOfConstantUnsafe___closed__3; lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__23; +extern lean_object* l_Lean_Parser_mkParserOfConstantUnsafe___closed__5; lean_object* l_Array_umapMAux___main___at___private_Lean_Elab_Syntax_9__expandNotationAux___spec__3(lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_elabMacroRulesAux___closed__2; lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__44; @@ -1666,7 +1666,7 @@ goto _start; else { lean_object* x_41; uint8_t x_42; -x_41 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__8; +x_41 = l_Lean_Parser_mkParserOfConstantUnsafe___closed__5; x_42 = lean_string_dec_eq(x_32, x_41); if (x_42 == 0) { @@ -1922,7 +1922,7 @@ goto _start; else { lean_object* x_89; uint8_t x_90; -x_89 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__8; +x_89 = l_Lean_Parser_mkParserOfConstantUnsafe___closed__5; x_90 = lean_string_dec_eq(x_80, x_89); if (x_90 == 0) { @@ -7441,9 +7441,7 @@ lean_inc(x_1504); x_1505 = lean_ctor_get(x_1503, 1); lean_inc(x_1505); lean_dec(x_1503); -lean_inc(x_1498); -lean_inc(x_1504); -x_1577 = lean_is_parser_category(x_1504, x_1498); +x_1577 = l_Lean_Parser_isParserCategory(x_1504, x_1498); if (x_1577 == 0) { lean_object* x_1578; lean_object* x_1579; lean_object* x_1580; lean_object* x_1581; lean_object* x_1582; lean_object* x_1583; @@ -9875,8 +9873,8 @@ x_7 = lean_unsigned_to_nat(5u); x_8 = l_Lean_Syntax_getIdAt(x_1, x_7); x_9 = l_Lean_Name_eraseMacroScopes(x_8); lean_dec(x_8); -lean_inc(x_9); -x_381 = lean_is_parser_category(x_5, x_9); +x_381 = l_Lean_Parser_isParserCategory(x_5, x_9); +lean_dec(x_5); if (x_381 == 0) { lean_object* x_382; lean_object* x_383; lean_object* x_384; lean_object* x_385; lean_object* x_386; lean_object* x_387; lean_object* x_388; uint8_t x_389; diff --git a/stage0/stdlib/Lean/Elab/Util.c b/stage0/stdlib/Lean/Elab/Util.c index c9fa4063af..5c8da4a342 100644 --- a/stage0/stdlib/Lean/Elab/Util.c +++ b/stage0/stdlib/Lean/Elab/Util.c @@ -124,7 +124,7 @@ lean_object* l_Array_umapMAux___main___at_Lean_Elab_expandMacros___main___spec__ lean_object* l_Lean_Elab_mkElabAttribute(lean_object*); lean_object* l_Lean_Elab_adaptMacro(lean_object*); lean_object* l_Lean_Syntax_getKind(lean_object*); -uint8_t lean_is_valid_syntax_node_kind(lean_object*, lean_object*); +uint8_t l_Lean_Parser_isValidSyntaxNodeKind(lean_object*, lean_object*); lean_object* l___private_Lean_Elab_Util_4__regTraceClasses(lean_object*); lean_object* l_Lean_Elab_evalSyntaxConstant(lean_object*, lean_object*); lean_object* l_Lean_Elab_adaptMacro___rarg(lean_object*, lean_object*, lean_object*, lean_object*); @@ -135,6 +135,7 @@ lean_object* l_Lean_PersistentEnvExtension_getState___rarg(lean_object*, lean_ob extern lean_object* l_Lean_Parser_Command_macro___elambda__1___closed__1; lean_object* l_Lean_Elab_mkMacroAttribute___closed__4; lean_object* l___private_Lean_Elab_Util_1__evalSyntaxConstantUnsafe___closed__1; +lean_object* l_Lean_Elab_checkSyntaxNodeKind___boxed(lean_object*, lean_object*); lean_object* l_List_foldl___main___at_Lean_MacroScopesView_review___spec__1(lean_object*, lean_object*); lean_object* l_Lean_Elab_adaptMacro___rarg___lambda__4(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_checkSyntaxNodeKind(lean_object*, lean_object*); @@ -545,8 +546,7 @@ lean_object* l_Lean_Elab_checkSyntaxNodeKind(lean_object* x_1, lean_object* x_2) _start: { uint8_t x_3; -lean_inc(x_2); -x_3 = lean_is_valid_syntax_node_kind(x_1, x_2); +x_3 = l_Lean_Parser_isValidSyntaxNodeKind(x_1, x_2); if (x_3 == 0) { lean_object* x_4; @@ -563,6 +563,15 @@ return x_5; } } } +lean_object* l_Lean_Elab_checkSyntaxNodeKind___boxed(lean_object* x_1, lean_object* x_2) { +_start: +{ +lean_object* x_3; +x_3 = l_Lean_Elab_checkSyntaxNodeKind(x_1, x_2); +lean_dec(x_1); +return x_3; +} +} lean_object* l_Lean_Elab_checkSyntaxNodeKindAtNamespaces___main(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { @@ -570,7 +579,6 @@ if (lean_obj_tag(x_3) == 0) { lean_object* x_4; lean_dec(x_2); -lean_dec(x_1); x_4 = l_Lean_Elab_checkSyntaxNodeKind___closed__2; return x_4; } @@ -581,7 +589,6 @@ x_5 = lean_ctor_get(x_3, 0); x_6 = lean_ctor_get(x_3, 1); lean_inc(x_2); x_7 = l_Lean_Name_append___main(x_5, x_2); -lean_inc(x_1); x_8 = l_Lean_Elab_checkSyntaxNodeKind(x_1, x_7); if (lean_obj_tag(x_8) == 0) { @@ -592,7 +599,6 @@ goto _start; else { lean_dec(x_2); -lean_dec(x_1); return x_8; } } @@ -604,6 +610,7 @@ _start: lean_object* x_4; x_4 = l_Lean_Elab_checkSyntaxNodeKindAtNamespaces___main(x_1, x_2, x_3); lean_dec(x_3); +lean_dec(x_1); return x_4; } } @@ -621,6 +628,7 @@ _start: lean_object* x_4; x_4 = l_Lean_Elab_checkSyntaxNodeKindAtNamespaces(x_1, x_2, x_3); lean_dec(x_3); +lean_dec(x_1); return x_4; } } @@ -669,17 +677,16 @@ x_6 = lean_ctor_get(x_4, 0); lean_inc(x_6); lean_dec(x_4); lean_inc(x_6); -lean_inc(x_1); x_7 = l_Lean_Elab_checkSyntaxNodeKind(x_1, x_6); lean_inc(x_1); x_8 = lean_get_namespaces(x_1); lean_inc(x_6); -lean_inc(x_1); x_9 = l_Lean_Elab_checkSyntaxNodeKindAtNamespaces___main(x_1, x_6, x_8); lean_dec(x_8); lean_inc(x_6); x_10 = l_Lean_Name_append___main(x_2, x_6); x_11 = l_Lean_Elab_checkSyntaxNodeKind(x_1, x_10); +lean_dec(x_1); if (lean_obj_tag(x_11) == 0) { lean_dec(x_11); diff --git a/stage0/stdlib/Lean/Parser/Extension.c b/stage0/stdlib/Lean/Parser/Extension.c index a97ffa896e..a8a919f245 100644 --- a/stage0/stdlib/Lean/Parser/Extension.c +++ b/stage0/stdlib/Lean/Parser/Extension.c @@ -1,6 +1,6 @@ // Lean compiler output // Module: Lean.Parser.Extension -// Imports: Init Lean.Parser.Basic Lean.PrettyPrinter.Parenthesizer +// Imports: Init Lean.Parser.Basic Lean.KeyedDeclsAttribute #include #if defined(__clang__) #pragma clang diagnostic ignored "-Wunused-parameter" @@ -16,16 +16,13 @@ extern "C" { lean_object* l_List_reverse___rarg(lean_object*); lean_object* l___private_Lean_Parser_Extension_13__registerParserAttributeImplBuilder___closed__3; lean_object* l_Array_iterateMAux___main___at___private_Lean_Parser_Extension_12__ParserAttribute_add___spec__5___boxed(lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l_Lean_Parser_mkParserAttributeHookAttribute___closed__10; lean_object* l_Lean_Parser_declareLeadingBuiltinParser___closed__2; lean_object* l_Lean_Parser_builtinTokenTable; extern lean_object* l_Lean_Name_toString___closed__1; lean_object* l___private_Lean_Parser_Extension_11__BuiltinParserAttribute_add___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l_Array_iterateMAux___main___at___private_Lean_Parser_Extension_10__ParserExtension_addImported___spec__3___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); size_t l_USize_add(size_t, size_t); lean_object* l_Lean_Parser_declareLeadingBuiltinParser___closed__1; lean_object* l_Lean_Parser_mkParserExtension___closed__1; -lean_object* l_Lean_Parser_parserAttributeHookAttribute___closed__4; lean_object* l_Std_PersistentHashMap_findAux___main___at_Lean_Parser_addLeadingParser___spec__2(lean_object*, size_t, lean_object*); lean_object* l_Lean_Parser_andthenInfo(lean_object*, lean_object*); lean_object* l_Lean_Parser_leadingIdentAsSymbol___boxed(lean_object*, lean_object*); @@ -43,7 +40,7 @@ lean_object* l_Std_PersistentHashMap_insertAux___main___at___private_Lean_Parser lean_object* l_IO_ofExcept___at___private_Lean_Parser_Extension_10__ParserExtension_addImported___spec__1(lean_object*, lean_object*); lean_object* l___private_Lean_Parser_Extension_6__addTokenConfig___closed__2; lean_object* l_List_foldlM___main___at_Lean_Parser_addParserTokens___spec__1(lean_object*, lean_object*); -extern lean_object* l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__8; +lean_object* l_Lean_Parser_registerParserAttributeHook(lean_object*, lean_object*); uint8_t lean_name_eq(lean_object*, lean_object*); extern lean_object* l_Lean_Parser_charLit; lean_object* l_Lean_Parser_trailingLoop___main(lean_object*, lean_object*, lean_object*); @@ -54,8 +51,8 @@ lean_object* l_Lean_Parser_parserExtension___elambda__1___boxed(lean_object*); lean_object* l_Lean_Parser_mkParserExtension___closed__4; lean_object* l_Lean_Parser_getTokenTable___boxed(lean_object*); lean_object* l___private_Lean_Parser_Extension_6__addTokenConfig___closed__1; +lean_object* l_List_foldlM___main___at___private_Lean_Parser_Extension_12__ParserAttribute_add___spec__6(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); uint8_t l_List_elem___main___at_Lean_NameHashSet_insert___spec__2(lean_object*, lean_object*); -lean_object* l_Std_PersistentHashMap_empty___at_Lean_Parser_parserAttributeHookAttribute___spec__3; lean_object* l_Std_PersistentHashMap_findAtAux___main___at_Lean_Parser_addLeadingParser___spec__3___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_addParser(lean_object*, lean_object*, lean_object*, uint8_t, lean_object*); extern lean_object* l_Lean_Parser_categoryParserFnRef; @@ -72,7 +69,6 @@ lean_object* l_Lean_Parser_parserExtension; extern lean_object* l_Lean_Parser_ident; lean_object* l_Lean_Parser_parserExtension___closed__2; lean_object* lean_io_mk_ref(lean_object*, lean_object*); -lean_object* l_Lean_PrettyPrinter_Parenthesizer_addParenthesizerFromConstantUnsafe(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_nonReservedSymbolFn(lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Parser_Extension_2__throwParserCategoryAlreadyDefined___rarg___closed__1; lean_object* l_Lean_Parser_mkParserState(lean_object*); @@ -100,22 +96,18 @@ lean_object* l_Lean_Parser_declareBuiltinParser___closed__1; extern lean_object* l_String_splitAux___main___closed__1; lean_object* l_Lean_Parser_categoryParserFnImpl(lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Parser_Extension_6__addTokenConfig(lean_object*, lean_object*); -lean_object* l_Lean_Parser_mkParserAttributeHookAttribute___closed__6; -lean_object* l_Lean_SMap_empty___at_Lean_Parser_parserAttributeHookAttribute___spec__1___closed__1; lean_object* l_Lean_Parser_checkPrecFn___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_Std_PersistentHashMap_foldlM___at_Lean_Parser_getSyntaxNodeKinds___spec__1___boxed(lean_object*, lean_object*); lean_object* l_List_foldl___main___at_Lean_Parser_addLeadingParser___spec__7(lean_object*, lean_object*, lean_object*); size_t l_USize_shiftRight(size_t, size_t); -lean_object* l_Lean_SMap_empty___at_Lean_Parser_parserAttributeHookAttribute___spec__1___closed__2; lean_object* l___private_Lean_Parser_Extension_8__updateBuiltinTokens___closed__1; lean_object* l_Lean_Parser_isParserCategory___boxed(lean_object*, lean_object*); lean_object* l_Lean_Parser_declareBuiltinParser___closed__2; extern lean_object* l_Lean_mkAppStx___closed__4; lean_object* l___private_Lean_Parser_Extension_11__BuiltinParserAttribute_add___closed__1; -lean_object* l_Lean_Parser_parserAttributeHookAttribute___closed__1; lean_object* l_Lean_Parser_parserExtension___closed__1; -lean_object* l_Lean_Parser_parserAttributeHookAttribute___closed__2; lean_object* l_Lean_Parser_declareBuiltinParser___closed__4; +lean_object* l_List_foldlM___main___at___private_Lean_Parser_Extension_11__BuiltinParserAttribute_add___spec__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_nameLitKind; extern lean_object* l_Lean_LocalContext_Inhabited___closed__1; lean_object* l_Array_anyRangeMAux___main___at_Lean_Parser_mkParserExtension___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -136,9 +128,7 @@ lean_object* l_Array_iterateMAux___main___at_Lean_Parser_getSyntaxNodeKinds___sp lean_object* l_Std_PersistentHashMap_insert___at_Lean_Parser_SyntaxNodeKindSet_insert___spec__1(lean_object*, lean_object*, lean_object*); uint8_t l_Lean_Parser_leadingIdentAsSymbol(lean_object*, lean_object*); lean_object* l_Std_PersistentHashMap_foldlM___at_Lean_Parser_getSyntaxNodeKinds___spec__1(lean_object*, lean_object*); -extern lean_object* l_Lean_PersistentEnvExtension_inhabited___rarg___closed__1; extern lean_object* l_Lean_mkAttributeImplOfConstant___closed__1; -lean_object* l_Array_iterateMAux___main___at___private_Lean_Parser_Extension_10__ParserExtension_addImported___spec__3(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_setCategoryParserFnRef(lean_object*); extern lean_object* l_Lean_registerTagAttribute___lambda__4___closed__3; lean_object* l_Lean_Parser_throwUnknownParserCategory(lean_object*); @@ -155,7 +145,6 @@ lean_object* l_Lean_Parser_mkParserExtension___closed__6; lean_object* lean_array_fget(lean_object*, lean_object*); uint8_t lean_nat_dec_eq(lean_object*, lean_object*); lean_object* l_Lean_Parser_mkBuiltinParserCategories(lean_object*); -lean_object* l_Lean_Parser_mkParserAttributeHookAttribute___closed__11; lean_object* l_Lean_Parser_lookaheadFn(lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_EnvExtension_Inhabited___rarg___closed__1; lean_object* l_Lean_Parser_nodeInfo(lean_object*, lean_object*); @@ -170,6 +159,7 @@ lean_object* l_Lean_Parser_noFirstTokenInfo(lean_object*); lean_object* l_Std_PersistentHashMap_insertAux___main___at___private_Lean_Parser_Extension_3__addParserCategoryCore___spec__4___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_KeyedDeclsAttribute_declareBuiltin___rarg___closed__6; lean_object* l_Lean_Parser_mkParserOfConstantUnsafe___closed__1; +lean_object* l_List_foldlM___main___at___private_Lean_Parser_Extension_11__BuiltinParserAttribute_add___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Std_PersistentHashMap_insertAux___main___rarg___closed__3; extern lean_object* l_Lean_strLitKind; lean_object* l_Lean_Parser_nonReservedSymbolInfo(lean_object*, uint8_t); @@ -178,8 +168,6 @@ lean_object* l_Lean_Parser_parserExtension___closed__6; lean_object* l_Lean_Parser_mkParserOfConstantUnsafe(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_registerAttributeOfBuilder(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Name_append___main(lean_object*, lean_object*); -extern lean_object* l_Lean_PersistentEnvExtension_inhabited___rarg___closed__2; -lean_object* l_Std_mkHashMap___at_Lean_Parser_parserAttributeHookAttribute___spec__2(lean_object*); lean_object* l_Lean_Parser_regTermParserAttribute___closed__1; lean_object* l_Lean_Parser_mkParserExtension___closed__8; lean_object* l_Lean_Parser_whitespace___main(lean_object*, lean_object*); @@ -191,14 +179,12 @@ lean_object* l_Std_PersistentHashMap_foldlMAux___main___at_Lean_Parser_getSyntax lean_object* l_Std_PersistentHashMap_foldlMAux___main___at___private_Lean_Parser_Extension_12__ParserAttribute_add___spec__3___boxed(lean_object*, lean_object*); lean_object* lean_array_fset(lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_Parser_nameLit; -lean_object* l_Std_mkHashMapImp___rarg(lean_object*); lean_object* l_List_lengthAux___main___rarg(lean_object*, lean_object*); lean_object* l_Lean_Parser_parserExtension___elambda__4(lean_object*, lean_object*); lean_object* l_Lean_Parser_throwUnknownParserCategory___rarg(lean_object*); lean_object* l_Std_PersistentHashMap_find_x3f___at_Lean_Parser_addLeadingParser___spec__1(lean_object*, lean_object*); lean_object* l_Lean_Parser_addLeadingParser___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_mkParserExtension___lambda__2___boxed(lean_object*); -lean_object* l_Lean_PrettyPrinter_Parenthesizer_compileParser(lean_object*, lean_object*, uint8_t, lean_object*); lean_object* l_Lean_Parser_mkParserOfConstantUnsafe___closed__4; size_t l_Lean_Name_hash(lean_object*); lean_object* l_Lean_Parser_addToken(lean_object*, lean_object*); @@ -208,7 +194,6 @@ lean_object* l_Lean_Parser_mkBuiltinSyntaxNodeKindSetRef(lean_object*); lean_object* l_Lean_Parser_registerBuiltinParserAttribute___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Std_PersistentHashMap_foldlMAux___main___at_Lean_Parser_getSyntaxNodeKinds___spec__2___boxed(lean_object*, lean_object*); lean_object* l_Lean_Parser_orelseInfo(lean_object*, lean_object*); -lean_object* l_Lean_Parser_mkParserAttributeHookAttribute___closed__7; lean_object* l_Array_iterateMAux___main___at___private_Lean_Parser_Extension_10__ParserExtension_addImported___spec__4(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_mkParserAttributeImpl___closed__1; extern lean_object* l_Lean_Parser_termParser___closed__2; @@ -222,7 +207,6 @@ extern size_t l_Std_PersistentHashMap_insertAux___main___rarg___closed__2; lean_object* lean_eval_const(lean_object*, lean_object*); lean_object* l_Lean_Parser_mkParserAttributeImpl(lean_object*, lean_object*); lean_object* l_IO_ofExcept___at___private_Lean_Parser_Extension_10__ParserExtension_addImported___spec__2___boxed(lean_object*, lean_object*); -lean_object* l_Lean_Parser_mkParserAttributeHookAttribute___closed__3; lean_object* l_Lean_Parser_ParserExtensionState_inhabited; lean_object* l_Lean_Parser_compileParserDescr(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_declareTrailingBuiltinParser(lean_object*, lean_object*, lean_object*, lean_object*); @@ -234,13 +218,11 @@ extern lean_object* l_Lean_Environment_evalConstCheck___rarg___closed__1; lean_object* l_Lean_Parser_parserExtension___elambda__2(lean_object*); extern lean_object* l_Lean_Options_empty; extern lean_object* l_IO_Error_Inhabited___closed__1; -lean_object* l_Lean_Parser_mkParserAttributeHookAttribute___lambda__1___closed__2; lean_object* l_Lean_Parser_compileParserDescr___main___closed__1; lean_object* l_Lean_Parser_addParserCategory___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_registerBuiltinParserAttribute(lean_object*, lean_object*, uint8_t, lean_object*); lean_object* l_Lean_Parser_mkParserOfConstantAux(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_registerBuiltinAttribute(lean_object*, lean_object*); -lean_object* l_Lean_Parser_mkParserAttributeHookAttribute___closed__2; lean_object* l_IO_ofExcept___at___private_Lean_Parser_Extension_10__ParserExtension_addImported___spec__1___boxed(lean_object*, lean_object*); size_t l_USize_mul(size_t, size_t); lean_object* l_Lean_FileMap_ofString(lean_object*); @@ -248,18 +230,15 @@ lean_object* l_List_redLength___main___rarg(lean_object*); lean_object* l___private_Lean_Parser_Extension_4__addBuiltinParserCategory___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_getTokenTable(lean_object*); lean_object* l_Lean_Parser_ParserState_restore(lean_object*, lean_object*, lean_object*); -lean_object* l_Lean_Parser_mkParserAttributeHookAttribute___lambda__1___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_isValidSyntaxNodeKind___boxed(lean_object*, lean_object*); +lean_object* l_Array_iterateMAux___main___at___private_Lean_Parser_Extension_10__ParserExtension_addImported___spec__5___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Std_PersistentHashMap_findAux___main___at_Lean_Parser_addLeadingParser___spec__2___boxed(lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Data_Trie_2__insertAux___main___rarg(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_mkParserExtension(lean_object*); lean_object* l_Lean_Parser_sepByFn___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_mkBuiltinTokenTable(lean_object*); -extern lean_object* l_Lean_PersistentEnvExtension_inhabited___rarg___closed__3; -lean_object* l_Lean_Parser_mkParserAttributeHookAttribute___lambda__1(uint8_t, lean_object*, lean_object*); lean_object* l_Lean_Parser_addTrailingParser(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_ConstantInfo_type(lean_object*); -lean_object* l_Lean_Parser_mkParserAttributeHookAttribute___lambda__1___closed__1; lean_object* l_Lean_Parser_trailingNodeFn(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_addBuiltinLeadingParser(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_mkParserExtension___closed__7; @@ -271,13 +250,10 @@ lean_object* l_Lean_registerEnvExtensionUnsafe___at_Lean_Parser_mkParserExtensio lean_object* l___private_Lean_Parser_Extension_3__addParserCategoryCore(lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_registerTagAttribute___lambda__4___closed__2; lean_object* l_Lean_ParametricAttribute_setParam___rarg(lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l_Lean_Parser_mkParserAttributeHookAttribute___lambda__1___closed__4; extern lean_object* l___private_Lean_Environment_5__envExtensionsRef; lean_object* l_Lean_Parser_mkParserAttributeImpl___elambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_sepBy1Info(lean_object*, lean_object*); -lean_object* l_Lean_Parser_mkParserAttributeHookAttribute___closed__8; lean_object* l_Lean_Parser_sepBy1Fn___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l_Lean_Parser_mkParserAttributeHookAttribute___closed__4; extern lean_object* l_Lean_mkAppStx___closed__3; uint8_t l_Array_anyRangeMAux___main___at_Lean_Parser_mkParserExtension___spec__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_registerPersistentEnvExtensionUnsafe___rarg___closed__3; @@ -288,7 +264,6 @@ lean_object* l_Lean_Parser_mkParserExtension___closed__3; extern lean_object* l_Lean_identKind; extern lean_object* l_Lean_registerPersistentEnvExtensionUnsafe___rarg___closed__1; extern lean_object* l_Lean_Parser_numLit; -lean_object* l_Lean_Parser_mkParserAttributeHookAttribute___closed__1; lean_object* l_Lean_Parser_compileParserDescr___main___closed__2; lean_object* l_Std_PersistentHashMap_foldlM___at___private_Lean_Parser_Extension_12__ParserAttribute_add___spec__2(lean_object*, lean_object*); lean_object* l_Std_PersistentHashMap_empty___at_Lean_Parser_mkBuiltinParserCategories___spec__1; @@ -297,15 +272,14 @@ extern lean_object* l_Lean_registerSimplePersistentEnvExtension___rarg___lambda_ uint8_t l_Lean_Syntax_hasArgs(lean_object*); lean_object* l_Lean_Parser_mergeOrElseErrors(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_tryFn(lean_object*, lean_object*, lean_object*); -uint8_t lean_is_parser_category(lean_object*, lean_object*); +uint8_t l_Lean_Parser_isParserCategory(lean_object*, lean_object*); uint8_t l_USize_decLe(size_t, size_t); +lean_object* l_Array_iterateMAux___main___at___private_Lean_Parser_Extension_10__ParserExtension_addImported___spec__5(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_registerTagAttribute___lambda__4___closed__5; lean_object* l_Std_PersistentHashMap_containsAtAux___main___at_Lean_Parser_isValidSyntaxNodeKind___spec__3___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_categoryParser(lean_object*, lean_object*); lean_object* l_Lean_Environment_addAndCompile(lean_object*, lean_object*, lean_object*); -lean_object* l_Lean_Parser_parserAttributeHookAttribute; -uint8_t lean_is_valid_syntax_node_kind(lean_object*, lean_object*); -lean_object* l_Lean_Parser_mkParserAttributeHookAttribute___lambda__1___closed__3; +uint8_t l_Lean_Parser_isValidSyntaxNodeKind(lean_object*, lean_object*); lean_object* l_Lean_Parser_runParserCategory(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Array_iterateMAux___main___at_Lean_Parser_getSyntaxNodeKinds___spec__4(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_addLeadingParser(lean_object*, lean_object*, lean_object*, lean_object*); @@ -315,6 +289,7 @@ lean_object* l_Lean_Parser_symbolInfo(lean_object*); lean_object* l_Lean_Parser_parserAttributeHooks; lean_object* l___private_Lean_Parser_Extension_13__registerParserAttributeImplBuilder(lean_object*); extern lean_object* l_Lean_Parser_epsilonInfo; +lean_object* l_List_foldlM___main___at___private_Lean_Parser_Extension_10__ParserExtension_addImported___spec__3(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_builtinSyntaxNodeKindSetRef; lean_object* l_Lean_Parser_registerBuiltinNodeKind(lean_object*, lean_object*); lean_object* l_Lean_Parser_mkParserState___boxed(lean_object*); @@ -341,12 +316,9 @@ lean_object* l___private_Lean_Parser_Extension_2__throwParserCategoryAlreadyDefi lean_object* l_Lean_PersistentEnvExtension_getState___rarg(lean_object*, lean_object*); lean_object* l_Lean_Parser_mkParserOfConstant(lean_object*, lean_object*, lean_object*); lean_object* lean_io_initializing(lean_object*); -lean_object* l_Lean_Parser_parserAttributeHookAttribute___closed__5; extern lean_object* l_Lean_registerPersistentEnvExtensionUnsafe___rarg___closed__2; -lean_object* l_Lean_Parser_mkParserAttributeHookAttribute___closed__5; lean_object* l_Std_PersistentHashMap_insert___at___private_Lean_Parser_Extension_3__addParserCategoryCore___spec__3(lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Parser_Extension_11__BuiltinParserAttribute_add(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, uint8_t, lean_object*); -lean_object* l_Lean_SMap_empty___at_Lean_Parser_parserAttributeHookAttribute___spec__1; lean_object* l_Lean_Parser_parserExtension___elambda__1(lean_object*); lean_object* l___private_Lean_Parser_Extension_2__throwParserCategoryAlreadyDefined___rarg___closed__2; lean_object* l_Lean_registerEnvExtensionUnsafe___at_Lean_Parser_mkParserExtension___spec__3(lean_object*, lean_object*); @@ -358,7 +330,6 @@ lean_object* l_Lean_Parser_addParser___boxed(lean_object*, lean_object*, lean_ob lean_object* l_Std_PersistentHashMap_containsAux___main___at_Lean_Parser_isValidSyntaxNodeKind___spec__2___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_ParserState_toErrorMsg(lean_object*, lean_object*); lean_object* l_Lean_Parser_manyFn(lean_object*, lean_object*, lean_object*); -lean_object* l_Lean_Parser_mkParserAttributeHookAttribute(lean_object*); lean_object* l___private_Lean_Parser_Extension_1__registerAuxiliaryNodeKindSets(lean_object*); lean_object* l_Array_iterateMAux___main___at_Lean_Parser_getSyntaxNodeKinds___spec__4___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_List_eraseDupsAux___main___at_Lean_Parser_addLeadingParser___spec__6(lean_object*, lean_object*); @@ -366,28 +337,24 @@ lean_object* l_List_toArrayAux___main___rarg(lean_object*, lean_object*); lean_object* l_unsafeCast(lean_object*, lean_object*, lean_object*); lean_object* l_Array_iterateMAux___main___at_Lean_mkAppN___spec__1(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Name_toStringWithSep___main(lean_object*, lean_object*); -lean_object* l_Lean_KeyedDeclsAttribute_init___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_many1Fn___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_usize_to_nat(size_t); lean_object* l___private_Lean_Parser_Extension_9__ParserExtension_addEntry(lean_object*, lean_object*); lean_object* l___private_Lean_Parser_Extension_12__ParserAttribute_add(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, uint8_t, lean_object*); lean_object* l_Lean_registerAttributeImplBuilder(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_ParserState_mkUnexpectedError(lean_object*, lean_object*); -extern lean_object* l_Lean_PrettyPrinter_mkParenthesizerAttribute___closed__6; lean_object* l_Lean_Parser_getSyntaxNodeKinds___boxed(lean_object*); lean_object* l_Array_back___at_Lean_Syntax_Traverser_up___spec__2(lean_object*); lean_object* l_Std_PersistentHashMap_findAtAux___main___at_Lean_Parser_addLeadingParser___spec__3(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_List_eraseDups___at_Lean_Parser_addLeadingParser___spec__5(lean_object*); -lean_object* l_Lean_Parser_parserAttributeHookAttribute___closed__3; lean_object* l_Lean_Parser_mkParserOfConstantUnsafe___closed__3; +lean_object* l_Lean_Parser_mkParserOfConstantUnsafe___closed__5; lean_object* l_Lean_mkConst(lean_object*, lean_object*); lean_object* l_Lean_Parser_regBuiltinTermParserAttr___closed__2; -lean_object* l_Lean_Parser_mkParserAttributeHookAttribute___closed__9; lean_object* l_Std_PersistentHashMap_insertAtCollisionNodeAux___main___at___private_Lean_Parser_Extension_3__addParserCategoryCore___spec__5(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_compileParserDescr___main___closed__4; lean_object* l___private_Lean_Data_Trie_3__findAux_x3f___main___rarg(lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_registerTagAttribute___lambda__4___closed__1; -extern lean_object* l_Lean_PersistentEnvExtension_inhabited___rarg___closed__4; lean_object* l_IO_ofExcept___at___private_Lean_Parser_Extension_10__ParserExtension_addImported___spec__2(lean_object*, lean_object*); extern lean_object* l_Lean_initAttr; lean_object* l_Std_PersistentHashMap_containsAux___main___at___private_Lean_Parser_Extension_3__addParserCategoryCore___spec__2___boxed(lean_object*, lean_object*, lean_object*); @@ -3329,6 +3296,14 @@ x_1 = lean_mk_string("TrailingParserDescr"); return x_1; } } +lean_object* _init_l_Lean_Parser_mkParserOfConstantUnsafe___closed__5() { +_start: +{ +lean_object* x_1; +x_1 = lean_mk_string("TrailingParser"); +return x_1; +} +} lean_object* l_Lean_Parser_mkParserOfConstantUnsafe(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { @@ -3644,7 +3619,7 @@ goto block_13; else { lean_object* x_85; uint8_t x_86; -x_85 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__8; +x_85 = l_Lean_Parser_mkParserOfConstantUnsafe___closed__5; x_86 = lean_string_dec_eq(x_76, x_85); if (x_86 == 0) { @@ -5248,6 +5223,92 @@ lean_dec(x_2); return x_5; } } +lean_object* l_Lean_Parser_mkParserAttributeHooks(lean_object* x_1) { +_start: +{ +lean_object* x_2; lean_object* x_3; +x_2 = lean_box(0); +x_3 = lean_io_mk_ref(x_2, x_1); +return x_3; +} +} +lean_object* l_Lean_Parser_registerParserAttributeHook(lean_object* x_1, lean_object* x_2) { +_start: +{ +lean_object* x_3; lean_object* x_4; +x_3 = l_Lean_Parser_parserAttributeHooks; +x_4 = lean_io_ref_get(x_3, x_2); +if (lean_obj_tag(x_4) == 0) +{ +lean_object* x_5; lean_object* x_6; lean_object* x_7; +x_5 = lean_ctor_get(x_4, 0); +lean_inc(x_5); +x_6 = lean_ctor_get(x_4, 1); +lean_inc(x_6); +lean_dec(x_4); +x_7 = lean_io_ref_reset(x_3, x_6); +if (lean_obj_tag(x_7) == 0) +{ +lean_object* x_8; lean_object* x_9; lean_object* x_10; +x_8 = lean_ctor_get(x_7, 1); +lean_inc(x_8); +lean_dec(x_7); +x_9 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_9, 0, x_1); +lean_ctor_set(x_9, 1, x_5); +x_10 = lean_io_ref_set(x_3, x_9, x_8); +return x_10; +} +else +{ +uint8_t x_11; +lean_dec(x_5); +lean_dec(x_1); +x_11 = !lean_is_exclusive(x_7); +if (x_11 == 0) +{ +return x_7; +} +else +{ +lean_object* x_12; lean_object* x_13; lean_object* x_14; +x_12 = lean_ctor_get(x_7, 0); +x_13 = lean_ctor_get(x_7, 1); +lean_inc(x_13); +lean_inc(x_12); +lean_dec(x_7); +x_14 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_14, 0, x_12); +lean_ctor_set(x_14, 1, x_13); +return x_14; +} +} +} +else +{ +uint8_t x_15; +lean_dec(x_1); +x_15 = !lean_is_exclusive(x_4); +if (x_15 == 0) +{ +return x_4; +} +else +{ +lean_object* x_16; lean_object* x_17; lean_object* x_18; +x_16 = lean_ctor_get(x_4, 0); +x_17 = lean_ctor_get(x_4, 1); +lean_inc(x_17); +lean_inc(x_16); +lean_dec(x_4); +x_18 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_18, 0, x_16); +lean_ctor_set(x_18, 1, x_17); +return x_18; +} +} +} +} lean_object* l_IO_ofExcept___at___private_Lean_Parser_Extension_10__ParserExtension_addImported___spec__1(lean_object* x_1, lean_object* x_2) { _start: { @@ -5302,7 +5363,74 @@ return x_7; } } } -lean_object* l_Array_iterateMAux___main___at___private_Lean_Parser_Extension_10__ParserExtension_addImported___spec__3(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) { +lean_object* l_List_foldlM___main___at___private_Lean_Parser_Extension_10__ParserExtension_addImported___spec__3(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { +_start: +{ +if (lean_obj_tag(x_4) == 0) +{ +lean_object* x_6; +lean_dec(x_2); +lean_dec(x_1); +x_6 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_6, 0, x_3); +lean_ctor_set(x_6, 1, x_5); +return x_6; +} +else +{ +lean_object* x_7; lean_object* x_8; uint8_t x_9; lean_object* x_10; lean_object* x_11; +x_7 = lean_ctor_get(x_4, 0); +lean_inc(x_7); +x_8 = lean_ctor_get(x_4, 1); +lean_inc(x_8); +lean_dec(x_4); +x_9 = 0; +x_10 = lean_box(x_9); +lean_inc(x_2); +lean_inc(x_1); +x_11 = lean_apply_5(x_7, x_1, x_3, x_2, x_10, x_5); +if (lean_obj_tag(x_11) == 0) +{ +lean_object* x_12; lean_object* x_13; +x_12 = lean_ctor_get(x_11, 0); +lean_inc(x_12); +x_13 = lean_ctor_get(x_11, 1); +lean_inc(x_13); +lean_dec(x_11); +x_3 = x_12; +x_4 = x_8; +x_5 = x_13; +goto _start; +} +else +{ +uint8_t x_15; +lean_dec(x_8); +lean_dec(x_2); +lean_dec(x_1); +x_15 = !lean_is_exclusive(x_11); +if (x_15 == 0) +{ +return x_11; +} +else +{ +lean_object* x_16; lean_object* x_17; lean_object* x_18; +x_16 = lean_ctor_get(x_11, 0); +x_17 = lean_ctor_get(x_11, 1); +lean_inc(x_17); +lean_inc(x_16); +lean_dec(x_11); +x_18 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_18, 0, x_16); +lean_ctor_set(x_18, 1, x_17); +return x_18; +} +} +} +} +} +lean_object* l_Array_iterateMAux___main___at___private_Lean_Parser_Extension_10__ParserExtension_addImported___spec__4(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) { _start: { lean_object* x_7; uint8_t x_8; @@ -5660,33 +5788,44 @@ lean_inc(x_102); lean_dec(x_99); x_103 = lean_unbox(x_101); lean_dec(x_101); +lean_inc(x_90); x_104 = l_Lean_Parser_addParser(x_95, x_90, x_91, x_103, x_102); x_105 = l_IO_ofExcept___at___private_Lean_Parser_Extension_4__addBuiltinParserCategory___spec__1(x_104, x_100); lean_dec(x_104); if (lean_obj_tag(x_105) == 0) { -lean_object* x_106; lean_object* x_107; lean_object* x_108; +lean_object* x_106; lean_object* x_107; lean_object* x_108; lean_object* x_109; x_106 = lean_ctor_get(x_105, 0); lean_inc(x_106); x_107 = lean_ctor_get(x_105, 1); lean_inc(x_107); lean_dec(x_105); -lean_inc(x_1); -x_108 = l_Lean_PrettyPrinter_Parenthesizer_addParenthesizerFromConstantUnsafe(x_1, x_91, x_107); -if (lean_obj_tag(x_108) == 0) +x_108 = l_Lean_Parser_parserAttributeHooks; +x_109 = lean_io_ref_get(x_108, x_107); +if (lean_obj_tag(x_109) == 0) { -lean_object* x_109; -x_109 = lean_ctor_get(x_108, 1); -lean_inc(x_109); -lean_dec(x_108); +lean_object* x_110; lean_object* x_111; lean_object* x_112; +x_110 = lean_ctor_get(x_109, 0); +lean_inc(x_110); +x_111 = lean_ctor_get(x_109, 1); +lean_inc(x_111); +lean_dec(x_109); +lean_inc(x_1); +x_112 = l_List_foldlM___main___at___private_Lean_Parser_Extension_10__ParserExtension_addImported___spec__3(x_90, x_91, x_1, x_110, x_111); +if (lean_obj_tag(x_112) == 0) +{ +lean_object* x_113; +x_113 = lean_ctor_get(x_112, 1); +lean_inc(x_113); +lean_dec(x_112); lean_ctor_set(x_5, 2, x_106); x_4 = x_12; -x_6 = x_109; +x_6 = x_113; goto _start; } else { -uint8_t x_111; +uint8_t x_115; lean_dec(x_106); lean_free_object(x_5); lean_dec(x_96); @@ -5694,49 +5833,19 @@ lean_dec(x_94); lean_dec(x_93); lean_dec(x_12); lean_dec(x_1); -x_111 = !lean_is_exclusive(x_108); -if (x_111 == 0) -{ -return x_108; -} -else -{ -lean_object* x_112; lean_object* x_113; lean_object* x_114; -x_112 = lean_ctor_get(x_108, 0); -x_113 = lean_ctor_get(x_108, 1); -lean_inc(x_113); -lean_inc(x_112); -lean_dec(x_108); -x_114 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_114, 0, x_112); -lean_ctor_set(x_114, 1, x_113); -return x_114; -} -} -} -else -{ -uint8_t x_115; -lean_free_object(x_5); -lean_dec(x_96); -lean_dec(x_94); -lean_dec(x_93); -lean_dec(x_91); -lean_dec(x_12); -lean_dec(x_1); -x_115 = !lean_is_exclusive(x_105); +x_115 = !lean_is_exclusive(x_112); if (x_115 == 0) { -return x_105; +return x_112; } else { lean_object* x_116; lean_object* x_117; lean_object* x_118; -x_116 = lean_ctor_get(x_105, 0); -x_117 = lean_ctor_get(x_105, 1); +x_116 = lean_ctor_get(x_112, 0); +x_117 = lean_ctor_get(x_112, 1); lean_inc(x_117); lean_inc(x_116); -lean_dec(x_105); +lean_dec(x_112); x_118 = lean_alloc_ctor(1, 2, 0); lean_ctor_set(x_118, 0, x_116); lean_ctor_set(x_118, 1, x_117); @@ -5747,28 +5856,28 @@ return x_118; else { uint8_t x_119; +lean_dec(x_106); lean_free_object(x_5); lean_dec(x_96); -lean_dec(x_95); lean_dec(x_94); lean_dec(x_93); lean_dec(x_91); lean_dec(x_90); lean_dec(x_12); lean_dec(x_1); -x_119 = !lean_is_exclusive(x_98); +x_119 = !lean_is_exclusive(x_109); if (x_119 == 0) { -return x_98; +return x_109; } else { lean_object* x_120; lean_object* x_121; lean_object* x_122; -x_120 = lean_ctor_get(x_98, 0); -x_121 = lean_ctor_get(x_98, 1); +x_120 = lean_ctor_get(x_109, 0); +x_121 = lean_ctor_get(x_109, 1); lean_inc(x_121); lean_inc(x_120); -lean_dec(x_98); +lean_dec(x_109); x_122 = lean_alloc_ctor(1, 2, 0); lean_ctor_set(x_122, 0, x_120); lean_ctor_set(x_122, 1, x_121); @@ -5778,159 +5887,267 @@ return x_122; } else { -lean_object* x_123; lean_object* x_124; lean_object* x_125; lean_object* x_126; lean_object* x_127; lean_object* x_128; -x_123 = lean_ctor_get(x_5, 0); -x_124 = lean_ctor_get(x_5, 1); -x_125 = lean_ctor_get(x_5, 2); -x_126 = lean_ctor_get(x_5, 3); -lean_inc(x_126); -lean_inc(x_125); -lean_inc(x_124); -lean_inc(x_123); -lean_dec(x_5); -lean_inc(x_91); -lean_inc(x_125); -lean_inc(x_1); -x_127 = l_Lean_Parser_mkParserOfConstant(x_1, x_125, x_91); -x_128 = l_IO_ofExcept___at___private_Lean_Parser_Extension_10__ParserExtension_addImported___spec__2(x_127, x_6); -lean_dec(x_127); -if (lean_obj_tag(x_128) == 0) -{ -lean_object* x_129; lean_object* x_130; lean_object* x_131; lean_object* x_132; uint8_t x_133; lean_object* x_134; lean_object* x_135; -x_129 = lean_ctor_get(x_128, 0); -lean_inc(x_129); -x_130 = lean_ctor_get(x_128, 1); -lean_inc(x_130); -lean_dec(x_128); -x_131 = lean_ctor_get(x_129, 0); -lean_inc(x_131); -x_132 = lean_ctor_get(x_129, 1); -lean_inc(x_132); -lean_dec(x_129); -x_133 = lean_unbox(x_131); -lean_dec(x_131); -x_134 = l_Lean_Parser_addParser(x_125, x_90, x_91, x_133, x_132); -x_135 = l_IO_ofExcept___at___private_Lean_Parser_Extension_4__addBuiltinParserCategory___spec__1(x_134, x_130); -lean_dec(x_134); -if (lean_obj_tag(x_135) == 0) -{ -lean_object* x_136; lean_object* x_137; lean_object* x_138; -x_136 = lean_ctor_get(x_135, 0); -lean_inc(x_136); -x_137 = lean_ctor_get(x_135, 1); -lean_inc(x_137); -lean_dec(x_135); -lean_inc(x_1); -x_138 = l_Lean_PrettyPrinter_Parenthesizer_addParenthesizerFromConstantUnsafe(x_1, x_91, x_137); -if (lean_obj_tag(x_138) == 0) -{ -lean_object* x_139; lean_object* x_140; -x_139 = lean_ctor_get(x_138, 1); -lean_inc(x_139); -lean_dec(x_138); -x_140 = lean_alloc_ctor(0, 4, 0); -lean_ctor_set(x_140, 0, x_123); -lean_ctor_set(x_140, 1, x_124); -lean_ctor_set(x_140, 2, x_136); -lean_ctor_set(x_140, 3, x_126); -x_4 = x_12; -x_5 = x_140; -x_6 = x_139; -goto _start; -} -else -{ -lean_object* x_142; lean_object* x_143; lean_object* x_144; lean_object* x_145; -lean_dec(x_136); -lean_dec(x_126); -lean_dec(x_124); -lean_dec(x_123); -lean_dec(x_12); -lean_dec(x_1); -x_142 = lean_ctor_get(x_138, 0); -lean_inc(x_142); -x_143 = lean_ctor_get(x_138, 1); -lean_inc(x_143); -if (lean_is_exclusive(x_138)) { - lean_ctor_release(x_138, 0); - lean_ctor_release(x_138, 1); - x_144 = x_138; -} else { - lean_dec_ref(x_138); - x_144 = lean_box(0); -} -if (lean_is_scalar(x_144)) { - x_145 = lean_alloc_ctor(1, 2, 0); -} else { - x_145 = x_144; -} -lean_ctor_set(x_145, 0, x_142); -lean_ctor_set(x_145, 1, x_143); -return x_145; -} -} -else -{ -lean_object* x_146; lean_object* x_147; lean_object* x_148; lean_object* x_149; -lean_dec(x_126); -lean_dec(x_124); -lean_dec(x_123); -lean_dec(x_91); -lean_dec(x_12); -lean_dec(x_1); -x_146 = lean_ctor_get(x_135, 0); -lean_inc(x_146); -x_147 = lean_ctor_get(x_135, 1); -lean_inc(x_147); -if (lean_is_exclusive(x_135)) { - lean_ctor_release(x_135, 0); - lean_ctor_release(x_135, 1); - x_148 = x_135; -} else { - lean_dec_ref(x_135); - x_148 = lean_box(0); -} -if (lean_is_scalar(x_148)) { - x_149 = lean_alloc_ctor(1, 2, 0); -} else { - x_149 = x_148; -} -lean_ctor_set(x_149, 0, x_146); -lean_ctor_set(x_149, 1, x_147); -return x_149; -} -} -else -{ -lean_object* x_150; lean_object* x_151; lean_object* x_152; lean_object* x_153; -lean_dec(x_126); -lean_dec(x_125); -lean_dec(x_124); -lean_dec(x_123); +uint8_t x_123; +lean_free_object(x_5); +lean_dec(x_96); +lean_dec(x_94); +lean_dec(x_93); lean_dec(x_91); lean_dec(x_90); lean_dec(x_12); lean_dec(x_1); -x_150 = lean_ctor_get(x_128, 0); -lean_inc(x_150); -x_151 = lean_ctor_get(x_128, 1); +x_123 = !lean_is_exclusive(x_105); +if (x_123 == 0) +{ +return x_105; +} +else +{ +lean_object* x_124; lean_object* x_125; lean_object* x_126; +x_124 = lean_ctor_get(x_105, 0); +x_125 = lean_ctor_get(x_105, 1); +lean_inc(x_125); +lean_inc(x_124); +lean_dec(x_105); +x_126 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_126, 0, x_124); +lean_ctor_set(x_126, 1, x_125); +return x_126; +} +} +} +else +{ +uint8_t x_127; +lean_free_object(x_5); +lean_dec(x_96); +lean_dec(x_95); +lean_dec(x_94); +lean_dec(x_93); +lean_dec(x_91); +lean_dec(x_90); +lean_dec(x_12); +lean_dec(x_1); +x_127 = !lean_is_exclusive(x_98); +if (x_127 == 0) +{ +return x_98; +} +else +{ +lean_object* x_128; lean_object* x_129; lean_object* x_130; +x_128 = lean_ctor_get(x_98, 0); +x_129 = lean_ctor_get(x_98, 1); +lean_inc(x_129); +lean_inc(x_128); +lean_dec(x_98); +x_130 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_130, 0, x_128); +lean_ctor_set(x_130, 1, x_129); +return x_130; +} +} +} +else +{ +lean_object* x_131; lean_object* x_132; lean_object* x_133; lean_object* x_134; lean_object* x_135; lean_object* x_136; +x_131 = lean_ctor_get(x_5, 0); +x_132 = lean_ctor_get(x_5, 1); +x_133 = lean_ctor_get(x_5, 2); +x_134 = lean_ctor_get(x_5, 3); +lean_inc(x_134); +lean_inc(x_133); +lean_inc(x_132); +lean_inc(x_131); +lean_dec(x_5); +lean_inc(x_91); +lean_inc(x_133); +lean_inc(x_1); +x_135 = l_Lean_Parser_mkParserOfConstant(x_1, x_133, x_91); +x_136 = l_IO_ofExcept___at___private_Lean_Parser_Extension_10__ParserExtension_addImported___spec__2(x_135, x_6); +lean_dec(x_135); +if (lean_obj_tag(x_136) == 0) +{ +lean_object* x_137; lean_object* x_138; lean_object* x_139; lean_object* x_140; uint8_t x_141; lean_object* x_142; lean_object* x_143; +x_137 = lean_ctor_get(x_136, 0); +lean_inc(x_137); +x_138 = lean_ctor_get(x_136, 1); +lean_inc(x_138); +lean_dec(x_136); +x_139 = lean_ctor_get(x_137, 0); +lean_inc(x_139); +x_140 = lean_ctor_get(x_137, 1); +lean_inc(x_140); +lean_dec(x_137); +x_141 = lean_unbox(x_139); +lean_dec(x_139); +lean_inc(x_90); +x_142 = l_Lean_Parser_addParser(x_133, x_90, x_91, x_141, x_140); +x_143 = l_IO_ofExcept___at___private_Lean_Parser_Extension_4__addBuiltinParserCategory___spec__1(x_142, x_138); +lean_dec(x_142); +if (lean_obj_tag(x_143) == 0) +{ +lean_object* x_144; lean_object* x_145; lean_object* x_146; lean_object* x_147; +x_144 = lean_ctor_get(x_143, 0); +lean_inc(x_144); +x_145 = lean_ctor_get(x_143, 1); +lean_inc(x_145); +lean_dec(x_143); +x_146 = l_Lean_Parser_parserAttributeHooks; +x_147 = lean_io_ref_get(x_146, x_145); +if (lean_obj_tag(x_147) == 0) +{ +lean_object* x_148; lean_object* x_149; lean_object* x_150; +x_148 = lean_ctor_get(x_147, 0); +lean_inc(x_148); +x_149 = lean_ctor_get(x_147, 1); +lean_inc(x_149); +lean_dec(x_147); +lean_inc(x_1); +x_150 = l_List_foldlM___main___at___private_Lean_Parser_Extension_10__ParserExtension_addImported___spec__3(x_90, x_91, x_1, x_148, x_149); +if (lean_obj_tag(x_150) == 0) +{ +lean_object* x_151; lean_object* x_152; +x_151 = lean_ctor_get(x_150, 1); lean_inc(x_151); -if (lean_is_exclusive(x_128)) { - lean_ctor_release(x_128, 0); - lean_ctor_release(x_128, 1); - x_152 = x_128; +lean_dec(x_150); +x_152 = lean_alloc_ctor(0, 4, 0); +lean_ctor_set(x_152, 0, x_131); +lean_ctor_set(x_152, 1, x_132); +lean_ctor_set(x_152, 2, x_144); +lean_ctor_set(x_152, 3, x_134); +x_4 = x_12; +x_5 = x_152; +x_6 = x_151; +goto _start; +} +else +{ +lean_object* x_154; lean_object* x_155; lean_object* x_156; lean_object* x_157; +lean_dec(x_144); +lean_dec(x_134); +lean_dec(x_132); +lean_dec(x_131); +lean_dec(x_12); +lean_dec(x_1); +x_154 = lean_ctor_get(x_150, 0); +lean_inc(x_154); +x_155 = lean_ctor_get(x_150, 1); +lean_inc(x_155); +if (lean_is_exclusive(x_150)) { + lean_ctor_release(x_150, 0); + lean_ctor_release(x_150, 1); + x_156 = x_150; } else { - lean_dec_ref(x_128); - x_152 = lean_box(0); + lean_dec_ref(x_150); + x_156 = lean_box(0); } -if (lean_is_scalar(x_152)) { - x_153 = lean_alloc_ctor(1, 2, 0); +if (lean_is_scalar(x_156)) { + x_157 = lean_alloc_ctor(1, 2, 0); } else { - x_153 = x_152; + x_157 = x_156; } -lean_ctor_set(x_153, 0, x_150); -lean_ctor_set(x_153, 1, x_151); -return x_153; +lean_ctor_set(x_157, 0, x_154); +lean_ctor_set(x_157, 1, x_155); +return x_157; +} +} +else +{ +lean_object* x_158; lean_object* x_159; lean_object* x_160; lean_object* x_161; +lean_dec(x_144); +lean_dec(x_134); +lean_dec(x_132); +lean_dec(x_131); +lean_dec(x_91); +lean_dec(x_90); +lean_dec(x_12); +lean_dec(x_1); +x_158 = lean_ctor_get(x_147, 0); +lean_inc(x_158); +x_159 = lean_ctor_get(x_147, 1); +lean_inc(x_159); +if (lean_is_exclusive(x_147)) { + lean_ctor_release(x_147, 0); + lean_ctor_release(x_147, 1); + x_160 = x_147; +} else { + lean_dec_ref(x_147); + x_160 = lean_box(0); +} +if (lean_is_scalar(x_160)) { + x_161 = lean_alloc_ctor(1, 2, 0); +} else { + x_161 = x_160; +} +lean_ctor_set(x_161, 0, x_158); +lean_ctor_set(x_161, 1, x_159); +return x_161; +} +} +else +{ +lean_object* x_162; lean_object* x_163; lean_object* x_164; lean_object* x_165; +lean_dec(x_134); +lean_dec(x_132); +lean_dec(x_131); +lean_dec(x_91); +lean_dec(x_90); +lean_dec(x_12); +lean_dec(x_1); +x_162 = lean_ctor_get(x_143, 0); +lean_inc(x_162); +x_163 = lean_ctor_get(x_143, 1); +lean_inc(x_163); +if (lean_is_exclusive(x_143)) { + lean_ctor_release(x_143, 0); + lean_ctor_release(x_143, 1); + x_164 = x_143; +} else { + lean_dec_ref(x_143); + x_164 = lean_box(0); +} +if (lean_is_scalar(x_164)) { + x_165 = lean_alloc_ctor(1, 2, 0); +} else { + x_165 = x_164; +} +lean_ctor_set(x_165, 0, x_162); +lean_ctor_set(x_165, 1, x_163); +return x_165; +} +} +else +{ +lean_object* x_166; lean_object* x_167; lean_object* x_168; lean_object* x_169; +lean_dec(x_134); +lean_dec(x_133); +lean_dec(x_132); +lean_dec(x_131); +lean_dec(x_91); +lean_dec(x_90); +lean_dec(x_12); +lean_dec(x_1); +x_166 = lean_ctor_get(x_136, 0); +lean_inc(x_166); +x_167 = lean_ctor_get(x_136, 1); +lean_inc(x_167); +if (lean_is_exclusive(x_136)) { + lean_ctor_release(x_136, 0); + lean_ctor_release(x_136, 1); + x_168 = x_136; +} else { + lean_dec_ref(x_136); + x_168 = lean_box(0); +} +if (lean_is_scalar(x_168)) { + x_169 = lean_alloc_ctor(1, 2, 0); +} else { + x_169 = x_168; +} +lean_ctor_set(x_169, 0, x_166); +lean_ctor_set(x_169, 1, x_167); +return x_169; } } } @@ -5938,7 +6155,7 @@ return x_153; } } } -lean_object* l_Array_iterateMAux___main___at___private_Lean_Parser_Extension_10__ParserExtension_addImported___spec__4(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) { +lean_object* l_Array_iterateMAux___main___at___private_Lean_Parser_Extension_10__ParserExtension_addImported___spec__5(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) { _start: { lean_object* x_7; uint8_t x_8; @@ -5964,7 +6181,7 @@ x_12 = lean_nat_add(x_4, x_11); lean_dec(x_4); x_13 = lean_unsigned_to_nat(0u); lean_inc(x_1); -x_14 = l_Array_iterateMAux___main___at___private_Lean_Parser_Extension_10__ParserExtension_addImported___spec__3(x_1, x_10, x_10, x_13, x_5, x_6); +x_14 = l_Array_iterateMAux___main___at___private_Lean_Parser_Extension_10__ParserExtension_addImported___spec__4(x_1, x_10, x_10, x_13, x_5, x_6); lean_dec(x_10); if (lean_obj_tag(x_14) == 0) { @@ -6020,7 +6237,7 @@ x_6 = lean_ctor_get(x_4, 1); lean_inc(x_6); lean_dec(x_4); x_7 = lean_unsigned_to_nat(0u); -x_8 = l_Array_iterateMAux___main___at___private_Lean_Parser_Extension_10__ParserExtension_addImported___spec__4(x_1, x_2, x_2, x_7, x_5, x_6); +x_8 = l_Array_iterateMAux___main___at___private_Lean_Parser_Extension_10__ParserExtension_addImported___spec__5(x_1, x_2, x_2, x_7, x_5, x_6); return x_8; } else @@ -6066,16 +6283,6 @@ lean_dec(x_1); return x_3; } } -lean_object* l_Array_iterateMAux___main___at___private_Lean_Parser_Extension_10__ParserExtension_addImported___spec__3___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) { -_start: -{ -lean_object* x_7; -x_7 = l_Array_iterateMAux___main___at___private_Lean_Parser_Extension_10__ParserExtension_addImported___spec__3(x_1, x_2, x_3, x_4, x_5, x_6); -lean_dec(x_3); -lean_dec(x_2); -return x_7; -} -} lean_object* l_Array_iterateMAux___main___at___private_Lean_Parser_Extension_10__ParserExtension_addImported___spec__4___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) { _start: { @@ -6086,6 +6293,16 @@ lean_dec(x_2); return x_7; } } +lean_object* l_Array_iterateMAux___main___at___private_Lean_Parser_Extension_10__ParserExtension_addImported___spec__5___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) { +_start: +{ +lean_object* x_7; +x_7 = l_Array_iterateMAux___main___at___private_Lean_Parser_Extension_10__ParserExtension_addImported___spec__5(x_1, x_2, x_3, x_4, x_5, x_6); +lean_dec(x_3); +lean_dec(x_2); +return x_7; +} +} lean_object* l___private_Lean_Parser_Extension_10__ParserExtension_addImported___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { @@ -7134,18 +7351,16 @@ lean_dec(x_1); return x_3; } } -uint8_t lean_is_parser_category(lean_object* x_1, lean_object* x_2) { +uint8_t l_Lean_Parser_isParserCategory(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; lean_object* x_4; lean_object* x_5; uint8_t x_6; x_3 = l_Lean_Parser_parserExtension; x_4 = l_Lean_PersistentEnvExtension_getState___rarg(x_3, x_1); -lean_dec(x_1); x_5 = lean_ctor_get(x_4, 2); lean_inc(x_5); lean_dec(x_4); x_6 = l_Std_PersistentHashMap_contains___at___private_Lean_Parser_Extension_3__addParserCategoryCore___spec__1(x_5, x_2); -lean_dec(x_2); return x_6; } } @@ -7153,7 +7368,9 @@ lean_object* l_Lean_Parser_isParserCategory___boxed(lean_object* x_1, lean_objec _start: { uint8_t x_3; lean_object* x_4; -x_3 = lean_is_parser_category(x_1, x_2); +x_3 = l_Lean_Parser_isParserCategory(x_1, x_2); +lean_dec(x_2); +lean_dec(x_1); x_4 = lean_box(x_3); return x_4; } @@ -7162,9 +7379,7 @@ lean_object* l_Lean_Parser_addParserCategory(lean_object* x_1, lean_object* x_2, _start: { uint8_t x_4; -lean_inc(x_2); -lean_inc(x_1); -x_4 = lean_is_parser_category(x_1, x_2); +x_4 = l_Lean_Parser_isParserCategory(x_1, x_2); if (x_4 == 0) { lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; @@ -7591,18 +7806,16 @@ x_5 = l_Std_PersistentHashMap_containsAux___main___at_Lean_Parser_isValidSyntaxN return x_5; } } -uint8_t lean_is_valid_syntax_node_kind(lean_object* x_1, lean_object* x_2) { +uint8_t l_Lean_Parser_isValidSyntaxNodeKind(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; lean_object* x_4; lean_object* x_5; uint8_t x_6; x_3 = l_Lean_Parser_parserExtension; x_4 = l_Lean_PersistentEnvExtension_getState___rarg(x_3, x_1); -lean_dec(x_1); x_5 = lean_ctor_get(x_4, 1); lean_inc(x_5); lean_dec(x_4); x_6 = l_Std_PersistentHashMap_contains___at_Lean_Parser_isValidSyntaxNodeKind___spec__1(x_5, x_2); -lean_dec(x_2); return x_6; } } @@ -7643,7 +7856,9 @@ lean_object* l_Lean_Parser_isValidSyntaxNodeKind___boxed(lean_object* x_1, lean_ _start: { uint8_t x_3; lean_object* x_4; -x_3 = lean_is_valid_syntax_node_kind(x_1, x_2); +x_3 = l_Lean_Parser_isValidSyntaxNodeKind(x_1, x_2); +lean_dec(x_2); +lean_dec(x_1); x_4 = lean_box(x_3); return x_4; } @@ -7933,317 +8148,6 @@ return x_15; } } } -lean_object* l_Lean_Parser_mkParserAttributeHooks(lean_object* x_1) { -_start: -{ -lean_object* x_2; lean_object* x_3; -x_2 = lean_box(0); -x_3 = lean_io_mk_ref(x_2, x_1); -return x_3; -} -} -lean_object* _init_l_Lean_Parser_mkParserAttributeHookAttribute___lambda__1___closed__1() { -_start: -{ -lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = lean_box(0); -x_2 = l_String_splitAux___main___closed__1; -x_3 = lean_name_mk_string(x_1, x_2); -return x_3; -} -} -lean_object* _init_l_Lean_Parser_mkParserAttributeHookAttribute___lambda__1___closed__2() { -_start: -{ -lean_object* x_1; lean_object* x_2; -x_1 = l_Lean_Parser_mkParserAttributeHookAttribute___lambda__1___closed__1; -x_2 = lean_alloc_ctor(1, 1, 0); -lean_ctor_set(x_2, 0, x_1); -return x_2; -} -} -lean_object* _init_l_Lean_Parser_mkParserAttributeHookAttribute___lambda__1___closed__3() { -_start: -{ -lean_object* x_1; -x_1 = lean_mk_string("invalid attribute 'parserAttributeHook', unexpected argument"); -return x_1; -} -} -lean_object* _init_l_Lean_Parser_mkParserAttributeHookAttribute___lambda__1___closed__4() { -_start: -{ -lean_object* x_1; lean_object* x_2; -x_1 = l_Lean_Parser_mkParserAttributeHookAttribute___lambda__1___closed__3; -x_2 = lean_alloc_ctor(0, 1, 0); -lean_ctor_set(x_2, 0, x_1); -return x_2; -} -} -lean_object* l_Lean_Parser_mkParserAttributeHookAttribute___lambda__1(uint8_t x_1, lean_object* x_2, lean_object* x_3) { -_start: -{ -uint8_t x_4; -x_4 = l_Lean_Syntax_hasArgs(x_3); -if (x_4 == 0) -{ -lean_object* x_5; -x_5 = l_Lean_Parser_mkParserAttributeHookAttribute___lambda__1___closed__2; -return x_5; -} -else -{ -lean_object* x_6; -x_6 = l_Lean_Parser_mkParserAttributeHookAttribute___lambda__1___closed__4; -return x_6; -} -} -} -lean_object* _init_l_Lean_Parser_mkParserAttributeHookAttribute___closed__1() { -_start: -{ -lean_object* x_1; -x_1 = lean_mk_string("builtinParserAttributeHook"); -return x_1; -} -} -lean_object* _init_l_Lean_Parser_mkParserAttributeHookAttribute___closed__2() { -_start: -{ -lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = lean_box(0); -x_2 = l_Lean_Parser_mkParserAttributeHookAttribute___closed__1; -x_3 = lean_name_mk_string(x_1, x_2); -return x_3; -} -} -lean_object* _init_l_Lean_Parser_mkParserAttributeHookAttribute___closed__3() { -_start: -{ -lean_object* x_1; -x_1 = lean_mk_string("parserAttributeHook"); -return x_1; -} -} -lean_object* _init_l_Lean_Parser_mkParserAttributeHookAttribute___closed__4() { -_start: -{ -lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = lean_box(0); -x_2 = l_Lean_Parser_mkParserAttributeHookAttribute___closed__3; -x_3 = lean_name_mk_string(x_1, x_2); -return x_3; -} -} -lean_object* _init_l_Lean_Parser_mkParserAttributeHookAttribute___closed__5() { -_start: -{ -lean_object* x_1; -x_1 = lean_mk_string("ParserAttributeHook"); -return x_1; -} -} -lean_object* _init_l_Lean_Parser_mkParserAttributeHookAttribute___closed__6() { -_start: -{ -lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = l_Lean_PrettyPrinter_mkParenthesizerAttribute___closed__6; -x_2 = l_Lean_Parser_mkParserAttributeHookAttribute___closed__5; -x_3 = lean_name_mk_string(x_1, x_2); -return x_3; -} -} -lean_object* _init_l_Lean_Parser_mkParserAttributeHookAttribute___closed__7() { -_start: -{ -lean_object* x_1; -x_1 = lean_mk_string("Add a hook of type `ParserAttributeHook`, which is executed whenever a parser attribute is applied."); -return x_1; -} -} -lean_object* _init_l_Lean_Parser_mkParserAttributeHookAttribute___closed__8() { -_start: -{ -lean_object* x_1; -x_1 = lean_alloc_closure((void*)(l_Lean_Parser_mkParserAttributeHookAttribute___lambda__1___boxed), 3, 0); -return x_1; -} -} -lean_object* _init_l_Lean_Parser_mkParserAttributeHookAttribute___closed__9() { -_start: -{ -lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; -x_1 = l_Lean_Parser_mkParserAttributeHookAttribute___closed__2; -x_2 = l_Lean_Parser_mkParserAttributeHookAttribute___closed__4; -x_3 = l_Lean_Parser_mkParserAttributeHookAttribute___closed__7; -x_4 = l_Lean_Parser_mkParserAttributeHookAttribute___closed__6; -x_5 = l_Lean_Parser_mkParserAttributeHookAttribute___closed__8; -x_6 = lean_alloc_ctor(0, 5, 0); -lean_ctor_set(x_6, 0, x_1); -lean_ctor_set(x_6, 1, x_2); -lean_ctor_set(x_6, 2, x_3); -lean_ctor_set(x_6, 3, x_4); -lean_ctor_set(x_6, 4, x_5); -return x_6; -} -} -lean_object* _init_l_Lean_Parser_mkParserAttributeHookAttribute___closed__10() { -_start: -{ -lean_object* x_1; -x_1 = lean_mk_string("parserAttributeHookAttribute"); -return x_1; -} -} -lean_object* _init_l_Lean_Parser_mkParserAttributeHookAttribute___closed__11() { -_start: -{ -lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = l_Lean_mkAppStx___closed__4; -x_2 = l_Lean_Parser_mkParserAttributeHookAttribute___closed__10; -x_3 = lean_name_mk_string(x_1, x_2); -return x_3; -} -} -lean_object* l_Lean_Parser_mkParserAttributeHookAttribute(lean_object* x_1) { -_start: -{ -lean_object* x_2; lean_object* x_3; lean_object* x_4; -x_2 = l_Lean_Parser_mkParserAttributeHookAttribute___closed__9; -x_3 = l_Lean_Parser_mkParserAttributeHookAttribute___closed__11; -x_4 = l_Lean_KeyedDeclsAttribute_init___rarg(x_2, x_3, x_1); -return x_4; -} -} -lean_object* l_Lean_Parser_mkParserAttributeHookAttribute___lambda__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { -_start: -{ -uint8_t x_4; lean_object* x_5; -x_4 = lean_unbox(x_1); -lean_dec(x_1); -x_5 = l_Lean_Parser_mkParserAttributeHookAttribute___lambda__1(x_4, x_2, x_3); -lean_dec(x_3); -lean_dec(x_2); -return x_5; -} -} -lean_object* l_Std_mkHashMap___at_Lean_Parser_parserAttributeHookAttribute___spec__2(lean_object* x_1) { -_start: -{ -lean_object* x_2; -x_2 = l_Std_mkHashMapImp___rarg(x_1); -return x_2; -} -} -lean_object* _init_l_Std_PersistentHashMap_empty___at_Lean_Parser_parserAttributeHookAttribute___spec__3() { -_start: -{ -lean_object* x_1; -x_1 = l_Lean_LocalContext_Inhabited___closed__1; -return x_1; -} -} -lean_object* _init_l_Lean_SMap_empty___at_Lean_Parser_parserAttributeHookAttribute___spec__1___closed__1() { -_start: -{ -lean_object* x_1; lean_object* x_2; -x_1 = lean_unsigned_to_nat(8u); -x_2 = l_Std_mkHashMapImp___rarg(x_1); -return x_2; -} -} -lean_object* _init_l_Lean_SMap_empty___at_Lean_Parser_parserAttributeHookAttribute___spec__1___closed__2() { -_start: -{ -uint8_t x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; -x_1 = 1; -x_2 = l_Lean_SMap_empty___at_Lean_Parser_parserAttributeHookAttribute___spec__1___closed__1; -x_3 = l_Std_PersistentHashMap_empty___at_Lean_Parser_parserAttributeHookAttribute___spec__3; -x_4 = lean_alloc_ctor(0, 2, 1); -lean_ctor_set(x_4, 0, x_2); -lean_ctor_set(x_4, 1, x_3); -lean_ctor_set_uint8(x_4, sizeof(void*)*2, x_1); -return x_4; -} -} -lean_object* _init_l_Lean_SMap_empty___at_Lean_Parser_parserAttributeHookAttribute___spec__1() { -_start: -{ -lean_object* x_1; -x_1 = l_Lean_SMap_empty___at_Lean_Parser_parserAttributeHookAttribute___spec__1___closed__2; -return x_1; -} -} -lean_object* _init_l_Lean_Parser_parserAttributeHookAttribute___closed__1() { -_start: -{ -lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = lean_box(0); -x_2 = l_Lean_SMap_empty___at_Lean_Parser_parserAttributeHookAttribute___spec__1; -x_3 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_3, 0, x_1); -lean_ctor_set(x_3, 1, x_2); -return x_3; -} -} -lean_object* _init_l_Lean_Parser_parserAttributeHookAttribute___closed__2() { -_start: -{ -lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = l_Array_empty___closed__1; -x_2 = l_Lean_Parser_parserAttributeHookAttribute___closed__1; -x_3 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_3, 0, x_1); -lean_ctor_set(x_3, 1, x_2); -return x_3; -} -} -lean_object* _init_l_Lean_Parser_parserAttributeHookAttribute___closed__3() { -_start: -{ -lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; -x_1 = lean_unsigned_to_nat(0u); -x_2 = l_Lean_EnvExtension_Inhabited___rarg___closed__1; -x_3 = l_Lean_Parser_parserAttributeHookAttribute___closed__2; -x_4 = lean_alloc_ctor(0, 3, 0); -lean_ctor_set(x_4, 0, x_1); -lean_ctor_set(x_4, 1, x_2); -lean_ctor_set(x_4, 2, x_3); -return x_4; -} -} -lean_object* _init_l_Lean_Parser_parserAttributeHookAttribute___closed__4() { -_start: -{ -lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; -x_1 = l_Lean_Parser_parserAttributeHookAttribute___closed__3; -x_2 = lean_box(0); -x_3 = l_Lean_PersistentEnvExtension_inhabited___rarg___closed__1; -x_4 = l_Lean_PersistentEnvExtension_inhabited___rarg___closed__2; -x_5 = l_Lean_PersistentEnvExtension_inhabited___rarg___closed__3; -x_6 = l_Lean_PersistentEnvExtension_inhabited___rarg___closed__4; -x_7 = lean_alloc_ctor(0, 6, 0); -lean_ctor_set(x_7, 0, x_1); -lean_ctor_set(x_7, 1, x_2); -lean_ctor_set(x_7, 2, x_3); -lean_ctor_set(x_7, 3, x_4); -lean_ctor_set(x_7, 4, x_5); -lean_ctor_set(x_7, 5, x_6); -return x_7; -} -} -lean_object* _init_l_Lean_Parser_parserAttributeHookAttribute___closed__5() { -_start: -{ -lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = lean_box(0); -x_2 = l_Lean_Parser_parserAttributeHookAttribute___closed__4; -x_3 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_3, 0, x_1); -lean_ctor_set(x_3, 1, x_2); -return x_3; -} -} lean_object* _init_l_Lean_Parser_declareBuiltinParser___closed__1() { _start: { @@ -8407,6 +8311,140 @@ x_6 = l_Lean_Parser_declareBuiltinParser(x_1, x_5, x_2, x_3, x_4); return x_6; } } +lean_object* l_List_foldlM___main___at___private_Lean_Parser_Extension_11__BuiltinParserAttribute_add___spec__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { +_start: +{ +if (lean_obj_tag(x_4) == 0) +{ +lean_object* x_6; +lean_dec(x_2); +lean_dec(x_1); +x_6 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_6, 0, x_3); +lean_ctor_set(x_6, 1, x_5); +return x_6; +} +else +{ +lean_object* x_7; lean_object* x_8; uint8_t x_9; lean_object* x_10; lean_object* x_11; +x_7 = lean_ctor_get(x_4, 0); +lean_inc(x_7); +x_8 = lean_ctor_get(x_4, 1); +lean_inc(x_8); +lean_dec(x_4); +x_9 = 1; +x_10 = lean_box(x_9); +lean_inc(x_2); +lean_inc(x_1); +x_11 = lean_apply_5(x_7, x_1, x_3, x_2, x_10, x_5); +if (lean_obj_tag(x_11) == 0) +{ +lean_object* x_12; lean_object* x_13; +x_12 = lean_ctor_get(x_11, 0); +lean_inc(x_12); +x_13 = lean_ctor_get(x_11, 1); +lean_inc(x_13); +lean_dec(x_11); +x_3 = x_12; +x_4 = x_8; +x_5 = x_13; +goto _start; +} +else +{ +uint8_t x_15; +lean_dec(x_8); +lean_dec(x_2); +lean_dec(x_1); +x_15 = !lean_is_exclusive(x_11); +if (x_15 == 0) +{ +return x_11; +} +else +{ +lean_object* x_16; lean_object* x_17; lean_object* x_18; +x_16 = lean_ctor_get(x_11, 0); +x_17 = lean_ctor_get(x_11, 1); +lean_inc(x_17); +lean_inc(x_16); +lean_dec(x_11); +x_18 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_18, 0, x_16); +lean_ctor_set(x_18, 1, x_17); +return x_18; +} +} +} +} +} +lean_object* l_List_foldlM___main___at___private_Lean_Parser_Extension_11__BuiltinParserAttribute_add___spec__2(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { +_start: +{ +if (lean_obj_tag(x_4) == 0) +{ +lean_object* x_6; +lean_dec(x_2); +lean_dec(x_1); +x_6 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_6, 0, x_3); +lean_ctor_set(x_6, 1, x_5); +return x_6; +} +else +{ +lean_object* x_7; lean_object* x_8; uint8_t x_9; lean_object* x_10; lean_object* x_11; +x_7 = lean_ctor_get(x_4, 0); +lean_inc(x_7); +x_8 = lean_ctor_get(x_4, 1); +lean_inc(x_8); +lean_dec(x_4); +x_9 = 1; +x_10 = lean_box(x_9); +lean_inc(x_2); +lean_inc(x_1); +x_11 = lean_apply_5(x_7, x_1, x_3, x_2, x_10, x_5); +if (lean_obj_tag(x_11) == 0) +{ +lean_object* x_12; lean_object* x_13; +x_12 = lean_ctor_get(x_11, 0); +lean_inc(x_12); +x_13 = lean_ctor_get(x_11, 1); +lean_inc(x_13); +lean_dec(x_11); +x_3 = x_12; +x_4 = x_8; +x_5 = x_13; +goto _start; +} +else +{ +uint8_t x_15; +lean_dec(x_8); +lean_dec(x_2); +lean_dec(x_1); +x_15 = !lean_is_exclusive(x_11); +if (x_15 == 0) +{ +return x_11; +} +else +{ +lean_object* x_16; lean_object* x_17; lean_object* x_18; +x_16 = lean_ctor_get(x_11, 0); +x_17 = lean_ctor_get(x_11, 1); +lean_inc(x_17); +lean_inc(x_16); +lean_dec(x_11); +x_18 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_18, 0, x_16); +lean_ctor_set(x_18, 1, x_17); +return x_18; +} +} +} +} +} lean_object* _init_l___private_Lean_Parser_Extension_11__BuiltinParserAttribute_add___closed__1() { _start: { @@ -8535,7 +8573,7 @@ goto block_26; else { lean_object* x_45; uint8_t x_46; -x_45 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__8; +x_45 = l_Lean_Parser_mkParserOfConstantUnsafe___closed__5; x_46 = lean_string_dec_eq(x_36, x_45); if (x_46 == 0) { @@ -8555,83 +8593,157 @@ else { lean_object* x_49; lean_inc(x_4); +lean_inc(x_2); x_49 = l_Lean_Parser_declareLeadingBuiltinParser(x_3, x_2, x_4, x_7); if (lean_obj_tag(x_49) == 0) { -lean_object* x_50; lean_object* x_51; uint8_t x_52; lean_object* x_53; +lean_object* x_50; lean_object* x_51; lean_object* x_52; lean_object* x_53; x_50 = lean_ctor_get(x_49, 0); lean_inc(x_50); x_51 = lean_ctor_get(x_49, 1); lean_inc(x_51); lean_dec(x_49); -x_52 = 1; -x_53 = l_Lean_PrettyPrinter_Parenthesizer_compileParser(x_50, x_4, x_52, x_51); +x_52 = l_Lean_Parser_parserAttributeHooks; +x_53 = lean_io_ref_get(x_52, x_51); +if (lean_obj_tag(x_53) == 0) +{ +lean_object* x_54; lean_object* x_55; lean_object* x_56; +x_54 = lean_ctor_get(x_53, 0); +lean_inc(x_54); +x_55 = lean_ctor_get(x_53, 1); +lean_inc(x_55); +lean_dec(x_53); +x_56 = l_List_foldlM___main___at___private_Lean_Parser_Extension_11__BuiltinParserAttribute_add___spec__1(x_2, x_4, x_50, x_54, x_55); +return x_56; +} +else +{ +uint8_t x_57; +lean_dec(x_50); +lean_dec(x_4); +lean_dec(x_2); +x_57 = !lean_is_exclusive(x_53); +if (x_57 == 0) +{ return x_53; } else { -uint8_t x_54; +lean_object* x_58; lean_object* x_59; lean_object* x_60; +x_58 = lean_ctor_get(x_53, 0); +x_59 = lean_ctor_get(x_53, 1); +lean_inc(x_59); +lean_inc(x_58); +lean_dec(x_53); +x_60 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_60, 0, x_58); +lean_ctor_set(x_60, 1, x_59); +return x_60; +} +} +} +else +{ +uint8_t x_61; lean_dec(x_4); -x_54 = !lean_is_exclusive(x_49); -if (x_54 == 0) +lean_dec(x_2); +x_61 = !lean_is_exclusive(x_49); +if (x_61 == 0) { return x_49; } else { -lean_object* x_55; lean_object* x_56; lean_object* x_57; -x_55 = lean_ctor_get(x_49, 0); -x_56 = lean_ctor_get(x_49, 1); -lean_inc(x_56); -lean_inc(x_55); +lean_object* x_62; lean_object* x_63; lean_object* x_64; +x_62 = lean_ctor_get(x_49, 0); +x_63 = lean_ctor_get(x_49, 1); +lean_inc(x_63); +lean_inc(x_62); lean_dec(x_49); -x_57 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_57, 0, x_55); -lean_ctor_set(x_57, 1, x_56); -return x_57; +x_64 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_64, 0, x_62); +lean_ctor_set(x_64, 1, x_63); +return x_64; } } } } else { -lean_object* x_58; +lean_object* x_65; lean_dec(x_36); lean_inc(x_4); -x_58 = l_Lean_Parser_declareTrailingBuiltinParser(x_3, x_2, x_4, x_7); -if (lean_obj_tag(x_58) == 0) +lean_inc(x_2); +x_65 = l_Lean_Parser_declareTrailingBuiltinParser(x_3, x_2, x_4, x_7); +if (lean_obj_tag(x_65) == 0) { -lean_object* x_59; lean_object* x_60; uint8_t x_61; lean_object* x_62; -x_59 = lean_ctor_get(x_58, 0); -lean_inc(x_59); -x_60 = lean_ctor_get(x_58, 1); -lean_inc(x_60); -lean_dec(x_58); -x_61 = 1; -x_62 = l_Lean_PrettyPrinter_Parenthesizer_compileParser(x_59, x_4, x_61, x_60); -return x_62; +lean_object* x_66; lean_object* x_67; lean_object* x_68; lean_object* x_69; +x_66 = lean_ctor_get(x_65, 0); +lean_inc(x_66); +x_67 = lean_ctor_get(x_65, 1); +lean_inc(x_67); +lean_dec(x_65); +x_68 = l_Lean_Parser_parserAttributeHooks; +x_69 = lean_io_ref_get(x_68, x_67); +if (lean_obj_tag(x_69) == 0) +{ +lean_object* x_70; lean_object* x_71; lean_object* x_72; +x_70 = lean_ctor_get(x_69, 0); +lean_inc(x_70); +x_71 = lean_ctor_get(x_69, 1); +lean_inc(x_71); +lean_dec(x_69); +x_72 = l_List_foldlM___main___at___private_Lean_Parser_Extension_11__BuiltinParserAttribute_add___spec__2(x_2, x_4, x_66, x_70, x_71); +return x_72; } else { -uint8_t x_63; +uint8_t x_73; +lean_dec(x_66); lean_dec(x_4); -x_63 = !lean_is_exclusive(x_58); -if (x_63 == 0) +lean_dec(x_2); +x_73 = !lean_is_exclusive(x_69); +if (x_73 == 0) { -return x_58; +return x_69; } else { -lean_object* x_64; lean_object* x_65; lean_object* x_66; -x_64 = lean_ctor_get(x_58, 0); -x_65 = lean_ctor_get(x_58, 1); -lean_inc(x_65); -lean_inc(x_64); -lean_dec(x_58); -x_66 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_66, 0, x_64); -lean_ctor_set(x_66, 1, x_65); -return x_66; +lean_object* x_74; lean_object* x_75; lean_object* x_76; +x_74 = lean_ctor_get(x_69, 0); +x_75 = lean_ctor_get(x_69, 1); +lean_inc(x_75); +lean_inc(x_74); +lean_dec(x_69); +x_76 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_76, 0, x_74); +lean_ctor_set(x_76, 1, x_75); +return x_76; +} +} +} +else +{ +uint8_t x_77; +lean_dec(x_4); +lean_dec(x_2); +x_77 = !lean_is_exclusive(x_65); +if (x_77 == 0) +{ +return x_65; +} +else +{ +lean_object* x_78; lean_object* x_79; lean_object* x_80; +x_78 = lean_ctor_get(x_65, 0); +x_79 = lean_ctor_get(x_65, 1); +lean_inc(x_79); +lean_inc(x_78); +lean_dec(x_65); +x_80 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_80, 0, x_78); +lean_ctor_set(x_80, 1, x_79); +return x_80; } } } @@ -8640,62 +8752,62 @@ return x_66; } else { -lean_object* x_67; +lean_object* x_81; lean_dec(x_35); lean_dec(x_34); lean_dec(x_33); lean_dec(x_32); lean_dec(x_3); lean_dec(x_2); -x_67 = lean_box(0); -x_17 = x_67; +x_81 = lean_box(0); +x_17 = x_81; goto block_26; } } else { -lean_object* x_68; +lean_object* x_82; lean_dec(x_34); lean_dec(x_33); lean_dec(x_32); lean_dec(x_3); lean_dec(x_2); -x_68 = lean_box(0); -x_17 = x_68; +x_82 = lean_box(0); +x_17 = x_82; goto block_26; } } else { -lean_object* x_69; +lean_object* x_83; lean_dec(x_33); lean_dec(x_32); lean_dec(x_3); lean_dec(x_2); -x_69 = lean_box(0); -x_17 = x_69; +x_83 = lean_box(0); +x_17 = x_83; goto block_26; } } else { -lean_object* x_70; +lean_object* x_84; lean_dec(x_32); lean_dec(x_3); lean_dec(x_2); -x_70 = lean_box(0); -x_17 = x_70; +x_84 = lean_box(0); +x_17 = x_84; goto block_26; } } else { -lean_object* x_71; +lean_object* x_85; lean_dec(x_31); lean_dec(x_3); lean_dec(x_2); -x_71 = lean_box(0); -x_17 = x_71; +x_85 = lean_box(0); +x_17 = x_85; goto block_26; } } @@ -8721,23 +8833,23 @@ return x_25; } else { -lean_object* x_72; lean_object* x_73; lean_object* x_74; lean_object* x_75; lean_object* x_76; lean_object* x_77; lean_object* x_78; lean_object* x_79; +lean_object* x_86; lean_object* x_87; lean_object* x_88; lean_object* x_89; lean_object* x_90; lean_object* x_91; lean_object* x_92; lean_object* x_93; lean_dec(x_4); lean_dec(x_3); lean_dec(x_2); -x_72 = l_Lean_Name_toString___closed__1; -x_73 = l_Lean_Name_toStringWithSep___main(x_72, x_1); -x_74 = l_Lean_registerTagAttribute___lambda__4___closed__1; -x_75 = lean_string_append(x_74, x_73); -lean_dec(x_73); -x_76 = l_Lean_registerTagAttribute___lambda__4___closed__5; -x_77 = lean_string_append(x_75, x_76); -x_78 = lean_alloc_ctor(18, 1, 0); -lean_ctor_set(x_78, 0, x_77); -x_79 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_79, 0, x_78); -lean_ctor_set(x_79, 1, x_7); -return x_79; +x_86 = l_Lean_Name_toString___closed__1; +x_87 = l_Lean_Name_toStringWithSep___main(x_86, x_1); +x_88 = l_Lean_registerTagAttribute___lambda__4___closed__1; +x_89 = lean_string_append(x_88, x_87); +lean_dec(x_87); +x_90 = l_Lean_registerTagAttribute___lambda__4___closed__5; +x_91 = lean_string_append(x_89, x_90); +x_92 = lean_alloc_ctor(18, 1, 0); +lean_ctor_set(x_92, 0, x_91); +x_93 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_93, 0, x_92); +lean_ctor_set(x_93, 1, x_7); +return x_93; } } } @@ -8995,6 +9107,73 @@ x_4 = l_Std_PersistentHashMap_foldlMAux___main___at___private_Lean_Parser_Extens return x_4; } } +lean_object* l_List_foldlM___main___at___private_Lean_Parser_Extension_12__ParserAttribute_add___spec__6(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { +_start: +{ +if (lean_obj_tag(x_4) == 0) +{ +lean_object* x_6; +lean_dec(x_2); +lean_dec(x_1); +x_6 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_6, 0, x_3); +lean_ctor_set(x_6, 1, x_5); +return x_6; +} +else +{ +lean_object* x_7; lean_object* x_8; uint8_t x_9; lean_object* x_10; lean_object* x_11; +x_7 = lean_ctor_get(x_4, 0); +lean_inc(x_7); +x_8 = lean_ctor_get(x_4, 1); +lean_inc(x_8); +lean_dec(x_4); +x_9 = 0; +x_10 = lean_box(x_9); +lean_inc(x_2); +lean_inc(x_1); +x_11 = lean_apply_5(x_7, x_1, x_3, x_2, x_10, x_5); +if (lean_obj_tag(x_11) == 0) +{ +lean_object* x_12; lean_object* x_13; +x_12 = lean_ctor_get(x_11, 0); +lean_inc(x_12); +x_13 = lean_ctor_get(x_11, 1); +lean_inc(x_13); +lean_dec(x_11); +x_3 = x_12; +x_4 = x_8; +x_5 = x_13; +goto _start; +} +else +{ +uint8_t x_15; +lean_dec(x_8); +lean_dec(x_2); +lean_dec(x_1); +x_15 = !lean_is_exclusive(x_11); +if (x_15 == 0) +{ +return x_11; +} +else +{ +lean_object* x_16; lean_object* x_17; lean_object* x_18; +x_16 = lean_ctor_get(x_11, 0); +x_17 = lean_ctor_get(x_11, 1); +lean_inc(x_17); +lean_inc(x_16); +lean_dec(x_11); +x_18 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_18, 0, x_16); +lean_ctor_set(x_18, 1, x_17); +return x_18; +} +} +} +} +} lean_object* l___private_Lean_Parser_Extension_12__ParserAttribute_add(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, uint8_t x_6, lean_object* x_7) { _start: { @@ -9088,10 +9267,11 @@ return x_23; } else { -lean_object* x_35; uint8_t x_36; lean_object* x_37; lean_object* x_38; +lean_object* x_35; uint8_t x_36; lean_object* x_37; lean_object* x_38; lean_object* x_39; lean_dec(x_32); lean_free_object(x_23); lean_inc(x_4); +lean_inc(x_2); x_35 = lean_alloc_ctor(3, 3, 1); lean_ctor_set(x_35, 0, x_2); lean_ctor_set(x_35, 1, x_4); @@ -9100,114 +9280,189 @@ x_36 = lean_unbox(x_17); lean_dec(x_17); lean_ctor_set_uint8(x_35, sizeof(void*)*3, x_36); x_37 = l_Lean_PersistentEnvExtension_addEntry___rarg(x_9, x_30, x_35); -x_38 = l_Lean_PrettyPrinter_Parenthesizer_addParenthesizerFromConstantUnsafe(x_37, x_4, x_26); -return x_38; +x_38 = l_Lean_Parser_parserAttributeHooks; +x_39 = lean_io_ref_get(x_38, x_26); +if (lean_obj_tag(x_39) == 0) +{ +lean_object* x_40; lean_object* x_41; lean_object* x_42; +x_40 = lean_ctor_get(x_39, 0); +lean_inc(x_40); +x_41 = lean_ctor_get(x_39, 1); +lean_inc(x_41); +lean_dec(x_39); +x_42 = l_List_foldlM___main___at___private_Lean_Parser_Extension_12__ParserAttribute_add___spec__6(x_2, x_4, x_37, x_40, x_41); +return x_42; +} +else +{ +uint8_t x_43; +lean_dec(x_37); +lean_dec(x_4); +lean_dec(x_2); +x_43 = !lean_is_exclusive(x_39); +if (x_43 == 0) +{ +return x_39; +} +else +{ +lean_object* x_44; lean_object* x_45; lean_object* x_46; +x_44 = lean_ctor_get(x_39, 0); +x_45 = lean_ctor_get(x_39, 1); +lean_inc(x_45); +lean_inc(x_44); +lean_dec(x_39); +x_46 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_46, 0, x_44); +lean_ctor_set(x_46, 1, x_45); +return x_46; +} +} } } else { -lean_object* x_39; lean_object* x_40; lean_object* x_41; lean_object* x_42; lean_object* x_43; lean_object* x_44; uint8_t x_45; lean_object* x_46; -x_39 = lean_ctor_get(x_23, 0); -x_40 = lean_ctor_get(x_23, 1); -lean_inc(x_40); -lean_inc(x_39); +lean_object* x_47; lean_object* x_48; lean_object* x_49; lean_object* x_50; lean_object* x_51; lean_object* x_52; uint8_t x_53; lean_object* x_54; +x_47 = lean_ctor_get(x_23, 0); +x_48 = lean_ctor_get(x_23, 1); +lean_inc(x_48); +lean_inc(x_47); lean_dec(x_23); -x_41 = lean_ctor_get(x_19, 1); -lean_inc(x_41); +x_49 = lean_ctor_get(x_19, 1); +lean_inc(x_49); lean_dec(x_19); -x_42 = l_Std_PersistentHashMap_empty___at_Lean_Parser_mkBuiltinSyntaxNodeKindSetRef___spec__1; -x_43 = lean_apply_1(x_41, x_42); -x_44 = l_Std_PersistentHashMap_foldlM___at___private_Lean_Parser_Extension_12__ParserAttribute_add___spec__2(x_43, x_39); -lean_dec(x_43); -x_45 = lean_unbox(x_17); +x_50 = l_Std_PersistentHashMap_empty___at_Lean_Parser_mkBuiltinSyntaxNodeKindSetRef___spec__1; +x_51 = lean_apply_1(x_49, x_50); +x_52 = l_Std_PersistentHashMap_foldlM___at___private_Lean_Parser_Extension_12__ParserAttribute_add___spec__2(x_51, x_47); +lean_dec(x_51); +x_53 = lean_unbox(x_17); lean_inc(x_18); lean_inc(x_2); -x_46 = l_Lean_Parser_addParser(x_11, x_2, x_4, x_45, x_18); -if (lean_obj_tag(x_46) == 0) +x_54 = l_Lean_Parser_addParser(x_11, x_2, x_4, x_53, x_18); +if (lean_obj_tag(x_54) == 0) { -lean_object* x_47; lean_object* x_48; lean_object* x_49; -lean_dec(x_44); +lean_object* x_55; lean_object* x_56; lean_object* x_57; +lean_dec(x_52); lean_dec(x_18); lean_dec(x_17); lean_dec(x_4); lean_dec(x_2); -x_47 = lean_ctor_get(x_46, 0); -lean_inc(x_47); -lean_dec(x_46); -x_48 = lean_alloc_ctor(18, 1, 0); -lean_ctor_set(x_48, 0, x_47); -x_49 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_49, 0, x_48); -lean_ctor_set(x_49, 1, x_40); -return x_49; +x_55 = lean_ctor_get(x_54, 0); +lean_inc(x_55); +lean_dec(x_54); +x_56 = lean_alloc_ctor(18, 1, 0); +lean_ctor_set(x_56, 0, x_55); +x_57 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_57, 0, x_56); +lean_ctor_set(x_57, 1, x_48); +return x_57; } else { -lean_object* x_50; uint8_t x_51; lean_object* x_52; lean_object* x_53; -lean_dec(x_46); +lean_object* x_58; uint8_t x_59; lean_object* x_60; lean_object* x_61; lean_object* x_62; +lean_dec(x_54); lean_inc(x_4); -x_50 = lean_alloc_ctor(3, 3, 1); -lean_ctor_set(x_50, 0, x_2); -lean_ctor_set(x_50, 1, x_4); -lean_ctor_set(x_50, 2, x_18); -x_51 = lean_unbox(x_17); +lean_inc(x_2); +x_58 = lean_alloc_ctor(3, 3, 1); +lean_ctor_set(x_58, 0, x_2); +lean_ctor_set(x_58, 1, x_4); +lean_ctor_set(x_58, 2, x_18); +x_59 = lean_unbox(x_17); lean_dec(x_17); -lean_ctor_set_uint8(x_50, sizeof(void*)*3, x_51); -x_52 = l_Lean_PersistentEnvExtension_addEntry___rarg(x_9, x_44, x_50); -x_53 = l_Lean_PrettyPrinter_Parenthesizer_addParenthesizerFromConstantUnsafe(x_52, x_4, x_40); -return x_53; +lean_ctor_set_uint8(x_58, sizeof(void*)*3, x_59); +x_60 = l_Lean_PersistentEnvExtension_addEntry___rarg(x_9, x_52, x_58); +x_61 = l_Lean_Parser_parserAttributeHooks; +x_62 = lean_io_ref_get(x_61, x_48); +if (lean_obj_tag(x_62) == 0) +{ +lean_object* x_63; lean_object* x_64; lean_object* x_65; +x_63 = lean_ctor_get(x_62, 0); +lean_inc(x_63); +x_64 = lean_ctor_get(x_62, 1); +lean_inc(x_64); +lean_dec(x_62); +x_65 = l_List_foldlM___main___at___private_Lean_Parser_Extension_12__ParserAttribute_add___spec__6(x_2, x_4, x_60, x_63, x_64); +return x_65; +} +else +{ +lean_object* x_66; lean_object* x_67; lean_object* x_68; lean_object* x_69; +lean_dec(x_60); +lean_dec(x_4); +lean_dec(x_2); +x_66 = lean_ctor_get(x_62, 0); +lean_inc(x_66); +x_67 = lean_ctor_get(x_62, 1); +lean_inc(x_67); +if (lean_is_exclusive(x_62)) { + lean_ctor_release(x_62, 0); + lean_ctor_release(x_62, 1); + x_68 = x_62; +} else { + lean_dec_ref(x_62); + x_68 = lean_box(0); +} +if (lean_is_scalar(x_68)) { + x_69 = lean_alloc_ctor(1, 2, 0); +} else { + x_69 = x_68; +} +lean_ctor_set(x_69, 0, x_66); +lean_ctor_set(x_69, 1, x_67); +return x_69; +} } } } else { -uint8_t x_54; +uint8_t x_70; lean_dec(x_19); lean_dec(x_18); lean_dec(x_17); lean_dec(x_11); lean_dec(x_4); lean_dec(x_2); -x_54 = !lean_is_exclusive(x_23); -if (x_54 == 0) +x_70 = !lean_is_exclusive(x_23); +if (x_70 == 0) { return x_23; } else { -lean_object* x_55; lean_object* x_56; lean_object* x_57; -x_55 = lean_ctor_get(x_23, 0); -x_56 = lean_ctor_get(x_23, 1); -lean_inc(x_56); -lean_inc(x_55); +lean_object* x_71; lean_object* x_72; lean_object* x_73; +x_71 = lean_ctor_get(x_23, 0); +x_72 = lean_ctor_get(x_23, 1); +lean_inc(x_72); +lean_inc(x_71); lean_dec(x_23); -x_57 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_57, 0, x_55); -lean_ctor_set(x_57, 1, x_56); -return x_57; +x_73 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_73, 0, x_71); +lean_ctor_set(x_73, 1, x_72); +return x_73; } } } } else { -lean_object* x_58; lean_object* x_59; lean_object* x_60; lean_object* x_61; lean_object* x_62; lean_object* x_63; lean_object* x_64; lean_object* x_65; +lean_object* x_74; lean_object* x_75; lean_object* x_76; lean_object* x_77; lean_object* x_78; lean_object* x_79; lean_object* x_80; lean_object* x_81; lean_dec(x_4); lean_dec(x_3); lean_dec(x_2); -x_58 = l_Lean_Name_toString___closed__1; -x_59 = l_Lean_Name_toStringWithSep___main(x_58, x_1); -x_60 = l_Lean_registerTagAttribute___lambda__4___closed__1; -x_61 = lean_string_append(x_60, x_59); -lean_dec(x_59); -x_62 = l_Lean_registerTagAttribute___lambda__4___closed__5; -x_63 = lean_string_append(x_61, x_62); -x_64 = lean_alloc_ctor(18, 1, 0); -lean_ctor_set(x_64, 0, x_63); -x_65 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_65, 0, x_64); -lean_ctor_set(x_65, 1, x_7); -return x_65; +x_74 = l_Lean_Name_toString___closed__1; +x_75 = l_Lean_Name_toStringWithSep___main(x_74, x_1); +x_76 = l_Lean_registerTagAttribute___lambda__4___closed__1; +x_77 = lean_string_append(x_76, x_75); +lean_dec(x_75); +x_78 = l_Lean_registerTagAttribute___lambda__4___closed__5; +x_79 = lean_string_append(x_77, x_78); +x_80 = lean_alloc_ctor(18, 1, 0); +lean_ctor_set(x_80, 0, x_79); +x_81 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_81, 0, x_80); +lean_ctor_set(x_81, 1, x_7); +return x_81; } } } @@ -9578,7 +9833,7 @@ return x_4; } lean_object* initialize_Init(lean_object*); lean_object* initialize_Lean_Parser_Basic(lean_object*); -lean_object* initialize_Lean_PrettyPrinter_Parenthesizer(lean_object*); +lean_object* initialize_Lean_KeyedDeclsAttribute(lean_object*); static bool _G_initialized = false; lean_object* initialize_Lean_Parser_Extension(lean_object* w) { lean_object * res; @@ -9590,7 +9845,7 @@ lean_dec_ref(res); res = initialize_Lean_Parser_Basic(lean_io_mk_world()); if (lean_io_result_is_error(res)) return res; lean_dec_ref(res); -res = initialize_Lean_PrettyPrinter_Parenthesizer(lean_io_mk_world()); +res = initialize_Lean_KeyedDeclsAttribute(lean_io_mk_world()); if (lean_io_result_is_error(res)) return res; lean_dec_ref(res); res = l_Lean_Parser_mkBuiltinTokenTable(lean_io_mk_world()); @@ -9639,6 +9894,8 @@ l_Lean_Parser_mkParserOfConstantUnsafe___closed__3 = _init_l_Lean_Parser_mkParse lean_mark_persistent(l_Lean_Parser_mkParserOfConstantUnsafe___closed__3); l_Lean_Parser_mkParserOfConstantUnsafe___closed__4 = _init_l_Lean_Parser_mkParserOfConstantUnsafe___closed__4(); lean_mark_persistent(l_Lean_Parser_mkParserOfConstantUnsafe___closed__4); +l_Lean_Parser_mkParserOfConstantUnsafe___closed__5 = _init_l_Lean_Parser_mkParserOfConstantUnsafe___closed__5(); +lean_mark_persistent(l_Lean_Parser_mkParserOfConstantUnsafe___closed__5); l_Lean_Parser_compileParserDescr___main___closed__1 = _init_l_Lean_Parser_compileParserDescr___main___closed__1(); lean_mark_persistent(l_Lean_Parser_compileParserDescr___main___closed__1); l_Lean_Parser_compileParserDescr___main___closed__2 = _init_l_Lean_Parser_compileParserDescr___main___closed__2(); @@ -9649,6 +9906,11 @@ l_Lean_Parser_compileParserDescr___main___closed__4 = _init_l_Lean_Parser_compil lean_mark_persistent(l_Lean_Parser_compileParserDescr___main___closed__4); l_Lean_Parser_compileParserDescr___main___closed__5 = _init_l_Lean_Parser_compileParserDescr___main___closed__5(); lean_mark_persistent(l_Lean_Parser_compileParserDescr___main___closed__5); +res = l_Lean_Parser_mkParserAttributeHooks(lean_io_mk_world()); +if (lean_io_result_is_error(res)) return res; +l_Lean_Parser_parserAttributeHooks = lean_io_result_get_value(res); +lean_mark_persistent(l_Lean_Parser_parserAttributeHooks); +lean_dec_ref(res); l_Lean_registerEnvExtensionUnsafe___at_Lean_Parser_mkParserExtension___spec__3___closed__1 = _init_l_Lean_registerEnvExtensionUnsafe___at_Lean_Parser_mkParserExtension___spec__3___closed__1(); lean_mark_persistent(l_Lean_registerEnvExtensionUnsafe___at_Lean_Parser_mkParserExtension___spec__3___closed__1); l_Lean_Parser_mkParserExtension___closed__1 = _init_l_Lean_Parser_mkParserExtension___closed__1(); @@ -9689,64 +9951,6 @@ lean_mark_persistent(l_Lean_Parser_setCategoryParserFnRef___closed__1); res = l_Lean_Parser_setCategoryParserFnRef(lean_io_mk_world()); if (lean_io_result_is_error(res)) return res; lean_dec_ref(res); -res = l_Lean_Parser_mkParserAttributeHooks(lean_io_mk_world()); -if (lean_io_result_is_error(res)) return res; -l_Lean_Parser_parserAttributeHooks = lean_io_result_get_value(res); -lean_mark_persistent(l_Lean_Parser_parserAttributeHooks); -lean_dec_ref(res); -l_Lean_Parser_mkParserAttributeHookAttribute___lambda__1___closed__1 = _init_l_Lean_Parser_mkParserAttributeHookAttribute___lambda__1___closed__1(); -lean_mark_persistent(l_Lean_Parser_mkParserAttributeHookAttribute___lambda__1___closed__1); -l_Lean_Parser_mkParserAttributeHookAttribute___lambda__1___closed__2 = _init_l_Lean_Parser_mkParserAttributeHookAttribute___lambda__1___closed__2(); -lean_mark_persistent(l_Lean_Parser_mkParserAttributeHookAttribute___lambda__1___closed__2); -l_Lean_Parser_mkParserAttributeHookAttribute___lambda__1___closed__3 = _init_l_Lean_Parser_mkParserAttributeHookAttribute___lambda__1___closed__3(); -lean_mark_persistent(l_Lean_Parser_mkParserAttributeHookAttribute___lambda__1___closed__3); -l_Lean_Parser_mkParserAttributeHookAttribute___lambda__1___closed__4 = _init_l_Lean_Parser_mkParserAttributeHookAttribute___lambda__1___closed__4(); -lean_mark_persistent(l_Lean_Parser_mkParserAttributeHookAttribute___lambda__1___closed__4); -l_Lean_Parser_mkParserAttributeHookAttribute___closed__1 = _init_l_Lean_Parser_mkParserAttributeHookAttribute___closed__1(); -lean_mark_persistent(l_Lean_Parser_mkParserAttributeHookAttribute___closed__1); -l_Lean_Parser_mkParserAttributeHookAttribute___closed__2 = _init_l_Lean_Parser_mkParserAttributeHookAttribute___closed__2(); -lean_mark_persistent(l_Lean_Parser_mkParserAttributeHookAttribute___closed__2); -l_Lean_Parser_mkParserAttributeHookAttribute___closed__3 = _init_l_Lean_Parser_mkParserAttributeHookAttribute___closed__3(); -lean_mark_persistent(l_Lean_Parser_mkParserAttributeHookAttribute___closed__3); -l_Lean_Parser_mkParserAttributeHookAttribute___closed__4 = _init_l_Lean_Parser_mkParserAttributeHookAttribute___closed__4(); -lean_mark_persistent(l_Lean_Parser_mkParserAttributeHookAttribute___closed__4); -l_Lean_Parser_mkParserAttributeHookAttribute___closed__5 = _init_l_Lean_Parser_mkParserAttributeHookAttribute___closed__5(); -lean_mark_persistent(l_Lean_Parser_mkParserAttributeHookAttribute___closed__5); -l_Lean_Parser_mkParserAttributeHookAttribute___closed__6 = _init_l_Lean_Parser_mkParserAttributeHookAttribute___closed__6(); -lean_mark_persistent(l_Lean_Parser_mkParserAttributeHookAttribute___closed__6); -l_Lean_Parser_mkParserAttributeHookAttribute___closed__7 = _init_l_Lean_Parser_mkParserAttributeHookAttribute___closed__7(); -lean_mark_persistent(l_Lean_Parser_mkParserAttributeHookAttribute___closed__7); -l_Lean_Parser_mkParserAttributeHookAttribute___closed__8 = _init_l_Lean_Parser_mkParserAttributeHookAttribute___closed__8(); -lean_mark_persistent(l_Lean_Parser_mkParserAttributeHookAttribute___closed__8); -l_Lean_Parser_mkParserAttributeHookAttribute___closed__9 = _init_l_Lean_Parser_mkParserAttributeHookAttribute___closed__9(); -lean_mark_persistent(l_Lean_Parser_mkParserAttributeHookAttribute___closed__9); -l_Lean_Parser_mkParserAttributeHookAttribute___closed__10 = _init_l_Lean_Parser_mkParserAttributeHookAttribute___closed__10(); -lean_mark_persistent(l_Lean_Parser_mkParserAttributeHookAttribute___closed__10); -l_Lean_Parser_mkParserAttributeHookAttribute___closed__11 = _init_l_Lean_Parser_mkParserAttributeHookAttribute___closed__11(); -lean_mark_persistent(l_Lean_Parser_mkParserAttributeHookAttribute___closed__11); -l_Std_PersistentHashMap_empty___at_Lean_Parser_parserAttributeHookAttribute___spec__3 = _init_l_Std_PersistentHashMap_empty___at_Lean_Parser_parserAttributeHookAttribute___spec__3(); -lean_mark_persistent(l_Std_PersistentHashMap_empty___at_Lean_Parser_parserAttributeHookAttribute___spec__3); -l_Lean_SMap_empty___at_Lean_Parser_parserAttributeHookAttribute___spec__1___closed__1 = _init_l_Lean_SMap_empty___at_Lean_Parser_parserAttributeHookAttribute___spec__1___closed__1(); -lean_mark_persistent(l_Lean_SMap_empty___at_Lean_Parser_parserAttributeHookAttribute___spec__1___closed__1); -l_Lean_SMap_empty___at_Lean_Parser_parserAttributeHookAttribute___spec__1___closed__2 = _init_l_Lean_SMap_empty___at_Lean_Parser_parserAttributeHookAttribute___spec__1___closed__2(); -lean_mark_persistent(l_Lean_SMap_empty___at_Lean_Parser_parserAttributeHookAttribute___spec__1___closed__2); -l_Lean_SMap_empty___at_Lean_Parser_parserAttributeHookAttribute___spec__1 = _init_l_Lean_SMap_empty___at_Lean_Parser_parserAttributeHookAttribute___spec__1(); -lean_mark_persistent(l_Lean_SMap_empty___at_Lean_Parser_parserAttributeHookAttribute___spec__1); -l_Lean_Parser_parserAttributeHookAttribute___closed__1 = _init_l_Lean_Parser_parserAttributeHookAttribute___closed__1(); -lean_mark_persistent(l_Lean_Parser_parserAttributeHookAttribute___closed__1); -l_Lean_Parser_parserAttributeHookAttribute___closed__2 = _init_l_Lean_Parser_parserAttributeHookAttribute___closed__2(); -lean_mark_persistent(l_Lean_Parser_parserAttributeHookAttribute___closed__2); -l_Lean_Parser_parserAttributeHookAttribute___closed__3 = _init_l_Lean_Parser_parserAttributeHookAttribute___closed__3(); -lean_mark_persistent(l_Lean_Parser_parserAttributeHookAttribute___closed__3); -l_Lean_Parser_parserAttributeHookAttribute___closed__4 = _init_l_Lean_Parser_parserAttributeHookAttribute___closed__4(); -lean_mark_persistent(l_Lean_Parser_parserAttributeHookAttribute___closed__4); -l_Lean_Parser_parserAttributeHookAttribute___closed__5 = _init_l_Lean_Parser_parserAttributeHookAttribute___closed__5(); -lean_mark_persistent(l_Lean_Parser_parserAttributeHookAttribute___closed__5); -res = l_Lean_Parser_mkParserAttributeHookAttribute(lean_io_mk_world()); -if (lean_io_result_is_error(res)) return res; -l_Lean_Parser_parserAttributeHookAttribute = lean_io_result_get_value(res); -lean_mark_persistent(l_Lean_Parser_parserAttributeHookAttribute); -lean_dec_ref(res); l_Lean_Parser_declareBuiltinParser___closed__1 = _init_l_Lean_Parser_declareBuiltinParser___closed__1(); lean_mark_persistent(l_Lean_Parser_declareBuiltinParser___closed__1); l_Lean_Parser_declareBuiltinParser___closed__2 = _init_l_Lean_Parser_declareBuiltinParser___closed__2(); diff --git a/stage0/stdlib/Lean/Parser/Level.c b/stage0/stdlib/Lean/Parser/Level.c index e527102663..c89be50114 100644 --- a/stage0/stdlib/Lean/Parser/Level.c +++ b/stage0/stdlib/Lean/Parser/Level.c @@ -1,6 +1,6 @@ // Lean compiler output // Module: Lean.Parser.Level -// Imports: Init Lean.Parser.Extension +// Imports: Init Lean.Parser.Extension Lean.PrettyPrinter.Parenthesizer #include #if defined(__clang__) #pragma clang diagnostic ignored "-Wunused-parameter" @@ -3742,6 +3742,7 @@ return x_5; } lean_object* initialize_Init(lean_object*); lean_object* initialize_Lean_Parser_Extension(lean_object*); +lean_object* initialize_Lean_PrettyPrinter_Parenthesizer(lean_object*); static bool _G_initialized = false; lean_object* initialize_Lean_Parser_Level(lean_object* w) { lean_object * res; @@ -3753,6 +3754,9 @@ lean_dec_ref(res); res = initialize_Lean_Parser_Extension(lean_io_mk_world()); if (lean_io_result_is_error(res)) return res; lean_dec_ref(res); +res = initialize_Lean_PrettyPrinter_Parenthesizer(lean_io_mk_world()); +if (lean_io_result_is_error(res)) return res; +lean_dec_ref(res); l_Lean_Parser_regBuiltinLevelParserAttr___closed__1 = _init_l_Lean_Parser_regBuiltinLevelParserAttr___closed__1(); lean_mark_persistent(l_Lean_Parser_regBuiltinLevelParserAttr___closed__1); l_Lean_Parser_regBuiltinLevelParserAttr___closed__2 = _init_l_Lean_Parser_regBuiltinLevelParserAttr___closed__2(); diff --git a/stage0/stdlib/Lean/PrettyPrinter/Formatter.c b/stage0/stdlib/Lean/PrettyPrinter/Formatter.c index 139c3bb643..e0e71dc66a 100644 --- a/stage0/stdlib/Lean/PrettyPrinter/Formatter.c +++ b/stage0/stdlib/Lean/PrettyPrinter/Formatter.c @@ -2775,7 +2775,7 @@ _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; x_1 = l_Lean_PrettyPrinter_Formatter_visit___main___lambda__1___closed__1; -x_2 = lean_unsigned_to_nat(131u); +x_2 = lean_unsigned_to_nat(132u); x_3 = lean_unsigned_to_nat(8u); x_4 = l_Lean_PrettyPrinter_Formatter_visit___main___lambda__1___closed__2; x_5 = l___private_Init_Util_1__mkPanicMessage(x_1, x_2, x_3, x_4); @@ -8107,7 +8107,7 @@ _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; x_1 = l_Lean_PrettyPrinter_Formatter_visit___main___lambda__1___closed__1; -x_2 = lean_unsigned_to_nat(244u); +x_2 = lean_unsigned_to_nat(245u); x_3 = lean_unsigned_to_nat(35u); x_4 = l_Lean_PrettyPrinter_Formatter_identNoAntiquot_formatter___rarg___closed__1; x_5 = l___private_Init_Util_1__mkPanicMessage(x_1, x_2, x_3, x_4); diff --git a/stage0/stdlib/Lean/PrettyPrinter/Parenthesizer.c b/stage0/stdlib/Lean/PrettyPrinter/Parenthesizer.c index 3f16fa5e7e..aeb591333d 100644 --- a/stage0/stdlib/Lean/PrettyPrinter/Parenthesizer.c +++ b/stage0/stdlib/Lean/PrettyPrinter/Parenthesizer.c @@ -1,6 +1,6 @@ // Lean compiler output // Module: Lean.PrettyPrinter.Parenthesizer -// Imports: Init Lean.Util.ReplaceExpr Lean.Meta.Basic Lean.Meta.WHNF Lean.KeyedDeclsAttribute Lean.Parser.Basic Lean.ParserCompiler +// Imports: Init Lean.Util.ReplaceExpr Lean.Meta.Basic Lean.Meta.WHNF Lean.KeyedDeclsAttribute Lean.Parser.Extension Lean.ParserCompiler #include #if defined(__clang__) #pragma clang diagnostic ignored "-Wunused-parameter" @@ -81,6 +81,7 @@ lean_object* l_Lean_PrettyPrinter_Parenthesizer_identNoAntiquot_parenthesizer___ lean_object* l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__8; lean_object* l_Lean_PrettyPrinter_Parenthesizer_maybeParenthesize___closed__8; lean_object* l_Lean_Format_pretty(lean_object*, lean_object*); +lean_object* l_Lean_Parser_registerParserAttributeHook(lean_object*, lean_object*); lean_object* l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___lambda__20(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_EIO_Monad___closed__1; lean_object* l_Lean_PrettyPrinter_Parenthesizer_withPosition_parenthesizer___closed__1; @@ -147,6 +148,7 @@ lean_object* l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___lambd lean_object* l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___lambda__14___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_PrettyPrinter_Parenthesizer_maybeParenthesize___closed__15; lean_object* l_Nat_forMAux___main___at_Lean_PrettyPrinter_Parenthesizer_many_parenthesizer___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l___private_Lean_PrettyPrinter_Parenthesizer_1__regTraceClasses___closed__1; lean_object* l_Lean_PrettyPrinter_Parenthesizer_visitToken(lean_object*); lean_object* l_Lean_PrettyPrinter_Parenthesizer_maybeParenthesize___closed__18; lean_object* l_Lean_Syntax_MonadTraverser_goDown___at_Lean_PrettyPrinter_Parenthesizer_visitArgs___spec__3___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -165,7 +167,6 @@ lean_object* l_Lean_PrettyPrinter_Parenthesizer_tactic_parenthesizer___lambda__1 lean_object* l_Lean_Meta_forallTelescope___rarg(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_List_range(lean_object*); lean_object* l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__21; -uint8_t lean_is_parser_category(lean_object*, lean_object*); lean_object* l_Array_iterateM_u2082Aux___main___at_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___spec__13(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_PrettyPrinter_mkCombinatorParenthesizerAttribute___closed__1; lean_object* l_Lean_PrettyPrinter_parenthesizeCommand(lean_object*, lean_object*, lean_object*); @@ -200,7 +201,6 @@ lean_object* l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___lambd lean_object* l_Lean_KeyedDeclsAttribute_addBuiltin___rarg(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_PrettyPrinter_Parenthesizer_maybeParenthesize___closed__10; lean_object* l_Lean_PrettyPrinter_Parenthesizer_andthen_parenthesizer(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__23; extern lean_object* l_Lean_LocalContext_Inhabited___closed__1; lean_object* l_Lean_PrettyPrinter_Parenthesizer_numLitNoAntiquot_parenthesizer___rarg___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_PrettyPrinter_Parenthesizer_checkPrec_parenthesizer___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -357,10 +357,12 @@ lean_object* l_Array_iterateM_u2082Aux___main___at_Lean_PrettyPrinter_Parenthesi lean_object* l_Array_iterateM_u2082Aux___main___at_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___spec__10(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Syntax_getId(lean_object*); lean_object* l_Lean_PrettyPrinter_parenthesize(lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l___private_Lean_PrettyPrinter_Parenthesizer_1__regTraceClasses___lambda__1(lean_object*, lean_object*, lean_object*, uint8_t, lean_object*); extern lean_object* l_Lean_Parser_termParser___closed__2; lean_object* lean_name_mk_string(lean_object*, lean_object*); lean_object* l_Lean_PrettyPrinter_Parenthesizer_nameLitNoAntiquot_parenthesizer___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_Array_iterateM_u2082Aux___main___at_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___spec__19___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l___private_Lean_PrettyPrinter_Parenthesizer_1__regTraceClasses___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Syntax_MonadTraverser_goRight___at_Lean_PrettyPrinter_Parenthesizer_maybeParenthesize___spec__4___boxed(lean_object*); lean_object* l_Lean_PrettyPrinter_Parenthesizer_maybeParenthesize___closed__22; extern lean_object* l_Lean_Parser_maxPrec; @@ -399,7 +401,6 @@ extern lean_object* l_IO_Error_Inhabited___closed__1; lean_object* l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___lambda__12___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_expr_dbg_to_string(lean_object*); lean_object* l_IO_ofExcept___at_Lean_PrettyPrinter_Parenthesizer_mkParenthesizerOfConstantUnsafe___spec__1___boxed(lean_object*, lean_object*); -lean_object* l_Lean_PrettyPrinter_isParserCategory___boxed(lean_object*, lean_object*); lean_object* l_Lean_attrParamSyntaxToIdentifier(lean_object*); lean_object* l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___lambda__13(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__14; @@ -427,7 +428,6 @@ lean_object* l___private_Init_Data_Array_Basic_3__iterateRevMAux___main___at_Lea lean_object* l_Lean_Syntax_MonadTraverser_getCur___at_Lean_PrettyPrinter_Parenthesizer_visitArgs___spec__1(lean_object*); lean_object* l_Array_iterateM_u2082Aux___main___at_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___spec__16(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_PrettyPrinter_Parenthesizer_mkParenthesizerOfConstantAux___boxed(lean_object*, lean_object*); -lean_object* l_Lean_PrettyPrinter_isValidSyntaxNodeKind___boxed(lean_object*, lean_object*); lean_object* l_Lean_PrettyPrinter_Parenthesizer_maybeParenthesize___closed__12; lean_object* l_Lean_KeyedDeclsAttribute_Table_insert___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_ReaderT_map___at_Lean_PrettyPrinter_Parenthesizer_ParenthesizerM_monadTraverser___spec__3(lean_object*, lean_object*); @@ -524,6 +524,7 @@ lean_object* l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___lambd lean_object* l___private_Init_Data_Array_Basic_3__iterateRevMAux___main___at_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___spec__17(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___lambda__19(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_PrettyPrinter_Parenthesizer_setExpected_parenthesizer(lean_object*); +uint8_t l_Lean_Parser_isParserCategory(lean_object*, lean_object*); lean_object* l_Lean_PrettyPrinter_combinatorParenthesizerAttribute; lean_object* l_Lean_PrettyPrinter_Parenthesizer_level_parenthesizer___lambda__2(lean_object*); uint8_t lean_nat_dec_le(lean_object*, lean_object*); @@ -543,6 +544,7 @@ lean_object* l_Lean_PrettyPrinter_Parenthesizer_ite___rarg(uint8_t, lean_object* lean_object* l_Lean_PrettyPrinter_mkParenthesizerAttribute___closed__4; lean_object* l_Lean_Environment_addAndCompile(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Syntax_getKind(lean_object*); +uint8_t l_Lean_Parser_isValidSyntaxNodeKind(lean_object*, lean_object*); lean_object* l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___lambda__4(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Syntax_Traverser_right(lean_object*); lean_object* l_Lean_PrettyPrinter_Parenthesizer_monadQuotation___closed__4; @@ -675,7 +677,6 @@ lean_object* l_Lean_PrettyPrinter_Parenthesizer_leadingNode_parenthesizer___clos lean_object* l_Nat_min(lean_object*, lean_object*); lean_object* l_Lean_PrettyPrinter_Parenthesizer_many1_parenthesizer(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_expr_update_app(lean_object*, lean_object*, lean_object*); -uint8_t lean_is_valid_syntax_node_kind(lean_object*, lean_object*); lean_object* l_Lean_PrettyPrinter_Parenthesizer_node_parenthesizer___closed__6; lean_object* l_Lean_PrettyPrinter_Parenthesizer_level_parenthesizer___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Init_Data_Array_Basic_3__iterateRevMAux___main___at_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___spec__29___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -693,6 +694,7 @@ lean_object* l_Array_iterateM_u2082Aux___main___at_Lean_PrettyPrinter_Parenthesi lean_object* l_Lean_Syntax_Traverser_left(lean_object*); lean_object* l_Lean_PrettyPrinter_Parenthesizer_quotedSymbol_parenthesizer___rarg___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___lambda__4___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +extern lean_object* l_Lean_Parser_mkParserOfConstantUnsafe___closed__5; extern lean_object* l_Lean_defaultMaxRecDepth; lean_object* l_Lean_PrettyPrinter_categoryParenthesizerAttribute___closed__3; lean_object* l_Lean_PrettyPrinter_Parenthesizer_symbolNoWs_parenthesizer___rarg(lean_object*, lean_object*, lean_object*); @@ -748,15 +750,6 @@ lean_object* l_Lean_PrettyPrinter_Parenthesizer_ParenthesizerM_monadTraverser; lean_object* l_Lean_PrettyPrinter_Parenthesizer_rawIdent_parenthesizer___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_PrettyPrinter_Parenthesizer_tactic_parenthesizer___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_PrettyPrinter_Parenthesizer_unicodeSymbol_parenthesizer(lean_object*); -lean_object* l_Lean_PrettyPrinter_isValidSyntaxNodeKind___boxed(lean_object* x_1, lean_object* x_2) { -_start: -{ -uint8_t x_3; lean_object* x_4; -x_3 = lean_is_valid_syntax_node_kind(x_1, x_2); -x_4 = lean_box(x_3); -return x_4; -} -} lean_object* _init_l_Lean_PrettyPrinter_mkParenthesizerAttribute___lambda__1___closed__1() { _start: { @@ -803,8 +796,8 @@ lean_object* x_6; uint8_t x_7; x_6 = lean_ctor_get(x_4, 0); lean_inc(x_6); lean_dec(x_4); -lean_inc(x_6); -x_7 = lean_is_valid_syntax_node_kind(x_2, x_6); +x_7 = l_Lean_Parser_isValidSyntaxNodeKind(x_2, x_6); +lean_dec(x_2); if (x_7 == 0) { lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; @@ -839,8 +832,8 @@ x_17 = lean_environment_find(x_2, x_16); if (lean_obj_tag(x_17) == 0) { uint8_t x_18; -lean_inc(x_16); -x_18 = lean_is_valid_syntax_node_kind(x_2, x_16); +x_18 = l_Lean_Parser_isValidSyntaxNodeKind(x_2, x_16); +lean_dec(x_2); if (x_18 == 0) { lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; @@ -1138,15 +1131,6 @@ lean_ctor_set(x_3, 1, x_2); return x_3; } } -lean_object* l_Lean_PrettyPrinter_isParserCategory___boxed(lean_object* x_1, lean_object* x_2) { -_start: -{ -uint8_t x_3; lean_object* x_4; -x_3 = lean_is_parser_category(x_1, x_2); -x_4 = lean_box(x_3); -return x_4; -} -} lean_object* _init_l_Lean_PrettyPrinter_mkCategoryParenthesizerAttribute___lambda__1___closed__1() { _start: { @@ -1163,7 +1147,6 @@ x_4 = l_Lean_attrParamSyntaxToIdentifier(x_3); if (lean_obj_tag(x_4) == 0) { lean_object* x_5; -lean_dec(x_2); x_5 = l_Lean_PrettyPrinter_mkParenthesizerAttribute___lambda__1___closed__2; return x_5; } @@ -1173,8 +1156,7 @@ lean_object* x_6; uint8_t x_7; x_6 = lean_ctor_get(x_4, 0); lean_inc(x_6); lean_dec(x_4); -lean_inc(x_6); -x_7 = lean_is_parser_category(x_2, x_6); +x_7 = l_Lean_Parser_isParserCategory(x_2, x_6); if (x_7 == 0) { lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; @@ -1323,6 +1305,7 @@ x_4 = lean_unbox(x_1); lean_dec(x_1); x_5 = l_Lean_PrettyPrinter_mkCategoryParenthesizerAttribute___lambda__1(x_4, x_2, x_3); lean_dec(x_3); +lean_dec(x_2); return x_5; } } @@ -2922,7 +2905,7 @@ _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; x_1 = l_Lean_PrettyPrinter_Parenthesizer_maybeParenthesize___closed__7; -x_2 = lean_unsigned_to_nat(204u); +x_2 = lean_unsigned_to_nat(198u); x_3 = lean_unsigned_to_nat(4u); x_4 = l_Lean_PrettyPrinter_Parenthesizer_maybeParenthesize___closed__8; x_5 = l___private_Init_Util_1__mkPanicMessage(x_1, x_2, x_3, x_4); @@ -12176,7 +12159,7 @@ _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; x_1 = l_Lean_PrettyPrinter_Parenthesizer_maybeParenthesize___closed__7; -x_2 = lean_unsigned_to_nat(362u); +x_2 = lean_unsigned_to_nat(356u); x_3 = lean_unsigned_to_nat(6u); x_4 = l_Lean_PrettyPrinter_Parenthesizer_trailingNode_parenthesizer___lambda__1___closed__1; x_5 = l___private_Init_Util_1__mkPanicMessage(x_1, x_2, x_3, x_4); @@ -20127,22 +20110,14 @@ return x_3; lean_object* _init_l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__8() { _start: { -lean_object* x_1; -x_1 = lean_mk_string("TrailingParser"); -return x_1; -} -} -lean_object* _init_l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__9() { -_start: -{ lean_object* x_1; lean_object* x_2; lean_object* x_3; x_1 = l_Lean_mkAppStx___closed__4; -x_2 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__8; +x_2 = l_Lean_Parser_mkParserOfConstantUnsafe___closed__5; x_3 = lean_name_mk_string(x_1, x_2); return x_3; } } -lean_object* _init_l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__10() { +lean_object* _init_l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__9() { _start: { lean_object* x_1; @@ -20150,27 +20125,27 @@ x_1 = lean_mk_string("don't know how to generate parenthesizer for non-parser co return x_1; } } -lean_object* _init_l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__11() { +lean_object* _init_l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__10() { _start: { lean_object* x_1; lean_object* x_2; -x_1 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__10; +x_1 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__9; x_2 = lean_alloc_ctor(2, 1, 0); lean_ctor_set(x_2, 0, x_1); return x_2; } } -lean_object* _init_l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__12() { +lean_object* _init_l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__11() { _start: { lean_object* x_1; lean_object* x_2; -x_1 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__11; +x_1 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__10; x_2 = lean_alloc_ctor(0, 1, 0); lean_ctor_set(x_2, 0, x_1); return x_2; } } -lean_object* _init_l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__13() { +lean_object* _init_l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__12() { _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; @@ -20182,7 +20157,7 @@ lean_closure_set(x_3, 1, x_2); return x_3; } } -lean_object* _init_l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__14() { +lean_object* _init_l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__13() { _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; @@ -20194,7 +20169,7 @@ lean_closure_set(x_3, 1, x_2); return x_3; } } -lean_object* _init_l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__15() { +lean_object* _init_l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__14() { _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; @@ -20206,7 +20181,7 @@ lean_closure_set(x_3, 1, x_2); return x_3; } } -lean_object* _init_l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__16() { +lean_object* _init_l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__15() { _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; @@ -20218,7 +20193,7 @@ lean_closure_set(x_3, 1, x_2); return x_3; } } -lean_object* _init_l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__17() { +lean_object* _init_l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__16() { _start: { lean_object* x_1; @@ -20226,7 +20201,7 @@ x_1 = lean_alloc_closure((void*)(l_Lean_PrettyPrinter_Parenthesizer_compileParse return x_1; } } -lean_object* _init_l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__18() { +lean_object* _init_l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__17() { _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; @@ -20238,7 +20213,7 @@ lean_closure_set(x_3, 1, x_2); return x_3; } } -lean_object* _init_l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__19() { +lean_object* _init_l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__18() { _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; @@ -20250,7 +20225,7 @@ lean_closure_set(x_3, 1, x_2); return x_3; } } -lean_object* _init_l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__20() { +lean_object* _init_l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__19() { _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; @@ -20262,7 +20237,7 @@ lean_closure_set(x_3, 1, x_2); return x_3; } } -lean_object* _init_l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__21() { +lean_object* _init_l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__20() { _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; @@ -20274,7 +20249,7 @@ lean_closure_set(x_3, 1, x_2); return x_3; } } -lean_object* _init_l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__22() { +lean_object* _init_l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__21() { _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; @@ -20286,7 +20261,7 @@ lean_closure_set(x_3, 1, x_2); return x_3; } } -lean_object* _init_l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__23() { +lean_object* _init_l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__22() { _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; @@ -20366,7 +20341,7 @@ lean_inc(x_38); x_39 = lean_ctor_get(x_37, 1); lean_inc(x_39); lean_dec(x_37); -x_109 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__9; +x_109 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__8; x_110 = l_Lean_Expr_isConstOf(x_38, x_109); if (x_110 == 0) { @@ -20402,7 +20377,7 @@ x_117 = lean_alloc_ctor(2, 1, 0); lean_ctor_set(x_117, 0, x_116); x_118 = lean_alloc_ctor(0, 1, 0); lean_ctor_set(x_118, 0, x_117); -x_119 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__12; +x_119 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__11; x_120 = lean_alloc_ctor(9, 2, 0); lean_ctor_set(x_120, 0, x_119); lean_ctor_set(x_120, 1, x_118); @@ -20940,7 +20915,7 @@ lean_inc(x_191); x_192 = lean_ctor_get(x_190, 1); lean_inc(x_192); lean_dec(x_190); -x_262 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__9; +x_262 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__8; x_263 = l_Lean_Expr_isConstOf(x_191, x_262); if (x_263 == 0) { @@ -20976,7 +20951,7 @@ x_270 = lean_alloc_ctor(2, 1, 0); lean_ctor_set(x_270, 0, x_269); x_271 = lean_alloc_ctor(0, 1, 0); lean_ctor_set(x_271, 0, x_270); -x_272 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__12; +x_272 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__11; x_273 = lean_alloc_ctor(9, 2, 0); lean_ctor_set(x_273, 0, x_272); lean_ctor_set(x_273, 1, x_271); @@ -21095,7 +21070,7 @@ lean_inc(x_207); x_208 = lean_ctor_get(x_206, 1); lean_inc(x_208); lean_dec(x_206); -x_227 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__13; +x_227 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__12; lean_inc(x_2); x_228 = l_Lean_Meta_forallTelescope___rarg(x_188, x_227, x_2, x_208); if (lean_obj_tag(x_228) == 0) @@ -21490,7 +21465,7 @@ lean_inc(x_340); x_341 = lean_ctor_get(x_339, 1); lean_inc(x_341); lean_dec(x_339); -x_411 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__9; +x_411 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__8; x_412 = l_Lean_Expr_isConstOf(x_340, x_411); if (x_412 == 0) { @@ -21526,7 +21501,7 @@ x_419 = lean_alloc_ctor(2, 1, 0); lean_ctor_set(x_419, 0, x_418); x_420 = lean_alloc_ctor(0, 1, 0); lean_ctor_set(x_420, 0, x_419); -x_421 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__12; +x_421 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__11; x_422 = lean_alloc_ctor(9, 2, 0); lean_ctor_set(x_422, 0, x_421); lean_ctor_set(x_422, 1, x_420); @@ -21645,7 +21620,7 @@ lean_inc(x_356); x_357 = lean_ctor_get(x_355, 1); lean_inc(x_357); lean_dec(x_355); -x_376 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__14; +x_376 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__13; lean_inc(x_2); x_377 = l_Lean_Meta_forallTelescope___rarg(x_337, x_376, x_2, x_357); if (lean_obj_tag(x_377) == 0) @@ -22040,7 +22015,7 @@ lean_inc(x_489); x_490 = lean_ctor_get(x_488, 1); lean_inc(x_490); lean_dec(x_488); -x_560 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__9; +x_560 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__8; x_561 = l_Lean_Expr_isConstOf(x_489, x_560); if (x_561 == 0) { @@ -22076,7 +22051,7 @@ x_568 = lean_alloc_ctor(2, 1, 0); lean_ctor_set(x_568, 0, x_567); x_569 = lean_alloc_ctor(0, 1, 0); lean_ctor_set(x_569, 0, x_568); -x_570 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__12; +x_570 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__11; x_571 = lean_alloc_ctor(9, 2, 0); lean_ctor_set(x_571, 0, x_570); lean_ctor_set(x_571, 1, x_569); @@ -22195,7 +22170,7 @@ lean_inc(x_505); x_506 = lean_ctor_get(x_504, 1); lean_inc(x_506); lean_dec(x_504); -x_525 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__15; +x_525 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__14; lean_inc(x_2); x_526 = l_Lean_Meta_forallTelescope___rarg(x_486, x_525, x_2, x_506); if (lean_obj_tag(x_526) == 0) @@ -22590,7 +22565,7 @@ lean_inc(x_638); x_639 = lean_ctor_get(x_637, 1); lean_inc(x_639); lean_dec(x_637); -x_709 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__9; +x_709 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__8; x_710 = l_Lean_Expr_isConstOf(x_638, x_709); if (x_710 == 0) { @@ -22626,7 +22601,7 @@ x_717 = lean_alloc_ctor(2, 1, 0); lean_ctor_set(x_717, 0, x_716); x_718 = lean_alloc_ctor(0, 1, 0); lean_ctor_set(x_718, 0, x_717); -x_719 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__12; +x_719 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__11; x_720 = lean_alloc_ctor(9, 2, 0); lean_ctor_set(x_720, 0, x_719); lean_ctor_set(x_720, 1, x_718); @@ -22745,7 +22720,7 @@ lean_inc(x_654); x_655 = lean_ctor_get(x_653, 1); lean_inc(x_655); lean_dec(x_653); -x_674 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__16; +x_674 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__15; lean_inc(x_2); x_675 = l_Lean_Meta_forallTelescope___rarg(x_635, x_674, x_2, x_655); if (lean_obj_tag(x_675) == 0) @@ -23090,7 +23065,7 @@ lean_object* x_755; lean_object* x_756; lean_object* x_757; x_755 = lean_ctor_get(x_4, 1); lean_inc(x_755); lean_dec(x_4); -x_756 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__17; +x_756 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__16; x_757 = l_Lean_Meta_lambdaTelescope___rarg(x_5, x_756, x_2, x_755); return x_757; } @@ -23150,7 +23125,7 @@ lean_inc(x_790); x_791 = lean_ctor_get(x_789, 1); lean_inc(x_791); lean_dec(x_789); -x_861 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__9; +x_861 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__8; x_862 = l_Lean_Expr_isConstOf(x_790, x_861); if (x_862 == 0) { @@ -23186,7 +23161,7 @@ x_869 = lean_alloc_ctor(2, 1, 0); lean_ctor_set(x_869, 0, x_868); x_870 = lean_alloc_ctor(0, 1, 0); lean_ctor_set(x_870, 0, x_869); -x_871 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__12; +x_871 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__11; x_872 = lean_alloc_ctor(9, 2, 0); lean_ctor_set(x_872, 0, x_871); lean_ctor_set(x_872, 1, x_870); @@ -23305,7 +23280,7 @@ lean_inc(x_806); x_807 = lean_ctor_get(x_805, 1); lean_inc(x_807); lean_dec(x_805); -x_826 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__18; +x_826 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__17; lean_inc(x_2); x_827 = l_Lean_Meta_forallTelescope___rarg(x_787, x_826, x_2, x_807); if (lean_obj_tag(x_827) == 0) @@ -23700,7 +23675,7 @@ lean_inc(x_939); x_940 = lean_ctor_get(x_938, 1); lean_inc(x_940); lean_dec(x_938); -x_1010 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__9; +x_1010 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__8; x_1011 = l_Lean_Expr_isConstOf(x_939, x_1010); if (x_1011 == 0) { @@ -23736,7 +23711,7 @@ x_1018 = lean_alloc_ctor(2, 1, 0); lean_ctor_set(x_1018, 0, x_1017); x_1019 = lean_alloc_ctor(0, 1, 0); lean_ctor_set(x_1019, 0, x_1018); -x_1020 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__12; +x_1020 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__11; x_1021 = lean_alloc_ctor(9, 2, 0); lean_ctor_set(x_1021, 0, x_1020); lean_ctor_set(x_1021, 1, x_1019); @@ -23855,7 +23830,7 @@ lean_inc(x_955); x_956 = lean_ctor_get(x_954, 1); lean_inc(x_956); lean_dec(x_954); -x_975 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__19; +x_975 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__18; lean_inc(x_2); x_976 = l_Lean_Meta_forallTelescope___rarg(x_936, x_975, x_2, x_956); if (lean_obj_tag(x_976) == 0) @@ -24250,7 +24225,7 @@ lean_inc(x_1088); x_1089 = lean_ctor_get(x_1087, 1); lean_inc(x_1089); lean_dec(x_1087); -x_1159 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__9; +x_1159 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__8; x_1160 = l_Lean_Expr_isConstOf(x_1088, x_1159); if (x_1160 == 0) { @@ -24286,7 +24261,7 @@ x_1167 = lean_alloc_ctor(2, 1, 0); lean_ctor_set(x_1167, 0, x_1166); x_1168 = lean_alloc_ctor(0, 1, 0); lean_ctor_set(x_1168, 0, x_1167); -x_1169 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__12; +x_1169 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__11; x_1170 = lean_alloc_ctor(9, 2, 0); lean_ctor_set(x_1170, 0, x_1169); lean_ctor_set(x_1170, 1, x_1168); @@ -24405,7 +24380,7 @@ lean_inc(x_1104); x_1105 = lean_ctor_get(x_1103, 1); lean_inc(x_1105); lean_dec(x_1103); -x_1124 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__20; +x_1124 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__19; lean_inc(x_2); x_1125 = l_Lean_Meta_forallTelescope___rarg(x_1085, x_1124, x_2, x_1105); if (lean_obj_tag(x_1125) == 0) @@ -24800,7 +24775,7 @@ lean_inc(x_1237); x_1238 = lean_ctor_get(x_1236, 1); lean_inc(x_1238); lean_dec(x_1236); -x_1308 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__9; +x_1308 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__8; x_1309 = l_Lean_Expr_isConstOf(x_1237, x_1308); if (x_1309 == 0) { @@ -24836,7 +24811,7 @@ x_1316 = lean_alloc_ctor(2, 1, 0); lean_ctor_set(x_1316, 0, x_1315); x_1317 = lean_alloc_ctor(0, 1, 0); lean_ctor_set(x_1317, 0, x_1316); -x_1318 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__12; +x_1318 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__11; x_1319 = lean_alloc_ctor(9, 2, 0); lean_ctor_set(x_1319, 0, x_1318); lean_ctor_set(x_1319, 1, x_1317); @@ -24955,7 +24930,7 @@ lean_inc(x_1253); x_1254 = lean_ctor_get(x_1252, 1); lean_inc(x_1254); lean_dec(x_1252); -x_1273 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__21; +x_1273 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__20; lean_inc(x_2); x_1274 = l_Lean_Meta_forallTelescope___rarg(x_1234, x_1273, x_2, x_1254); if (lean_obj_tag(x_1274) == 0) @@ -25350,7 +25325,7 @@ lean_inc(x_1386); x_1387 = lean_ctor_get(x_1385, 1); lean_inc(x_1387); lean_dec(x_1385); -x_1457 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__9; +x_1457 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__8; x_1458 = l_Lean_Expr_isConstOf(x_1386, x_1457); if (x_1458 == 0) { @@ -25386,7 +25361,7 @@ x_1465 = lean_alloc_ctor(2, 1, 0); lean_ctor_set(x_1465, 0, x_1464); x_1466 = lean_alloc_ctor(0, 1, 0); lean_ctor_set(x_1466, 0, x_1465); -x_1467 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__12; +x_1467 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__11; x_1468 = lean_alloc_ctor(9, 2, 0); lean_ctor_set(x_1468, 0, x_1467); lean_ctor_set(x_1468, 1, x_1466); @@ -25505,7 +25480,7 @@ lean_inc(x_1402); x_1403 = lean_ctor_get(x_1401, 1); lean_inc(x_1403); lean_dec(x_1401); -x_1422 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__22; +x_1422 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__21; lean_inc(x_2); x_1423 = l_Lean_Meta_forallTelescope___rarg(x_1383, x_1422, x_2, x_1403); if (lean_obj_tag(x_1423) == 0) @@ -25900,7 +25875,7 @@ lean_inc(x_1535); x_1536 = lean_ctor_get(x_1534, 1); lean_inc(x_1536); lean_dec(x_1534); -x_1606 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__9; +x_1606 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__8; x_1607 = l_Lean_Expr_isConstOf(x_1535, x_1606); if (x_1607 == 0) { @@ -25936,7 +25911,7 @@ x_1614 = lean_alloc_ctor(2, 1, 0); lean_ctor_set(x_1614, 0, x_1613); x_1615 = lean_alloc_ctor(0, 1, 0); lean_ctor_set(x_1615, 0, x_1614); -x_1616 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__12; +x_1616 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__11; x_1617 = lean_alloc_ctor(9, 2, 0); lean_ctor_set(x_1617, 0, x_1616); lean_ctor_set(x_1617, 1, x_1615); @@ -26055,7 +26030,7 @@ lean_inc(x_1551); x_1552 = lean_ctor_get(x_1550, 1); lean_inc(x_1552); lean_dec(x_1550); -x_1571 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__23; +x_1571 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__22; lean_inc(x_2); x_1572 = l_Lean_Meta_forallTelescope___rarg(x_1532, x_1571, x_2, x_1552); if (lean_obj_tag(x_1572) == 0) @@ -27441,7 +27416,7 @@ lean_inc(x_14); lean_dec(x_5); x_15 = l_Lean_ConstantInfo_type(x_14); lean_dec(x_14); -x_16 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__9; +x_16 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__8; x_17 = l_Lean_Expr_isConstOf(x_15, x_16); if (x_17 == 0) { @@ -29891,7 +29866,7 @@ lean_inc(x_23); lean_dec(x_14); x_24 = l_Lean_ConstantInfo_type(x_23); lean_dec(x_23); -x_25 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__9; +x_25 = l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__8; x_26 = l_Lean_Expr_isConstOf(x_24, x_25); if (x_26 == 0) { @@ -30739,6 +30714,31 @@ x_5 = l_Lean_PrettyPrinter_parenthesize(x_4, x_1, x_2, x_3); return x_5; } } +lean_object* l___private_Lean_PrettyPrinter_Parenthesizer_1__regTraceClasses___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, uint8_t x_4, lean_object* x_5) { +_start: +{ +if (x_4 == 0) +{ +lean_object* x_6; +x_6 = l_Lean_PrettyPrinter_Parenthesizer_addParenthesizerFromConstantUnsafe(x_2, x_3, x_5); +return x_6; +} +else +{ +lean_object* x_7; +x_7 = l_Lean_PrettyPrinter_Parenthesizer_compileParser(x_2, x_3, x_4, x_5); +return x_7; +} +} +} +lean_object* _init_l___private_Lean_PrettyPrinter_Parenthesizer_1__regTraceClasses___closed__1() { +_start: +{ +lean_object* x_1; +x_1 = lean_alloc_closure((void*)(l___private_Lean_PrettyPrinter_Parenthesizer_1__regTraceClasses___lambda__1___boxed), 5, 0); +return x_1; +} +} lean_object* l___private_Lean_PrettyPrinter_Parenthesizer_1__regTraceClasses(lean_object* x_1) { _start: { @@ -30747,60 +30747,102 @@ x_2 = l_Lean_PrettyPrinter_Parenthesizer_maybeParenthesize___closed__5; x_3 = l_Lean_registerTraceClass(x_2, x_1); if (lean_obj_tag(x_3) == 0) { -uint8_t x_4; -x_4 = !lean_is_exclusive(x_3); -if (x_4 == 0) -{ -lean_object* x_5; lean_object* x_6; -x_5 = lean_ctor_get(x_3, 0); -lean_dec(x_5); -x_6 = lean_box(0); -lean_ctor_set(x_3, 0, x_6); -return x_3; -} -else -{ -lean_object* x_7; lean_object* x_8; lean_object* x_9; -x_7 = lean_ctor_get(x_3, 1); -lean_inc(x_7); +lean_object* x_4; lean_object* x_5; lean_object* x_6; +x_4 = lean_ctor_get(x_3, 1); +lean_inc(x_4); lean_dec(x_3); -x_8 = lean_box(0); -x_9 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_9, 0, x_8); -lean_ctor_set(x_9, 1, x_7); -return x_9; +x_5 = l___private_Lean_PrettyPrinter_Parenthesizer_1__regTraceClasses___closed__1; +x_6 = l_Lean_Parser_registerParserAttributeHook(x_5, x_4); +if (lean_obj_tag(x_6) == 0) +{ +uint8_t x_7; +x_7 = !lean_is_exclusive(x_6); +if (x_7 == 0) +{ +lean_object* x_8; lean_object* x_9; +x_8 = lean_ctor_get(x_6, 0); +lean_dec(x_8); +x_9 = lean_box(0); +lean_ctor_set(x_6, 0, x_9); +return x_6; +} +else +{ +lean_object* x_10; lean_object* x_11; lean_object* x_12; +x_10 = lean_ctor_get(x_6, 1); +lean_inc(x_10); +lean_dec(x_6); +x_11 = lean_box(0); +x_12 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_12, 0, x_11); +lean_ctor_set(x_12, 1, x_10); +return x_12; } } else { -uint8_t x_10; -x_10 = !lean_is_exclusive(x_3); -if (x_10 == 0) +uint8_t x_13; +x_13 = !lean_is_exclusive(x_6); +if (x_13 == 0) +{ +return x_6; +} +else +{ +lean_object* x_14; lean_object* x_15; lean_object* x_16; +x_14 = lean_ctor_get(x_6, 0); +x_15 = lean_ctor_get(x_6, 1); +lean_inc(x_15); +lean_inc(x_14); +lean_dec(x_6); +x_16 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_16, 0, x_14); +lean_ctor_set(x_16, 1, x_15); +return x_16; +} +} +} +else +{ +uint8_t x_17; +x_17 = !lean_is_exclusive(x_3); +if (x_17 == 0) { return x_3; } else { -lean_object* x_11; lean_object* x_12; lean_object* x_13; -x_11 = lean_ctor_get(x_3, 0); -x_12 = lean_ctor_get(x_3, 1); -lean_inc(x_12); -lean_inc(x_11); +lean_object* x_18; lean_object* x_19; lean_object* x_20; +x_18 = lean_ctor_get(x_3, 0); +x_19 = lean_ctor_get(x_3, 1); +lean_inc(x_19); +lean_inc(x_18); lean_dec(x_3); -x_13 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_13, 0, x_11); -lean_ctor_set(x_13, 1, x_12); -return x_13; +x_20 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_20, 0, x_18); +lean_ctor_set(x_20, 1, x_19); +return x_20; } } } } +lean_object* l___private_Lean_PrettyPrinter_Parenthesizer_1__regTraceClasses___lambda__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { +_start: +{ +uint8_t x_6; lean_object* x_7; +x_6 = lean_unbox(x_4); +lean_dec(x_4); +x_7 = l___private_Lean_PrettyPrinter_Parenthesizer_1__regTraceClasses___lambda__1(x_1, x_2, x_3, x_6, x_5); +lean_dec(x_1); +return x_7; +} +} lean_object* initialize_Init(lean_object*); lean_object* initialize_Lean_Util_ReplaceExpr(lean_object*); lean_object* initialize_Lean_Meta_Basic(lean_object*); lean_object* initialize_Lean_Meta_WHNF(lean_object*); lean_object* initialize_Lean_KeyedDeclsAttribute(lean_object*); -lean_object* initialize_Lean_Parser_Basic(lean_object*); +lean_object* initialize_Lean_Parser_Extension(lean_object*); lean_object* initialize_Lean_ParserCompiler(lean_object*); static bool _G_initialized = false; lean_object* initialize_Lean_PrettyPrinter_Parenthesizer(lean_object* w) { @@ -30822,7 +30864,7 @@ lean_dec_ref(res); res = initialize_Lean_KeyedDeclsAttribute(lean_io_mk_world()); if (lean_io_result_is_error(res)) return res; lean_dec_ref(res); -res = initialize_Lean_Parser_Basic(lean_io_mk_world()); +res = initialize_Lean_Parser_Extension(lean_io_mk_world()); if (lean_io_result_is_error(res)) return res; lean_dec_ref(res); res = initialize_Lean_ParserCompiler(lean_io_mk_world()); @@ -31180,8 +31222,6 @@ l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__21 = _init lean_mark_persistent(l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__21); l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__22 = _init_l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__22(); lean_mark_persistent(l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__22); -l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__23 = _init_l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__23(); -lean_mark_persistent(l_Lean_PrettyPrinter_Parenthesizer_compileParserBody___main___closed__23); l_Lean_PrettyPrinter_Parenthesizer_compileParser___closed__1 = _init_l_Lean_PrettyPrinter_Parenthesizer_compileParser___closed__1(); lean_mark_persistent(l_Lean_PrettyPrinter_Parenthesizer_compileParser___closed__1); l_Lean_PrettyPrinter_Parenthesizer_compileParser___closed__2 = _init_l_Lean_PrettyPrinter_Parenthesizer_compileParser___closed__2(); @@ -31244,6 +31284,8 @@ l_Lean_PrettyPrinter_parenthesizeCommand___closed__2 = _init_l_Lean_PrettyPrinte lean_mark_persistent(l_Lean_PrettyPrinter_parenthesizeCommand___closed__2); l_Lean_PrettyPrinter_parenthesizeCommand___closed__3 = _init_l_Lean_PrettyPrinter_parenthesizeCommand___closed__3(); lean_mark_persistent(l_Lean_PrettyPrinter_parenthesizeCommand___closed__3); +l___private_Lean_PrettyPrinter_Parenthesizer_1__regTraceClasses___closed__1 = _init_l___private_Lean_PrettyPrinter_Parenthesizer_1__regTraceClasses___closed__1(); +lean_mark_persistent(l___private_Lean_PrettyPrinter_Parenthesizer_1__regTraceClasses___closed__1); res = l___private_Lean_PrettyPrinter_Parenthesizer_1__regTraceClasses(lean_io_mk_world()); if (lean_io_result_is_error(res)) return res; lean_dec_ref(res);