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

Unified Diff: mojo/public/bindings/parse/mojo_parser.py

Issue 99623010: Add support for enums within structs and interfaces to mojom. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 11 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 | « mojo/public/bindings/generators/mojom_data.py ('k') | mojo/public/bindings/parse/mojo_translate.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/bindings/parse/mojo_parser.py
diff --git a/mojo/public/bindings/parse/mojo_parser.py b/mojo/public/bindings/parse/mojo_parser.py
index 3322c0fe4f1fee5e93d2f2b328128f4845daa20a..3e8e991b51f447b9ae8972538881944ddfdbc310 100755
--- a/mojo/public/bindings/parse/mojo_parser.py
+++ b/mojo/public/bindings/parse/mojo_parser.py
@@ -184,12 +184,13 @@ class Parser(object):
p[0] = ('ATTRIBUTE', p[1], p[3])
def p_struct(self, p):
- """struct : attribute_section STRUCT NAME LCURLY fields RCURLY SEMICOLON"""
+ """struct : attribute_section STRUCT NAME LCURLY struct_body RCURLY SEMICOLON"""
p[0] = ('STRUCT', p[3], p[1], p[5])
- def p_fields(self, p):
- """fields : field fields
- |"""
+ def p_struct_body(self, p):
+ """struct_body : field struct_body
+ | enum struct_body
+ |"""
if len(p) > 1:
p[0] = ListFromConcat(p[1], p[2])
@@ -198,12 +199,13 @@ class Parser(object):
p[0] = ('FIELD', p[1], p[2], p[3])
def p_interface(self, p):
- """interface : attribute_section INTERFACE NAME LCURLY methods RCURLY SEMICOLON"""
+ """interface : attribute_section INTERFACE NAME LCURLY interface_body RCURLY SEMICOLON"""
p[0] = ('INTERFACE', p[3], p[1], p[5])
- def p_methods(self, p):
- """methods : method methods
- | """
+ def p_interface_body(self, p):
+ """interface_body : method interface_body
+ | enum interface_body
+ | """
if len(p) > 1:
p[0] = ListFromConcat(p[1], p[2])
« no previous file with comments | « mojo/public/bindings/generators/mojom_data.py ('k') | mojo/public/bindings/parse/mojo_translate.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698