mirror of
https://github.com/urbit/shrub.git
synced 2024-12-01 06:35:32 +03:00
151ify tree hooks
This commit is contained in:
parent
812e4c9f02
commit
8a6bb31ed0
@ -2,9 +2,9 @@
|
||||
:::: /hoon/urb-split/lib
|
||||
::
|
||||
/? 314
|
||||
|= [dep=@uvH urb=manx] ^- [hed=[@uvh marl] bod=[@uvH marl]]
|
||||
|= {dep/@uvH urb/manx} ^- {hed/{@uvh marl} bod/{@uvH marl}}
|
||||
~| [%malformed-urb urb] :: XX types
|
||||
?> ?=([[%html ~] [[%head ~] *] [[%body ~] *] ~] urb)
|
||||
=+ `[[%html ~] [[%head ~] hed=marl] [[%body ~] bod=marl] ~]`urb
|
||||
?> ?=({{$html $~} {{$head $~} *} {{$body $~} *} $~} urb)
|
||||
=+ `{{$html $~} {{$head $~} hed/marl} {{$body $~} bod/marl} $~}`urb
|
||||
:- [dep hed] :: Assume all dependencies are hard
|
||||
[0v0 bod]
|
||||
|
@ -3,12 +3,12 @@
|
||||
::
|
||||
::
|
||||
/? 314
|
||||
/= tub /$ |=([bem=beam *] (flop s.bem))
|
||||
/= tub /$ |=({bem/beam *} (flop s.bem))
|
||||
/= aut
|
||||
/$ %+ cork fuel :: after parsing params,
|
||||
|= gas=epic ^- ? :: check that the fcgi
|
||||
|= gas/epic ^- ? :: check that the fcgi
|
||||
%+ lien (~(tap in (~(get ju aut.ced.gas) %$))) :: has an identity
|
||||
|=(a=span !=(%pawn (slav %p a))) :: which isn't a comet
|
||||
|=(a/knot !=(%pawn (slav %p a))) :: which isn't a comet
|
||||
::
|
||||
!:
|
||||
::::
|
||||
|
@ -11,59 +11,59 @@
|
||||
::::
|
||||
::
|
||||
|%
|
||||
++ schema (dict ,[term $|(mark schema)])
|
||||
++ dict |*(a=_,* $&([a (dict a)] a))
|
||||
++ schema (dict {term $@(mark schema)})
|
||||
++ dict |*(a=_* $^({a (dict a)} a))
|
||||
++ query
|
||||
$% [%kids p=(list query)]
|
||||
[%name %t]
|
||||
[%path %t]
|
||||
[%spur %t]
|
||||
$% {$kids p/(list query)}
|
||||
{$name $t}
|
||||
{$path $t}
|
||||
{$spur $t}
|
||||
::
|
||||
[%comt %j]
|
||||
[%head %r]
|
||||
[%sect %j]
|
||||
[%snip %r]
|
||||
[%body %r]
|
||||
[%meta %j]
|
||||
[%mime %m]
|
||||
{$comt $j}
|
||||
{$head $r}
|
||||
{$sect $j}
|
||||
{$snip $r}
|
||||
{$body $r}
|
||||
{$meta $j}
|
||||
{$mime $m}
|
||||
==
|
||||
++ to-queries
|
||||
|= a=schema ^- (list query)
|
||||
|= a/schema ^- (list query)
|
||||
?@(-.a [(to-query a) ~] [(to-query -.a) $(a +.a)])
|
||||
::
|
||||
++ to-query
|
||||
|= a=[term $|(mark schema)]
|
||||
~| invalid-query/a
|
||||
|= a/{term $@(mark schema)}
|
||||
~| invalid-query+a
|
||||
?+ -.a ;;(query a)
|
||||
%kids [%kids (to-queries ?@(+.a !! +.a))]
|
||||
==
|
||||
++ from-type :: XX holding out for noun odors
|
||||
|= a=$%([%t p=cord] [%r p=json] [%j p=json] [%m mime])
|
||||
|= a/$%({$t p/cord} {$r p/json} {$j p/json} {$m mime})
|
||||
?- -.a
|
||||
%t [%s p.a]
|
||||
%m (jobe mite/[%s (moon p.a)] octs/[%s q.q.a] ~)
|
||||
%r p.a
|
||||
%j p.a
|
||||
$t [%s p.a]
|
||||
$m (jobe mite+[%s (moon p.a)] octs+[%s q.q.a] ~)
|
||||
$r p.a
|
||||
$j p.a
|
||||
==
|
||||
++ from-queries
|
||||
|= [bem=beam quy=(list query)]
|
||||
|= {bem/beam quy/(list query)}
|
||||
=< (jobe (turn quy .))
|
||||
|= a=query
|
||||
|= a/query
|
||||
:- -.a
|
||||
?- -.a
|
||||
%name (from-type +.a ?^(s.bem i.s.bem q.bem))
|
||||
%path (from-type +.a (crip (spud (flop s.bem))))
|
||||
%spur (from-type +.a (crip (spud s.bem)))
|
||||
%comt (from-type +.a comt.dat)
|
||||
%head (from-type +.a head.dat)
|
||||
%snip (from-type +.a snip.dat)
|
||||
%sect (from-type +.a sect.dat)
|
||||
%meta (from-type +.a meta.dat)
|
||||
%mime (from-type +.a mime.dat)
|
||||
%body (from-type +.a body.dat)
|
||||
%kids ?< (~(has by (mo p.a)) %kids) :: XX recursion?
|
||||
=< o/(~(urn by kid) .)
|
||||
|= [dir=span dak=tree-include]
|
||||
$name (from-type +.a ?^(s.bem i.s.bem q.bem))
|
||||
$path (from-type +.a (crip (spud (flop s.bem))))
|
||||
$spur (from-type +.a (crip (spud s.bem)))
|
||||
$comt (from-type +.a comt.dat)
|
||||
$head (from-type +.a head.dat)
|
||||
$snip (from-type +.a snip.dat)
|
||||
$sect (from-type +.a sect.dat)
|
||||
$meta (from-type +.a meta.dat)
|
||||
$mime (from-type +.a mime.dat)
|
||||
$body (from-type +.a body.dat)
|
||||
$kids ?< (~(has by (mo p.a)) %kids) :: XX recursion?
|
||||
=< o+(~(urn by kid) .)
|
||||
|= {dir/span dak/tree-include}
|
||||
^^$(quy p.a, s.bem [dir s.bem], dat dak, kid ~)
|
||||
==
|
||||
--
|
||||
@ -75,5 +75,5 @@
|
||||
=+ default='spur.t_mime.m_body.r_comt.j_kids.name.t'
|
||||
=+ ^= schem
|
||||
=+ seh=(fall (~(get by qix.gas) 'q') default)
|
||||
~|(bad-noun/seh ;;(schema (rash seh read-schem)))
|
||||
~|(bad-noun+seh ;;(schema (rash seh read-schem)))
|
||||
(from-queries bem.gas(s but.gas) (to-queries schem))
|
||||
|
@ -5,5 +5,5 @@
|
||||
/? 314
|
||||
/= hed /# /% /: /===/ren /tree-head/ :: XX static
|
||||
/= bod /# /% /tree-body/
|
||||
^- [hed=[@uvH marl] bod=[@uvH marl]]
|
||||
^- {hed/{@uvH marl} bod/{@uvH marl}}
|
||||
[hed bod]
|
||||
|
Loading…
Reference in New Issue
Block a user