call. */
size_t token_pos; /* Offset into src->buffer of token start. */
size_t token_len; /* Length of source for token in bytes. */
- int first_line; /* Line number at token_pos. */
/* For a token obtained through macro expansion, this is just this token.
size_t journal_pos; /* First byte not yet output to journal. */
size_t seg_pos; /* First byte not yet scanned as token. */
- int n_newlines; /* Number of new-lines up to seg_pos. */
+ /* Offset into 'buffer' of starts of lines. */
+ size_t *lines;
+ size_t n_lines, allocated_lines;
+
bool suppress_next_newline;
/* Tokens.
lex_token_get_last_line_number (const struct lex_source *src,
const struct lex_token *token)
{
+ size_t end = token->token_pos + token->token_len
+ return lex_source_ofs_to_line_number (src,
if (token->first_line == 0)
return 0;
else