aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/expand/rust-macro-invoc-lexer.cc
blob: 8a43d29e0d123440b4e9314d7030b278e6633fd6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include "rust-macro-invoc-lexer.h"

namespace Rust {

const_TokenPtr
MacroInvocLexer::peek_token (int n)
{
  if ((offs + n) >= token_stream.size ())
    return Token::make (END_OF_FILE, Location ());

  return token_stream.at (offs + n)->get_tok_ptr ();
}

// Advances current token to n + 1 tokens ahead of current position.
void
MacroInvocLexer::skip_token (int n)
{
  offs += (n + 1);
}

void
MacroInvocLexer::split_current_token (TokenId new_left __attribute__ ((unused)),
				      TokenId new_right
				      __attribute__ ((unused)))
{
  // FIXME
  gcc_unreachable ();
}
} // namespace Rust