2015-01-02 13:39:14 -05:00
|
|
|
USING: kernel vocabs summary debugger io ;
|
2008-11-15 04:07:55 -05:00
|
|
|
IN: json
|
|
|
|
|
|
|
|
SINGLETON: json-null
|
2008-11-15 04:09:57 -05:00
|
|
|
|
2014-11-28 11:11:21 -05:00
|
|
|
ERROR: json-error ;
|
|
|
|
|
2015-01-02 13:39:14 -05:00
|
|
|
ERROR: json-fp-special-error value ;
|
|
|
|
M: json-fp-special-error summary drop "JSON serialization: illegal float:" ;
|
|
|
|
|
2010-02-05 17:09:43 -05:00
|
|
|
: if-json-null ( x if-null else -- )
|
|
|
|
[ dup json-null? ]
|
|
|
|
[ [ drop ] prepose ]
|
|
|
|
[ ] tri* if ; inline
|
|
|
|
|
|
|
|
: when-json-null ( x if-null -- ) [ ] if-json-null ; inline
|
2014-11-28 11:11:21 -05:00
|
|
|
|
2010-02-05 17:09:43 -05:00
|
|
|
: unless-json-null ( x else -- ) [ ] swap if-json-null ; inline
|
|
|
|
|
2008-11-15 04:09:57 -05:00
|
|
|
"json.reader" require
|
|
|
|
"json.writer" require
|