Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(569)

Unified Diff: src/parsing/parser-base.h

Issue 2179423002: [parser] Refactor parser and preparser traits (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: More changes after reviewers' comments Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/parsing/parser.cc ('k') | src/parsing/preparser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser-base.h
diff --git a/src/parsing/parser-base.h b/src/parsing/parser-base.h
index 192235dd77ca84b87495b48042e8c1a52f13f4dc..a01253b26caf56c9b61deaf5d63ab0e96d0964e3 100644
--- a/src/parsing/parser-base.h
+++ b/src/parsing/parser-base.h
@@ -869,11 +869,31 @@ class ParserBase : public Traits {
Traits::ReportMessageAt(source_location, message, arg, error_type);
}
+ void ReportMessage(MessageTemplate::Template message, const AstRawString* arg,
+ ParseErrorType error_type = kSyntaxError) {
+ Scanner::Location source_location = scanner()->location();
+ Traits::ReportMessageAt(source_location, message, arg, error_type);
+ }
+
+ void ReportMessageAt(Scanner::Location location,
+ MessageTemplate::Template message,
+ const char* arg = NULL,
+ ParseErrorType error_type = kSyntaxError) {
+ Traits::ReportMessageAt(location, message, arg, error_type);
+ }
+
void ReportMessageAt(Scanner::Location location,
MessageTemplate::Template message,
+ const AstRawString* arg,
ParseErrorType error_type = kSyntaxError) {
- Traits::ReportMessageAt(location, message, reinterpret_cast<const char*>(0),
- error_type);
+ Traits::ReportMessageAt(location, message, arg, error_type);
+ }
+
+ void ReportMessageAt(Scanner::Location location,
+ MessageTemplate::Template message,
+ ParseErrorType error_type) {
+ ReportMessageAt(location, message, static_cast<const char*>(nullptr),
+ error_type);
}
void GetUnexpectedTokenMessage(
« no previous file with comments | « src/parsing/parser.cc ('k') | src/parsing/preparser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698