diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2022-02-18 14:43:08 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-18 14:43:08 +0000 |
commit | 31387e76090007b12da82d7ef11b042e88df0ba5 (patch) | |
tree | f17c983fd3f00f44830ee9ec9cc8a00894e3fdc2 /gcc | |
parent | 425905b49ae04bf0e00be95caa01fd6d2cc8e74c (diff) | |
parent | 5f35a8c63780f5033c168d3c32bf68d203695e8d (diff) | |
download | gcc-31387e76090007b12da82d7ef11b042e88df0ba5.zip gcc-31387e76090007b12da82d7ef11b042e88df0ba5.tar.gz gcc-31387e76090007b12da82d7ef11b042e88df0ba5.tar.bz2 |
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 <arthur.cohen@embecosm.com>
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/parse/rust-parse.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/rust/parse/rust-parse.h b/gcc/rust/parse/rust-parse.h index 17440d5..438ab41 100644 --- a/gcc/rust/parse/rust-parse.h +++ b/gcc/rust/parse/rust-parse.h @@ -603,6 +603,7 @@ private: bool done_end_of_file (); void add_error (Error error) { error_table.push_back (std::move (error)); } + void clear_errors () { error_table.clear (); } public: // Construct parser with specified "managed" token source. |