]> gitweb.factorcode.org Git - factor.git/blob - basis/json/json.factor
Update actions, because Node.js 16 actions are deprecated, to Node.js 20
[factor.git] / basis / json / json.factor
1 USING: kernel summary vocabs ;
2 IN: json
3
4 SINGLETON: json-null
5
6 ERROR: json-error ;
7
8 ERROR: json-fp-special-error value ;
9 M: json-fp-special-error summary drop "JSON serialization: illegal float:" ;
10
11 : if-json-null ( x if-null else -- )
12     [ dup json-null? ]
13     [ [ drop ] prepose ]
14     [ ] tri* if ; inline
15
16 : when-json-null ( x if-null -- ) [ ] if-json-null ; inline
17
18 : unless-json-null ( x else -- ) [ ] swap if-json-null ; inline
19
20 "json.reader" require
21 "json.writer" require