File: .lake/packages/lean4/src/lean/Lean/Parser/Extension.lean

full_name: Lean.Parser.builtinTokenTable
code: builtin_initialize builtinTokenTable : IO.Ref TokenTable ← IO.mkRef {}
goal: IO.Ref Lean.Parser.TokenTable

full_name: Lean.Parser.initFn._@..lake.packages.lean4.src.lean.Lean.Parser.Extension._hyg.6
code: builtin_initialize builtinTokenTable : IO.Ref TokenTable ← IO.mkRef {}
goal: IO (IO.Ref Lean.Parser.TokenTable)

full_name: Lean.Parser.builtinSyntaxNodeKindSetRef
code: builtin_initialize builtinSyntaxNodeKindSetRef : IO.Ref SyntaxNodeKindSet ← IO.mkRef {}
goal: IO.Ref Lean.Parser.SyntaxNodeKindSet

full_name: Lean.Parser.initFn._@..lake.packages.lean4.src.lean.Lean.Parser.Extension._hyg.42
code: builtin_initialize builtinSyntaxNodeKindSetRef : IO.Ref SyntaxNodeKindSet ← IO.mkRef {}
goal: IO (IO.Ref Lean.Parser.SyntaxNodeKindSet)

full_name: Lean.Parser.registerBuiltinNodeKind
code: def registerBuiltinNodeKind (k : SyntaxNodeKind) : IO Unit 
goal: IO Unit

full_name: Lean.Parser.initFn._@..lake.packages.lean4.src.lean.Lean.Parser.Extension._hyg.89
code: builtin_initialize
  registerBuiltinNodeKind choiceKind
  registerBuiltinNodeKind identKind
  registerBuiltinNodeKind strLitKind
  registerBuiltinNodeKind numLitKind
  registerBuiltinNodeKind scientificLitKind
  registerBuiltinNodeKind charLitKind
  registerBuiltinNodeKind nameLitKind
goal: IO Unit

full_name: Lean.Parser.initFn._@..lake.packages.lean4.src.lean.Lean.Parser.Extension._hyg.200
code: builtin_initialize builtinParserCategoriesRef : IO.Ref ParserCategories ← IO.mkRef {}
goal: IO (IO.Ref Lean.Parser.ParserCategories)

full_name: Lean.Parser.builtinParserCategoriesRef
code: builtin_initialize builtinParserCategoriesRef : IO.Ref ParserCategories ← IO.mkRef {}
goal: IO.Ref Lean.Parser.ParserCategories

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Parser.Extension.0.Lean.Parser.throwParserCategoryAlreadyDefined
code: private def throwParserCategoryAlreadyDefined {α} (catName : Name) : ExceptT String Id α 
goal: ExceptT String Id α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Parser.Extension.0.Lean.Parser.addParserCategoryCore
code: private def addParserCategoryCore (categories : ParserCategories) (catName : Name) (initial : ParserCategory) : Except String ParserCategories 
goal: Except String Lean.Parser.ParserCategories

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Parser.Extension.0.Lean.Parser.addBuiltinParserCategory
code: /-- All builtin parser categories are Pratt's parsers -/

private def addBuiltinParserCategory (catName declName : Name) (behavior : LeadingIdentBehavior) : IO Unit 
goal: IO Unit

full_name: Lean.Parser.ParserExtension.OLeanEntry
code: inductive OLeanEntry where
  | token     (val : Token) : OLeanEntry
  | kind      (val : SyntaxNodeKind) : OLeanEntry
  | category  (catName : Name) (declName : Name) (behavior : LeadingIdentBehavior)
  | parser    (catName : Name) (declName : Name) (prio : Nat) : OLeanEntry
  deriving Inhabited
goal: Type

full_name: Lean.Parser.ParserExtension.instInhabitedOLeanEntry
code: inductive OLeanEntry where
  | token     (val : Token) : OLeanEntry
  | kind      (val : SyntaxNodeKind) : OLeanEntry
  | category  (catName : Name) (declName : Name) (behavior : LeadingIdentBehavior)
  | parser    (catName : Name) (declName : Name) (prio : Nat) : OLeanEntry
  deriving Inhabited
goal: Inhabited Lean.Parser.ParserExtension.OLeanEntry

full_name: Lean.Parser.ParserExtension.OLeanEntry.category
code: inductive OLeanEntry where
  | token     (val : Token) : OLeanEntry
  | kind      (val : SyntaxNodeKind) : OLeanEntry
  | category  (catName : Name) (declName : Name) (behavior : LeadingIdentBehavior)
  | parser    (catName : Name) (declName : Name) (prio : Nat) : OLeanEntry
  deriving Inhabited
goal: Lean.Parser.ParserExtension.OLeanEntry

full_name: Lean.Parser.ParserExtension.OLeanEntry.parser
code: inductive OLeanEntry where
  | token     (val : Token) : OLeanEntry
  | kind      (val : SyntaxNodeKind) : OLeanEntry
  | category  (catName : Name) (declName : Name) (behavior : LeadingIdentBehavior)
  | parser    (catName : Name) (declName : Name) (prio : Nat) : OLeanEntry
  deriving Inhabited
goal: Lean.Parser.ParserExtension.OLeanEntry

