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

full_name: Lean.Parser.mkAtom
code: abbrev mkAtom (info : SourceInfo) (val : String) : Syntax 
goal: Lean.Syntax

full_name: Lean.Parser.mkIdent
code: abbrev mkIdent (info : SourceInfo) (rawVal : Substring) (val : Name) : Syntax 
goal: Lean.Syntax

full_name: Lean.Parser.getNext
code: /-- Return character after position `pos` -/
def getNext (input : String) (pos : String.Pos) : Char 
goal: Char

full_name: Lean.Parser.maxPrec
code: /-- Maximal (and function application) precedence.
   In the standard lean language, no parser has precedence higher than `maxPrec`.

   Note that nothing prevents users from using a higher precedence, but we strongly
   discourage them from doing it. -/
def maxPrec  : Nat 
goal: Nat

full_name: Lean.Parser.argPrec
code: def argPrec  : Nat 
goal: Nat

full_name: Lean.Parser.leadPrec
code: def leadPrec : Nat 
goal: Nat

full_name: Lean.Parser.minPrec
code: def minPrec  : Nat 
goal: Nat

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

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

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

full_name: Lean.Parser.SyntaxNodeKindSet.insert
code: def SyntaxNodeKindSet.insert (s : SyntaxNodeKindSet) (k : SyntaxNodeKind) : SyntaxNodeKindSet 
goal: Lean.Parser.SyntaxNodeKindSet

full_name: Lean.Parser.InputContext.input
code: /--
  Input string and related data. Recall that the `FileMap` is a helper structure for mapping
  `String.Pos` in the input string to line/column information.  -/
structure InputContext where
  input    : String
  fileName : String
  fileMap  : FileMap
  deriving Inhabited
goal: String

full_name: Lean.Parser.InputContext.fileMap
code: /--
  Input string and related data. Recall that the `FileMap` is a helper structure for mapping
  `String.Pos` in the input string to line/column information.  -/
structure InputContext where
  input    : String
  fileName : String
  fileMap  : FileMap
  deriving Inhabited
goal: Lean.FileMap

full_name: Lean.Parser.InputContext
code: /--
  Input string and related data. Recall that the `FileMap` is a helper structure for mapping
  `String.Pos` in the input string to line/column information.  -/
structure InputContext where
  input    : String
  fileName : String
  fileMap  : FileMap
  deriving Inhabited
goal: Type

full_name: Lean.Parser.instInhabitedInputContext
code: /--
  Input string and related data. Recall that the `FileMap` is a helper structure for mapping
  `String.Pos` in the input string to line/column information.  -/
structure InputContext where
  input    : String
  fileName : String
  fileMap  : FileMap
  deriving Inhabited
goal: Inhabited Lean.Parser.InputContext

full_name: Lean.Parser.InputContext.fileName
code: /--
  Input string and related data. Recall that the `FileMap` is a helper structure for mapping
  `String.Pos` in the input string to line/column information.  -/
structure InputContext where
  input    : String
  fileName : String
  fileMap  : FileMap
  deriving Inhabited
goal: String

full_name: Lean.Parser.ParserModuleContext.env
code: /-- Input context derived from elaboration of previous commands. -/
structure ParserModuleContext where
  env : Environment
  options       : Options
  -- for name lookup
  currNamespace : Name := .anonymous
  openDecls     : List OpenDecl := []
goal: Lean.Environment

full_name: Lean.Parser.ParserModuleContext.openDecls
code: /-- Input context derived from elaboration of previous commands. -/
structure ParserModuleContext where
  env : Environment
  options       : Options
  -- for name lookup
  currNamespace : Name := .anonymous
  openDecls     : List OpenDecl := []
goal: List Lean.OpenDecl

full_name: Lean.Parser.ParserModuleContext
code: /-- Input context derived from elaboration of previous commands. -/
structure ParserModuleContext where
  env : Environment
  options       : Options
  -- for name lookup
  currNamespace : Name := .anonymous
  openDecls     : List OpenDecl := []
goal: Type

full_name: Lean.Parser.ParserModuleContext.currNamespace
code: /-- Input context derived from elaboration of previous commands. -/
structure ParserModuleContext where
  env : Environment
  options       : Options
  -- for name lookup
  currNamespace : Name := .anonymous
  openDecls     : List OpenDecl := []
goal: Lean.Name

full_name: Lean.Parser.ParserModuleContext.options
code: /-- Input context derived from elaboration of previous commands. -/
structure ParserModuleContext where
  env : Environment
  options       : Options
  -- for name lookup
  currNamespace : Name := .anonymous
  openDecls     : List OpenDecl := []
goal: Lean.Options

