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