mirror of
https://github.com/urbit/shrub.git
synced 2024-11-23 20:26:54 +03:00
zuse: implement json number to @rd parsing
This commit is contained in:
parent
aa7ba9f075
commit
133cbbb6ae
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d0d7e3807c3159b1483220caf14fc2b96af65c05f2f761c4351c8614dc7db3cf
|
||||
size 9634290
|
||||
oid sha256:17e7708b65df64f3d8a69f360b5eccdb96dec87dd1e1c60658be834b40f066ce
|
||||
size 9627978
|
||||
|
@ -5453,6 +5453,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
|
||||
|%
|
||||
@ -5571,9 +5604,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
|
||||
@ -5784,7 +5817,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
|
||||
|
Loading…
Reference in New Issue
Block a user