full_name: Lean.Parser.CacheableParserContext.suppressInsideQuot
code: /-- Parser context parts that can be updated without invalidating the parser cache. -/
structure CacheableParserContext where
  prec               : Nat
  -- used for bootstrapping only
  quotDepth          : Nat := 0
  suppressInsideQuot : Bool := false
  savedPos?          : Option String.Pos := none
  forbiddenTk?       : Option Token := none
  deriving BEq
goal: Bool

full_name: Lean.Parser.CacheableParserContext.quotDepth
code: /-- Parser context parts that can be updated without invalidating the parser cache. -/
structure CacheableParserContext where
  prec               : Nat
  -- used for bootstrapping only
  quotDepth          : Nat := 0
  suppressInsideQuot : Bool := false
  savedPos?          : Option String.Pos := none
  forbiddenTk?       : Option Token := none
  deriving BEq
goal: Nat

full_name: Lean.Parser.CacheableParserContext.savedPos?
code: /-- Parser context parts that can be updated without invalidating the parser cache. -/
structure CacheableParserContext where
  prec               : Nat
  -- used for bootstrapping only
  quotDepth          : Nat := 0
  suppressInsideQuot : Bool := false
  savedPos?          : Option String.Pos := none
  forbiddenTk?       : Option Token := none
  deriving BEq
goal: Option String.Pos

full_name: Lean.Parser.CacheableParserContext.forbiddenTk?
code: /-- Parser context parts that can be updated without invalidating the parser cache. -/
structure CacheableParserContext where
  prec               : Nat
  -- used for bootstrapping only
  quotDepth          : Nat := 0
  suppressInsideQuot : Bool := false
  savedPos?          : Option String.Pos := none
  forbiddenTk?       : Option Token := none
  deriving BEq
goal: Option Lean.Parser.Token

full_name: Lean.Parser.CacheableParserContext.prec
code: /-- Parser context parts that can be updated without invalidating the parser cache. -/
structure CacheableParserContext where
  prec               : Nat
  -- used for bootstrapping only
  quotDepth          : Nat := 0
  suppressInsideQuot : Bool := false
  savedPos?          : Option String.Pos := none
  forbiddenTk?       : Option Token := none
  deriving BEq
goal: Nat

full_name: Lean.Parser.CacheableParserContext
code: /-- Parser context parts that can be updated without invalidating the parser cache. -/
structure CacheableParserContext where
  prec               : Nat
  -- used for bootstrapping only
  quotDepth          : Nat := 0
  suppressInsideQuot : Bool := false
  savedPos?          : Option String.Pos := none
  forbiddenTk?       : Option Token := none
  deriving BEq
goal: Type

full_name: Lean.Parser.instBEqCacheableParserContext
code: /-- Parser context parts that can be updated without invalidating the parser cache. -/
structure CacheableParserContext where
  prec               : Nat
  -- used for bootstrapping only
  quotDepth          : Nat := 0
  suppressInsideQuot : Bool := false
  savedPos?          : Option String.Pos := none
  forbiddenTk?       : Option Token := none
  deriving BEq
goal: BEq Lean.Parser.CacheableParserContext

full_name: Lean.Parser.ParserContextCore.tokens
code: /-- Parser context updateable in `adaptUncacheableContextFn`. -/
structure ParserContextCore extends InputContext, ParserModuleContext, CacheableParserContext where
  tokens : TokenTable
goal: Lean.Parser.TokenTable

full_name: Lean.Parser.ParserContextCore
code: /-- Parser context updateable in `adaptUncacheableContextFn`. -/
structure ParserContextCore extends InputContext, ParserModuleContext, CacheableParserContext where
  tokens : TokenTable
goal: Type

full_name: Lean.Parser.ParserContext
code: /-- Opaque parser context updateable using `adaptCacheableContextFn` and `adaptUncacheableContextFn`. -/
structure ParserContext extends ParserContextCore where private mk ::
goal: Type

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Parser.Types.0.Lean.Parser.ParserContext.mk
code: /-- Opaque parser context updateable using `adaptCacheableContextFn` and `adaptUncacheableContextFn`. -/
structure ParserContext extends ParserContextCore where private mk ::
goal: Lean.Parser.ParserContext

full_name: Lean.Parser.instBEqError
code: structure Error where
  /--
    If not `missing`, used for lazily calculating `unexpected` message and range in `mkErrorMessage`.
    Otherwise, `ParserState.pos` is used as an empty range. -/
  unexpectedTk : Syntax := .missing
  unexpected : String := ""
  expected : List String := []
  deriving Inhabited, BEq
goal: BEq Lean.Parser.Error

