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 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.literalStringFn = Lake.Toml.usePosFn fun (startPos : String.Pos) => Lake.Toml.chFn ''' ["literal string"] >> Lake.Toml.literalStringAuxFn startPos
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 = Lake.Toml.digitPairFn ["hour digit"] >> Lake.Toml.chFn ':' >> Lake.Toml.digitPairFn ["minute digit"]
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
- Lake.Toml.timeAuxFn allowOffset = Lake.Toml.digitPairFn ["minute digit"] >> Lake.Toml.chFn ':' >> Lake.Toml.digitPairFn ["second digit"] >> Lake.Toml.timeTailFn allowOffset
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lake.Toml.dateTimeFn = Lake.Toml.repeatFn 4 (Lake.Toml.digitFn ["year digit"]) >> Lake.Toml.chFn '-' >> Lake.Toml.dateTimeAuxFn
Instances For
Equations
- Lake.Toml.dateTimeLitFn = Lake.Toml.litFn `Lake.Toml.dateTime Lake.Toml.dateTimeFn
Instances For
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lake.Toml.nanAuxFn startPos = Lake.Toml.strFn "an" ["'nan'"] >> Lake.Toml.pushLit `Lake.Toml.float startPos
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Parsers #
Instances For
Equations
- Lake.Toml.unquotedKey = Lake.Toml.litWithAntiquot "unquotedKey" `Lake.Toml.unquotedKey Lake.Toml.unquotedKeyFn
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 (Lake.Toml.unquotedKey <|> Lake.Toml.quotedKey) true
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
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
- Lake.Toml.false = Lake.Toml.lit `Lake.Toml.false (Lake.Toml.strFn "false")
Instances For
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.valCore val = (Lake.Toml.string <|> Lake.Toml.boolean <|> Lake.Toml.numeral <|> Lake.Toml.arrayCore val <|> Lake.Toml.inlineTableCore val)
Instances For
Equations
- Lake.Toml.val = Lake.Toml.recNodeWithAntiquot "val" `Lake.Toml.val Lake.Toml.valCore true