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

Unified Diff: mojo/public/tools/bindings/pylib/mojom/parse/ast.py

Issue 382553004: Mojo: Mojom: Add AST types for imports and import lists. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 6 years, 5 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 | mojo/public/tools/bindings/pylib/mojom/parse/parser.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/tools/bindings/pylib/mojom/parse/ast.py
diff --git a/mojo/public/tools/bindings/pylib/mojom/parse/ast.py b/mojo/public/tools/bindings/pylib/mojom/parse/ast.py
index 846aae785785eb7e6ba2fb31cf984a388a5b3329..5df77bf3d4a82105cd870730ecbfcc515e66183b 100644
--- a/mojo/public/tools/bindings/pylib/mojom/parse/ast.py
+++ b/mojo/public/tools/bindings/pylib/mojom/parse/ast.py
@@ -83,6 +83,24 @@ class AttributeList(NodeListBase):
_list_item_type = Attribute
+class Import(NodeBase):
+ """Represents an import statement."""
+
+ def __init__(self, import_filename, **kwargs):
+ assert isinstance(import_filename, str)
+ NodeBase.__init__(self, **kwargs)
+ self.import_filename = import_filename
+
+ def __eq__(self, other):
+ return self.import_filename == other.import_filename
+
+
+class ImportList(NodeListBase):
+ """Represents a list (i.e., sequence) of import statements."""
+
+ _list_item_type = Import
+
+
class Module(NodeBase):
"""Represents a module statement."""
« no previous file with comments | « no previous file | mojo/public/tools/bindings/pylib/mojom/parse/parser.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698