full_name: Lean.Parser.Error.unexpectedTk
code: structure Error where
  /--
    If not `missing`, used for lazily calculating `unexpected` message and range in `mkErrorMessage`.
    Otherwise, `ParserState.pos` is used as an empty range. -/
  unexpectedTk : Syntax := .missing
  unexpected : String := ""
  expected : List String := []
  deriving Inhabited, BEq
goal: Lean.Syntax

full_name: Lean.Parser.instInhabitedError
code: structure Error where
  /--
    If not `missing`, used for lazily calculating `unexpected` message and range in `mkErrorMessage`.
    Otherwise, `ParserState.pos` is used as an empty range. -/
  unexpectedTk : Syntax := .missing
  unexpected : String := ""
  expected : List String := []
  deriving Inhabited, BEq
goal: Inhabited Lean.Parser.Error

full_name: Lean.Parser.Error.expected
code: structure Error where
  /--
    If not `missing`, used for lazily calculating `unexpected` message and range in `mkErrorMessage`.
    Otherwise, `ParserState.pos` is used as an empty range. -/
  unexpectedTk : Syntax := .missing
  unexpected : String := ""
  expected : List String := []
  deriving Inhabited, BEq
goal: List String

full_name: Lean.Parser.Error
code: structure Error where
  /--
    If not `missing`, used for lazily calculating `unexpected` message and range in `mkErrorMessage`.
    Otherwise, `ParserState.pos` is used as an empty range. -/
  unexpectedTk : Syntax := .missing
  unexpected : String := ""
  expected : List String := []
  deriving Inhabited, BEq
goal: Type

full_name: Lean.Parser.Error.unexpected
code: structure Error where
  /--
    If not `missing`, used for lazily calculating `unexpected` message and range in `mkErrorMessage`.
    Otherwise, `ParserState.pos` is used as an empty range. -/
  unexpectedTk : Syntax := .missing
  unexpected : String := ""
  expected : List String := []
  deriving Inhabited, BEq
goal: String

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Parser.Types.0.Lean.Parser.Error.expectedToString
code: private def expectedToString : List String → String
  
goal: List String → String

full_name: Lean.Parser.Error.toString
code: protected def toString (e : Error) : String 
goal: String

full_name: Lean.Parser.Error.instToString
code: instance : ToString Error 
goal: ToString Lean.Parser.Error

full_name: Lean.Parser.Error.merge
code: def merge (e₁ e₂ : Error) : Error 
goal: Lean.Parser.Error

full_name: Lean.Parser.TokenCacheEntry
code: structure TokenCacheEntry where
  startPos : String.Pos := 0
  stopPos  : String.Pos := 0
  token    : Syntax := Syntax.missing
goal: Type

full_name: Lean.Parser.TokenCacheEntry.startPos
code: structure TokenCacheEntry where
  startPos : String.Pos := 0
  stopPos  : String.Pos := 0
  token    : Syntax := Syntax.missing
goal: String.Pos

full_name: Lean.Parser.TokenCacheEntry.token
code: structure TokenCacheEntry where
  startPos : String.Pos := 0
  stopPos  : String.Pos := 0
  token    : Syntax := Syntax.missing
goal: Lean.Syntax

full_name: Lean.Parser.TokenCacheEntry.stopPos
code: structure TokenCacheEntry where
  startPos : String.Pos := 0
  stopPos  : String.Pos := 0
  token    : Syntax := Syntax.missing
goal: String.Pos

full_name: Lean.Parser.ParserCacheKey
code: structure ParserCacheKey extends CacheableParserContext where
  parserName : Name
  pos        : String.Pos
  deriving BEq
goal: Type

full_name: Lean.Parser.instBEqParserCacheKey
code: structure ParserCacheKey extends CacheableParserContext where
  parserName : Name
  pos        : String.Pos
  deriving BEq
goal: BEq Lean.Parser.ParserCacheKey

full_name: Lean.Parser.ParserCacheKey.parserName
code: structure ParserCacheKey extends CacheableParserContext where
  parserName : Name
  pos        : String.Pos
  deriving BEq
goal: Lean.Name

full_name: Lean.Parser.ParserCacheKey.pos
code: structure ParserCacheKey extends CacheableParserContext where
  parserName : Name
  pos        : String.Pos
  deriving BEq
goal: String.Pos

full_name: Lean.Parser.instHashableParserCacheKey
code: instance : Hashable ParserCacheKey 
goal: Hashable Lean.Parser.ParserCacheKey

full_name: Lean.Parser.ParserCacheEntry
code: structure ParserCacheEntry where
  stx      : Syntax
  lhsPrec  : Nat
  newPos   : String.Pos
  errorMsg : Option Error
goal: Type

