hoon: add +stap, path parser

And cleans up a bunch of locally hand-written implementations of it.
This commit is contained in:
fang 2021-04-07 21:14:13 +02:00
parent 4a92313549
commit 1ec5e5acfb
No known key found for this signature in database
GPG Key ID: EB035760C1BBA972
5 changed files with 8 additions and 9 deletions

View File

@ -21,7 +21,7 @@
(most ;~(plug com gaw) taut-rule) (most ;~(plug com gaw) taut-rule)
:: ::
%+ rune tis %+ rune tis
;~(plug sym ;~(pfix gap fas (more fas urs:ab))) ;~(plug sym ;~(pfix gap stap))
:: ::
%+ rune cen %+ rune cen
;~(plug sym ;~(pfix gap ;~(pfix cen sym))) ;~(plug sym ;~(pfix gap ;~(pfix cen sym)))
@ -37,7 +37,7 @@
;~ (glue gap) ;~ (glue gap)
sym sym
;~(pfix cen sym) ;~(pfix cen sym)
;~(pfix fas (more fas urs:ab)) stap
== ==
:: ::
%+ stag %tssg %+ stag %tssg

View File

@ -5965,9 +5965,8 @@
:: ::
++ spat |=(pax=path (crip (spud pax))) :: render path to cord ++ spat |=(pax=path (crip (spud pax))) :: render path to cord
++ spud |=(pax=path ~(ram re (smyt pax))) :: render path to tape ++ spud |=(pax=path ~(ram re (smyt pax))) :: render path to tape
++ stab :: parse cord to path ++ stab |=(zep=@t `path`(rash zep stap)) :: parse cord to path
=+ fel=;~(pfix fas (more fas urs:ab)) ++ stap ;~(pfix fas (more fas urs:ab)) :: path parser
|=(zep=@t `path`(rash zep fel))
:: ::
:::: 4n: virtualization :::: 4n: virtualization
:: ::

View File

@ -869,7 +869,7 @@
(most ;~(plug com gaw) taut-rule) (most ;~(plug com gaw) taut-rule)
:: ::
%+ rune tis %+ rune tis
;~(plug sym ;~(pfix gap fas (more fas urs:ab))) ;~(plug sym ;~(pfix gap stap))
:: ::
%+ rune cen %+ rune cen
;~(plug sym ;~(pfix gap ;~(pfix cen sym))) ;~(plug sym ;~(pfix gap ;~(pfix cen sym)))
@ -885,7 +885,7 @@
;~ (glue gap) ;~ (glue gap)
sym sym
;~(pfix cen sym) ;~(pfix cen sym)
;~(pfix fas (more fas urs:ab)) ;~(pfix stap)
== ==
:: ::
%+ stag %tssg %+ stag %tssg

View File

@ -215,7 +215,7 @@
?: =('subscribe' u.maybe-key) ?: =('subscribe' u.maybe-key)
%. item %. item
%+ pe %subscribe %+ pe %subscribe
(ot id+ni ship+(su fed:ag) app+so path+(su ;~(pfix fas (more fas urs:ab))) ~) (ot id+ni ship+(su fed:ag) app+so path+(su stap) ~)
?: =('unsubscribe' u.maybe-key) ?: =('unsubscribe' u.maybe-key)
%. item %. item
%+ pe %unsubscribe %+ pe %unsubscribe

View File

@ -3458,7 +3458,7 @@
[(rash a fel) b] [(rash a fel) b]
:: :: ++pa:dejs:format :: :: ++pa:dejs:format
++ pa :: string as path ++ pa :: string as path
(su ;~(pfix fas (more fas urs:ab))) (su stap)
:: :: ++pe:dejs:format :: :: ++pe:dejs:format
++ pe :: prefix ++ pe :: prefix
|* [pre=* wit=fist] |* [pre=* wit=fist]