full_name: Lean.Parser.ParserExtension.OLeanEntry.token
code: inductive OLeanEntry where
  | token     (val : Token) : OLeanEntry
  | kind      (val : SyntaxNodeKind) : OLeanEntry
  | category  (catName : Name) (declName : Name) (behavior : LeadingIdentBehavior)
  | parser    (catName : Name) (declName : Name) (prio : Nat) : OLeanEntry
  deriving Inhabited
goal: Lean.Parser.ParserExtension.OLeanEntry

full_name: Lean.Parser.ParserExtension.OLeanEntry.kind
code: inductive OLeanEntry where
  | token     (val : Token) : OLeanEntry
  | kind      (val : SyntaxNodeKind) : OLeanEntry
  | category  (catName : Name) (declName : Name) (behavior : LeadingIdentBehavior)
  | parser    (catName : Name) (declName : Name) (prio : Nat) : OLeanEntry
  deriving Inhabited
goal: Lean.Parser.ParserExtension.OLeanEntry

full_name: Lean.Parser.ParserExtension.Entry.parser
code: inductive Entry where
  | token     (val : Token) : Entry
  | kind      (val : SyntaxNodeKind) : Entry
  | category  (catName : Name) (declName : Name) (behavior : LeadingIdentBehavior)
  | parser    (catName : Name) (declName : Name) (leading : Bool) (p : Parser) (prio : Nat) : Entry
  deriving Inhabited
goal: Lean.Parser.ParserExtension.Entry

full_name: Lean.Parser.ParserExtension.Entry
code: inductive Entry where
  | token     (val : Token) : Entry
  | kind      (val : SyntaxNodeKind) : Entry
  | category  (catName : Name) (declName : Name) (behavior : LeadingIdentBehavior)
  | parser    (catName : Name) (declName : Name) (leading : Bool) (p : Parser) (prio : Nat) : Entry
  deriving Inhabited
goal: Type

full_name: Lean.Parser.ParserExtension.instInhabitedEntry
code: inductive Entry where
  | token     (val : Token) : Entry
  | kind      (val : SyntaxNodeKind) : Entry
  | category  (catName : Name) (declName : Name) (behavior : LeadingIdentBehavior)
  | parser    (catName : Name) (declName : Name) (leading : Bool) (p : Parser) (prio : Nat) : Entry
  deriving Inhabited
goal: Inhabited Lean.Parser.ParserExtension.Entry

full_name: Lean.Parser.ParserExtension.Entry.kind
code: inductive Entry where
  | token     (val : Token) : Entry
  | kind      (val : SyntaxNodeKind) : Entry
  | category  (catName : Name) (declName : Name) (behavior : LeadingIdentBehavior)
  | parser    (catName : Name) (declName : Name) (leading : Bool) (p : Parser) (prio : Nat) : Entry
  deriving Inhabited
goal: Lean.Parser.ParserExtension.Entry

full_name: Lean.Parser.ParserExtension.Entry.token
code: inductive Entry where
  | token     (val : Token) : Entry
  | kind      (val : SyntaxNodeKind) : Entry
  | category  (catName : Name) (declName : Name) (behavior : LeadingIdentBehavior)
  | parser    (catName : Name) (declName : Name) (leading : Bool) (p : Parser) (prio : Nat) : Entry
  deriving Inhabited
goal: Lean.Parser.ParserExtension.Entry

full_name: Lean.Parser.ParserExtension.Entry.category
code: inductive Entry where
  | token     (val : Token) : Entry
  | kind      (val : SyntaxNodeKind) : Entry
  | category  (catName : Name) (declName : Name) (behavior : LeadingIdentBehavior)
  | parser    (catName : Name) (declName : Name) (leading : Bool) (p : Parser) (prio : Nat) : Entry
  deriving Inhabited
goal: Lean.Parser.ParserExtension.Entry

full_name: Lean.Parser.ParserExtension.Entry.toOLeanEntry
code: def Entry.toOLeanEntry : Entry → OLeanEntry
  
goal: Lean.Parser.ParserExtension.Entry → Lean.Parser.ParserExtension.OLeanEntry

full_name: Lean.Parser.ParserExtension.State.categories
code: structure State where
  tokens      : TokenTable := {}
  kinds       : SyntaxNodeKindSet := {}
  categories  : ParserCategories := {}
  deriving Inhabited
goal: Lean.Parser.ParserCategories

full_name: Lean.Parser.ParserExtension.State.kinds
code: structure State where
  tokens      : TokenTable := {}
  kinds       : SyntaxNodeKindSet := {}
  categories  : ParserCategories := {}
  deriving Inhabited
goal: Lean.Parser.SyntaxNodeKindSet

full_name: Lean.Parser.ParserExtension.State
code: structure State where
  tokens      : TokenTable := {}
  kinds       : SyntaxNodeKindSet := {}
  categories  : ParserCategories := {}
  deriving Inhabited
goal: Type

full_name: Lean.Parser.ParserExtension.instInhabitedState
code: structure State where
  tokens      : TokenTable := {}
  kinds       : SyntaxNodeKindSet := {}
  categories  : ParserCategories := {}
  deriving Inhabited
goal: Inhabited Lean.Parser.ParserExtension.State