full_name: Lean.Parser.ParserCacheEntry.errorMsg
code: structure ParserCacheEntry where
  stx      : Syntax
  lhsPrec  : Nat
  newPos   : String.Pos
  errorMsg : Option Error
goal: Option Lean.Parser.Error

full_name: Lean.Parser.ParserCacheEntry.stx
code: structure ParserCacheEntry where
  stx      : Syntax
  lhsPrec  : Nat
  newPos   : String.Pos
  errorMsg : Option Error
goal: Lean.Syntax

full_name: Lean.Parser.ParserCacheEntry.lhsPrec
code: structure ParserCacheEntry where
  stx      : Syntax
  lhsPrec  : Nat
  newPos   : String.Pos
  errorMsg : Option Error
goal: Nat

full_name: Lean.Parser.ParserCacheEntry.newPos
code: structure ParserCacheEntry where
  stx      : Syntax
  lhsPrec  : Nat
  newPos   : String.Pos
  errorMsg : Option Error
goal: String.Pos

full_name: Lean.Parser.ParserCache.tokenCache
code: structure ParserCache where
  tokenCache  : TokenCacheEntry
  parserCache : HashMap ParserCacheKey ParserCacheEntry
goal: Lean.Parser.TokenCacheEntry

full_name: Lean.Parser.ParserCache.parserCache
code: structure ParserCache where
  tokenCache  : TokenCacheEntry
  parserCache : HashMap ParserCacheKey ParserCacheEntry
goal: Lean.HashMap Lean.Parser.ParserCacheKey Lean.Parser.ParserCacheEntry

full_name: Lean.Parser.ParserCache
code: structure ParserCache where
  tokenCache  : TokenCacheEntry
  parserCache : HashMap ParserCacheKey ParserCacheEntry
goal: Type

full_name: Lean.Parser.initCacheForInput
code: def initCacheForInput (input : String) : ParserCache 
goal: Lean.Parser.ParserCache

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Parser.Types.0.Lean.Parser.SyntaxStack.raw
code: /-- A syntax array with an inaccessible prefix, used for sound caching. -/
structure SyntaxStack where
  private raw  : Array Syntax
  private drop : Nat
goal: Array Lean.Syntax

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Parser.Types.0.Lean.Parser.SyntaxStack.drop
code: /-- A syntax array with an inaccessible prefix, used for sound caching. -/
structure SyntaxStack where
  private raw  : Array Syntax
  private drop : Nat
goal: Nat

full_name: Lean.Parser.SyntaxStack
code: /-- A syntax array with an inaccessible prefix, used for sound caching. -/
structure SyntaxStack where
  private raw  : Array Syntax
  private drop : Nat
goal: Type

full_name: Lean.Parser.SyntaxStack.toSubarray
code: def toSubarray (stack : SyntaxStack) : Subarray Syntax 
goal: Subarray Lean.Syntax

full_name: Lean.Parser.SyntaxStack.empty
code: def empty : SyntaxStack 
goal: Lean.Parser.SyntaxStack

full_name: Lean.Parser.SyntaxStack.size
code: def size (stack : SyntaxStack) : Nat 
goal: Nat

full_name: Lean.Parser.SyntaxStack.isEmpty
code: def isEmpty (stack : SyntaxStack) : Bool 
goal: Bool

full_name: Lean.Parser.SyntaxStack.shrink
code: def shrink (stack : SyntaxStack) (n : Nat) : SyntaxStack 
goal: Lean.Parser.SyntaxStack

full_name: Lean.Parser.SyntaxStack.push
code: def push (stack : SyntaxStack) (a : Syntax) : SyntaxStack 
goal: Lean.Parser.SyntaxStack

full_name: Lean.Parser.SyntaxStack.pop
code: def pop (stack : SyntaxStack) : SyntaxStack 
goal: Lean.Parser.SyntaxStack

full_name: Lean.Parser.SyntaxStack.back
code: def back (stack : SyntaxStack) : Syntax 
goal: Lean.Syntax

full_name: Lean.Parser.SyntaxStack.get!
code: def get! (stack : SyntaxStack) (i : Nat) : Syntax 
goal: Lean.Syntax

full_name: Lean.Parser.SyntaxStack.extract
code: def extract (stack : SyntaxStack) (start stop : Nat) : Array Syntax 
goal: Array Lean.Syntax

full_name: Lean.Parser.SyntaxStack.instHAppendArraySyntax
code: instance : HAppend SyntaxStack (Array Syntax) SyntaxStack 
goal: HAppend Lean.Parser.SyntaxStack (Array Lean.Syntax) Lean.Parser.SyntaxStack

