File: .lake/packages/lean4/src/lean/Lean/Elab/Syntax.lean

full_name: Lean.Elab.Term.expandOptPrecedence
code: /--
Expand `optional «precedence»` where
 «precedence» := leading_parser " : " >> precedenceParser -/
def expandOptPrecedence (stx : Syntax) : MacroM (Option Nat) 
goal: Lean.MacroM (Option Nat)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Syntax.0.Lean.Elab.Term.mkParserSeq
code: private def mkParserSeq (ds : Array (Term × Nat)) : TermElabM (Term × Nat) 
goal: Lean.Elab.TermElabM (Lean.Term × Nat)

full_name: Lean.Elab.Term.ToParserDescrContext.leftRec
code: structure ToParserDescrContext where
  catName  : Name
  first    : Bool
  leftRec  : Bool -- true iff left recursion is allowed
  /-- See comment at `Parser.ParserCategory`. -/
  behavior : Parser.LeadingIdentBehavior
goal: Bool

full_name: Lean.Elab.Term.ToParserDescrContext.catName
code: structure ToParserDescrContext where
  catName  : Name
  first    : Bool
  leftRec  : Bool -- true iff left recursion is allowed
  /-- See comment at `Parser.ParserCategory`. -/
  behavior : Parser.LeadingIdentBehavior
goal: Lean.Name

full_name: Lean.Elab.Term.ToParserDescrContext.behavior
code: structure ToParserDescrContext where
  catName  : Name
  first    : Bool
  leftRec  : Bool -- true iff left recursion is allowed
  /-- See comment at `Parser.ParserCategory`. -/
  behavior : Parser.LeadingIdentBehavior
goal: Lean.Parser.LeadingIdentBehavior

full_name: Lean.Elab.Term.ToParserDescrContext
code: structure ToParserDescrContext where
  catName  : Name
  first    : Bool
  leftRec  : Bool -- true iff left recursion is allowed
  /-- See comment at `Parser.ParserCategory`. -/
  behavior : Parser.LeadingIdentBehavior
goal: Type

full_name: Lean.Elab.Term.ToParserDescrContext.first
code: structure ToParserDescrContext where
  catName  : Name
  first    : Bool
  leftRec  : Bool -- true iff left recursion is allowed
  /-- See comment at `Parser.ParserCategory`. -/
  behavior : Parser.LeadingIdentBehavior
goal: Bool

full_name: Lean.Elab.Term.ToParserDescrM
code: abbrev ToParserDescrM 
goal: Type

full_name: Lean.Elab.Term.ToParserDescr
code: abbrev ToParserDescr 
goal: Type

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Syntax.0.Lean.Elab.Term.markAsTrailingParser
code: private def markAsTrailingParser (lhsPrec : Nat) : ToParserDescrM Unit 
goal: Lean.Elab.Term.ToParserDescrM Unit

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Syntax.0.Lean.Elab.Term.withNotFirst
code: @[inline] private def withNotFirst {α} (x : ToParserDescrM α) : ToParserDescrM α 
goal: Lean.Elab.Term.ToParserDescrM α

full_name: Lean.Elab.Term.ensureUnaryOutput
code: def ensureUnaryOutput (x : Term × Nat) : Term 
goal: Lean.Term

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Syntax.0.Lean.Elab.Term.withNestedParser
code: @[inline] private def withNestedParser (x : ToParserDescr) : ToParserDescr 
goal: Lean.Elab.Term.ToParserDescr

full_name: Lean.Elab.Term.addCategoryInfo
code: /-- (Try to) add a term info for the category `catName` at `ref`. -/
def addCategoryInfo (ref : Syntax) (catName : Name) : TermElabM Unit 
goal: Lean.Elab.TermElabM Unit

full_name: Lean.Elab.Term.addAliasInfo
code: /-- (Try to) add a term info for the alias with info `info` at `ref`. -/
def addAliasInfo (ref : Syntax) (info : Parser.ParserAliasInfo) : TermElabM Unit 
goal: Lean.Elab.TermElabM Unit

