aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/expand/rust-macro-invoc-lexer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/rust/expand/rust-macro-invoc-lexer.cc')
-rw-r--r--gcc/rust/expand/rust-macro-invoc-lexer.cc29
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc/rust/expand/rust-macro-invoc-lexer.cc b/gcc/rust/expand/rust-macro-invoc-lexer.cc
new file mode 100644
index 0000000..8a43d29
--- /dev/null
+++ b/gcc/rust/expand/rust-macro-invoc-lexer.cc
@@ -0,0 +1,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