Merge branch 'pkova/master' (#1991)

* pkova/master:
  zuse: implement json number to @rd parsing

Signed-off-by: Jared Tobin <jared@tlon.io>
This commit is contained in:
Jared Tobin 2019-12-05 16:38:57 +08:00
commit f23bbd1cec
No known key found for this signature in database
GPG Key ID: 0E4647D58F8A69E4
2 changed files with 40 additions and 6 deletions

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:fdb2fce980015e3789b0bf5a4e90a468227e6b2a0c97a7448de6edb6cde175c9
size 9503162
oid sha256:8185eba8c879ae9f5c6572864426362d72e73376ada057daed03726e5dac9d1d
size 9506882

View File

@ -5510,6 +5510,39 @@
|= cis/coin
?. ?=({$$ case} cis) ~
`(unit beam)`[~ [who dex `case`p.cis] (flop t.t.t.pax)]
::
++ json-rn :: json to rn parser
%+ knee *rn |.
;~ plug
(easy %d)
;~(pose (cold | hep) (easy &))
;~ plug dim:ag
;~ pose
;~ pfix dot
%+ sear
|= a=tape
=/ b (rust a dum:ag)
?~ b ~
(some [(lent a) u.b])
(plus (shim '0' '9'))
==
(easy [0 0])
==
;~ pose
;~ pfix
(just 'e')
;~ plug
;~(pose (cold | hep) (easy &))
;~ pose
;~(pfix (plus (just '0')) dim:ag)
dim:ag
==
==
==
(easy [& 0])
==
==
==
:: :: ++enjs:format
++ enjs ^? :: json encoders
|%
@ -5628,9 +5661,9 @@
:: :: ++ne:dejs:format
++ ne :: number as real
|= jon/json
^- (unit @rd)
:: please implement me, it's not that hard!
!!
^- @rd
?> ?=([%n *] jon)
(rash p.jon (cook ryld (cook royl-cell:^so json-rn)))
:: :: ++ni:dejs:format
++ ni :: number as integer
|= jon/json
@ -5841,7 +5874,8 @@
++ ne :: number as real
|= jon/json
^- (unit @rd)
!!
?. ?=([%n *] jon) ~
(rush p.jon (cook ryld (cook royl-cell:^so json-rn)))
::
++ ni :: number as integer
|= jon/json