full_name: Lean.Parser.ParserExtension.State.tokens
code: structure State where
  tokens      : TokenTable := {}
  kinds       : SyntaxNodeKindSet := {}
  categories  : ParserCategories := {}
  deriving Inhabited
goal: Lean.Parser.TokenTable

full_name: Lean.Parser.ParserExtension
code: abbrev ParserExtension 
goal: Type

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Parser.Extension.0.Lean.Parser.ParserExtension.mkInitial
code: private def ParserExtension.mkInitial : IO ParserExtension.State 
goal: IO Lean.Parser.ParserExtension.State

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Parser.Extension.0.Lean.Parser.addTokenConfig
code: private def addTokenConfig (tokens : TokenTable) (tk : Token) : Except String TokenTable 
goal: Except String Lean.Parser.TokenTable

full_name: Lean.Parser.throwUnknownParserCategory
code: def throwUnknownParserCategory {α} (catName : Name) : ExceptT String Id α 
goal: ExceptT String Id α

full_name: Lean.Parser.getCategory
code: abbrev getCategory (categories : ParserCategories) (catName : Name) : Option ParserCategory 
goal: Option Lean.Parser.ParserCategory

full_name: Lean.Parser.addLeadingParser
code: def addLeadingParser (categories : ParserCategories) (catName declName : Name) (p : Parser) (prio : Nat) : Except String ParserCategories 
goal: Except String Lean.Parser.ParserCategories

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Parser.Extension.0.Lean.Parser.addTrailingParserAux
code: private def addTrailingParserAux (tables : PrattParsingTables) (p : TrailingParser) (prio : Nat) : PrattParsingTables 
goal: Lean.Parser.PrattParsingTables

full_name: Lean.Parser.addTrailingParser
code: def addTrailingParser (categories : ParserCategories) (catName declName : Name) (p : TrailingParser) (prio : Nat) : Except String ParserCategories 
goal: Except String Lean.Parser.ParserCategories

full_name: Lean.Parser.addParser
code: def addParser (categories : ParserCategories) (catName declName : Name)
    (leading : Bool) (p : Parser) (prio : Nat) : Except String ParserCategories 
goal: Except String Lean.Parser.ParserCategories

full_name: Lean.Parser.addParserTokens
code: def addParserTokens (tokenTable : TokenTable) (info : ParserInfo) : Except String TokenTable 
goal: Except String Lean.Parser.TokenTable

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Parser.Extension.0.Lean.Parser.updateBuiltinTokens
code: private def updateBuiltinTokens (info : ParserInfo) (declName : Name) : IO Unit 
goal: IO Unit

full_name: Lean.Parser.ParserExtension.addEntryImpl
code: def ParserExtension.addEntryImpl (s : State) (e : Entry) : State 
goal: Lean.Parser.ParserExtension.State

full_name: Lean.Parser.AliasValue.binary
code: /-- Parser aliases for making `ParserDescr` extensible -/
inductive AliasValue (α : Type) where
  | const  (p : α)
  | unary  (p : α → α)
  | binary (p : α → α → α)
goal: Lean.Parser.AliasValue α

full_name: Lean.Parser.AliasValue.const
code: /-- Parser aliases for making `ParserDescr` extensible -/
inductive AliasValue (α : Type) where
  | const  (p : α)
  | unary  (p : α → α)
  | binary (p : α → α → α)
goal: Lean.Parser.AliasValue α

full_name: Lean.Parser.AliasValue
code: /-- Parser aliases for making `ParserDescr` extensible -/
inductive AliasValue (α : Type) where
  | const  (p : α)
  | unary  (p : α → α)
  | binary (p : α → α → α)
goal: Type

full_name: Lean.Parser.AliasValue.unary
code: /-- Parser aliases for making `ParserDescr` extensible -/
inductive AliasValue (α : Type) where
  | const  (p : α)
  | unary  (p : α → α)
  | binary (p : α → α → α)
goal: Lean.Parser.AliasValue α

full_name: Lean.Parser.AliasTable
code: abbrev AliasTable (α) 
goal: Type

full_name: Lean.Parser.registerAliasCore
code: def registerAliasCore {α} (mapRef : IO.Ref (AliasTable α)) (aliasName : Name) (value : AliasValue α) : IO Unit 
goal: IO Unit

full_name: Lean.Parser.getAlias
code: def getAlias {α} (mapRef : IO.Ref (AliasTable α)) (aliasName : Name) : IO (Option (AliasValue α)) 
goal: IO (Option (Lean.Parser.AliasValue α))

full_name: Lean.Parser.getConstAlias
code: def getConstAlias {α} (mapRef : IO.Ref (AliasTable α)) (aliasName : Name) : IO α 
goal: IO α

full_name: Lean.Parser.getUnaryAlias
code: def getUnaryAlias {α} (mapRef : IO.Ref (AliasTable α)) (aliasName : Name) : IO (α → α) 
goal: IO (α → α)

full_name: Lean.Parser.getBinaryAlias
code: def getBinaryAlias {α} (mapRef : IO.Ref (AliasTable α)) (aliasName : Name) : IO (α → α → α) 
goal: IO (α → α → α)

full_name: Lean.Parser.ParserAliasValue
code: abbrev ParserAliasValue 
goal: Type

