Skip to content

Commit 31387e7

Browse files
Merge #944
944: parser: Add `clear_errors()` method r=CohenArthur a=CohenArthur Clears all errors from the error table so we can reuse the parser in later situations. I'm unsure whether or not the method should also emit all of the errors if present? In that case, we might want to rename it or add another wrapper that emits then clears Co-authored-by: Arthur Cohen <[email protected]>
2 parents 425905b + 5f35a8c commit 31387e7

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

gcc/rust/parse/rust-parse.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,7 @@ template <typename ManagedTokenSource> class Parser
603603
bool done_end_of_file ();
604604

605605
void add_error (Error error) { error_table.push_back (std::move (error)); }
606+
void clear_errors () { error_table.clear (); }
606607

607608
public:
608609
// Construct parser with specified "managed" token source.

0 commit comments

Comments
 (0)