about summary refs log tree commit diff
path: root/Src/pattern.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2005-05-09 10:46:08 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2005-05-09 10:46:08 +0000
commit4fc0fadfaa5dc5a586f231f32cdab8a43906f677 (patch)
tree8de3bf503c6f989c593c38998c10c0082db3dd4a /Src/pattern.c
parent627cafd9db0c3d06e4a742345a78b175ab6b5116 (diff)
downloadzsh-4fc0fadfaa5dc5a586f231f32cdab8a43906f677.tar.gz
zsh-4fc0fadfaa5dc5a586f231f32cdab8a43906f677.tar.xz
zsh-4fc0fadfaa5dc5a586f231f32cdab8a43906f677.zip
Add [[:IFS:]] etc. tests.
Diffstat (limited to 'Src/pattern.c')
-rw-r--r--Src/pattern.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/Src/pattern.c b/Src/pattern.c
index ed88bb7ce..393d9bf41 100644
--- a/Src/pattern.c
+++ b/Src/pattern.c
@@ -193,8 +193,12 @@ typedef union upat *Upat;
 #define PP_SPACE  11
 #define PP_UPPER  12
 #define PP_XDIGIT 13
-#define PP_UNKWN  14
-#define PP_RANGE  15
+#define PP_IDENT  14
+#define PP_IFS    15
+#define PP_IFSSPACE   16
+#define PP_WORD   17
+#define PP_UNKWN  18
+#define PP_RANGE  19
 
 #define	P_OP(p)		((p)->l & 0xff)
 #define	P_NEXT(p)	((p)->l >> 8)
@@ -1118,6 +1122,14 @@ patcomppiece(int *flagp)
 			    ch = PP_UPPER;
 			else if (!strncmp(patparse, "xdigit", len))
 			    ch = PP_XDIGIT;
+			else if (!strncmp(patparse, "IDENT", len))
+			    ch = PP_IDENT;
+			else if (!strncmp(patparse, "IFS", len))
+			    ch = PP_IFS;
+			else if (!strncmp(patparse, "IFSSPACE", len))
+			    ch = PP_IFSSPACE;
+			else if (!strncmp(patparse, "WORD", len))
+			    ch = PP_WORD;
 			else
 			    ch = PP_UNKWN;
 			patparse = nptr + 2;
@@ -2724,6 +2736,22 @@ patmatchrange(char *range, int ch)
 		if (isxdigit(ch))
 		    return 1;
 		break;
+	    case PP_IDENT:
+		if (iident(ch))
+		    return 1;
+		break;
+	    case PP_IFS:
+		if (isep(ch))
+		    return 1;
+		break;
+	    case PP_IFSSPACE:
+		if (iwsep(ch))
+		    return 1;
+		break;
+	    case PP_WORD:
+		if (iword(ch))
+		    return 1;
+		break;
 	    case PP_RANGE:
 		range++;
 		r1 = STOUC(UNMETA(range));