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

Side by Side Diff: lib/dom/scripts/idlparser.py

Issue 10317037: Make interface definitions accept both 'interface' and 'exception' as a keyword. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 2 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
3 # for details. All rights reserved. Use of this source code is governed by a 3 # for details. All rights reserved. Use of this source code is governed by a
4 # BSD-style license that can be found in the LICENSE file. 4 # BSD-style license that can be found in the LICENSE file.
5 5
6 import re 6 import re
7 import subprocess 7 import subprocess
8 import tempfile 8 import tempfile
9 9
10 from pegparser import * 10 from pegparser import *
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 # FremontCut: 83 # FremontCut:
84 [MAYBE(_Annotations), MAYBE(ExtAttrs), 'module', Id, 84 [MAYBE(_Annotations), MAYBE(ExtAttrs), 'module', Id,
85 '{', _Definitions, '}', MAYBE(';')]) 85 '{', _Definitions, '}', MAYBE(';')])
86 86
87 def Interface(): 87 def Interface():
88 return syntax_switch( 88 return syntax_switch(
89 # Web IDL: 89 # Web IDL:
90 [MAYBE(ExtAttrs), 'interface', Id, MAYBE(_ParentInterfaces), 90 [MAYBE(ExtAttrs), 'interface', Id, MAYBE(_ParentInterfaces),
91 MAYBE(['{', MAYBE(MANY(_Member)), '}']), ';'], 91 MAYBE(['{', MAYBE(MANY(_Member)), '}']), ';'],
92 # WebKit: 92 # WebKit:
93 ['interface', MAYBE(ExtAttrs), Id, MAYBE(_ParentInterfaces), 93 [OR('interface', 'exception'), MAYBE(ExtAttrs), Id, MAYBE(_ParentInterfa ces),
94 MAYBE(['{', MAYBE(MANY(_Member)), '}']), MAYBE(';')], 94 MAYBE(['{', MAYBE(MANY(_Member)), '}']), MAYBE(';')],
95 # FremontCut: 95 # FremontCut:
96 [MAYBE(_Annotations), MAYBE(ExtAttrs), 'interface', 96 [MAYBE(_Annotations), MAYBE(ExtAttrs), 'interface',
97 Id, MAYBE(_ParentInterfaces), MAYBE(['{', MAYBE(MANY(_Member)), 97 Id, MAYBE(_ParentInterfaces), MAYBE(['{', MAYBE(MANY(_Member)),
98 '}']), ';']) 98 '}']), ';'])
99 99
100 def _Member(): 100 def _Member():
101 return syntax_switch( 101 return syntax_switch(
102 # Web IDL: 102 # Web IDL:
103 OR(Const, Attribute, Operation, ExtAttrs), 103 OR(Const, Attribute, Operation, ExtAttrs),
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 Args: 433 Args:
434 content -- text to parse. 434 content -- text to parse.
435 defines -- an array of pre-processor defines. 435 defines -- an array of pre-processor defines.
436 includePaths -- an array of path strings used by the 436 includePaths -- an array of path strings used by the
437 gcc pre-processor. 437 gcc pre-processor.
438 """ 438 """
439 if self._syntax == WEBKIT_SYNTAX: 439 if self._syntax == WEBKIT_SYNTAX:
440 content = self._pre_process(content, defines, includePaths) 440 content = self._pre_process(content, defines, includePaths)
441 441
442 return self._pegparser.parse(content) 442 return self._pegparser.parse(content)
OLDNEW
« 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