full_name: Lean.Parser.ParserAliasInfo.stackSz?
code: structure ParserAliasInfo where
  declName : Name := .anonymous
  /-- Number of syntax nodes produced by this parser. `none` means "sum of input sizes". -/
  stackSz? : Option Nat := some 1
  /-- Whether arguments should be wrapped in `group(·)` if they do not produce exactly one syntax node. -/
  autoGroupArgs : Bool := stackSz?.isSome
goal: Option Nat

full_name: Lean.Parser.ParserAliasInfo.declName
code: structure ParserAliasInfo where
  declName : Name := .anonymous
  /-- Number of syntax nodes produced by this parser. `none` means "sum of input sizes". -/
  stackSz? : Option Nat := some 1
  /-- Whether arguments should be wrapped in `group(·)` if they do not produce exactly one syntax node. -/
  autoGroupArgs : Bool := stackSz?.isSome
goal: Lean.Name

full_name: Lean.Parser.ParserAliasInfo
code: structure ParserAliasInfo where
  declName : Name := .anonymous
  /-- Number of syntax nodes produced by this parser. `none` means "sum of input sizes". -/
  stackSz? : Option Nat := some 1
  /-- Whether arguments should be wrapped in `group(·)` if they do not produce exactly one syntax node. -/
  autoGroupArgs : Bool := stackSz?.isSome
goal: Type

full_name: Lean.Parser.ParserAliasInfo.autoGroupArgs
code: structure ParserAliasInfo where
  declName : Name := .anonymous
  /-- Number of syntax nodes produced by this parser. `none` means "sum of input sizes". -/
  stackSz? : Option Nat := some 1
  /-- Whether arguments should be wrapped in `group(·)` if they do not produce exactly one syntax node. -/
  autoGroupArgs : Bool := stackSz?.isSome
goal: Bool

full_name: Lean.Parser.parserAliasesRef
code: builtin_initialize parserAliasesRef : IO.Ref (NameMap ParserAliasValue) ← IO.mkRef {}
goal: IO.Ref (Lean.NameMap Lean.Parser.ParserAliasValue)

full_name: Lean.Parser.initFn._@..lake.packages.lean4.src.lean.Lean.Parser.Extension._hyg.2196
code: builtin_initialize parserAliasesRef : IO.Ref (NameMap ParserAliasValue) ← IO.mkRef {}
goal: IO (IO.Ref (Lean.NameMap Lean.Parser.ParserAliasValue))

full_name: Lean.Parser.initFn._@..lake.packages.lean4.src.lean.Lean.Parser.Extension._hyg.2238
code: builtin_initialize parserAlias2kindRef : IO.Ref (NameMap SyntaxNodeKind) ← IO.mkRef {}
goal: IO (IO.Ref (Lean.NameMap Lean.SyntaxNodeKind))

full_name: Lean.Parser.parserAlias2kindRef
code: builtin_initialize parserAlias2kindRef : IO.Ref (NameMap SyntaxNodeKind) ← IO.mkRef {}
goal: IO.Ref (Lean.NameMap Lean.SyntaxNodeKind)

full_name: Lean.Parser.initFn._@..lake.packages.lean4.src.lean.Lean.Parser.Extension._hyg.2280
code: builtin_initialize parserAliases2infoRef : IO.Ref (NameMap ParserAliasInfo) ← IO.mkRef {}
goal: IO (IO.Ref (Lean.NameMap Lean.Parser.ParserAliasInfo))

full_name: Lean.Parser.parserAliases2infoRef
code: builtin_initialize parserAliases2infoRef : IO.Ref (NameMap ParserAliasInfo) ← IO.mkRef {}
goal: IO.Ref (Lean.NameMap Lean.Parser.ParserAliasInfo)

full_name: Lean.Parser.getParserAliasInfo
code: def getParserAliasInfo (aliasName : Name) : IO ParserAliasInfo 
goal: IO Lean.Parser.ParserAliasInfo

full_name: Lean.Parser.registerAlias
code: def registerAlias (aliasName declName : Name) (p : ParserAliasValue) (kind? : Option SyntaxNodeKind := none) (info : ParserAliasInfo := {}) : IO Unit 
goal: IO Unit

full_name: Lean.Parser.instCoeParserParserAliasValue
code: instance : Coe Parser ParserAliasValue 
goal: Coe Lean.Parser.Parser Lean.Parser.ParserAliasValue

full_name: Lean.Parser.instCoeForallParserParserAliasValue
code: instance : Coe (Parser → Parser) ParserAliasValue 
goal: Coe (Lean.Parser.Parser → Lean.Parser.Parser) Lean.Parser.ParserAliasValue

full_name: Lean.Parser.instCoeForallParserForallParserAliasValue
code: instance : Coe (Parser → Parser → Parser) ParserAliasValue 
goal: Coe (Lean.Parser.Parser → Lean.Parser.Parser → Lean.Parser.Parser) Lean.Parser.ParserAliasValue

full_name: Lean.Parser.isParserAlias
code: def isParserAlias (aliasName : Name) : IO Bool 
goal: IO Bool

full_name: Lean.Parser.getSyntaxKindOfParserAlias?
code: def getSyntaxKindOfParserAlias? (aliasName : Name) : IO (Option SyntaxNodeKind) 
goal: IO (Option Lean.SyntaxNodeKind)

