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
Consume a newline.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Consumes a line comment.
Equations
- Lake.Toml.commentFn = Lake.Toml.chFn '#' ["comment"] >> Lake.Toml.commentBodyFn✝
Instances For
Consume optional whitespace (space, tab, or newline).
Consume optional sequence of whitespace / newline(s) / comment (s).
Strings #
Equations
- Lake.Toml.basicStringFn = Lake.Toml.usePosFn fun (startPos : String.Pos) => Lake.Toml.chFn '\"' ["basic string"] >> Lake.Toml.basicStringAuxFn✝ startPos
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
Equations
- One or more equations did not get rendered due to their size.
Instances For
Numerals (Date-Times, Floats, and Integers) #
Equations
- Lake.Toml.timeFn allowOffset = Lake.Toml.digitPairFn ["hour"] >> Lake.Toml.chFn ':' >> Lake.Toml.timeAuxFn✝ allowOffset
Instances For
Equations
- Lake.Toml.dateTimeFn = Lake.Toml.repeatFn 4 (Lake.Toml.digitFn ["year digit"]) >> Lake.Toml.chFn '-' >> Lake.Toml.dateTimeAuxFn✝
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 (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
- 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
- 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
- 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 (Lake.Toml.true <|> Lake.Toml.false)
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lake.Toml.numeralOfKind name kind = Lake.Toml.numeral >> Lean.Parser.setExpected [name] (Lean.Parser.checkStackTop (fun (x : Lean.Syntax) => x.isOfKind kind) "illegal numeral kind")
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
- Lake.Toml.val = Lake.Toml.recNodeWithAntiquot "val" `Lake.Toml.val Lake.Toml.valCore✝ true
Instances For
Instances For
Instances For
Instances For
Instances For
Equations
- Lake.Toml.toml = Lean.Parser.withCache `Lake.Toml.toml (Lake.Toml.tomlCore✝ Lake.Toml.val)