1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
let json_value =
`Assoc
[ ("null", `Null)
; ("bool", `Bool true)
; ("int", `Int 0)
; ("intlit", `Intlit "10000000000000000000")
; ("float", `Float 0.)
; ("string", `String "string")
; ("list", `List [`Int 0; `Int 1; `Int 2])
]
let json_string =
"{"
^ {|"null":null,|}
^ {|"bool":true,|}
^ {|"int":0,|}
^ {|"intlit":10000000000000000000,|}
^ {|"float":0.0,|}
^ {|"string":"string",|}
^ {|"list":[0,1,2]|}
^ "}"
let unquoted_json = {|{foo: null}|}
let unquoted_value = `Assoc [("foo", `Null)]
let json_string_newline =
json_string
^ "\n"
|