full_name: Lean.Elab.Term.checkLeftRec
code: def checkLeftRec (stx : Syntax) : ToParserDescrM Bool 
goal: Lean.Elab.Term.ToParserDescrM Bool

full_name: Lean.Elab.Term.elabParserName?
code: def elabParserName? (stx : Syntax.Ident) : TermElabM (Option Parser.ParserResolution) 
goal: Lean.Elab.TermElabM (Option Lean.Parser.ParserResolution)

full_name: Lean.Elab.Term.elabParserName
code: def elabParserName (stx : Syntax.Ident) : TermElabM Parser.ParserResolution 
goal: Lean.Elab.TermElabM Lean.Parser.ParserResolution

full_name: Lean.Elab.Term.toParserDescr.isValidAtom
code: /--
  Given a `stx` of category `syntax`, return a `(newStx, lhsPrec?)`,
  where `newStx` is of category `term`. After elaboration, `newStx` should have type
  `TrailingParserDescr` if `lhsPrec?.isSome`, and `ParserDescr` otherwise. -/
partial def toParserDescr (stx : Syntax) (catName : Name) : TermElabM (Term × Option Nat) 
goal: Bool

full_name: Lean.Elab.Term.toParserDescr
code: /--
  Given a `stx` of category `syntax`, return a `(newStx, lhsPrec?)`,
  where `newStx` is of category `term`. After elaboration, `newStx` should have type
  `TrailingParserDescr` if `lhsPrec?.isSome`, and `ParserDescr` otherwise. -/
partial def toParserDescr (stx : Syntax) (catName : Name) : TermElabM (Term × Option Nat) 
goal: Lean.Elab.TermElabM (Lean.Term × Option Nat)

full_name: Lean.Elab.Term.toParserDescr.processNullaryOrCat
code: /--
  Given a `stx` of category `syntax`, return a `(newStx, lhsPrec?)`,
  where `newStx` is of category `term`. After elaboration, `newStx` should have type
  `TrailingParserDescr` if `lhsPrec?.isSome`, and `ParserDescr` otherwise. -/
partial def toParserDescr (stx : Syntax) (catName : Name) : TermElabM (Term × Option Nat) 
goal: Lean.Elab.Term.ToParserDescrM (Lean.Term × Nat)

full_name: Lean.Elab.Term.toParserDescr.processSepBy1
code: /--
  Given a `stx` of category `syntax`, return a `(newStx, lhsPrec?)`,
  where `newStx` is of category `term`. After elaboration, `newStx` should have type
  `TrailingParserDescr` if `lhsPrec?.isSome`, and `ParserDescr` otherwise. -/
partial def toParserDescr (stx : Syntax) (catName : Name) : TermElabM (Term × Option Nat) 
goal: Lean.Elab.Term.ToParserDescrM (Lean.Term × Nat)

full_name: Lean.Elab.Term.toParserDescr.ensureNoPrec
code: /--
  Given a `stx` of category `syntax`, return a `(newStx, lhsPrec?)`,
  where `newStx` is of category `term`. After elaboration, `newStx` should have type
  `TrailingParserDescr` if `lhsPrec?.isSome`, and `ParserDescr` otherwise. -/
partial def toParserDescr (stx : Syntax) (catName : Name) : TermElabM (Term × Option Nat) 
goal: Lean.Elab.Term.ToParserDescrM PUnit

full_name: Lean.Elab.Term.toParserDescr.process
code: /--
  Given a `stx` of category `syntax`, return a `(newStx, lhsPrec?)`,
  where `newStx` is of category `term`. After elaboration, `newStx` should have type
  `TrailingParserDescr` if `lhsPrec?.isSome`, and `ParserDescr` otherwise. -/
partial def toParserDescr (stx : Syntax) (catName : Name) : TermElabM (Term × Option Nat) 
goal: Lean.Elab.Term.ToParserDescr

full_name: Lean.Elab.Term.toParserDescr.processNonReserved
code: /--
  Given a `stx` of category `syntax`, return a `(newStx, lhsPrec?)`,
  where `newStx` is of category `term`. After elaboration, `newStx` should have type
  `TrailingParserDescr` if `lhsPrec?.isSome`, and `ParserDescr` otherwise. -/
