From 49420e2fe25de7e09adece2319520a5f0e8a691a Mon Sep 17 00:00:00 2001 From: drbeefsupreme Date: Sun, 17 Jul 2022 17:18:38 -0400 Subject: [PATCH] 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 --- pkg/arvo/sys/hoon.hoon | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/pkg/arvo/sys/hoon.hoon b/pkg/arvo/sys/hoon.hoon index 77f09396d6..65a38554e1 100644 --- a/pkg/arvo/sys/hoon.hoon +++ b/pkg/arvo/sys/hoon.hoon @@ -13085,8 +13085,8 @@ %- stew ^. stet ^. limo :~ ['_' (rune cab %brcb exqr)] - ['%' (runn cen %brcn expe)] - ['@' (runn pat %brpt expe)] + ['%' (runo cen %brcn blab expe)] + ['@' (runo pat %brpt blab expe)] [':' (rune col %brcl expb)] ['.' (rune dot %brdt expa)] ['-' (rune hep %brhp expa)] @@ -13482,13 +13482,10 @@ ;~(pfix dif (stag tuq (toad har))) -- :: - ++ runn :: build named rune - =+ [dif=*rule tuq=** har=expa] + ++ runo :: build rune w option + =+ [dif=*rule tuq=** hil=*rule har=expa] |@ ++ $ - ;~ pfix - dif - (stag tuq ;~(plug (punt ;~(pfix gap cen sym)) (toad har))) - == + ;~(pfix dif (stag tuq ;~(plug (punt ;~(pfix gap hil)) (toad har)))) -- :: ++ runq :: wide or tall if tol @@ -13652,8 +13649,9 @@ == loaf == + ++ blab ;~(pfix cen sym) :: term ++ bont ;~ (bend) :: term, optional hoon - ;~(pfix cen sym) + blab ;~(pfix dot ;~(pose wide ;~(pfix muck loaf))) == ++ bony (cook |=(a=(list) (lent a)) (plus tis)) :: base 1 =en count @@ -13662,7 +13660,7 @@ (cold ~ sig) %+ ifix ?:(tol [;~(plug duz gap) ;~(plug gap duz)] [pal par]) - (more mash ;~(gunk ;~(pfix cen sym) loaf)) + (more mash ;~(gunk blab loaf)) == -- ::