diff options
Diffstat (limited to 'scripts/genksyms/lex.l')
-rw-r--r-- | scripts/genksyms/lex.l | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/scripts/genksyms/lex.l b/scripts/genksyms/lex.l index e4ddd493fec..f770071719c 100644 --- a/scripts/genksyms/lex.l +++ b/scripts/genksyms/lex.l | |||
@@ -29,7 +29,7 @@ | |||
29 | #include <ctype.h> | 29 | #include <ctype.h> |
30 | 30 | ||
31 | #include "genksyms.h" | 31 | #include "genksyms.h" |
32 | #include "parse.h" | 32 | #include "parse.tab.h" |
33 | 33 | ||
34 | /* We've got a two-level lexer here. We let flex do basic tokenization | 34 | /* We've got a two-level lexer here. We let flex do basic tokenization |
35 | and then we categorize those basic tokens in the second stage. */ | 35 | and then we categorize those basic tokens in the second stage. */ |
@@ -94,7 +94,7 @@ MC_TOKEN ([~%^&*+=|<>/-]=)|(&&)|("||")|(->)|(<<)|(>>) | |||
94 | 94 | ||
95 | /* Bring in the keyword recognizer. */ | 95 | /* Bring in the keyword recognizer. */ |
96 | 96 | ||
97 | #include "keywords.c" | 97 | #include "keywords.hash.c" |
98 | 98 | ||
99 | 99 | ||
100 | /* Macros to append to our phrase collection list. */ | 100 | /* Macros to append to our phrase collection list. */ |
@@ -116,6 +116,7 @@ MC_TOKEN ([~%^&*+=|<>/-]=)|(&&)|("||")|(->)|(<<)|(>>) | |||
116 | cur_node->tag = \ | 116 | cur_node->tag = \ |
117 | find_symbol(cur_node->string, SYM_ENUM_CONST, 1)?\ | 117 | find_symbol(cur_node->string, SYM_ENUM_CONST, 1)?\ |
118 | SYM_ENUM_CONST : SYM_NORMAL ; \ | 118 | SYM_ENUM_CONST : SYM_NORMAL ; \ |
119 | cur_node->in_source_file = in_source_file; \ | ||
119 | } while (0) | 120 | } while (0) |
120 | 121 | ||
121 | #define APP _APP(yytext, yyleng) | 122 | #define APP _APP(yytext, yyleng) |
@@ -166,6 +167,13 @@ repeat: | |||
166 | cur_filename = memcpy(xmalloc(e-file+1), file, e-file+1); | 167 | cur_filename = memcpy(xmalloc(e-file+1), file, e-file+1); |
167 | cur_line = atoi(yytext+2); | 168 | cur_line = atoi(yytext+2); |
168 | 169 | ||
170 | if (!source_file) { | ||
171 | source_file = xstrdup(cur_filename); | ||
172 | in_source_file = 1; | ||
173 | } else { | ||
174 | in_source_file = (strcmp(cur_filename, source_file) == 0); | ||
175 | } | ||
176 | |||
169 | goto repeat; | 177 | goto repeat; |
170 | } | 178 | } |
171 | 179 | ||