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

Unified Diff: src/ast/ast.h

Issue 1801633003: Add parsing for type queries (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@types
Patch Set: Created 4 years, 9 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/parsing/parser.h » ('j') | src/parsing/parser-base.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/ast.h
diff --git a/src/ast/ast.h b/src/ast/ast.h
index 2b3dbad5d57504c5493a7809e010f86c9fc1c26e..7a0ec8be03d0ce93cf293b889a322933660e0a10 100644
--- a/src/ast/ast.h
+++ b/src/ast/ast.h
@@ -111,6 +111,7 @@ namespace internal {
V(FormalParameter) \
V(TypeReference) \
V(StringLiteralType) \
+ V(QueryType) \
V(TypeOrParameters)
// Forward declarations
@@ -3153,6 +3154,26 @@ class StringLiteralType : public Type {
};
+class QueryType : public Type {
+ public:
+ DECLARE_NODE_TYPE(QueryType)
+
+ const AstRawString* name() const { return name_; }
+ ZoneList<const AstRawString*>* property_names() const {
+ return property_names_;
+ }
+
+ protected:
+ QueryType(Zone* zone, const AstRawString* name,
+ ZoneList<const AstRawString*>* property_names, int pos)
+ : Type(zone, pos), name_(name), property_names_(property_names) {}
+
+ private:
+ const AstRawString* name_;
+ ZoneList<const AstRawString*>* property_names_;
+};
+
+
class TypeOrParameters : public Type {
public:
DECLARE_NODE_TYPE(TypeOrParameters)
@@ -3798,6 +3819,13 @@ class AstNodeFactory final BASE_EMBEDDED {
typesystem::StringLiteralType(local_zone_, string, pos);
}
+ typesystem::QueryType* NewQueryType(
+ const AstRawString* name, ZoneList<const AstRawString*>* property_names,
+ int pos) {
+ return new (local_zone_)
+ typesystem::QueryType(local_zone_, name, property_names, pos);
+ }
+
typesystem::FormalParameter* NewFormalParameter(const AstRawString* name,
bool optional, bool spread,
typesystem::Type* type,
« no previous file with comments | « no previous file | src/parsing/parser.h » ('j') | src/parsing/parser-base.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698