further tree/*.json.hook uncoupling

This commit is contained in:
Anton Dyudin 2015-07-30 15:32:46 -07:00
parent 96eba00fd8
commit b535f43fc5
3 changed files with 21 additions and 36 deletions

View File

@ -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]

View File

@ -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]

View File

@ -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))