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

Unified Diff: src/ast.h

Issue 1286383005: Parse arrow functions at proper precedence level (Closed) Base URL: https://chromium.googlesource.com/v8/v8@master
Patch Set: Fix nits Created 5 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 | « no previous file | src/ast-literal-reindexer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast.h
diff --git a/src/ast.h b/src/ast.h
index 1366041387215bc4c018c4b1650d39ff5f6549c4..6e9390f6e3f62ebfe9d168b25993ffb0fef3a47c 100644
--- a/src/ast.h
+++ b/src/ast.h
@@ -88,7 +88,8 @@ namespace internal {
V(ThisFunction) \
V(SuperPropertyReference) \
V(SuperCallReference) \
- V(CaseClause)
+ V(CaseClause) \
+ V(EmptyParentheses)
#define AST_NODE_LIST(V) \
DECLARATION_NODE_LIST(V) \
@@ -2848,6 +2849,17 @@ class SuperCallReference final : public Expression {
};
+// This class is produced when parsing the () in arrow functions without any
+// arguments and is not actually a valid expression.
+class EmptyParentheses final : public Expression {
+ public:
+ DECLARE_NODE_TYPE(EmptyParentheses)
+
+ private:
+ EmptyParentheses(Zone* zone, int pos) : Expression(zone, pos) {}
+};
+
+
#undef DECLARE_NODE_TYPE
@@ -3633,6 +3645,10 @@ class AstNodeFactory final BASE_EMBEDDED {
this_function_var, pos);
}
+ EmptyParentheses* NewEmptyParentheses(int pos) {
+ return new (zone_) EmptyParentheses(zone_, pos);
+ }
+
private:
Zone* zone_;
AstValueFactory* ast_value_factory_;
« no previous file with comments | « no previous file | src/ast-literal-reindexer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698