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

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

Issue 378383002: Mojo: Mojom: Add an AST node type for the module "statement". (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 9f3088e3fc1ea7d0fa43bfbeb80b90fe6062c0e4..846aae785785eb7e6ba2fb31cf984a388a5b3329 100644
--- a/mojo/public/tools/bindings/pylib/mojom/parse/ast.py
+++ b/mojo/public/tools/bindings/pylib/mojom/parse/ast.py
@@ -83,6 +83,22 @@ class AttributeList(NodeListBase):
_list_item_type = Attribute
+class Module(NodeBase):
+ """Represents a module statement."""
+
+ def __init__(self, name, attribute_list, **kwargs):
+ # |name| is either none or a "wrapped identifier".
+ assert name is None or isinstance(name, tuple)
+ assert attribute_list is None or isinstance(attribute_list, AttributeList)
+ NodeBase.__init__(self, **kwargs)
+ self.name = name
+ self.attribute_list = attribute_list
+
+ def __eq__(self, other):
+ return self.name == other.name and \
+ self.attribute_list == other.attribute_list
+
+
class Ordinal(NodeBase):
"""Represents an ordinal value labeling, e.g., a struct field."""
« 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