Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] docs: clarify glob-qualifier syntax



> On 27/05/2025 13:17 BST dana <dana@xxxxxxx> wrote:
> ps: it seems like the ability to use <...> as the delimiters is broken.
> haven't investigated

That's in the lexer, so changing it could potentially be hairy.  I don't
know why angle brackets should have to be special at this point (at
least to the extent of starting a new word) but that certainly doesn't
mean there's no reason, particularly since parentheses are fairly
heavily overloaded.

See what side effects the following has, though we certainly don't want
to commit it just before a release.  It doesn't seem to cause any tests
to fail, at least.

cheers
pws

diff --git a/Src/lex.c b/Src/lex.c
index efbb62b..2f9770a 100644
--- a/Src/lex.c
+++ b/Src/lex.c
@@ -1169,7 +1169,7 @@ gettokstr(int c, int sub)
 		c = Comma;
 	    break;
 	case LX2_OUTANG:
-	    if (in_brace_param || sub)
+	    if (in_brace_param || sub || pct)
 		break;
 	    e = hgetc();
 	    if (e != '(') {
@@ -1206,7 +1206,7 @@ gettokstr(int c, int sub)
 		break;
 	    }
 	    lexstop = 0;
-	    if (in_brace_param || sub)
+	    if (in_brace_param || sub || pct)
 		break;
 	    goto brk;
 	case LX2_EQUALS:




Messages sorted by: Reverse Date, Date, Thread, Author