File tree Expand file tree Collapse file tree 4 files changed +7
-12
lines changed Expand file tree Collapse file tree 4 files changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,8 @@ Span_Size Diag_List::size() const {
81
81
}
82
82
83
83
bool Diag_List::reported_any_diagnostic_except_since (
84
- std::initializer_list<Diag_Type> ignored_types, const Rewind_State &r) {
84
+ std::initializer_list<Diag_Type> ignored_types,
85
+ const Rewind_State &r) const {
85
86
for (Node_Base *node = r.last_ == nullptr ? this ->first_ : r.last_ ;
86
87
node != nullptr ; node = node->next ) {
87
88
if (!contains (ignored_types, node->type )) {
Original file line number Diff line number Diff line change @@ -70,7 +70,8 @@ class Diag_List {
70
70
Span_Size size () const ;
71
71
72
72
bool reported_any_diagnostic_except_since (
73
- std::initializer_list<Diag_Type> ignored_types, const Rewind_State &);
73
+ std::initializer_list<Diag_Type> ignored_types,
74
+ const Rewind_State &) const ;
74
75
bool have_diagnostic (Diag_Type type) const ;
75
76
76
77
// Removes all diagnostics, but does not deallocate memory.
Original file line number Diff line number Diff line change @@ -1252,7 +1252,7 @@ void Lexer::roll_back_transaction(Lexer_Transaction&& transaction) {
1252
1252
this ->last_last_token_end_ = transaction.old_last_last_token_end ;
1253
1253
this ->input_ = transaction.old_input ;
1254
1254
1255
- this ->diag_list_ . diags () .rewind (std::move (transaction.diag_list_rewind ));
1255
+ this ->diags_ .rewind (std::move (transaction.diag_list_rewind ));
1256
1256
}
1257
1257
1258
1258
bool Lexer::transaction_has_lex_diagnostics (const Lexer_Transaction& transaction) const {
Original file line number Diff line number Diff line change @@ -144,12 +144,7 @@ class Lexer {
144
144
bool test_for_regexp (const Char8* regexp_begin);
145
145
146
146
// Returns all the diagnostics reported so far by the the lexer.
147
- Diag_List& diags () { return this ->diag_list_ .diags (); }
148
-
149
- // TODO(#1154): Delete.
150
- Diag_List_Diag_Reporter& diag_list_diag_reporter () {
151
- return this ->diag_list_ ;
152
- }
147
+ Diag_List& diags () { return this ->diags_ ; }
153
148
154
149
// Save lexer state.
155
150
//
@@ -348,9 +343,7 @@ class Lexer {
348
343
349
344
Monotonic_Allocator allocator_{" lexer::allocator_" };
350
345
351
- Diag_List_Diag_Reporter diag_list_ =
352
- Diag_List_Diag_Reporter (&this ->allocator_);
353
- Diag_List& diags_ = diag_list_.diags();
346
+ Diag_List diags_ = Diag_List(&this ->allocator_);
354
347
355
348
friend struct Lex_Tables ;
356
349
};
You can’t perform that action at this time.
0 commit comments