full_name: Lean.Parser.ParserState.recoveredErrors
code: structure ParserState where
  stxStack : SyntaxStack := .empty
  /--
    Set to the precedence of the preceding (not surrounding) parser by `runLongestMatchParser`
    for the use of `checkLhsPrec` in trailing parsers.
    Note that with chaining, the preceding parser can be another trailing parser:
    in `1 * 2 + 3`, the preceding parser is '*' when '+' is executed. -/
  lhsPrec  : Nat := 0
  pos      : String.Pos := 0
  cache    : ParserCache
  errorMsg : Option Error := none
  recoveredErrors : Array (String.Pos × SyntaxStack × Error) := #[]
goal: Array (String.Pos × Lean.Parser.SyntaxStack × Lean.Parser.Error)

full_name: Lean.Parser.ParserState
code: structure ParserState where
  stxStack : SyntaxStack := .empty
  /--
    Set to the precedence of the preceding (not surrounding) parser by `runLongestMatchParser`
    for the use of `checkLhsPrec` in trailing parsers.
    Note that with chaining, the preceding parser can be another trailing parser:
    in `1 * 2 + 3`, the preceding parser is '*' when '+' is executed. -/
  lhsPrec  : Nat := 0
  pos      : String.Pos := 0
  cache    : ParserCache
  errorMsg : Option Error := none
  recoveredErrors : Array (String.Pos × SyntaxStack × Error) := #[]
goal: Type

full_name: Lean.Parser.ParserState.pos
code: structure ParserState where
  stxStack : SyntaxStack := .empty
  /--
    Set to the precedence of the preceding (not surrounding) parser by `runLongestMatchParser`
    for the use of `checkLhsPrec` in trailing parsers.
    Note that with chaining, the preceding parser can be another trailing parser:
    in `1 * 2 + 3`, the preceding parser is '*' when '+' is executed. -/
  lhsPrec  : Nat := 0
  pos      : String.Pos := 0
  cache    : ParserCache
  errorMsg : Option Error := none
  recoveredErrors : Array (String.Pos × SyntaxStack × Error) := #[]
goal: String.Pos

full_name: Lean.Parser.ParserState.errorMsg
code: structure ParserState where
  stxStack : SyntaxStack := .empty
  /--
    Set to the precedence of the preceding (not surrounding) parser by `runLongestMatchParser`
    for the use of `checkLhsPrec` in trailing parsers.
    Note that with chaining, the preceding parser can be another trailing parser:
    in `1 * 2 + 3`, the preceding parser is '*' when '+' is executed. -/
  lhsPrec  : Nat := 0
  pos      : String.Pos := 0
  cache    : ParserCache
  errorMsg : Option Error := none
  recoveredErrors : Array (String.Pos × SyntaxStack × Error) := #[]
goal: Option Lean.Parser.Error

full_name: Lean.Parser.ParserState.stxStack
code: structure ParserState where
  stxStack : SyntaxStack := .empty
  /--
    Set to the precedence of the preceding (not surrounding) parser by `runLongestMatchParser`
    for the use of `checkLhsPrec` in trailing parsers.
    Note that with chaining, the preceding parser can be another trailing parser:
    in `1 * 2 + 3`, the preceding parser is '*' when '+' is executed. -/
  lhsPrec  : Nat := 0
  pos      : String.Pos := 0
  cache    : ParserCache
  errorMsg : Option Error := none
  recoveredErrors : Array (String.Pos × SyntaxStack × Error) := #[]
goal: Lean.Parser.SyntaxStack

full_name: Lean.Parser.ParserState.lhsPrec
code: structure ParserState where
  stxStack : SyntaxStack := .empty
  /--
    Set to the precedence of the preceding (not surrounding) parser by `runLongestMatchParser`
    for the use of `checkLhsPrec` in trailing parsers.
    Note that with chaining, the preceding parser can be another trailing parser:
    in `1 * 2 + 3`, the preceding parser is '*' when '+' is executed. -/
  lhsPrec  : Nat := 0
  pos      : String.Pos := 0
  cache    : ParserCache
  errorMsg : Option Error := none
  recoveredErrors : Array (String.Pos × SyntaxStack × Error) := #[]
goal: Nat

full_name: Lean.Parser.ParserState.cache
code: structure ParserState where
  stxStack : SyntaxStack := .empty
  /--
    Set to the precedence of the preceding (not surrounding) parser by `runLongestMatchParser`
    for the use of `checkLhsPrec` in trailing parsers.
    Note that with chaining, the preceding parser can be another trailing parser:
    in `1 * 2 + 3`, the preceding parser is '*' when '+' is executed. -/
  lhsPrec  : Nat := 0
  pos      : String.Pos := 0
  cache    : ParserCache
  errorMsg : Option Error := none
  recoveredErrors : Array (String.Pos × SyntaxStack × Error) := #[]
