support attribute(__const) because it is used in glibc headers
authorMatthias Braun <matze@braunis.de>
Sat, 7 Mar 2009 23:11:29 +0000 (23:11 +0000)
committerMatthias Braun <matze@braunis.de>
Sat, 7 Mar 2009 23:11:29 +0000 (23:11 +0000)
[r25622]

parser.c
token.c
token_t.h

index 94da9e4..5a444f3 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -1306,6 +1306,7 @@ static symbol_t *get_symbol_from_token(void)
 {
        switch(token.type) {
        case T_IDENTIFIER:
+               return token.v.symbol;
        case T_auto:
        case T_char:
        case T_double:
@@ -1335,7 +1336,7 @@ static symbol_t *get_symbol_from_token(void)
        case T_volatile:
        case T_inline:
                /* maybe we need more tokens ... add them on demand */
-               return token.v.symbol;
+               return get_token_symbol(&token);
        default:
                return NULL;
        }
diff --git a/token.c b/token.c
index 94ac183..0d5e164 100644 (file)
--- a/token.c
+++ b/token.c
@@ -119,6 +119,11 @@ void print_token_type(FILE *f, token_type_t token_type)
        }
 }
 
+symbol_t *get_token_symbol(const token_t *token)
+{
+       return token_symbols[token->type];
+}
+
 void print_token(FILE *f, const token_t *token)
 {
        switch(token->type) {
index ecd26bb..6997469 100644 (file)
--- a/token_t.h
+++ b/token_t.h
@@ -77,6 +77,8 @@ void exit_tokens(void);
 void print_token_type(FILE *out, token_type_t token_type);
 void print_token(FILE *out, const token_t *token);
 
+symbol_t *get_token_symbol(const token_t *token);
+
 void print_pp_token_type(FILE *out, int type);
 void print_pp_token(FILE *out, const token_t *token);