full_name: Lean.Parser.ensureUnaryParserAlias
code: def ensureUnaryParserAlias (aliasName : Name) : IO Unit 
goal: IO Unit

full_name: Lean.Parser.ensureBinaryParserAlias
code: def ensureBinaryParserAlias (aliasName : Name) : IO Unit 
goal: IO Unit

full_name: Lean.Parser.ensureConstantParserAlias
code: def ensureConstantParserAlias (aliasName : Name) : IO Unit 
goal: IO Unit

full_name: Lean.Parser.mkParserOfConstantUnsafe
code: unsafe def mkParserOfConstantUnsafe (constName : Name) (compileParserDescr : ParserDescr → ImportM Parser) : ImportM (Bool × Parser) 
goal: Lean.ImportM (Bool × Lean.Parser.Parser)

full_name: Lean.Parser.mkParserOfConstantAux
code: @[implemented_by mkParserOfConstantUnsafe]
opaque mkParserOfConstantAux (constName : Name) (compileParserDescr : ParserDescr → ImportM Parser) : ImportM (Bool × Parser)
goal: Lean.ImportM (Bool × Lean.Parser.Parser)

full_name: Lean.Parser.compileParserDescr
code: partial def compileParserDescr (categories : ParserCategories) (d : ParserDescr) : ImportM Parser 
goal: Lean.ImportM Lean.Parser.Parser

full_name: Lean.Parser.compileParserDescr.visit
code: partial def compileParserDescr (categories : ParserCategories) (d : ParserDescr) : ImportM Parser 
goal: Lean.ParserDescr → Lean.ImportM Lean.Parser.Parser

full_name: Lean.Parser.mkParserOfConstant
code: def mkParserOfConstant (categories : ParserCategories) (constName : Name) : ImportM (Bool × Parser) 
goal: Lean.ImportM (Bool × Lean.Parser.Parser)

full_name: Lean.Parser.ParserAttributeHook.postAdd
code: structure ParserAttributeHook where
  /-- Called after a parser attribute is applied to a declaration. -/
  postAdd (catName : Name) (declName : Name) (builtin : Bool) : AttrM Unit
goal: Lean.AttrM Unit

full_name: Lean.Parser.ParserAttributeHook
code: structure ParserAttributeHook where
  /-- Called after a parser attribute is applied to a declaration. -/
  postAdd (catName : Name) (declName : Name) (builtin : Bool) : AttrM Unit
goal: Type

full_name: Lean.Parser.initFn._@..lake.packages.lean4.src.lean.Lean.Parser.Extension._hyg.3666
code: builtin_initialize parserAttributeHooks : IO.Ref (List ParserAttributeHook) ← IO.mkRef {}
goal: IO (IO.Ref (List Lean.Parser.ParserAttributeHook))

full_name: Lean.Parser.parserAttributeHooks
code: builtin_initialize parserAttributeHooks : IO.Ref (List ParserAttributeHook) ← IO.mkRef {}
goal: IO.Ref (List Lean.Parser.ParserAttributeHook)

full_name: Lean.Parser.registerParserAttributeHook
code: def registerParserAttributeHook (hook : ParserAttributeHook) : IO Unit 
goal: IO Unit

full_name: Lean.Parser.runParserAttributeHooks
code: def runParserAttributeHooks (catName : Name) (declName : Name) (builtin : Bool) : AttrM Unit 
goal: Lean.AttrM Unit

full_name: Lean.Parser.initFn._@..lake.packages.lean4.src.lean.Lean.Parser.Extension._hyg.3765
code: builtin_initialize
  registerBuiltinAttribute {
    name  := `run_builtin_parser_attribute_hooks
    descr := "explicitly run hooks normally activated by builtin parser attributes"
    add   := fun decl stx _ => do
      Attribute.Builtin.ensureNoArgs stx
      runParserAttributeHooks Name.anonymous decl (builtin := true)
  }
goal: IO Unit

full_name: Lean.Parser.initFn._@..lake.packages.lean4.src.lean.Lean.Parser.Extension._hyg.3851
code: builtin_initialize
  registerBuiltinAttribute {
    name  := `run_parser_attribute_hooks
    descr := "explicitly run hooks normally activated by parser attributes"
    add   := fun decl stx _ => do
      Attribute.Builtin.ensureNoArgs stx
      runParserAttributeHooks Name.anonymous decl (builtin := false)
  }
goal: IO Unit

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Parser.Extension.0.Lean.Parser.ParserExtension.OLeanEntry.toEntry
code: private def ParserExtension.OLeanEntry.toEntry (s : State) : OLeanEntry → ImportM Entry
  
goal: Lean.Parser.ParserExtension.OLeanEntry → Lean.ImportM Lean.Parser.ParserExtension.Entry

full_name: Lean.Parser.initFn._@..lake.packages.lean4.src.lean.Lean.Parser.Extension._hyg.4084
code: builtin_initialize parserExtension : ParserExtension ←
  registerScopedEnvExtension {
    mkInitial       := ParserExtension.mkInitial
    addEntry        := ParserExtension.addEntryImpl
    toOLeanEntry    := ParserExtension.Entry.toOLeanEntry
    ofOLeanEntry    := ParserExtension.OLeanEntry.toEntry
  }
