TOML Grammar #
A Lean encoding of the v1.0.0 TOML grammar (en, [abnf]]2)
using Lean.Parser
objects. The current encoding elides the use of
tokens entirely, relying purely on custom parser functions.
Trailing Functions #
Consume optional horizontal whitespace (i.e., tab or space).
Equations
- Lake.Toml.wsFn = Lean.Parser.takeWhileFn fun (c : Char) => decide (c = ' ') || decide (c = '\t')
Instances For
Consumes the LF following a CR in a CRLF newline.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Consume a newline.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Consumes the body of a comment.
Instances For
Consumes a line comment.
Equations
- Lake.Toml.commentFn = HAndThen.hAndThen (Lake.Toml.chFn '#' ["comment"]) fun (x : Unit) => Lake.Toml.commentBodyFn
Instances For
Consume optional whitespace (space, tab, or newline).
Consume optional sequence of whitespace / newline(s) / comment (s).
Strings #
Consumes a TOML string escape sequence after a \
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lake.Toml.basicStringFn = Lake.Toml.usePosFn fun (startPos : String.Pos) => HAndThen.hAndThen (Lake.Toml.chFn '\"' ["basic string"]) fun (x : Unit) => Lake.Toml.basicStringAuxFn startPos
Instances For
Equations
- Lake.Toml.literalStringFn = Lake.Toml.usePosFn fun (startPos : String.Pos) => HAndThen.hAndThen (Lake.Toml.chFn ''' ["literal string"]) fun (x : Unit) => Lake.Toml.literalStringAuxFn startPos
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Numerals (Date-Times, Floats, and Integers) #
Equations
- Lake.Toml.hourMinFn = HAndThen.hAndThen (Lake.Toml.digitPairFn ["hour digit"]) fun (x : Unit) => HAndThen.hAndThen (Lake.Toml.chFn ':') fun (x : Unit) => Lake.Toml.digitPairFn ["minute digit"]
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[inline]
def
Lake.Toml.timeTailFn.timeOffsetFn
(allowOffset : Bool)
(curr : Char)
(nextPos : String.Pos)
(c : Lean.Parser.ParserContext)
(s : Lean.Parser.ParserState)
:
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lake.Toml.timeFn allowOffset = HAndThen.hAndThen (Lake.Toml.digitPairFn ["hour"]) fun (x : Unit) => HAndThen.hAndThen (Lake.Toml.chFn ':') fun (x : Unit) => Lake.Toml.timeAuxFn allowOffset
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lake.Toml.dateTimeLitFn = Lake.Toml.litFn `Lake.Toml.dateTime Lake.Toml.dateTimeFn
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lake.Toml.infAuxFn startPos = HAndThen.hAndThen (Lake.Toml.strFn "nf" ["'inf'"]) fun (x : Unit) => Lake.Toml.pushLit `Lake.Toml.float startPos
Instances For
Equations
- Lake.Toml.nanAuxFn startPos = HAndThen.hAndThen (Lake.Toml.strFn "an" ["'nan'"]) fun (x : Unit) => Lake.Toml.pushLit `Lake.Toml.float startPos
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Parsers #
Instances For
Instances For
Equations
- Lake.Toml.unquotedKeyFn = Lake.Toml.takeWhile1Fn (fun (c : Char) => c.isAlphanum || c == '_' || c == '-') ["unquoted key"]
Instances For
Equations
- Lake.Toml.unquotedKey = Lake.Toml.litWithAntiquot "unquotedKey" `Lake.Toml.unquotedKey Lake.Toml.unquotedKeyFn
Instances For
Equations
- Lake.Toml.basicString = Lake.Toml.litWithAntiquot "basicString" `Lake.Toml.basicString Lake.Toml.basicStringFn
Instances For
Equations
- Lake.Toml.literalString = Lake.Toml.litWithAntiquot "literalString" `Lake.Toml.literalString Lake.Toml.literalStringFn
Instances For
Equations
- Lake.Toml.mlBasicString = Lake.Toml.litWithAntiquot "mlBasicString" `Lake.Toml.mlBasicString Lake.Toml.mlBasicStringFn
Instances For
Equations
- Lake.Toml.mlLiteralString = Lake.Toml.litWithAntiquot "mlLiteralString" `Lake.Toml.mlLiteralString Lake.Toml.mlLiteralStringFn
Instances For
Equations
Instances For
Equations
- Lake.Toml.simpleKey = Lean.Parser.nodeWithAntiquot "simpleKey" `Lake.Toml.simpleKey (HOrElse.hOrElse Lake.Toml.unquotedKey fun (x : Unit) => Lake.Toml.quotedKey) true
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lake.Toml.header = Lake.Toml.litWithAntiquot "header" `Lake.Toml.header Lake.Toml.skipFn Lake.Toml.trailingFn
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lake.Toml.true = Lake.Toml.lit `Lake.Toml.true (Lake.Toml.strFn "true")
Instances For
Equations
- Lake.Toml.false = Lake.Toml.lit `Lake.Toml.false (Lake.Toml.strFn "false")
Instances For
Equations
- Lake.Toml.boolean = Lean.Parser.nodeWithAntiquot "boolean" `Lake.Toml.boolean (HOrElse.hOrElse Lake.Toml.true fun (x : Unit) => Lake.Toml.false)
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lake.Toml.float = Lake.Toml.numeralOfKind "float" `Lake.Toml.float
Instances For
Equations
- Lake.Toml.decInt = Lake.Toml.numeralOfKind "decimal integer" `Lake.Toml.decInt
Instances For
Equations
- Lake.Toml.binNum = Lake.Toml.numeralOfKind "binary number" `Lake.Toml.binNum
Instances For
Equations
- Lake.Toml.octNum = Lake.Toml.numeralOfKind "octal number" `Lake.Toml.octNum
Instances For
Equations
- Lake.Toml.hexNum = Lake.Toml.numeralOfKind "hexadecimal number" `Lake.Toml.hexNum
Instances For
Equations
- Lake.Toml.dateTime = Lake.Toml.numeralOfKind "date-time" `Lake.Toml.dateTime
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lake.Toml.val = Lake.Toml.recNodeWithAntiquot "val" `Lake.Toml.val Lake.Toml.valCore true
Instances For
Equations
Instances For
Instances For
Instances For
Instances For
Equations
- Lake.Toml.toml = Lean.Parser.withCache `Lake.Toml.toml (Lake.Toml.tomlCore Lake.Toml.val)