mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-04 20:54:21 +03:00
hoon: adds hints for likely-to-be-jetted list/treap/parser arms
This commit is contained in:
parent
5edaf634bc
commit
9d5119b33f
@ -781,6 +781,7 @@
|
||||
(weld (scag b a) [c (slag b a)])
|
||||
::
|
||||
++ welp :: faceless weld
|
||||
~/ %welp
|
||||
=| {* *}
|
||||
|@
|
||||
++ $
|
||||
@ -790,6 +791,7 @@
|
||||
--
|
||||
::
|
||||
++ zing :: promote
|
||||
~/ %zing
|
||||
=| *
|
||||
|@
|
||||
++ $
|
||||
@ -1199,8 +1201,10 @@
|
||||
?|((b n.a) $(a l.a) $(a r.a))
|
||||
::
|
||||
++ apt :: check correctness
|
||||
=< $
|
||||
~/ %apt
|
||||
=| {l/(unit) r/(unit)}
|
||||
|- ^- ?
|
||||
|. ^- ?
|
||||
?~ a &
|
||||
?& ?~(l & (gor n.a u.l))
|
||||
?~(r & (gor u.r n.a))
|
||||
@ -1349,6 +1353,7 @@
|
||||
c(l a(r l.c))
|
||||
::
|
||||
++ rep :: reduce to product
|
||||
~/ %rep
|
||||
|* b/_=>(~ |=({* *} +<+))
|
||||
|-
|
||||
?~ a +<+.b
|
||||
@ -1493,8 +1498,10 @@
|
||||
$(a r.a, c (peg c 7))
|
||||
::
|
||||
++ apt :: check correctness
|
||||
=< $
|
||||
~/ %apt
|
||||
=| {l/(unit) r/(unit)}
|
||||
|- ^- ?
|
||||
|. ^- ?
|
||||
?~ a &
|
||||
?& ?~(l & &((gor p.n.a u.l) !=(p.n.a u.l)))
|
||||
?~(r & &((gor u.r p.n.a) !=(u.r p.n.a)))
|
||||
@ -1606,6 +1613,7 @@
|
||||
d(l a(r l.d))
|
||||
::
|
||||
++ rep :: reduce to product
|
||||
~/ %rep
|
||||
|* b/_=>(~ |=({* *} +<+))
|
||||
|-
|
||||
?~ a +<+.b
|
||||
@ -1622,6 +1630,7 @@
|
||||
[-.f a(l +.e, r +.f)]
|
||||
::
|
||||
++ run :: apply gate to values
|
||||
~/ %run
|
||||
|* b/gate
|
||||
|-
|
||||
?~ a a
|
||||
@ -1688,18 +1697,23 @@
|
||||
::
|
||||
::
|
||||
++ urn :: apply gate to nodes
|
||||
~/ %urn
|
||||
|* b/$-({* *} *)
|
||||
|-
|
||||
?~ a ~
|
||||
a(n n.a(q (b p.n.a q.n.a)), l $(a l.a), r $(a r.a))
|
||||
::
|
||||
++ wyt :: depth of map
|
||||
|- ^- @
|
||||
=< $
|
||||
~% %wyt + ~
|
||||
|. ^- @
|
||||
?~(a 0 +((add $(a l.a) $(a r.a))))
|
||||
::
|
||||
++ key :: set of keys
|
||||
=< $
|
||||
~/ %key
|
||||
=+ b=`(set _?>(?=(^ a) p.n.a))`~
|
||||
|- ^+ b
|
||||
|. ^+ b
|
||||
?~ a b
|
||||
$(a r.a, b $(a l.a, b (~(put in b) p.n.a)))
|
||||
::
|
||||
@ -5524,6 +5538,7 @@
|
||||
[(last p.vex p.wag) [~ (raq p.u.q.vex p.u.q.wag) q.u.q.wag]]
|
||||
::
|
||||
++ stun :: parse several times
|
||||
~/ %stun
|
||||
|* {lig/{@ @} fel/rule}
|
||||
|= tub/nail
|
||||
^- (like (list _(wonk (fel))))
|
||||
|
Loading…
Reference in New Issue
Block a user