hoon: refactor %brcn %brpt optional arg parsing

this refactors the parser for %brcn and %brpt to separate the optional
argument(s) from the required argument(s).

also adds +blab, which allows for a minor refactor of a couple other
arms as well as being used for %brcn and %brpt
This commit is contained in:
drbeefsupreme 2022-07-17 17:18:38 -04:00
parent c29512308f
commit 49420e2fe2

View File

@ -13085,8 +13085,8 @@
%- stew %- stew
^. stet ^. limo ^. stet ^. limo
:~ ['_' (rune cab %brcb exqr)] :~ ['_' (rune cab %brcb exqr)]
['%' (runn cen %brcn expe)] ['%' (runo cen %brcn blab expe)]
['@' (runn pat %brpt expe)] ['@' (runo pat %brpt blab expe)]
[':' (rune col %brcl expb)] [':' (rune col %brcl expb)]
['.' (rune dot %brdt expa)] ['.' (rune dot %brdt expa)]
['-' (rune hep %brhp expa)] ['-' (rune hep %brhp expa)]
@ -13482,13 +13482,10 @@
;~(pfix dif (stag tuq (toad har))) ;~(pfix dif (stag tuq (toad har)))
-- --
:: ::
++ runn :: build named rune ++ runo :: build rune w option
=+ [dif=*rule tuq=** har=expa] =+ [dif=*rule tuq=** hil=*rule har=expa]
|@ ++ $ |@ ++ $
;~ pfix ;~(pfix dif (stag tuq ;~(plug (punt ;~(pfix gap hil)) (toad har))))
dif
(stag tuq ;~(plug (punt ;~(pfix gap cen sym)) (toad har)))
==
-- --
:: ::
++ runq :: wide or tall if tol ++ runq :: wide or tall if tol
@ -13652,8 +13649,9 @@
== ==
loaf loaf
== ==
++ blab ;~(pfix cen sym) :: term
++ bont ;~ (bend) :: term, optional hoon ++ bont ;~ (bend) :: term, optional hoon
;~(pfix cen sym) blab
;~(pfix dot ;~(pose wide ;~(pfix muck loaf))) ;~(pfix dot ;~(pose wide ;~(pfix muck loaf)))
== ==
++ bony (cook |=(a=(list) (lent a)) (plus tis)) :: base 1 =en count ++ bony (cook |=(a=(list) (lent a)) (plus tis)) :: base 1 =en count
@ -13662,7 +13660,7 @@
(cold ~ sig) (cold ~ sig)
%+ ifix %+ ifix
?:(tol [;~(plug duz gap) ;~(plug gap duz)] [pal par]) ?:(tol [;~(plug duz gap) ;~(plug gap duz)] [pal par])
(more mash ;~(gunk ;~(pfix cen sym) loaf)) (more mash ;~(gunk blab loaf))
== ==
-- --
:: ::