package jsonxt
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page
Jsonxt - JSON parsers for files, strings and more
Install
dune-project
Dependency
Authors
Maintainers
Sources
jsonxt-v1.0.1.tbz
sha256=71eb44d6e6deefa4b3ba7595d22f8e684ffb686c6a306679489c4e09779ee96b
sha512=4ca7c252d8cd3d3eb39f8094d16c7e1b14968ab61b314c1937248209785bedf434c2b422eb5961d896a41cd70565f9675f11f26b2ccc4e1e34c30260eed5d97b
doc/jsonxt/Jsonxt/Yojson/index.html
Module Jsonxt.YojsonSource
Yojson compatibility module
To use Jsonxt's Yojson compatibility module create a yojson.ml file in the projects source directory with the following contents:
include Jsonxt.YojsonNote that compatibility is mostly a thin layer on top of Jsonxt. In particular the error reporting by the utils module uses the Failure exception rather than Yojson's specialist exceptions
JSON compatibility differences
The underlying parser used by the Yojson compatibility modules are RFC 8259 compliant except for specific extensions. In particular:
- Control characters must be escaped as defined by RFC 8259
- Comment are supported with /* */ and // at the end of the line
- Variants and tuples are supported but with syntax changes noted later
- Object keys must be quoted. So {ab:10} is not valid and must be encoded as {"ab":10}
- Variant names must be quoted. eg. <"ab"> and <"ab":10>
Behavioural differences
- The
lexer_statedata structure is used to report errors but not updated during the parsing of the input - The optional
bufparameter is ignored - Error messages are likely to be different
- The utils module module uses the
Failureexception rather than Yojson's specialist exceptions
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page