Adds json usage example.
This commit is contained in:
parent
d3eaddc961
commit
545a7577e5
1 changed files with 17 additions and 0 deletions
|
|
@ -13,6 +13,23 @@
|
||||||
## (unlike XML). It is easy for machines to parse and generate.
|
## (unlike XML). It is easy for machines to parse and generate.
|
||||||
## JSON is based on a subset of the JavaScript Programming Language,
|
## JSON is based on a subset of the JavaScript Programming Language,
|
||||||
## Standard ECMA-262 3rd Edition - December 1999.
|
## Standard ECMA-262 3rd Edition - December 1999.
|
||||||
|
##
|
||||||
|
## Usage example:
|
||||||
|
##
|
||||||
|
## .. code-block:: nimrod
|
||||||
|
## let
|
||||||
|
## small_json = """{"test": 1.3, "key2": true}"""
|
||||||
|
## jobj = parseJson(small_json)
|
||||||
|
## assert (jobj.kind == JObject)
|
||||||
|
## echo($jobj["test"].fnum)
|
||||||
|
## echo($jobj["key2"].bval)
|
||||||
|
##
|
||||||
|
## Results in:
|
||||||
|
##
|
||||||
|
## .. code-block:: nimrod
|
||||||
|
##
|
||||||
|
## 1.3000000000000000e+00
|
||||||
|
## true
|
||||||
|
|
||||||
import
|
import
|
||||||
hashes, strutils, lexbase, streams, unicode
|
hashes, strutils, lexbase, streams, unicode
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue