aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/token.h
diff options
authorAl Viro <viro@zeniv.linux.org.uk>2013-01-07 14:00:48 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2013-02-12 10:05:31 -0500
commit959bd8973bfcfced69715a522007662929ae6d48 (patch)
tree18c00b9c8fde48546638c613e4db9d0fa84d06c6 /token.h
parent15cfba61d99668e9c14782779766f48834490ead (diff)
downloadsparse-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.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/token.h b/token.h
index cd292331..20c23268 100644
--- a/token.h
+++ b/token.h
@@ -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 **);