Lines Matching defs:pos

94 static struct token *alloc_token(struct position *pos)
98 token->pos.stream = pos->stream;
99 token->pos.line = pos->line;
100 token->pos.pos = pos->pos;
101 token->pos.whitespace = 1;
146 sparse_error(token->pos, "expected preprocessor identifier");
165 replace_with_integer(token, token->pos.line);
170 replace_with_string(token, stream_name(token->pos.stream));
214 if (token->pos.noexpand)
258 static struct token *collect_arg(struct token *prev, int vararg, struct position *pos, int count)
260 struct stream *stream = input_streams + prev->pos.stream;
266 if (next->pos.newline && match_op(next, '#')) {
267 if (!next->pos.noexpand) {
297 next->pos.stream = pos->stream;
298 next->pos.line = pos->line;
299 next->pos.pos = pos->pos;
300 next->pos.newline = 0;
329 next = collect_arg(start, 0, &what->pos, 0);
339 next = collect_arg(start, p->vararg, &what->pos, p->normal);
373 sparse_error(what->pos, "macro \"%s\" requires %d arguments, but only %d given",
378 next = collect_arg(next, 0, &what->pos, 0);
383 sparse_error(what->pos, "macro \"%s\" passed %d arguments, but takes just %d",
387 sparse_error(what->pos, "unterminated argument list invoking macro \"%s\"",
422 sparse_error(token->pos, "too long token expansion");
431 whitespace = token->pos.whitespace;
446 token->pos = arg->pos;
552 left->pos.noexpand = 0;
574 left->pos.noexpand = 0;
580 left->pos.noexpand = 0;
587 sparse_error(left->pos, "'##' failed: concatenation is not a valid token");
595 alloc->pos.newline = token->pos.newline;
596 alloc->pos.whitespace = token->pos.whitespace;
598 alloc->pos.noexpand = token->pos.noexpand;
608 token = dup_token(list, &list->pos);
612 token->pos.noexpand = 1;
644 struct position *base_pos = &(*list)->pos;
703 added->pos.newline = body->pos.newline;
704 added->pos.whitespace = body->pos.whitespace;
717 added->pos.noexpand = 1;
756 token->pos.noexpand = 1;
781 (*list)->pos.newline = token->pos.newline;
782 (*list)->pos.whitespace = token->pos.whitespace;
805 sparse_error(start->pos, "expected '>' at end of filename");
899 static int try_include(struct position pos, const char *path, const char *filename, int flen, struct token **where, const char **next_path)
916 *where = tokenize(&pos, streamname, fd, *where, next_path);
928 if (!try_include(token->pos, path, filename, flen, list, pptr))
971 if (try_include(token->pos, "", filename, flen, list, includepath))
994 error_die(token->pos, "unable to open '%s'", filename);
1168 sparse_error(arg->pos, "parameter name missing");
1171 sparse_error(arg->pos, "\"%s\" may not appear in macro parameter list",
1175 sparse_error(arg->pos, "missing ')' in macro parameter list");
1178 sparse_error(arg->pos, "__VA_ARGS__ can only appear in the expansion of a C99 variadic macro");
1181 sparse_error(arg->pos, "too many arguments in macro definition");
1232 next->pos.whitespace = token->pos.whitespace;
1236 token->pos.noexpand = 1;
1241 sparse_error(token->pos, "'#' is not followed by a macro parameter");
1295 sparse_error(concat->pos, "'##' cannot appear at the ends of macro expansion");
1330 token = alloc_token(&expansion->pos);
1338 sparse_error(token->pos, "'##' cannot appear at the ends of macro expansion");
1341 sparse_error(token->pos, "too many instances of argument in body");
1345 static int do_define(struct position pos, struct token *token, struct ident *name,
1369 warning(pos, "preprocessor token %.*s redefined",
1371 info(sym->pos, "this was the original definition");
1378 sym = alloc_symbol(pos, SYM_NODE);
1429 value->pos.whitespace = 1;
1433 do_define(value->pos, NULL, ident, NULL, value, attr);
1477 sparse_error(token->pos, "expected identifier to 'define'");
1485 if (!expansion->pos.whitespace) {
1492 warning(expansion->pos,
1497 return do_define(left->pos, token, name, arglist, expansion, attr);
1521 sparse_error(token->pos, "expected identifier to 'undef'");
1535 sym = alloc_symbol(left->pos, SYM_NODE);
1576 sparse_error(token->pos, "expected preprocessor identifier");
1600 sparse_error(token->pos, "expected preprocessor identifier");
1655 sparse_error(p->pos, "missing ')' after \"defined\"");
1664 sparse_error(p->pos, "garbage at end: %s", show_token_sequence(p, 0));
1686 sparse_error(token->pos, "unmatched #elif within stream");
1692 sparse_error(token->pos, "#elif after #else");
1719 sparse_error(token->pos, "unmatched #else within stream");
1725 sparse_error(token->pos, "#else after #else");
1743 sparse_error(token->pos, "unmatched #endif in stream");
1755 warning(token->pos, "%s", show_token_sequence(token->next, 0));
1761 sparse_error(token->pos, "%s", show_token_sequence(token->next, 0));
1816 error_die(token->pos, "too many include path entries");
1849 warning(token->pos, "expected path string");
1863 sparse_error(token->pos, "expected path string");
1877 sparse_error(token->pos, "expected path string");
1891 error_die(token->pos, "too many include path entries");
1908 sparse_error(token->pos, "expected path string");
1955 token->pos.newline = 1;
1956 token->pos.whitespace = 1;
1957 token->pos.pos = 1;
1978 sparse_error(token->pos, "unrecognized preprocessor line '%s'", show_token_sequence(token, 0));
1988 sparse_error(arg->pos, "identifier expected");
2003 sparse_error(arg->pos, "identifier expected");
2019 sparse_error(arg->pos, "identifier expected");
2044 sparse_error(arg->pos, "identifier expected");
2204 warning(start->pos, "directive in macro's argument list");
2220 if (next->pos.newline)
2234 struct stream *stream = input_streams + next->pos.stream;
2236 if (next->pos.newline && match_op(next, '#')) {
2237 if (!next->pos.noexpand) {
2248 sparse_error(stream->top_if->pos, "unterminated preprocessor conditional");
2325 if (token->pos.whitespace)