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

Unified Diff: tools/dom/scripts/idlparser.py

Issue 12079101: Allow parsing of enum declarations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/scripts/idlparser.py
diff --git a/tools/dom/scripts/idlparser.py b/tools/dom/scripts/idlparser.py
index fa905762574eac4cb28c0d308a667c4a23dabdcf..a3ee82f6aee4126f911d326cbf89ccb27c12e1e1 100755
--- a/tools/dom/scripts/idlparser.py
+++ b/tools/dom/scripts/idlparser.py
@@ -68,9 +68,15 @@ class IDLParser(object):
return syntax_switch(
# Web IDL:
OR(Module, Interface, ExceptionDef, TypeDef, ImplStmt,
- ValueTypeDef, Const),
+ ValueTypeDef, Const, Enum),
# WebKit:
- OR(Module, Interface))
+ OR(Module, Interface, Enum))
+
+ def Enum():
+ def StringLiteral():
+ return re.compile(r'"\w+"')
+
+ return ['enum', Id, '{', MAYBE(MANY(StringLiteral, ',')), '}', ';']
def Module():
return syntax_switch(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698