goal: Lean.Parser.ParserCache

full_name: Lean.Parser.ParserState.hasError
code: @[inline]
def hasError (s : ParserState) : Bool 
goal: Bool

full_name: Lean.Parser.ParserState.stackSize
code: def stackSize (s : ParserState) : Nat 
goal: Nat

full_name: Lean.Parser.ParserState.restore
code: def restore (s : ParserState) (iniStackSz : Nat) (iniPos : String.Pos) : ParserState 
goal: Lean.Parser.ParserState

full_name: Lean.Parser.ParserState.setPos
code: def setPos (s : ParserState) (pos : String.Pos) : ParserState 
goal: Lean.Parser.ParserState

full_name: Lean.Parser.ParserState.setCache
code: def setCache (s : ParserState) (cache : ParserCache) : ParserState 
goal: Lean.Parser.ParserState

full_name: Lean.Parser.ParserState.pushSyntax
code: def pushSyntax (s : ParserState) (n : Syntax) : ParserState 
goal: Lean.Parser.ParserState

full_name: Lean.Parser.ParserState.popSyntax
code: def popSyntax (s : ParserState) : ParserState 
goal: Lean.Parser.ParserState

full_name: Lean.Parser.ParserState.shrinkStack
code: def shrinkStack (s : ParserState) (iniStackSz : Nat) : ParserState 
goal: Lean.Parser.ParserState

full_name: Lean.Parser.ParserState.next
code: def next (s : ParserState) (input : String) (pos : String.Pos) : ParserState 
goal: Lean.Parser.ParserState

full_name: Lean.Parser.ParserState.next'
code: def next' (s : ParserState) (input : String) (pos : String.Pos) (h : ¬ input.atEnd pos) : ParserState 
goal: Lean.Parser.ParserState

full_name: Lean.Parser.ParserState.mkNode
code: def mkNode (s : ParserState) (k : SyntaxNodeKind) (iniStackSz : Nat) : ParserState 
goal: Lean.Parser.ParserState

full_name: Lean.Parser.ParserState.mkTrailingNode
code: def mkTrailingNode (s : ParserState) (k : SyntaxNodeKind) (iniStackSz : Nat) : ParserState 
goal: Lean.Parser.ParserState

full_name: Lean.Parser.ParserState.allErrors
code: def allErrors (s : ParserState) : Array (String.Pos × SyntaxStack × Error) 
goal: Array (String.Pos × Lean.Parser.SyntaxStack × Lean.Parser.Error)

full_name: Lean.Parser.ParserState.setError
code: @[inline]
def setError (s : ParserState) (e : Error) : ParserState 
goal: Lean.Parser.ParserState

full_name: Lean.Parser.ParserState.mkError
code: def mkError (s : ParserState) (msg : String) : ParserState 
goal: Lean.Parser.ParserState

full_name: Lean.Parser.ParserState.mkUnexpectedError
code: def mkUnexpectedError (s : ParserState) (msg : String) (expected : List String := []) (pushMissing := true) : ParserState 
goal: Lean.Parser.ParserState

full_name: Lean.Parser.ParserState.mkEOIError
code: def mkEOIError (s : ParserState) (expected : List String := []) : ParserState 
goal: Lean.Parser.ParserState

full_name: Lean.Parser.ParserState.mkErrorsAt
code: def mkErrorsAt (s : ParserState) (ex : List String) (pos : String.Pos) (initStackSz? : Option Nat := none) : ParserState 
goal: Lean.Parser.ParserState

full_name: Lean.Parser.ParserState.mkErrorAt
code: def mkErrorAt (s : ParserState) (msg : String) (pos : String.Pos) (initStackSz? : Option Nat := none) : ParserState 
goal: Lean.Parser.ParserState

full_name: Lean.Parser.ParserState.mkUnexpectedTokenErrors
code: /--
  Reports given 'expected' messages at range of top stack element (assumed to be a single token).
  Replaces the element with `missing` and resets position to the token position.
  `iniPos` can be specified to avoid this position lookup but still must be identical to the token position. -/
-- We use `0` as a cheap default to save an allocation; we're unlikely to do enough backtracking at that
-- position to be significant.
def mkUnexpectedTokenErrors (s : ParserState) (ex : List String) (iniPos : String.Pos := 0) : ParserState 
goal: Lean.Parser.ParserState

full_name: Lean.Parser.ParserState.mkUnexpectedTokenError
code: /--
  Reports given 'expected' message at range of top stack element (assumed to be a single token).
  Replaces the element with `missing` and resets position to the token position.
  `iniPos` can be specified to avoid this position lookup but still must be identical to the token position. -/
