From 289b14113b1675b7b8d844b1f41aff1e2f3a5146 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 5 Oct 2006 21:53:26 +0000 Subject: 22819: improved internal use of string quotation, plus completion bug fix with RCQUOTES --- Src/zsh.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'Src/zsh.h') diff --git a/Src/zsh.h b/Src/zsh.h index 9a76bf9a5..c73ae3b9a 100644 --- a/Src/zsh.h +++ b/Src/zsh.h @@ -178,6 +178,41 @@ struct mathfunc { #define SPECCHARS "#$^*()=|{}[]`<>?~;&\n\t \\\'\"" +/* + * Types of quote. This is used in various places, so care needs + * to be taken when changing them. (Oooh, don't you look surprised.) + * - Passed to quotestring() to indicate style. This is the ultimate + * destiny of most of the other uses of members of the enum. + * - In paramsubst(), to count q's in parameter substitution. + * - In the completion code, where we maintain a stack of quotation types. + */ +enum { + /* + * No quote. Not a valid quote, but useful in the substitution + * and completion code to indicate we're not doing any quoting. + */ + QT_NONE, + /* Backslash: \ */ + QT_BACKSLASH, + /* Single quote: ' */ + QT_SINGLE, + /* Double quote: " */ + QT_DOUBLE, + /* Print-style quote: $' */ + QT_DOLLARS, + /* + * Backtick: ` + * Not understood by many parts of the code; here for a convenience + * in those cases where we need to represent a complete set. + */ + QT_BACKTICK, +}; + +/* + * Lexical tokens: unlike the character tokens above, these never + * appear in strings and don't necessarily represent a single character. + */ + enum { NULLTOK, /* 0 */ SEPER, -- cgit 1.4.1