TOML Parser Utilities #
Generic parser utilities used by Lake's TOML parser.
Equations
- Lake.Toml.isBinDigit c = (c == '0' || c == '1')
Instances For
@[instance_reducible]
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[inline]
ParserFn combinator that runs f with the current position.
Equations
- Lake.Toml.usePosFn f c s = f s.pos c s
Instances For
Match an arbitrary parser or do nothing.
Equations
Instances For
@[inline]
A sequence of n repetitions of a parser function.
Equations
- Lake.Toml.repeatFn n p c s = Lake.Toml.repeatFn.loop✝ p c n s
Instances For
def Lake.Toml.mkUnexpectedCharError (s : Lean.Parser.ParserState) (c : Char) (expected : List String := []) (pushMissing : Bool := true) :
Equations
- Lake.Toml.mkUnexpectedCharError s c expected pushMissing = s.mkUnexpectedError (toString "unexpected '" ++ toString c ++ toString "'") expected pushMissing
Instances For
@[inline]
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lake.Toml.takeWhile1Fn p expected = Lake.Toml.satisfyFn p expected >> Lean.Parser.takeWhileFn p
Instances For
Consume a single digit (i.e., Char.isDigit).
Equations
- Lake.Toml.digitFn expected = Lake.Toml.satisfyFn Char.isDigit expected
Instances For
Consume a two digits (i.e., Char.isDigit).
Equations
- Lake.Toml.digitPairFn expected = Lake.Toml.digitFn expected >> Lake.Toml.digitFn expected
Instances For
def Lake.Toml.strFn (str : String) (expected : List String := [toString "'" ++ toString str ++ toString "'"]) :
Consume a matching string atomically.
Equations
- Lake.Toml.strFn str expected = Lean.Parser.atomicFn (Lake.Toml.strAuxFn str expected 0)
Instances For
Push a new atom onto the syntax stack.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Match an arbitrary ParserFn and return the consumed String in a Syntax.atom.
Equations
- Lake.Toml.atomFn p trailingFn c s = if (p c s).hasError = true then p c s else Lake.Toml.pushAtom s.pos trailingFn c (p c s)
Instances For
Equations
- Lake.Toml.atom p trailingFn = { fn := Lake.Toml.atomFn p trailingFn }
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
def Lake.Toml.chAtom (c : Char) (expected : List String := [toString "'" ++ toString c ++ toString "'"]) (trailingFn : Lean.Parser.ParserFn := skipFn) :
Parse a single character as an atom.
Equations
- Lake.Toml.chAtom c expected trailingFn = Lake.Toml.atom (Lake.Toml.chFn c expected) trailingFn
Instances For
def Lake.Toml.strAtom (s : String) (expected : List String := [toString "'" ++ toString s ++ toString "'"]) (trailingFn : Lean.Parser.ParserFn := skipFn) :
Parse the trimmed string as an atom (but use the full string for formatting).
Equations
- Lake.Toml.strAtom s expected trailingFn = Lake.Toml.atom (Lake.Toml.strFn s.trimAscii.copy expected) trailingFn
Instances For
def Lake.Toml.pushLit (kind : Lean.SyntaxNodeKind) (startPos : String.Pos.Raw) (trailingFn : Lean.Parser.ParserFn := skipFn) :
Push (Syntax.node kind <new-atom>) onto the syntax stack.
Equations
- One or more equations did not get rendered due to their size.
Instances For
def Lake.Toml.litFn (kind : Lean.SyntaxNodeKind) (p : Lean.Parser.ParserFn) (trailingFn : Lean.Parser.ParserFn := skipFn) :
Equations
- Lake.Toml.litFn kind p trailingFn c s = if (p c s).hasError = true then p c s else Lake.Toml.pushLit kind s.pos trailingFn c (p c s)
Instances For
def Lake.Toml.lit (kind : Lean.SyntaxNodeKind) (p : Lean.Parser.ParserFn) (trailingFn : Lean.Parser.ParserFn := skipFn) :
Equations
- Lake.Toml.lit kind p trailingFn = { fn := Lake.Toml.litFn kind p trailingFn }
Instances For
Equations
- Lake.Toml.lit.formatter kind x✝¹ x✝ = Lean.PrettyPrinter.Formatter.visitAtom kind
Instances For
def Lake.Toml.litWithAntiquot (name : String) (kind : Lean.SyntaxNodeKind) (p : Lean.Parser.ParserFn) (trailingFn : Lean.Parser.ParserFn := skipFn) (anonymous : Bool := false) :
Equations
- Lake.Toml.litWithAntiquot name kind p trailingFn anonymous = Lean.Parser.withAntiquot (Lean.Parser.mkAntiquot name kind anonymous) (Lake.Toml.lit kind p trailingFn)
Instances For
Equations
Instances For
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Equations
- Lake.Toml.dynamicNode p = { fn := p }
Instances For
Equations
- Lake.Toml.dynamicNode.formatter x✝ = do let __do_lift ← Lean.Syntax.MonadTraverser.getCur Lean.PrettyPrinter.Formatter.formatterForKind __do_lift.getKind
Instances For
Equations
- Lake.Toml.dynamicNode.parenthesizer x✝ = do let __do_lift ← Lean.Syntax.MonadTraverser.getCur Lean.PrettyPrinter.Parenthesizer.parenthesizerForKind __do_lift.getKind
Instances For
@[reducible, inline]
Parser → Parser hidden by an abbrev.
Prevents the formatter/parenthesizer generator from transforming it.
Equations
Instances For
Equations
Instances For
def Lake.Toml.recNodeWithAntiquot (name : String) (kind : Lean.SyntaxNodeKind) (f : ParserMapFn) (anonymous : Bool := false) :
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[inline]
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[inline]
Equations
- One or more equations did not get rendered due to their size.