JSON-like syntax for Lean. #
Now you can write
open Lean.Json
#eval json% {
hello : "world",
cheese : ["edam", "cheddar", {kind : "spicy", rank : 100.2}],
lemonCount : 100e30,
isCool : true,
isBug : null,
lookACalc: $(23 + 54 * 2)
}
Json syntactic category
Equations
Instances For
Json true value syntax.
Equations
- Lean.Json.jsonTrue = Lean.ParserDescr.node `Lean.Json.jsonTrue 1024 (Lean.ParserDescr.nonReservedSymbol "true" false)
Instances For
Json false value syntax.
Equations
- Lean.Json.jsonFalse = Lean.ParserDescr.node `Lean.Json.jsonFalse 1024 (Lean.ParserDescr.nonReservedSymbol "false" false)
Instances For
Json string syntax.
Equations
- Lean.Json.json_ = Lean.ParserDescr.node `Lean.Json.json_ 1022 (Lean.ParserDescr.const `str)
Instances For
Json number negation syntax for ordinary numbers.
Instances For
Json number negation syntax for scientific numbers.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Json array syntax.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Json identifier syntax.
Equations
- Lean.Json.jsonIdent = Lean.ParserDescr.nodeWithAntiquot "jsonIdent" `Lean.Json.jsonIdent (Lean.ParserDescr.binary `orelse (Lean.ParserDescr.const `ident) (Lean.ParserDescr.const `str))
Instances For
Allows to use Json syntax in a Lean file.
Equations
- Lean.Json.«termJson%_» = Lean.ParserDescr.node `Lean.Json.«termJson%_» 1022 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol "json% ") (Lean.ParserDescr.cat `json 0))