File tree 2 files changed +3
-28
lines changed
2 files changed +3
-28
lines changed Original file line number Diff line number Diff line change @@ -30,13 +30,6 @@ ProcMacroInvocLexer::peek_token (int n)
30
30
return token_stream.at (offs + n);
31
31
}
32
32
33
- // Advances current token to n + 1 tokens ahead of current position.
34
- void
35
- ProcMacroInvocLexer::skip_token (int n)
36
- {
37
- offs += (n + 1 );
38
- }
39
-
40
33
void
41
34
ProcMacroInvocLexer::split_current_token (TokenId new_left, TokenId new_right)
42
35
{
Original file line number Diff line number Diff line change 20
20
#define RUST_PROC_MACRO_INVOC_LEXER_H
21
21
22
22
#include " rust-lex.h"
23
+ #include " rust-macro-invoc-lexer.h"
23
24
24
25
namespace Rust {
25
- class ProcMacroInvocLexer
26
+ class ProcMacroInvocLexer : public MacroInvocLexerBase <const_TokenPtr>
26
27
{
27
28
public:
28
29
ProcMacroInvocLexer (std::vector<const_TokenPtr> stream)
29
- : offs ( 0 ), token_stream (std::move (stream))
30
+ : MacroInvocLexerBase (std::move (stream))
30
31
{}
31
32
32
33
// Returns token n tokens ahead of current position.
@@ -35,29 +36,10 @@ class ProcMacroInvocLexer
35
36
// Peeks the current token.
36
37
const_TokenPtr peek_token () { return peek_token (0 ); }
37
38
38
- // Advances current token to n + 1 tokens ahead of current position.
39
- void skip_token (int n);
40
-
41
- // Skips the current token.
42
- void skip_token () { skip_token (0 ); }
43
-
44
39
// Splits the current token into two. Intended for use with nested generics
45
40
// closes (i.e. T<U<X>> where >> is wrongly lexed as one token). Note that
46
41
// this will only work with "simple" tokens like punctuation.
47
42
void split_current_token (TokenId new_left, TokenId new_right);
48
-
49
- std::string get_filename () const
50
- {
51
- // FIXME
52
- rust_unreachable ();
53
- return " FIXME" ;
54
- }
55
-
56
- size_t get_offs () const { return offs; }
57
-
58
- private:
59
- size_t offs;
60
- std::vector<const_TokenPtr> token_stream;
61
43
};
62
44
} // namespace Rust
63
45
You can’t perform that action at this time.
0 commit comments