goal: IO Lean.Parser.ParserExtension

full_name: Lean.Parser.parserExtension
code: builtin_initialize parserExtension : ParserExtension ←
  registerScopedEnvExtension {
    mkInitial       := ParserExtension.mkInitial
    addEntry        := ParserExtension.addEntryImpl
    toOLeanEntry    := ParserExtension.Entry.toOLeanEntry
    ofOLeanEntry    := ParserExtension.OLeanEntry.toEntry
  }
goal: Lean.Parser.ParserExtension

full_name: Lean.Parser.isParserCategory
code: def isParserCategory (env : Environment) (catName : Name) : Bool 
goal: Bool

full_name: Lean.Parser.addParserCategory
code: def addParserCategory (env : Environment) (catName declName : Name) (behavior : LeadingIdentBehavior) : Except String Environment 
goal: Except String Lean.Environment

full_name: Lean.Parser.leadingIdentBehavior
code: def leadingIdentBehavior (env : Environment) (catName : Name) : LeadingIdentBehavior 
goal: Lean.Parser.LeadingIdentBehavior

full_name: Lean.Parser.evalParserConstUnsafe
code: unsafe def evalParserConstUnsafe (declName : Name) : ParserFn 
goal: Lean.Parser.ParserFn

full_name: Lean.Parser.evalParserConst
code: @[implemented_by evalParserConstUnsafe]
opaque evalParserConst (declName : Name) : ParserFn
goal: Lean.Parser.ParserFn

full_name: Lean.Parser.internal.parseQuotWithCurrentStage
code: register_builtin_option internal.parseQuotWithCurrentStage : Bool := {
  defValue := false
  group    := "internal"
  descr    := "(Lean bootstrapping) use parsers from the current stage inside quotations"
}
goal: Lean.Option Bool

full_name: Lean.Parser.initFn._@..lake.packages.lean4.src.lean.Lean.Parser.Extension._hyg.4327
code: register_builtin_option internal.parseQuotWithCurrentStage : Bool := {
  defValue := false
  group    := "internal"
  descr    := "(Lean bootstrapping) use parsers from the current stage inside quotations"
}
goal: IO (Lean.Option Bool)

full_name: Lean.Parser.evalInsideQuot
code: /-- Run `declName` if possible and inside a quotation, or else `p`. The `ParserInfo` will always be taken from `p`. -/
def evalInsideQuot (declName : Name) : Parser → Parser 
goal: Lean.Parser.Parser → Lean.Parser.Parser

full_name: Lean.Parser.addBuiltinParser
code: def addBuiltinParser (catName : Name) (declName : Name) (leading : Bool) (p : Parser) (prio : Nat) : IO Unit 
goal: IO Unit

full_name: Lean.Parser.addBuiltinLeadingParser
code: def addBuiltinLeadingParser (catName : Name) (declName : Name) (p : Parser) (prio : Nat) : IO Unit 
goal: IO Unit

full_name: Lean.Parser.addBuiltinTrailingParser
code: def addBuiltinTrailingParser (catName : Name) (declName : Name) (p : TrailingParser) (prio : Nat) : IO Unit 
goal: IO Unit

full_name: Lean.Parser.mkCategoryAntiquotParser
code: def mkCategoryAntiquotParser (kind : Name) : Parser 
goal: Lean.Parser.Parser

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Parser.Extension.0.Lean.Parser.mkCategoryAntiquotParserFn
code: @[inline] private def mkCategoryAntiquotParserFn (kind : Name) : ParserFn 
goal: Lean.Parser.ParserFn

full_name: Lean.Parser.categoryParserFnImpl
code: def categoryParserFnImpl (catName : Name) : ParserFn 
goal: Lean.Parser.ParserFn

full_name: Lean.Parser.initFn._@..lake.packages.lean4.src.lean.Lean.Parser.Extension._hyg.4624
code: builtin_initialize
  categoryParserFnRef.set categoryParserFnImpl
goal: IO Unit

full_name: Lean.Parser.addToken
code: def addToken (tk : Token) (kind : AttributeKind) : AttrM Unit 
goal: Lean.AttrM Unit

full_name: Lean.Parser.addSyntaxNodeKind
code: def addSyntaxNodeKind (env : Environment) (k : SyntaxNodeKind) : Environment 
goal: Lean.Environment

full_name: Lean.Parser.isValidSyntaxNodeKind
code: def isValidSyntaxNodeKind (env : Environment) (k : SyntaxNodeKind) : Bool 
goal: Bool

full_name: Lean.Parser.getSyntaxNodeKinds
code: def getSyntaxNodeKinds (env : Environment) : List SyntaxNodeKind 
goal: List Lean.SyntaxNodeKind

full_name: Lean.Parser.getTokenTable
code: def getTokenTable (env : Environment) : TokenTable 
goal: Lean.Parser.TokenTable

full_name: Lean.Parser.mkInputContext
code: def mkInputContext (input : String) (fileName : String) (normalizeLineEndings := true) : InputContext 
goal: Lean.Parser.InputContext

full_name: Lean.Parser.mkParserState
code: def mkParserState (input : String) : ParserState 
goal: Lean.Parser.ParserState

