mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-03 02:35:52 +03:00
further tree/*.json.hook uncoupling
This commit is contained in:
parent
96eba00fd8
commit
b535f43fc5
@ -2,23 +2,14 @@
|
||||
:::: /hook/json/kids/tree
|
||||
::
|
||||
/? 314
|
||||
/= gas /$ fuel
|
||||
/= dat /: /===
|
||||
/^ (map ,@ta json)
|
||||
/% 2
|
||||
/_ /react-json/
|
||||
::
|
||||
::::
|
||||
::
|
||||
// /%%%/util
|
||||
::
|
||||
[util=. +>]
|
||||
::
|
||||
!:
|
||||
::::
|
||||
::
|
||||
^- json
|
||||
=+ ~(. util gas)
|
||||
%+ joba %kids
|
||||
=- [%a (turn (~(tap by dat)) -)]
|
||||
|= [a=span b=json]
|
||||
|
@ -2,7 +2,6 @@
|
||||
:::: /hook/json/snip/tree
|
||||
::
|
||||
/? 314
|
||||
/= gas /$ fuel
|
||||
/= dat /: /===
|
||||
/^ (map ,@ta json)
|
||||
/% 2
|
||||
@ -10,15 +9,31 @@
|
||||
::
|
||||
::::
|
||||
::
|
||||
// /%%%/util
|
||||
::
|
||||
[util=. +>]
|
||||
::
|
||||
|%
|
||||
++ baff |*([a=(unit) b=(trap)] ?^(a a *b))
|
||||
++ find-in-tree
|
||||
|* [paz=fist:jo fun=$+(* (unit))]
|
||||
|= a=json ^+ *fun
|
||||
%+ biff (paz a)
|
||||
|* [b=(list json) c=*] ^+ *fun
|
||||
%+ baff (fun c)
|
||||
|.
|
||||
?~ b ~
|
||||
(baff ^^$(a i.b) |.(^$(b t.b)))
|
||||
++ json-front
|
||||
|= a=json ^- json
|
||||
=- (fall `(unit json)`- ~)
|
||||
%+ biff ((ot body/some ~):jo a)
|
||||
%+ find-in-tree (ot c/(ar some) gn/so ga/(om so) ~):jo
|
||||
|= [nom=span atr=(map span cord)] ^- (unit json)
|
||||
?. (~(has by atr) 'urb:front') ~
|
||||
?> ?=(%meta nom)
|
||||
(biff (~(get by atr) %value) poja)
|
||||
--
|
||||
!:
|
||||
::::
|
||||
::
|
||||
^- json
|
||||
=+ ~(. util gas)
|
||||
%+ joba %snip
|
||||
=- [%a (turn (~(tap by dat)) -)]
|
||||
|= [a=span b=json]
|
||||
|
@ -1,26 +1,5 @@
|
||||
!:
|
||||
|_ gas=epic
|
||||
++ baff |*([a=(unit) b=(trap)] ?^(a a *b))
|
||||
++ find-in-tree
|
||||
|* [paz=fist:jo fun=$+(* (unit))]
|
||||
|= a=json ^+ *fun
|
||||
%+ biff (paz a)
|
||||
|* [b=(list json) c=*] ^+ *fun
|
||||
%+ baff (fun c)
|
||||
|.
|
||||
?~ b ~
|
||||
(baff ^^$(a i.b) |.(^$(b t.b)))
|
||||
::
|
||||
++ json-front
|
||||
|= a=json ^- json
|
||||
=- (fall `(unit json)`- ~)
|
||||
%+ biff ((ot body/some ~):jo a)
|
||||
%+ find-in-tree (ot c/(ar some) gn/so ga/(om so) ~):jo
|
||||
|= [nom=span atr=(map span cord)] ^- (unit json)
|
||||
?. (~(has by atr) 'urb:front') ~
|
||||
?> ?=(%meta nom)
|
||||
(biff (~(get by atr) %value) poja)
|
||||
::
|
||||
++ get-path
|
||||
^- path
|
||||
(tope bem.gas(s but.gas))
|
||||
|
Loading…
Reference in New Issue
Block a user