def mkUnexpectedTokenError (s : ParserState) (msg : String) (iniPos : String.Pos := 0) : ParserState 
goal: Lean.Parser.ParserState

full_name: Lean.Parser.ParserState.mkUnexpectedErrorAt
code: def mkUnexpectedErrorAt (s : ParserState) (msg : String) (pos : String.Pos) : ParserState 
goal: Lean.Parser.ParserState

full_name: Lean.Parser.ParserState.toErrorMsg
code: def toErrorMsg (ctx : InputContext) (s : ParserState) : String 
goal: String

full_name: Lean.Parser.ParserFn
code: def ParserFn 
goal: Type

full_name: Lean.Parser.instInhabitedParserFn
code: instance : Inhabited ParserFn 
goal: Inhabited Lean.Parser.ParserFn

full_name: Lean.Parser.FirstTokens.epsilon
code: inductive FirstTokens where
  | epsilon   : FirstTokens
  | unknown   : FirstTokens
  | tokens    : List Token → FirstTokens
  | optTokens : List Token → FirstTokens
  deriving Inhabited
goal: Lean.Parser.FirstTokens

full_name: Lean.Parser.instInhabitedFirstTokens
code: inductive FirstTokens where
  | epsilon   : FirstTokens
  | unknown   : FirstTokens
  | tokens    : List Token → FirstTokens
  | optTokens : List Token → FirstTokens
  deriving Inhabited
goal: Inhabited Lean.Parser.FirstTokens

full_name: Lean.Parser.FirstTokens.tokens
code: inductive FirstTokens where
  | epsilon   : FirstTokens
  | unknown   : FirstTokens
  | tokens    : List Token → FirstTokens
  | optTokens : List Token → FirstTokens
  deriving Inhabited
goal: List Lean.Parser.Token → Lean.Parser.FirstTokens

full_name: Lean.Parser.FirstTokens
code: inductive FirstTokens where
  | epsilon   : FirstTokens
  | unknown   : FirstTokens
  | tokens    : List Token → FirstTokens
  | optTokens : List Token → FirstTokens
  deriving Inhabited
goal: Type

full_name: Lean.Parser.FirstTokens.unknown
code: inductive FirstTokens where
  | epsilon   : FirstTokens
  | unknown   : FirstTokens
  | tokens    : List Token → FirstTokens
  | optTokens : List Token → FirstTokens
  deriving Inhabited
goal: Lean.Parser.FirstTokens

full_name: Lean.Parser.FirstTokens.optTokens
code: inductive FirstTokens where
  | epsilon   : FirstTokens
  | unknown   : FirstTokens
  | tokens    : List Token → FirstTokens
  | optTokens : List Token → FirstTokens
  deriving Inhabited
goal: List Lean.Parser.Token → Lean.Parser.FirstTokens

full_name: Lean.Parser.FirstTokens.seq
code: def seq : FirstTokens → FirstTokens → FirstTokens
  
goal: Lean.Parser.FirstTokens → Lean.Parser.FirstTokens → Lean.Parser.FirstTokens

full_name: Lean.Parser.FirstTokens.toOptional
code: def toOptional : FirstTokens → FirstTokens
  
goal: Lean.Parser.FirstTokens → Lean.Parser.FirstTokens

full_name: Lean.Parser.FirstTokens.merge
code: def merge : FirstTokens → FirstTokens → FirstTokens
  
goal: Lean.Parser.FirstTokens → Lean.Parser.FirstTokens → Lean.Parser.FirstTokens

full_name: Lean.Parser.FirstTokens.toStr
code: def toStr : FirstTokens → String
  
goal: Lean.Parser.FirstTokens → String

full_name: Lean.Parser.FirstTokens.instToString
code: instance : ToString FirstTokens 
goal: ToString Lean.Parser.FirstTokens

full_name: Lean.Parser.ParserInfo.collectTokens
code: structure ParserInfo where
  collectTokens : List Token → List Token := id
  collectKinds  : SyntaxNodeKindSet → SyntaxNodeKindSet := id
  firstTokens   : FirstTokens := FirstTokens.unknown
  deriving Inhabited
goal: List Lean.Parser.Token → List Lean.Parser.Token

full_name: Lean.Parser.instInhabitedParserInfo
code: structure ParserInfo where
  collectTokens : List Token → List Token := id
  collectKinds  : SyntaxNodeKindSet → SyntaxNodeKindSet := id
  firstTokens   : FirstTokens := FirstTokens.unknown
  deriving Inhabited
goal: Inhabited Lean.Parser.ParserInfo