partial def toParserDescr (stx : Syntax) (catName : Name) : TermElabM (Term × Option Nat) 
goal: Lean.Elab.Term.ToParserDescrM (Lean.Term × Nat)

full_name: Lean.Elab.Term.toParserDescr.processParserCategory
code: /--
  Given a `stx` of category `syntax`, return a `(newStx, lhsPrec?)`,
  where `newStx` is of category `term`. After elaboration, `newStx` should have type
  `TrailingParserDescr` if `lhsPrec?.isSome`, and `ParserDescr` otherwise. -/
partial def toParserDescr (stx : Syntax) (catName : Name) : TermElabM (Term × Option Nat) 
goal: Lean.Elab.Term.ToParserDescrM (Lean.Term × Nat)

full_name: Lean.Elab.Term.toParserDescr.processAtom
code: /--
  Given a `stx` of category `syntax`, return a `(newStx, lhsPrec?)`,
  where `newStx` is of category `term`. After elaboration, `newStx` should have type
  `TrailingParserDescr` if `lhsPrec?.isSome`, and `ParserDescr` otherwise. -/
partial def toParserDescr (stx : Syntax) (catName : Name) : TermElabM (Term × Option Nat) 
goal: Lean.Elab.Term.ToParserDescrM (Lean.Term × Nat)

full_name: Lean.Elab.Term.toParserDescr.processSeq
code: /--
  Given a `stx` of category `syntax`, return a `(newStx, lhsPrec?)`,
  where `newStx` is of category `term`. After elaboration, `newStx` should have type
  `TrailingParserDescr` if `lhsPrec?.isSome`, and `ParserDescr` otherwise. -/
partial def toParserDescr (stx : Syntax) (catName : Name) : TermElabM (Term × Option Nat) 
goal: Lean.Elab.Term.ToParserDescrM (Lean.Term × Nat)

full_name: Lean.Elab.Term.toParserDescr.processAlias
code: /--
  Given a `stx` of category `syntax`, return a `(newStx, lhsPrec?)`,
  where `newStx` is of category `term`. After elaboration, `newStx` should have type
  `TrailingParserDescr` if `lhsPrec?.isSome`, and `ParserDescr` otherwise. -/
partial def toParserDescr (stx : Syntax) (catName : Name) : TermElabM (Term × Option Nat) 
goal: Lean.Elab.Term.ToParserDescrM (Lean.Term × Nat)

full_name: Lean.Elab.Term.toParserDescr.processSepBy
code: /--
  Given a `stx` of category `syntax`, return a `(newStx, lhsPrec?)`,
  where `newStx` is of category `term`. After elaboration, `newStx` should have type
  `TrailingParserDescr` if `lhsPrec?.isSome`, and `ParserDescr` otherwise. -/
partial def toParserDescr (stx : Syntax) (catName : Name) : TermElabM (Term × Option Nat) 
goal: Lean.Elab.Term.ToParserDescrM (Lean.Term × Nat)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Syntax.0.Lean.Elab.Command.declareSyntaxCatQuotParser
code: private def declareSyntaxCatQuotParser (catName : Name) : CommandElabM Unit 
goal: Lean.Elab.Command.CommandElabM Unit

full_name: Lean.Elab.Command.elabDeclareSyntaxCat
code: @[builtin_command_elab syntaxCat] def elabDeclareSyntaxCat : CommandElab 
goal: Lean.Elab.Command.CommandElab

full_name: Lean.Elab.Command.mkNameFromParserSyntax.appendCatName
code: /--
  Auxiliary function for creating declaration names from parser descriptions.
  Example:
  Given
  ```
  syntax term "+" term : term
  syntax "[" sepBy(term, ", ") "]"  : term
  ```
  It generates the names `term_+_` and `term[_,]`
-/
partial def mkNameFromParserSyntax (catName : Name) (stx : Syntax) : MacroM Name 
goal: String

