Lines Matching full:token
2 * Do C preprocessing, based on a token list gathered by
42 #include "token.h"
94 static struct token *alloc_token(struct position *pos) in alloc_token()
96 struct token *token = __alloc_token(0); in alloc_token() local
98 token->pos.stream = pos->stream; in alloc_token()
99 token->pos.line = pos->line; in alloc_token()
100 token->pos.pos = pos->pos; in alloc_token()
101 token->pos.whitespace = 1; in alloc_token()
102 return token; in alloc_token()
106 static int expand(struct token **, struct symbol *);
108 static void replace_with_string(struct token *token, const char *str) in replace_with_string() argument
115 token_type(token) = TOKEN_STRING; in replace_with_string()
116 token->string = s; in replace_with_string()
119 static void replace_with_integer(struct token *token, unsigned int val) in replace_with_integer() argument
123 token_type(token) = TOKEN_NUMBER; in replace_with_integer()
124 token->number = buf; in replace_with_integer()
135 static int token_defined(struct token *token) in token_defined() argument
137 if (token_type(token) == TOKEN_IDENT) { in token_defined()
138 struct symbol *sym = lookup_macro(token->ident); in token_defined()
146 sparse_error(token->pos, "expected preprocessor identifier"); in token_defined()
150 static void replace_with_bool(struct token *token, bool val) in replace_with_bool() argument
154 token_type(token) = TOKEN_NUMBER; in replace_with_bool()
155 token->number = string[val]; in replace_with_bool()
158 static void replace_with_defined(struct token *token) in replace_with_defined() argument
160 replace_with_bool(token, token_defined(token)); in replace_with_defined()
163 static void expand_line(struct token *token) in expand_line() argument
165 replace_with_integer(token, token->pos.line); in expand_line()
168 static void expand_file(struct token *token) in expand_file() argument
170 replace_with_string(token, stream_name(token->pos.stream)); in expand_file()
173 static void expand_basefile(struct token *token) in expand_basefile() argument
175 replace_with_string(token, base_filename); in expand_basefile()
179 static void expand_date(struct token *token) in expand_date() argument
186 replace_with_string(token, buffer); in expand_date()
189 static void expand_time(struct token *token) in expand_time() argument
196 replace_with_string(token, buffer); in expand_time()
199 static void expand_counter(struct token *token) in expand_counter() argument
201 replace_with_integer(token, counter_macro++); in expand_counter()
204 static void expand_include_level(struct token *token) in expand_include_level() argument
206 replace_with_integer(token, include_level - 1); in expand_include_level()
209 static int expand_one_symbol(struct token **list) in expand_one_symbol()
211 struct token *token = *list; in expand_one_symbol() local
214 if (token->pos.noexpand) in expand_one_symbol()
217 sym = lookup_macro(token->ident); in expand_one_symbol()
221 sym->expand_simple(token); in expand_one_symbol()
234 static inline struct token *scan_next(struct token **where) in scan_next()
236 struct token *token = *where; in scan_next() local
237 if (token_type(token) != TOKEN_UNTAINT) in scan_next()
238 return token; in scan_next()
240 token->ident->tainted = 0; in scan_next()
241 token = token->next; in scan_next()
242 } while (token_type(token) == TOKEN_UNTAINT); in scan_next()
243 *where = token; in scan_next()
244 return token; in scan_next()
247 static void expand_list(struct token **list) in expand_list()
249 struct token *next; in expand_list()
256 static void preprocessor_line(struct stream *stream, struct token **line);
258 static struct token *collect_arg(struct token *prev, int vararg, struct position *pos, int count) in collect_arg()
261 struct token **p = &prev->next; in collect_arg()
262 struct token *next; in collect_arg()
269 __free_token(next); /* Free the '#' token */ in collect_arg()
312 struct token *arg;
313 struct token *expanded;
314 struct token *str;
320 static int collect_arguments(struct token *start, struct token *arglist, struct arg *args, struct t… in collect_arguments()
323 struct token *next = NULL; in collect_arguments()
394 static struct token *dup_list(struct token *list) in dup_list()
396 struct token *res = NULL; in dup_list()
397 struct token **p = &res; in dup_list()
400 struct token *newtok = __alloc_token(0); in dup_list()
409 static const char *show_token_sequence(struct token *token, int quote) in show_token_sequence() argument
415 if (!token && !quote) in show_token_sequence()
417 while (!eof_token(token)) { in show_token_sequence()
418 const char *val = quote ? quote_token(token) : show_token(token); in show_token_sequence()
422 sparse_error(token->pos, "too long token expansion"); in show_token_sequence()
430 token = token->next; in show_token_sequence()
431 whitespace = token->pos.whitespace; in show_token_sequence()
437 static struct token *stringify(struct token *arg) in stringify()
441 struct token *token = __alloc_token(0); in stringify() local
446 token->pos = arg->pos; in stringify()
447 token_type(token) = TOKEN_STRING; in stringify()
448 token->string = string; in stringify()
449 token->next = &eof_token_entry; in stringify()
450 return token; in stringify()
457 struct token *arg = args[i].arg; in expand_arguments()
489 static enum token_type combine(struct token *left, struct token *right, char *p) in combine()
543 static int merge(struct token *left, struct token *right) in merge()
587 sparse_error(left->pos, "'##' failed: concatenation is not a valid token"); in merge()
591 static struct token *dup_token(struct token *token, struct position *streampos) in dup_token() argument
593 struct token *alloc = alloc_token(streampos); in dup_token()
594 token_type(alloc) = token_type(token); in dup_token()
595 alloc->pos.newline = token->pos.newline; in dup_token()
596 alloc->pos.whitespace = token->pos.whitespace; in dup_token()
597 alloc->number = token->number; in dup_token()
598 alloc->pos.noexpand = token->pos.noexpand; in dup_token()
602 static struct token **copy(struct token **where, struct token *list, int *count) in copy()
606 struct token *token; in copy() local
608 token = dup_token(list, &list->pos); in copy()
610 token = list; in copy()
611 if (token_type(token) == TOKEN_IDENT && token->ident->tainted) in copy()
612 token->pos.noexpand = 1; in copy()
613 *where = token; in copy()
614 where = &token->next; in copy()
621 static int handle_kludge(struct token **p, struct arg *args) in handle_kludge()
623 struct token *t = (*p)->next->next; in handle_kludge()
642 static struct token **substitute(struct token **list, struct token *body, struct arg *args) in substitute()
649 struct token *added, *arg; in substitute()
650 struct token **tail; in substitute()
651 struct token *t; in substitute()
745 static int expand(struct token **list, struct symbol *sym) in expand()
747 struct token *last; in expand()
748 struct token *token = *list; in expand() local
749 struct ident *expanding = token->ident; in expand()
750 struct token **tail; in expand()
751 struct token *expansion = sym->expansion; in expand()
756 token->pos.noexpand = 1; in expand()
761 if (!match_op(scan_next(&token->next), '(')) in expand()
763 if (!collect_arguments(token->next, sym->arglist, args, token)) in expand()
769 return sym->expand(token, args) ? 0 : 1; in expand()
773 last = token->next; in expand()
781 (*list)->pos.newline = token->pos.newline; in expand()
782 (*list)->pos.whitespace = token->pos.whitespace; in expand()
788 static const char *token_name_sequence(struct token *token, int endop, struct token *start) in token_name_sequence() argument
793 while (!eof_token(token) && !match_op(token, endop)) { in token_name_sequence()
795 const char *val = token->string->data; in token_name_sequence()
796 if (token_type(token) != TOKEN_STRING) in token_name_sequence()
797 val = show_token(token); in token_name_sequence()
801 token = token->next; in token_name_sequence()
804 if (endop && !match_op(token, endop)) in token_name_sequence()
899 …ct position pos, const char *path, const char *filename, int flen, struct token **where, const cha… in try_include()
923 static int do_include_path(const char **pptr, struct token **list, struct token *token, const char … in do_include_path() argument
928 if (!try_include(token->pos, path, filename, flen, list, pptr)) in do_include_path()
935 static int free_preprocessor_line(struct token *token) in free_preprocessor_line() argument
937 while (token_type(token) != TOKEN_EOF) { in free_preprocessor_line()
938 struct token *free = token; in free_preprocessor_line()
939 token = token->next; in free_preprocessor_line()
945 static int handle_include_path(struct stream *stream, struct token **list, struct token *token, int… in handle_include_path() argument
948 struct token *next; in handle_include_path()
953 next = token->next; in handle_include_path()
956 expand_list(&token->next); in handle_include_path()
958 next = token; in handle_include_path()
959 if (match_op(token->next, '<')) { in handle_include_path()
960 next = token->next; in handle_include_path()
965 token = next->next; in handle_include_path()
966 filename = token_name_sequence(token, expect, token); in handle_include_path()
971 if (try_include(token->pos, "", filename, flen, list, includepath)) in handle_include_path()
991 if (do_include_path(path, list, token, filename, flen)) in handle_include_path()
994 error_die(token->pos, "unable to open '%s'", filename); in handle_include_path()
997 static int handle_include(struct stream *stream, struct token **list, struct token *token) in handle_include() argument
999 return handle_include_path(stream, list, token, 0); in handle_include()
1002 static int handle_include_next(struct stream *stream, struct token **list, struct token *token) in handle_include_next() argument
1004 return handle_include_path(stream, list, token, 1); in handle_include_next()
1007 static int handle_argv_include(struct stream *stream, struct token **list, struct token *token) in handle_argv_include() argument
1009 return handle_include_path(stream, list, token, 2); in handle_argv_include()
1012 static int token_different(struct token *t1, struct token *t2) in token_different()
1065 static int token_list_different(struct token *list1, struct token *list2) in token_list_different()
1079 static inline void set_arg_count(struct token *token) in set_arg_count() argument
1081 token_type(token) = TOKEN_ARG_COUNT; in set_arg_count()
1082 token->count.normal = token->count.quoted = in set_arg_count()
1083 token->count.str = token->count.vararg = 0; in set_arg_count()
1086 static struct token *parse_arguments(struct token *list) in parse_arguments()
1088 struct token *arg = list->next, *next = list; in parse_arguments()
1185 static int try_arg(struct token *token, enum token_type type, struct token *arglist) in try_arg() argument
1187 struct ident *ident = token->ident; in try_arg()
1190 if (!arglist || token_type(token) != TOKEN_IDENT) in try_arg()
1200 token->argnum = nr; in try_arg()
1201 token_type(token) = type; in try_arg()
1218 token_type(token) = TOKEN_ERROR; in try_arg()
1225 static struct token *handle_hash(struct token **p, struct token *arglist) in handle_hash()
1227 struct token *token = *p; in handle_hash() local
1229 struct token *next = token->next; in handle_hash()
1232 next->pos.whitespace = token->pos.whitespace; in handle_hash()
1233 __free_token(token); in handle_hash()
1234 token = *p = next; in handle_hash()
1236 token->pos.noexpand = 1; in handle_hash()
1238 return token; in handle_hash()
1241 sparse_error(token->pos, "'#' is not followed by a macro parameter"); in handle_hash()
1245 /* token->next is ## */
1246 static struct token *handle_hashhash(struct token *token, struct token *arglist) in handle_hashhash() argument
1248 struct token *last = token; in handle_hashhash()
1249 struct token *concat; in handle_hashhash()
1250 int state = match_op(token, ','); in handle_hashhash()
1252 try_arg(token, TOKEN_QUOTED_ARGUMENT, arglist); in handle_hashhash()
1255 struct token *t; in handle_hashhash()
1259 concat = token->next; in handle_hashhash()
1261 token->next = t; in handle_hashhash()
1285 token = t; in handle_hashhash()
1286 if (!match_op(token->next, SPECIAL_HASHHASH)) in handle_hashhash()
1292 return token; in handle_hashhash()
1299 static struct token *parse_expansion(struct token *expansion, struct token *arglist, struct ident *… in parse_expansion()
1301 struct token *token = expansion; in parse_expansion() local
1302 struct token **p; in parse_expansion()
1304 if (match_op(token, SPECIAL_HASHHASH)) in parse_expansion()
1307 for (p = &expansion; !eof_token(token); p = &token->next, token = *p) { in parse_expansion()
1308 if (match_op(token, '#')) { in parse_expansion()
1309 token = handle_hash(p, arglist); in parse_expansion()
1310 if (!token) in parse_expansion()
1313 if (match_op(token->next, SPECIAL_HASHHASH)) { in parse_expansion()
1314 token = handle_hashhash(token, arglist); in parse_expansion()
1315 if (!token) in parse_expansion()
1318 try_arg(token, TOKEN_MACRO_ARGUMENT, arglist); in parse_expansion()
1320 switch (token_type(token)) { in parse_expansion()
1326 token->string->immutable = 1; in parse_expansion()
1330 token = alloc_token(&expansion->pos); in parse_expansion()
1331 token_type(token) = TOKEN_UNTAINT; in parse_expansion()
1332 token->ident = name; in parse_expansion()
1333 token->next = *p; in parse_expansion()
1334 *p = token; in parse_expansion()
1338 sparse_error(token->pos, "'##' cannot appear at the ends of macro expansion"); in parse_expansion()
1341 sparse_error(token->pos, "too many instances of argument in body"); in parse_expansion()
1345 static int do_define(struct position pos, struct token *token, struct ident *name, in do_define() argument
1346 struct token *arglist, struct token *expansion, int attr) in do_define()
1369 warning(pos, "preprocessor token %.*s redefined", in do_define()
1387 if (token) /* Free the "define" token, but not the rest of the line */ in do_define()
1388 __free_token(token); in do_define()
1410 struct token *value = &eof_token_entry; in predefine()
1470 static int do_handle_define(struct stream *stream, struct token **line, struct token *token, int at… in do_handle_define() argument
1472 struct token *arglist, *expansion; in do_handle_define()
1473 struct token *left = token->next; in do_handle_define()
1477 sparse_error(token->pos, "expected identifier to 'define'"); in do_handle_define()
1497 return do_define(left->pos, token, name, arglist, expansion, attr); in do_handle_define()
1500 static int handle_define(struct stream *stream, struct token **line, struct token *token) in handle_define() argument
1502 return do_handle_define(stream, line, token, SYM_ATTR_NORMAL); in handle_define()
1505 static int handle_weak_define(struct stream *stream, struct token **line, struct token *token) in handle_weak_define() argument
1507 return do_handle_define(stream, line, token, SYM_ATTR_WEAK); in handle_weak_define()
1510 static int handle_strong_define(struct stream *stream, struct token **line, struct token *token) in handle_strong_define() argument
1512 return do_handle_define(stream, line, token, SYM_ATTR_STRONG); in handle_strong_define()
1515 static int do_handle_undef(struct stream *stream, struct token **line, struct token *token, int att… in do_handle_undef() argument
1517 struct token *left = token->next; in do_handle_undef()
1521 sparse_error(token->pos, "expected identifier to 'undef'"); in do_handle_undef()
1546 static int handle_undef(struct stream *stream, struct token **line, struct token *token) in handle_undef() argument
1548 return do_handle_undef(stream, line, token, SYM_ATTR_NORMAL); in handle_undef()
1551 static int handle_strong_undef(struct stream *stream, struct token **line, struct token *token) in handle_strong_undef() argument
1553 return do_handle_undef(stream, line, token, SYM_ATTR_STRONG); in handle_strong_undef()
1556 static int preprocessor_if(struct stream *stream, struct token *token, int cond) in preprocessor_if() argument
1558 token_type(token) = false_nesting ? TOKEN_SKIP_GROUPS : TOKEN_IF; in preprocessor_if()
1559 free_preprocessor_line(token->next); in preprocessor_if()
1560 token->next = stream->top_if; in preprocessor_if()
1561 stream->top_if = token; in preprocessor_if()
1567 static int handle_ifdef(struct stream *stream, struct token **line, struct token *token) in handle_ifdef() argument
1569 struct token *next = token->next; in handle_ifdef()
1576 sparse_error(token->pos, "expected preprocessor identifier"); in handle_ifdef()
1579 return preprocessor_if(stream, token, arg); in handle_ifdef()
1582 static int handle_ifndef(struct stream *stream, struct token **line, struct token *token) in handle_ifndef() argument
1584 struct token *next = token->next; in handle_ifndef()
1589 stream->ifndef = token; in handle_ifndef()
1592 stream->ifndef = token; in handle_ifndef()
1600 sparse_error(token->pos, "expected preprocessor identifier"); in handle_ifndef()
1604 return preprocessor_if(stream, token, arg); in handle_ifndef()
1611 static int expression_value(struct token **where) in expression_value()
1614 struct token *p; in expression_value()
1615 struct token **list = where, **beginning = NULL; in expression_value()
1669 static int handle_if(struct stream *stream, struct token **line, struct token *token) in handle_if() argument
1673 value = expression_value(&token->next); in handle_if()
1676 return preprocessor_if(stream, token, value); in handle_if()
1679 static int handle_elif(struct stream * stream, struct token **line, struct token *token) in handle_elif() argument
1681 struct token *top_if = stream->top_if; in handle_elif()
1686 sparse_error(token->pos, "unmatched #elif within stream"); in handle_elif()
1692 sparse_error(token->pos, "#elif after #else"); in handle_elif()
1703 if (!expression_value(&token->next)) in handle_elif()
1712 static int handle_else(struct stream *stream, struct token **line, struct token *token) in handle_else() argument
1714 struct token *top_if = stream->top_if; in handle_else()
1719 sparse_error(token->pos, "unmatched #else within stream"); in handle_else()
1725 sparse_error(token->pos, "#else after #else"); in handle_else()
1737 static int handle_endif(struct stream *stream, struct token **line, struct token *token) in handle_endif() argument
1739 struct token *top_if = stream->top_if; in handle_endif()
1743 sparse_error(token->pos, "unmatched #endif in stream"); in handle_endif()
1753 static int handle_warning(struct stream *stream, struct token **line, struct token *token) in handle_warning() argument
1755 warning(token->pos, "%s", show_token_sequence(token->next, 0)); in handle_warning()
1759 static int handle_error(struct stream *stream, struct token **line, struct token *token) in handle_error() argument
1761 sparse_error(token->pos, "%s", show_token_sequence(token->next, 0)); in handle_error()
1765 static int handle_nostdinc(struct stream *stream, struct token **line, struct token *token) in handle_nostdinc() argument
1808 static void add_path_entry(struct token *token, const char *path, in add_path_entry() argument
1816 error_die(token->pos, "too many include path entries"); in add_path_entry()
1842 static int handle_add_include(struct stream *stream, struct token **line, struct token *token) in handle_add_include() argument
1845 token = token->next; in handle_add_include()
1846 if (eof_token(token)) in handle_add_include()
1848 if (token_type(token) != TOKEN_STRING) { in handle_add_include()
1849 warning(token->pos, "expected path string"); in handle_add_include()
1852 add_path_entry(token, token->string->data, &isys_includepath); in handle_add_include()
1856 static int handle_add_isystem(struct stream *stream, struct token **line, struct token *token) in handle_add_isystem() argument
1859 token = token->next; in handle_add_isystem()
1860 if (eof_token(token)) in handle_add_isystem()
1862 if (token_type(token) != TOKEN_STRING) { in handle_add_isystem()
1863 sparse_error(token->pos, "expected path string"); in handle_add_isystem()
1866 add_path_entry(token, token->string->data, &sys_includepath); in handle_add_isystem()
1870 static int handle_add_system(struct stream *stream, struct token **line, struct token *token) in handle_add_system() argument
1873 token = token->next; in handle_add_system()
1874 if (eof_token(token)) in handle_add_system()
1876 if (token_type(token) != TOKEN_STRING) { in handle_add_system()
1877 sparse_error(token->pos, "expected path string"); in handle_add_system()
1880 add_path_entry(token, token->string->data, &dirafter_includepath); in handle_add_system()
1885 static void add_dirafter_entry(struct token *token, const char *path) in add_dirafter_entry() argument
1891 error_die(token->pos, "too many include path entries"); in add_dirafter_entry()
1901 static int handle_add_dirafter(struct stream *stream, struct token **line, struct token *token) in handle_add_dirafter() argument
1904 token = token->next; in handle_add_dirafter()
1905 if (eof_token(token)) in handle_add_dirafter()
1907 if (token_type(token) != TOKEN_STRING) { in handle_add_dirafter()
1908 sparse_error(token->pos, "expected path string"); in handle_add_dirafter()
1911 add_dirafter_entry(token, token->string->data); in handle_add_dirafter()
1915 static int handle_split_include(struct stream *stream, struct token **line, struct token *token) in handle_split_include() argument
1935 * We replace "#pragma xxx" with "__pragma__" in the token
1939 * is that we can use this to insert arbitrary token sequences
1946 static int handle_pragma(struct stream *stream, struct token **line, struct token *token) in handle_pragma() argument
1948 struct token *next = *line; in handle_pragma()
1950 if (match_ident(token->next, &once_ident) && eof_token(token->next->next)) { in handle_pragma()
1954 token->ident = &pragma_ident; in handle_pragma()
1955 token->pos.newline = 1; in handle_pragma()
1956 token->pos.whitespace = 1; in handle_pragma()
1957 token->pos.pos = 1; in handle_pragma()
1958 *line = token; in handle_pragma()
1959 token->next = next; in handle_pragma()
1966 static int handle_line(struct stream *stream, struct token **line, struct token *token) in handle_line() argument
1971 static int handle_ident(struct stream *stream, struct token **line, struct token *token) in handle_ident() argument
1976 static int handle_nondirective(struct stream *stream, struct token **line, struct token *token) in handle_nondirective() argument
1978 sparse_error(token->pos, "unrecognized preprocessor line '%s'", show_token_sequence(token, 0)); in handle_nondirective()
1982 static bool expand_has_attribute(struct token *token, struct arg *args) in expand_has_attribute() argument
1984 struct token *arg = args[0].expanded; in expand_has_attribute()
1993 replace_with_bool(token, sym && sym->op && sym->op->attribute); in expand_has_attribute()
1997 static bool expand_has_builtin(struct token *token, struct arg *args) in expand_has_builtin() argument
1999 struct token *arg = args[0].expanded; in expand_has_builtin()
2008 replace_with_bool(token, sym && sym->builtin); in expand_has_builtin()
2012 static bool expand_has_extension(struct token *token, struct arg *args) in expand_has_extension() argument
2014 struct token *arg = args[0].expanded; in expand_has_extension()
2033 replace_with_bool(token, val); in expand_has_extension()
2037 static bool expand_has_feature(struct token *token, struct arg *args) in expand_has_feature() argument
2039 struct token *arg = args[0].expanded; in expand_has_feature()
2060 replace_with_bool(token, val); in expand_has_feature()
2066 struct token *token; in create_arglist() local
2067 struct token **next; in create_arglist()
2072 token = __alloc_token(0); in create_arglist()
2073 token_type(token) = TOKEN_ARG_COUNT; in create_arglist()
2074 token->count.normal = count; in create_arglist()
2075 sym->arglist = token; in create_arglist()
2076 next = &token->next; in create_arglist()
2079 struct token *id, *uses; in create_arglist()
2099 int (*handler)(struct stream *, struct token **, struct token *); in init_preprocessor()
2132 void (*expand_simple)(struct token *); in init_preprocessor()
2133 bool (*expand)(struct token *, struct arg *args); in init_preprocessor()
2171 static void handle_preprocessor_line(struct stream *stream, struct token **line, struct token *star… in handle_preprocessor_line()
2173 int (*handler)(struct stream *, struct token **, struct token *); in handle_preprocessor_line()
2174 struct token *token = start->next; in handle_preprocessor_line() local
2178 if (eof_token(token)) in handle_preprocessor_line()
2181 if (token_type(token) == TOKEN_IDENT) { in handle_preprocessor_line()
2182 struct symbol *sym = lookup_symbol(token->ident, NS_PREPROCESSOR); in handle_preprocessor_line()
2190 } else if (token_type(token) == TOKEN_NUMBER) { in handle_preprocessor_line()
2206 if (!handler(stream, line, token)) /* all set */ in handle_preprocessor_line()
2210 free_preprocessor_line(token); in handle_preprocessor_line()
2213 static void preprocessor_line(struct stream *stream, struct token **line) in preprocessor_line()
2215 struct token *start = *line, *next; in preprocessor_line()
2216 struct token **tp = &start->next; in preprocessor_line()
2229 static void do_preprocess(struct token **list) in do_preprocess()
2231 struct token *next; in do_preprocess()
2239 __free_token(next); /* Free the '#' token */ in do_preprocess()
2277 struct token * preprocess(struct token *token) in preprocess() argument
2281 do_preprocess(&token); in preprocess()
2288 return token; in preprocess()
2291 static int is_VA_ARGS_token(struct token *token) in is_VA_ARGS_token() argument
2293 return (token_type(token) == TOKEN_IDENT) && in is_VA_ARGS_token()
2294 (token->ident == &__VA_ARGS___ident); in is_VA_ARGS_token()
2300 struct token *args[nargs]; in dump_macro()
2301 struct token *token; in dump_macro() local
2304 token = sym->arglist; in dump_macro()
2305 if (token) { in dump_macro()
2309 for (; !eof_token(token); token = token->next) { in dump_macro()
2310 if (token_type(token) == TOKEN_ARG_COUNT) in dump_macro()
2312 if (is_VA_ARGS_token(token)) in dump_macro()
2315 printf("%s%s", sep, show_token(token)); in dump_macro()
2316 args[narg++] = token; in dump_macro()
2322 token = sym->expansion; in dump_macro()
2323 while (token_type(token) != TOKEN_UNTAINT) { in dump_macro()
2324 struct token *next = token->next; in dump_macro()
2325 if (token->pos.whitespace) in dump_macro()
2327 switch (token_type(token)) { in dump_macro()
2336 token = args[token->argnum]; in dump_macro()
2339 printf("%s", show_token(token)); in dump_macro()
2341 token = next; in dump_macro()