Index: src/parsing/scanner.h |
diff --git a/src/parsing/scanner.h b/src/parsing/scanner.h |
index 075b9ca6b2ba0c1d9468e7eef7e3598c85a5cd36..a2996e420a1c3fe8908cfd316bad4564f3a19ffe 100644 |
--- a/src/parsing/scanner.h |
+++ b/src/parsing/scanner.h |
@@ -209,10 +209,17 @@ class Scanner { |
// (the token last returned by Next()). |
Location location() const { return current_.location; } |
+ // This error is specifically an invalid hex or unicode escape sequence. |
bool has_error() const { return scanner_error_ != MessageTemplate::kNone; } |
MessageTemplate::Template error() const { return scanner_error_; } |
Location error_location() const { return scanner_error_location_; } |
+ void clear_error() { |
+ DCHECK(has_error()); |
+ scanner_error_ = MessageTemplate::kNone; |
+ scanner_error_location_ = Location(); |
+ } |
+ |
// Similar functions for the upcoming token. |
// One token look-ahead (past the token returned by Next()). |