diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2005-05-09 10:46:08 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2005-05-09 10:46:08 +0000 |
commit | 4fc0fadfaa5dc5a586f231f32cdab8a43906f677 (patch) | |
tree | 8de3bf503c6f989c593c38998c10c0082db3dd4a /Src/pattern.c | |
parent | 627cafd9db0c3d06e4a742345a78b175ab6b5116 (diff) | |
download | zsh-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.c | 32 |
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)); |