full_name: Lean.Parser.runParserCategory
code: /-- convenience function for testing -/
def runParserCategory (env : Environment) (catName : Name) (input : String) (fileName := "<input>") : Except String Syntax 
goal: Except String Lean.Syntax

full_name: Lean.Parser.declareBuiltinParser
code: def declareBuiltinParser (addFnName : Name) (catName : Name) (declName : Name) (prio : Nat) : CoreM Unit 
goal: Lean.CoreM Unit

full_name: Lean.Parser.declareLeadingBuiltinParser
code: def declareLeadingBuiltinParser (catName : Name) (declName : Name) (prio : Nat) : CoreM Unit 
goal: Lean.CoreM Unit

full_name: Lean.Parser.declareTrailingBuiltinParser
code: def declareTrailingBuiltinParser (catName : Name) (declName : Name) (prio : Nat) : CoreM Unit 
goal: Lean.CoreM Unit

full_name: Lean.Parser.getParserPriority
code: def getParserPriority (args : Syntax) : Except String Nat 
goal: Except String Nat

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Parser.Extension.0.Lean.Parser.BuiltinParserAttribute.add
code: private def BuiltinParserAttribute.add (attrName : Name) (catName : Name)
    (declName : Name) (stx : Syntax) (kind : AttributeKind) : AttrM Unit 
goal: Lean.AttrM Unit

full_name: Lean.Parser.registerBuiltinParserAttribute
code: /--
The parsing tables for builtin parsers are "stored" in the extracted source code.
-/
def registerBuiltinParserAttribute (attrName declName : Name)
    (behavior := LeadingIdentBehavior.default) (ref : Name := by exact decl_name%) : IO Unit 
goal: IO Unit

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Parser.Extension.0.Lean.Parser.ParserAttribute.add
code: private def ParserAttribute.add (_attrName : Name) (catName : Name) (declName : Name) (stx : Syntax) (attrKind : AttributeKind) : AttrM Unit 
goal: Lean.AttrM Unit

full_name: Lean.Parser.mkParserAttributeImpl
code: def mkParserAttributeImpl (attrName catName : Name) (ref : Name := by exact decl_name%) : AttributeImpl 
goal: Lean.AttributeImpl

full_name: Lean.Parser.registerBuiltinDynamicParserAttribute
code: /-- A builtin parser attribute that can be extended by users. -/
def registerBuiltinDynamicParserAttribute (attrName catName : Name) (ref : Name := by exact decl_name%) : IO Unit 
goal: IO Unit

full_name: Lean.Parser.initFn._@..lake.packages.lean4.src.lean.Lean.Parser.Extension._hyg.5804
code: builtin_initialize
  registerAttributeImplBuilder `parserAttr fun ref args =>
    match args with
    | [DataValue.ofName attrName, DataValue.ofName catName] => pure $ mkParserAttributeImpl attrName catName ref
    | _ => throw "invalid parser attribute implementation builder arguments"
goal: IO Unit

full_name: Lean.Parser.registerParserCategory
code: def registerParserCategory (env : Environment) (attrName catName : Name)
    (behavior := LeadingIdentBehavior.default) (ref : Name := by exact decl_name%) : IO Environment 
goal: IO Lean.Environment

full_name: Lean.Parser.initFn._@..lake.packages.lean4.src.lean.Lean.Parser.Extension._hyg.5931
code: builtin_initialize registerBuiltinParserAttribute `builtin_term_parser ``Category.term
goal: IO Unit

full_name: Lean.Parser.initFn._@..lake.packages.lean4.src.lean.Lean.Parser.Extension._hyg.5981
code: builtin_initialize registerBuiltinDynamicParserAttribute `term_parser `term
goal: IO Unit

full_name: Lean.Parser.initFn._@..lake.packages.lean4.src.lean.Lean.Parser.Extension._hyg.6031
code: builtin_initialize registerBuiltinParserAttribute `builtin_command_parser ``Category.command
goal: IO Unit

full_name: Lean.Parser.initFn._@..lake.packages.lean4.src.lean.Lean.Parser.Extension._hyg.6081
code: builtin_initialize registerBuiltinDynamicParserAttribute `command_parser `command
goal: IO Unit

full_name: Lean.Parser.commandParser
code: @[inline] def commandParser (rbp : Nat := 0) : Parser 
goal: Lean.Parser.Parser

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Parser.Extension.0.Lean.Parser.withNamespaces
code: private def withNamespaces (ids : Array Name) (addOpenSimple : Bool) : ParserFn → ParserFn 
goal: Lean.Parser.ParserFn → Lean.Parser.ParserFn

full_name: Lean.Parser.withOpenDeclFnCore
code: def withOpenDeclFnCore (openDeclStx : Syntax) (p : ParserFn) : ParserFn 
goal: Lean.Parser.ParserFn

full_name: Lean.Parser.withOpenFn
code: /-- If the parsing stack is of the form `#[.., openCommand]`, we process the open command, and execute `p` -/
def withOpenFn (p : ParserFn) : ParserFn 
goal: Lean.Parser.ParserFn

full_name: Lean.Parser.withOpen
code: @[inline] def withOpen : Parser → Parser 
goal: Lean.Parser.Parser → Lean.Parser.Parser

