X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=syntax.h;h=b14427a32f29e67019c285e5c776f95be51204e0;hb=7117c2d221b2aed4ede8600f6a36b7c1454b4f55;hp=87938d61fee5ad8dc0d2a5c80a6197beed7788ed;hpb=f73dda092b33638d2d5e9c35375f687a607b5403;p=thirdparty%2Fbash.git diff --git a/syntax.h b/syntax.h index 87938d61f..b14427a32 100644 --- a/syntax.h +++ b/syntax.h @@ -61,13 +61,17 @@ #define CXGLOB 0x0200 /* extended globbing characters */ #define CXQUOTE 0x0400 /* cquote + backslash */ #define CSPECVAR 0x0800 /* single-character shell variable name */ +#define CSUBSTOP 0x1000 /* values of OP for ${word[:]OPstuff} */ /* Defines for use by the rest of the shell. */ extern const int sh_syntaxtab[]; -#define shellmeta(c) (sh_syntaxtab[(c)] & CSHMETA) -#define shellbreak(c) (sh_syntaxtab[(c)] & CSHBRK) -#define shellquote(c) (sh_syntaxtab[(c)] & CQUOTE) +#define shellmeta(c) (sh_syntaxtab[(unsigned char)(c)] & CSHMETA) +#define shellbreak(c) (sh_syntaxtab[(unsigned char)(c)] & CSHBRK) +#define shellquote(c) (sh_syntaxtab[(unsigned char)(c)] & CQUOTE) + +#define issyntype(c, t) ((sh_syntaxtab[(unsigned char)(c)] & (t)) != 0) +#define notsyntype(c,t) ((sh_syntaxtab[(unsigned char)(c)] & (t)) == 0) #if defined (PROCESS_SUBSTITUTION) # define shellexp(c) ((c) == '$' || (c) == '<' || (c) == '>')