mirror of
https://github.com/urbit/shrub.git
synced 2024-12-01 06:35:32 +03:00
fix (some) generators
This commit is contained in:
parent
8a6bb31ed0
commit
dafdf4d161
@ -14,11 +14,11 @@
|
||||
%+ turn arg
|
||||
|= pax/path
|
||||
^- tang
|
||||
=+ ark=;;(arch .^(%cy pax))
|
||||
=+ ark=.^(arch %cy pax)
|
||||
?^ fil.ark
|
||||
?: =(%sched -:(flop pax))
|
||||
[>;;((map ,@da cord) .^(%cx pax))<]~
|
||||
[leaf+(spud pax) (pretty-file .^(%cx pax))]
|
||||
[>.^((map @da cord) %cx pax)<]~
|
||||
[leaf+(spud pax) (pretty-file .^(noun %cx pax))]
|
||||
?- dir.ark :: handle ambiguity
|
||||
$~
|
||||
[rose+[" " `~]^~[leaf+"~" (smyt pax)]]~
|
||||
|
@ -5,24 +5,24 @@
|
||||
!:
|
||||
|%
|
||||
++ pretty-noun
|
||||
|= pri=* ^- tank
|
||||
|= pri/* ^- tank
|
||||
?~ pri
|
||||
leaf+"~"
|
||||
?@ pri
|
||||
leaf+?:(((sane %tas) pri) <`@tas`pri> <pri>)
|
||||
=< rose+[" " ?:(- "~[" "[") "]"]^+
|
||||
|- ^- [? (list tank)]
|
||||
|- ^- {? (list tank)}
|
||||
?~ +.pri
|
||||
[& ^$(pri -.pri) ~]
|
||||
?@ +.pri
|
||||
[| ^$(pri -.pri) ^$(pri +.pri) ~]
|
||||
[+< - +>]:[^$(pri -.pri) $(pri +.pri)]
|
||||
::
|
||||
++ vale-cord |=(a=cord `?`(levy (trip a) |=(b=@ |((gte b 32) =(10 b)))))
|
||||
++ vale-cord |=(a/cord `?`(levy (trip a) |=(b/@ |((gte b 32) =(10 b)))))
|
||||
::
|
||||
++ pretty-file
|
||||
=+ wain-to-tang=|=(a=wain (turn a |=(b=cord leaf+(trip b))))
|
||||
|= fyl=* ^- tang
|
||||
=+ wain-to-tang=|=(a/wain (turn a |=(b/cord leaf+(trip b))))
|
||||
|= fyl/* ^- tang
|
||||
=+ `(unit wain)`?@(fyl `(lore fyl) ((soft wain) fyl))
|
||||
?^ - (wain-to-tang u)
|
||||
[(pretty-noun fyl)]~
|
||||
|
@ -7,7 +7,7 @@
|
||||
!:
|
||||
:- %say
|
||||
|= $: [now=@da eny=@uvI bec=beak]
|
||||
[[pax=$|(term [i=span t=path]) ~] ~]
|
||||
[[pax=$|(term [i=knot t=path]) ~] ~]
|
||||
==
|
||||
:- %helm-serve
|
||||
?@ pax pax
|
||||
|
@ -7,7 +7,7 @@
|
||||
!:
|
||||
:- %say
|
||||
|= $: {now/@da eny/@uvI bec/beak}
|
||||
{{mon/$@(term {span path}) $~} $~}
|
||||
{{mon/$@(term {knot path}) $~} $~}
|
||||
==
|
||||
:- %kiln-unmount
|
||||
mon
|
||||
|
@ -9,5 +9,5 @@
|
||||
::
|
||||
:- %say
|
||||
|= {^ {arg/path $~} $~}
|
||||
=+ lon=((hard arch) .^(%cy arg))
|
||||
=+ lon=.^(arch %cy arg)
|
||||
tang+[?~(dir.lon leaf+"~" (subdir arg dir.lon))]~
|
||||
|
@ -11,14 +11,14 @@
|
||||
|= {kid/@ta $~}
|
||||
=+ paf=`path`/[kid]
|
||||
=- :+ %rose ["/" ~ ?:(dir "/" ~)]
|
||||
(turn paf |=(a/span leaf+(trip a)))
|
||||
(turn paf |=(a/knot leaf+(trip a)))
|
||||
|- ^- {dir/? paf/path}
|
||||
=+ arf=;;(arch .^(%cy (weld pax paf)))
|
||||
=+ arf=.^(arch %cy (weld pax paf))
|
||||
?^ fil.arf
|
||||
[| paf]
|
||||
?~ dir.arf
|
||||
[& paf] :: !!
|
||||
?. ?+({^ $~ $~} dir.arf)
|
||||
?. ?=({^ $~ $~} dir.arf)
|
||||
[& paf]
|
||||
$(paf (welp paf /[p.n.dir.arf]))
|
||||
--
|
||||
|
@ -12,5 +12,5 @@
|
||||
:- %noun
|
||||
?> =(1 (met 5 p.bec))
|
||||
=+ mon=(mix (lsh 5 1 (end 5 1 eny)) p.bec)
|
||||
=+ tic=((hard @p) .^(/a/(scot %p p.bec)/tick/(scot %da now)/(scot %p mon)))
|
||||
=+ tic=.^(@p /a/(scot %p p.bec)/tick/(scot %da now)/(scot %p mon))
|
||||
"moon: {<`@p`mon>}; ticket: {<tic>}"
|
||||
|
@ -7,6 +7,6 @@
|
||||
!:
|
||||
:- %say
|
||||
|= $: [now=@da eny=@uvI byk=beak]
|
||||
[[man=span ~] ~]
|
||||
[[man=knot ~] ~]
|
||||
==
|
||||
[%talk-load man]
|
||||
|
@ -7,6 +7,6 @@
|
||||
!:
|
||||
:- %say
|
||||
|= $: [now=@da eny=@uvI byk=beak]
|
||||
[[man=span ~] ~]
|
||||
[[man=knot ~] ~]
|
||||
==
|
||||
[%talk-log man]
|
||||
|
@ -7,6 +7,6 @@
|
||||
!:
|
||||
:- %say
|
||||
|= $: [now=@da eny=@uvI byk=beak]
|
||||
[[man=span ~] ~]
|
||||
[[man=knot ~] ~]
|
||||
==
|
||||
[%talk-save man]
|
||||
|
@ -7,6 +7,6 @@
|
||||
!:
|
||||
:- %say
|
||||
|= $: [now=@da eny=@uvI byk=beak]
|
||||
[[man=span ~] ~]
|
||||
[[man=knot ~] ~]
|
||||
==
|
||||
[%talk-unlog man]
|
||||
|
@ -12,7 +12,7 @@
|
||||
=+ rend=?^(fla smyt |=(a/path (smyt (slag len a))))
|
||||
:- %tang %- flop
|
||||
|- ^- tang
|
||||
=+ ark=;;(arch .^(cy+pax))
|
||||
=+ ark=.^(arch cy+pax))
|
||||
=- ?~ fil.ark -
|
||||
[(rend pax) -]
|
||||
%- zing
|
||||
|
@ -4,7 +4,7 @@
|
||||
::
|
||||
/? 314
|
||||
/= sum /snip/
|
||||
/^ kid=(map span ,[marl marl])
|
||||
/^ kid=(map knot ,[marl marl])
|
||||
/_ /snip/
|
||||
/$ |=([bem=beam but=path] [our=p.bem tub=(slag 1 (flop but))])
|
||||
::
|
||||
|
@ -14,12 +14,12 @@
|
||||
!:
|
||||
^- tree-include
|
||||
=+ rj=react-to-json:react
|
||||
=+ cj=|=([a=time b=manx] (jobe time/(jode a) body/(rj b) ~))
|
||||
=+ cj=|=({a/time b/manx} (jobe time+(jode a) body+(rj b) ~))
|
||||
:* mime
|
||||
(rj body)
|
||||
(rj /h1 hed.snip) :: head
|
||||
(rj /div tal.snip) :: snip
|
||||
meta
|
||||
sect
|
||||
[%a (turn (sort comt |=([a=* b=*] (lor b a))) cj)]
|
||||
[%a (turn (sort comt |=({a/* b/*} (lor b a))) cj)]
|
||||
==
|
||||
|
@ -7,7 +7,7 @@
|
||||
/; (getall:tree /h1/h2/h3/h4/h5/h6) /tree-elem/
|
||||
::
|
||||
/pub/docs/dev/hoon/runes
|
||||
/; |= [tip=marl sub=(map span marl) ~]
|
||||
/; |= [tip=marl sub=(map knot marl) ~]
|
||||
(zing `(list marl)`[tip (turn (~(tap by sub)) tail)])
|
||||
/. /; (getall:tree %h1 ~) /tree-elem/
|
||||
/_ /; (getall:tree %h1 ~) /tree-elem/
|
||||
|
@ -5,14 +5,14 @@
|
||||
/+ tree
|
||||
/= gas /$ fuel
|
||||
/= dat /^ tree-include /tree-include/
|
||||
/= kid /^ (map span tree-include)
|
||||
/= kid /^ (map knot tree-include)
|
||||
/_ /tree-include/
|
||||
!:
|
||||
::::
|
||||
::
|
||||
|%
|
||||
++ schema (dict {term $@(mark schema)})
|
||||
++ dict |*(a=_* $^({a (dict a)} a))
|
||||
++ dict |*(a/_* $^({a (dict a)} a))
|
||||
++ query
|
||||
$% {$kids p/(list query)}
|
||||
{$name $t}
|
||||
@ -32,10 +32,10 @@
|
||||
?@(-.a [(to-query a) ~] [(to-query -.a) $(a +.a)])
|
||||
::
|
||||
++ to-query
|
||||
|= a/{term $@(mark schema)}
|
||||
|= a/{term $@(mark schema)} ^- query
|
||||
~| invalid-query+a
|
||||
?+ -.a ;;(query a)
|
||||
%kids [%kids (to-queries ?@(+.a !! +.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})
|
||||
@ -61,9 +61,9 @@
|
||||
$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?
|
||||
$kids ?< (~(has by (malt p.a)) %kids) :: XX recursion?
|
||||
=< o+(~(urn by kid) .)
|
||||
|= {dir/span dak/tree-include}
|
||||
|= {dir/knot dak/tree-include} ^- json
|
||||
^^$(quy p.a, s.bem [dir s.bem], dat dak, kid ~)
|
||||
==
|
||||
--
|
||||
|
Loading…
Reference in New Issue
Block a user