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)
::
%+ rune tis
;~(plug sym ;~(pfix gap fas (more fas urs:ab)))
;~(plug sym ;~(pfix gap stap))
::
%+ rune cen
;~(plug sym ;~(pfix gap ;~(pfix cen sym)))
@ -37,7 +37,7 @@
;~ (glue gap)
sym
;~(pfix cen sym)
;~(pfix fas (more fas urs:ab))
stap
==
::
%+ stag %tssg

View File

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

View File

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

View File

@ -215,7 +215,7 @@
?: =('subscribe' u.maybe-key)
%. item
%+ 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)
%. item
%+ pe %unsubscribe

View File

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