aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/expand/rust-macro-invoc-lexer.cc
diff options
context:
space:
mode:
authorArthur Cohen <arthur.cohen@embecosm.com>2022-02-21 17:23:48 +0100
committerArthur Cohen <arthur.cohen@embecosm.com>2022-02-21 17:27:56 +0100
commit4e19c2f792e14c2a047a53c913a73d79f91ff277 (patch)
tree4d5320a427a276b1588b296ae0aeb42d071cc6bb /gcc/rust/expand/rust-macro-invoc-lexer.cc
parent796465596faa9fa69ffede1c16d944e6a6e24458 (diff)
downloadgcc-4e19c2f792e14c2a047a53c913a73d79f91ff277.zip
gcc-4e19c2f792e14c2a047a53c913a73d79f91ff277.tar.gz
gcc-4e19c2f792e14c2a047a53c913a73d79f91ff277.tar.bz2
macro-invoc-lexer: Split implementation in its own file
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