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 :::: /hook/json/kids/tree
:: ::
/? 314 /? 314
/= gas /$ fuel
/= dat /: /=== /= dat /: /===
/^ (map ,@ta json) /^ (map ,@ta json)
/% 2 /% 2
/_ /react-json/ /_ /react-json/
::
::::
::
// /%%%/util
::
[util=. +>]
::
!: !:
:::: ::::
:: ::
^- json ^- json
=+ ~(. util gas)
%+ joba %kids %+ joba %kids
=- [%a (turn (~(tap by dat)) -)] =- [%a (turn (~(tap by dat)) -)]
|= [a=span b=json] |= [a=span b=json]

View File

@ -2,7 +2,6 @@
:::: /hook/json/snip/tree :::: /hook/json/snip/tree
:: ::
/? 314 /? 314
/= gas /$ fuel
/= dat /: /=== /= dat /: /===
/^ (map ,@ta json) /^ (map ,@ta json)
/% 2 /% 2
@ -10,15 +9,31 @@
:: ::
:::: ::::
:: ::
// /%%%/util |%
:: ++ baff |*([a=(unit) b=(trap)] ?^(a a *b))
[util=. +>] ++ 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 ^- json
=+ ~(. util gas)
%+ joba %snip %+ joba %snip
=- [%a (turn (~(tap by dat)) -)] =- [%a (turn (~(tap by dat)) -)]
|= [a=span b=json] |= [a=span b=json]

View File

@ -1,26 +1,5 @@
!: !:
|_ gas=epic |_ 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 ++ get-path
^- path ^- path
(tope bem.gas(s but.gas)) (tope bem.gas(s but.gas))