| OLD | NEW |
| 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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 return syntax_switch( | 209 return syntax_switch( |
| 210 # Web IDL: | 210 # Web IDL: |
| 211 ['setraises', '(', _ScopedNames, ')'], | 211 ['setraises', '(', _ScopedNames, ')'], |
| 212 # WebKit: | 212 # WebKit: |
| 213 ['setter', 'raises', '(', _ScopedNames, ')']) | 213 ['setter', 'raises', '(', _ScopedNames, ')']) |
| 214 | 214 |
| 215 # Operation: | 215 # Operation: |
| 216 def Operation(): | 216 def Operation(): |
| 217 return syntax_switch( | 217 return syntax_switch( |
| 218 # Web IDL: | 218 # Web IDL: |
| 219 [MAYBE(ExtAttrs), MAYBE(Stringifier), MAYBE(_Specials), | 219 [MAYBE(ExtAttrs), MAYBE(Static), MAYBE(Stringifier), MAYBE(_Specials), |
| 220 ReturnType, MAYBE(Id), '(', _Arguments, ')', MAYBE(Raises), | 220 ReturnType, MAYBE(Id), '(', _Arguments, ')', MAYBE(Raises), |
| 221 ';'], | 221 ';'], |
| 222 # WebKit: | 222 # WebKit: |
| 223 [MAYBE(ExtAttrs), ReturnType, MAYBE(Id), '(', _Arguments, ')', | 223 [MAYBE(ExtAttrs), MAYBE(Static), |
| 224 ReturnType, MAYBE(Id), '(', _Arguments, ')', |
| 224 MAYBE(Raises), ';'], | 225 MAYBE(Raises), ';'], |
| 225 # FremontCut: | 226 # FremontCut: |
| 226 [MAYBE(_Annotations), MAYBE(ExtAttrs), MAYBE(Stringifier), | 227 [MAYBE(_Annotations), MAYBE(ExtAttrs), MAYBE(Static), MAYBE(Stringifier)
, |
| 227 MAYBE(_Specials), ReturnType, MAYBE(Id), '(', _Arguments, ')', | 228 MAYBE(_Specials), ReturnType, MAYBE(Id), '(', _Arguments, ')', |
| 228 MAYBE(Raises), ';']) | 229 MAYBE(Raises), ';']) |
| 229 | 230 |
| 231 def Static(): |
| 232 return 'static' |
| 233 |
| 230 def _Specials(): | 234 def _Specials(): |
| 231 return MANY(Special) | 235 return MANY(Special) |
| 232 | 236 |
| 233 def Special(): | 237 def Special(): |
| 234 return re.compile(r'getter|setter|creator|deleter|caller') | 238 return re.compile(r'getter|setter|creator|deleter|caller') |
| 235 | 239 |
| 236 def Stringifier(): | 240 def Stringifier(): |
| 237 return 'stringifier' | 241 return 'stringifier' |
| 238 | 242 |
| 239 def Raises(): | 243 def Raises(): |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 Args: | 436 Args: |
| 433 content -- text to parse. | 437 content -- text to parse. |
| 434 defines -- an array of pre-processor defines. | 438 defines -- an array of pre-processor defines. |
| 435 includePaths -- an array of path strings used by the | 439 includePaths -- an array of path strings used by the |
| 436 gcc pre-processor. | 440 gcc pre-processor. |
| 437 """ | 441 """ |
| 438 if self._syntax == WEBKIT_SYNTAX: | 442 if self._syntax == WEBKIT_SYNTAX: |
| 439 content = self._pre_process(content, defines, includePaths) | 443 content = self._pre_process(content, defines, includePaths) |
| 440 | 444 |
| 441 return self._pegparser.parse(content) | 445 return self._pegparser.parse(content) |
| OLD | NEW |