full_name: Lean.Parser.ParserInfo.firstTokens
code: structure ParserInfo where
  collectTokens : List Token → List Token := id
  collectKinds  : SyntaxNodeKindSet → SyntaxNodeKindSet := id
  firstTokens   : FirstTokens := FirstTokens.unknown
  deriving Inhabited
goal: Lean.Parser.FirstTokens

full_name: Lean.Parser.ParserInfo
code: structure ParserInfo where
  collectTokens : List Token → List Token := id
  collectKinds  : SyntaxNodeKindSet → SyntaxNodeKindSet := id
  firstTokens   : FirstTokens := FirstTokens.unknown
  deriving Inhabited
goal: Type

full_name: Lean.Parser.ParserInfo.collectKinds
code: structure ParserInfo where
  collectTokens : List Token → List Token := id
  collectKinds  : SyntaxNodeKindSet → SyntaxNodeKindSet := id
  firstTokens   : FirstTokens := FirstTokens.unknown
  deriving Inhabited
goal: Lean.Parser.SyntaxNodeKindSet → Lean.Parser.SyntaxNodeKindSet

full_name: Lean.Parser.Parser.info
code: structure Parser where
  info : ParserInfo := {}
  fn   : ParserFn
  deriving Inhabited
goal: Lean.Parser.ParserInfo

full_name: Lean.Parser.instInhabitedParser
code: structure Parser where
  info : ParserInfo := {}
  fn   : ParserFn
  deriving Inhabited
goal: Inhabited Lean.Parser.Parser

full_name: Lean.Parser.Parser
code: structure Parser where
  info : ParserInfo := {}
  fn   : ParserFn
  deriving Inhabited
goal: Type

full_name: Lean.Parser.Parser.fn
code: structure Parser where
  info : ParserInfo := {}
  fn   : ParserFn
  deriving Inhabited
goal: Lean.Parser.ParserFn

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

full_name: Lean.Parser.withFn
code: /-- Create a simple parser combinator that inherits the `info` of the nested parser. -/
@[inline]
def withFn (f : ParserFn → ParserFn) (p : Parser) : Parser 
goal: Lean.Parser.Parser

full_name: Lean.Parser.adaptCacheableContextFn
code: def adaptCacheableContextFn (f : CacheableParserContext → CacheableParserContext) (p : ParserFn) : ParserFn 
goal: Lean.Parser.ParserFn

full_name: Lean.Parser.adaptCacheableContext
code: def adaptCacheableContext (f : CacheableParserContext → CacheableParserContext) : Parser → Parser 
goal: Lean.Parser.Parser → Lean.Parser.Parser

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Parser.Types.0.Lean.Parser.withStackDrop
code: private def withStackDrop (drop : Nat) (p : ParserFn) : ParserFn 
goal: Lean.Parser.ParserFn

full_name: Lean.Parser.withResetCacheFn
code: /--
Run `p` with a fresh cache, restore outer cache afterwards.
`p` may access the entire syntax stack.
-/
def withResetCacheFn (p : ParserFn) : ParserFn 
goal: Lean.Parser.ParserFn

full_name: Lean.Parser.withResetCache
code: @[inherit_doc withResetCacheFn]
def withResetCache : Parser → Parser 
goal: Lean.Parser.Parser → Lean.Parser.Parser

full_name: Lean.Parser.adaptUncacheableContextFn
code: /-- Run `p` under the given context transformation with a fresh cache (see also `withResetCacheFn`). -/
def adaptUncacheableContextFn (f : ParserContextCore → ParserContextCore) (p : ParserFn) : ParserFn 
goal: Lean.Parser.ParserFn

full_name: Lean.Parser.withCacheFn
code: /--
Run `p` and record result in parser cache for any further invocation with this `parserName`, parser context, and parser state.
`p` cannot access syntax stack elements pushed before the invocation in order to make caching independent of parser history.
As this excludes trailing parsers from being cached, we also reset `lhsPrec`, which is not read but set by leading parsers, to 0
in order to increase cache hits. Finally, `errorMsg` is also reset to `none` as a leading parser should not be called in the first
place if there was an error.
-/
def withCacheFn (parserName : Name) (p : ParserFn) : ParserFn 
goal: Lean.Parser.ParserFn

full_name: Lean.Parser.withCache
code: @[inherit_doc withCacheFn]
def withCache (parserName : Name) : Parser → Parser 
goal: Lean.Parser.Parser → Lean.Parser.Parser

full_name: Lean.Parser.ParserFn.run
code: def ParserFn.run (p : ParserFn) (ictx : InputContext) (pmctx : ParserModuleContext) (tokens : TokenTable) (s : ParserState) : ParserState 
goal: Lean.Parser.ParserState