full_name: Lean.Elab.Command.mkNameFromParserSyntax.visit
code: /--
  Auxiliary function for creating declaration names from parser descriptions.
  Example:
  Given
  ```
  syntax term "+" term : term
  syntax "[" sepBy(term, ", ") "]"  : term
  ```
  It generates the names `term_+_` and `term[_,]`
-/
partial def mkNameFromParserSyntax (catName : Name) (stx : Syntax) : MacroM Name 
goal: String

full_name: Lean.Elab.Command.mkNameFromParserSyntax
code: /--
  Auxiliary function for creating declaration names from parser descriptions.
  Example:
  Given
  ```
  syntax term "+" term : term
  syntax "[" sepBy(term, ", ") "]"  : term
  ```
  It generates the names `term_+_` and `term[_,]`
-/
partial def mkNameFromParserSyntax (catName : Name) (stx : Syntax) : MacroM Name 
goal: Lean.MacroM Lean.Name

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Syntax.0.Lean.Elab.Command.isAtomLikeSyntax
code: /-- We assume a new syntax can be treated as an atom when it starts and ends with a token.
   Here are examples of atom-like syntax.
   ```
   syntax "(" term ")" : term
   syntax "[" (sepBy term ",") "]" : term
   syntax "foo" : term
   ```
 -/
private partial def isAtomLikeSyntax (stx : Syntax) : Bool 
goal: Bool

full_name: Lean.Elab.Command.resolveSyntaxKind
code: def resolveSyntaxKind (k : Name) : CommandElabM Name 
goal: Lean.Elab.Command.CommandElabM Lean.Name

full_name: Lean.Elab.Command.isLocalAttrKind
code: def isLocalAttrKind (attrKind : Syntax) : Bool 
goal: Bool

full_name: Lean.Elab.Command.addMacroScopeIfLocal
code: /--
Add macro scope to `name` if it does not already have them, and `attrKind` is `local`.
-/
def addMacroScopeIfLocal [MonadQuotation m] [Monad m] (name : Name) (attrKind : Syntax) : m Name 
goal: m Lean.Name

full_name: Lean.Elab.Command.elabSyntax
code: @[builtin_command_elab «syntax»] def elabSyntax : CommandElab 
goal: Lean.Elab.Command.CommandElab

full_name: Lean.Elab.Command.elabSyntaxAbbrev
code: @[builtin_command_elab «syntaxAbbrev»] def elabSyntaxAbbrev : CommandElab 
goal: Lean.Elab.Command.CommandElab

full_name: Lean.Elab.Command.checkRuleKind
code: def checkRuleKind (given expected : SyntaxNodeKind) : Bool 
goal: Bool

full_name: Lean.Elab.Command.inferMacroRulesAltKind
code: def inferMacroRulesAltKind : TSyntax ``matchAlt → CommandElabM SyntaxNodeKind
  
goal: Lean.TSyntax `Lean.Parser.Term.matchAlt → Lean.Elab.Command.CommandElabM Lean.SyntaxNodeKind

full_name: Lean.Elab.Command.expandNoKindMacroRulesAux
code: /--
Infer syntax kind `k` from first pattern, put alternatives of same kind into new `macro/elab_rules (kind := k)` via `mkCmd (some k)`,
leave remaining alternatives (via `mkCmd none`) to be recursively expanded. -/
def expandNoKindMacroRulesAux (alts : Array (TSyntax ``matchAlt)) (cmdName : String) (mkCmd : Option Name → Array (TSyntax ``matchAlt) → CommandElabM Command) : CommandElabM Command 
goal: Lean.Elab.Command.CommandElabM Lean.Command

full_name: Lean.Elab.Command.strLitToPattern
code: def strLitToPattern (stx: Syntax) : MacroM Syntax 
goal: Lean.MacroM Lean.Syntax

full_name: Lean.Elab.Command.initFn._@..lake.packages.lean4.src.lean.Lean.Elab.Syntax._hyg.11148
code: builtin_initialize
  registerTraceClass `Elab.defaultInstance
goal: IO Unit