full_name: Lean.Parser.withOpenDeclFn
code: /-- If the parsing stack is of the form `#[.., openDecl]`, we process the open declaration, and execute `p` -/
def withOpenDeclFn (p : ParserFn) : ParserFn 
goal: Lean.Parser.ParserFn

full_name: Lean.Parser.withOpenDecl
code: @[inline] def withOpenDecl : Parser → Parser 
goal: Lean.Parser.Parser → Lean.Parser.Parser

full_name: Lean.Parser.aliasExtension
code: /--
Helper environment extension that gives us access to built-in aliases in pure parser functions.
-/
builtin_initialize aliasExtension : EnvExtension (NameMap ParserAliasValue) ←
  registerEnvExtension parserAliasesRef.get
goal: Lean.EnvExtension (Lean.NameMap Lean.Parser.ParserAliasValue)

full_name: Lean.Parser.initFn._@..lake.packages.lean4.src.lean.Lean.Parser.Extension._hyg.6538
code: /--
Helper environment extension that gives us access to built-in aliases in pure parser functions.
-/
builtin_initialize aliasExtension : EnvExtension (NameMap ParserAliasValue) ←
  registerEnvExtension parserAliasesRef.get
goal: IO (Lean.EnvExtension (Lean.NameMap Lean.Parser.ParserAliasValue))

full_name: Lean.Parser.ParserResolution.alias
code: /-- Result of resolving a parser name. -/
inductive ParserResolution where
  /-- Reference to a category. -/
  | category (cat : Name)
  /--
  Reference to a parser declaration in the environment.  A `(Trailing)ParserDescr` if `isDescr` is
  true.
  -/
  | parser (decl : Name) (isDescr : Bool)
  /--
  Reference to a parser alias. Note that as aliases are built-in, a corresponding declaration may
  not be in the environment (yet).
  -/
  | alias (p : ParserAliasValue)
goal: Lean.Parser.ParserResolution

full_name: Lean.Parser.ParserResolution
code: /-- Result of resolving a parser name. -/
inductive ParserResolution where
  /-- Reference to a category. -/
  | category (cat : Name)
  /--
  Reference to a parser declaration in the environment.  A `(Trailing)ParserDescr` if `isDescr` is
  true.
  -/
  | parser (decl : Name) (isDescr : Bool)
  /--
  Reference to a parser alias. Note that as aliases are built-in, a corresponding declaration may
  not be in the environment (yet).
  -/
  | alias (p : ParserAliasValue)
goal: Type

full_name: Lean.Parser.ParserResolution.parser
code: /-- Result of resolving a parser name. -/
inductive ParserResolution where
  /-- Reference to a category. -/
  | category (cat : Name)
  /--
  Reference to a parser declaration in the environment.  A `(Trailing)ParserDescr` if `isDescr` is
  true.
  -/
  | parser (decl : Name) (isDescr : Bool)
  /--
  Reference to a parser alias. Note that as aliases are built-in, a corresponding declaration may
  not be in the environment (yet).
  -/
  | alias (p : ParserAliasValue)
goal: Lean.Parser.ParserResolution

full_name: Lean.Parser.ParserResolution.category
code: /-- Result of resolving a parser name. -/
inductive ParserResolution where
  /-- Reference to a category. -/
  | category (cat : Name)
  /--
  Reference to a parser declaration in the environment.  A `(Trailing)ParserDescr` if `isDescr` is
  true.
  -/
  | parser (decl : Name) (isDescr : Bool)
  /--
  Reference to a parser alias. Note that as aliases are built-in, a corresponding declaration may
  not be in the environment (yet).
  -/
  | alias (p : ParserAliasValue)
goal: Lean.Parser.ParserResolution

full_name: Lean.Parser.resolveParserNameCore
code: /-- Resolve the given parser name and return a list of candidates. -/
def resolveParserNameCore (env : Environment) (currNamespace : Name)
    (openDecls : List OpenDecl) (ident : Ident) : List ParserResolution 
goal: List Lean.Parser.ParserResolution

full_name: Lean.Parser.resolveParserNameCore.isParser
code: /-- Resolve the given parser name and return a list of candidates. -/
def resolveParserNameCore (env : Environment) (currNamespace : Name)
    (openDecls : List OpenDecl) (ident : Ident) : List ParserResolution 
goal: Option Bool

full_name: Lean.Parser.ParserContext.resolveParserName
code: /-- Resolve the given parser name and return a list of candidates. -/
def ParserContext.resolveParserName (ctx : ParserContext) (id : Ident) : List ParserResolution 
goal: List Lean.Parser.ParserResolution

full_name: Lean.Parser.resolveParserName
code: /-- Resolve the given parser name and return a list of candidates. -/
def resolveParserName (id : Ident) : CoreM (List ParserResolution) 
goal: Lean.CoreM (List Lean.Parser.ParserResolution)

full_name: Lean.Parser.parserOfStackFn
code: def parserOfStackFn (offset : Nat) : ParserFn 
goal: Lean.Parser.ParserFn

full_name: Lean.Parser.parserOfStack
code: def parserOfStack (offset : Nat) (prec : Nat := 0) : Parser 
goal: Lean.Parser.Parser