diff options
| author | Al Viro <viro@zeniv.linux.org.uk> | 2013-01-07 14:00:48 -0500 |
|---|---|---|
| committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-02-12 10:05:31 -0500 |
| commit | 959bd8973bfcfced69715a522007662929ae6d48 (patch) | |
| tree | 18c00b9c8fde48546638c613e4db9d0fa84d06c6 /token.h | |
| parent | 15cfba61d99668e9c14782779766f48834490ead (diff) | |
| download | sparse-dev-959bd8973bfcfced69715a522007662929ae6d48.tar.gz | |
switch to delayed handling of escape sequences
#define A(x) #x
A('\12')
should *not* yield "'\\n'"; the problem is that we are doing the conversion
too early.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'token.h')
| -rw-r--r-- | token.h | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -68,8 +68,8 @@ enum token_type { TOKEN_ZERO_IDENT, TOKEN_NUMBER, TOKEN_CHAR, - TOKEN_WIDE_CHAR, - TOKEN_STRING, + TOKEN_WIDE_CHAR = TOKEN_CHAR + 5, + TOKEN_STRING = TOKEN_WIDE_CHAR + 5, TOKEN_WIDE_STRING, TOKEN_SPECIAL, TOKEN_STREAMBEGIN, @@ -165,9 +165,9 @@ struct token { struct ident *ident; unsigned int special; struct string *string; - int character; int argnum; struct argcount count; + char embedded[4]; }; }; @@ -198,6 +198,7 @@ extern const char *show_special(int); extern const char *show_ident(const struct ident *); extern const char *show_string(const struct string *string); extern const char *show_token(const struct token *); +extern const char *quote_token(const struct token *); extern struct token * tokenize(const char *, int, struct token *, const char **next_path); extern struct token * tokenize_buffer(void *, unsigned long, struct token **); |
