urbit/tree/json.hook

53 lines
1005 B
Plaintext
Raw Normal View History

2015-08-04 02:49:34 +03:00
::
/? 314
/= gas /$ fuel
/= ral /: /=== /% /react-json/
/= pal /: /===
/^ (map ,@ta json)
/% 2
/_ /react-json/
::
/= sal /: /===
/^ (map ,@ta json)
/% 2
/_ /react-snips-json/
::
::::
::
// /%%/util
::
[util=. +>]
::
!:
::::
::
^- json
=+ ~(. util gas)
:: .json?kids
?: (~(has by qix.gas) %kids)
%+ joba %kids
=. pal (~(del by pal) %md) :: XX haxor
=- [%a (turn (~(tap by pal)) -)]
|= [a=span b=json]
%- jobe :~
name/s/a
body/b
==
:: .json?snip
?: (~(has by qix.gas) %snip)
%+ joba %snip
=. sal (~(del by sal) %md) :: XX haxor
=- [%a (turn (~(tap by sal)) -)]
|= [a=span b=json]
=+ fon=(json-front b)
%- jobe :~
meta/fon
name/s/a
body/b
==
:: .json
%- jobe :~
kids/[%a (turn get-kids |=(a=span s/a))]
body/ral
==