| 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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 # Operation arguments: | 227 # Operation arguments: |
| 228 def _Arguments(): | 228 def _Arguments(): |
| 229 return MAYBE(MANY(Argument, ',')) | 229 return MAYBE(MANY(Argument, ',')) |
| 230 | 230 |
| 231 def Argument(): | 231 def Argument(): |
| 232 return syntax_switch( | 232 return syntax_switch( |
| 233 # Web IDL: | 233 # Web IDL: |
| 234 [MAYBE(ExtAttrs), MAYBE(Optional), MAYBE('in'), | 234 [MAYBE(ExtAttrs), MAYBE(Optional), MAYBE('in'), |
| 235 MAYBE(Optional), Type, MAYBE(AnEllipsis), Id], | 235 MAYBE(Optional), Type, MAYBE(AnEllipsis), Id], |
| 236 # WebKit: | 236 # WebKit: |
| 237 # TODO(antonm): cleanup this mess. |
| 237 [MAYBE(Optional), MAYBE('in'), MAYBE(Optional), | 238 [MAYBE(Optional), MAYBE('in'), MAYBE(Optional), |
| 238 MAYBE(ExtAttrs), Type, Id]) | 239 MAYBE(ExtAttrs), MAYBE(Optional), Type, Id]) |
| 239 | 240 |
| 240 def Optional(): | 241 def Optional(): |
| 241 return 'optional' | 242 return 'optional' |
| 242 | 243 |
| 243 def AnEllipsis(): | 244 def AnEllipsis(): |
| 244 return '...' | 245 return '...' |
| 245 | 246 |
| 246 # Exceptions (Web IDL). | 247 # Exceptions (Web IDL). |
| 247 def ExceptionDef(): | 248 def ExceptionDef(): |
| 248 return ['exception', Id, '{', MAYBE(MANY(_ExceptionMember)), '}', | 249 return ['exception', Id, '{', MAYBE(MANY(_ExceptionMember)), '}', |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 Args: | 412 Args: |
| 412 content -- text to parse. | 413 content -- text to parse. |
| 413 defines -- an array of pre-processor defines. | 414 defines -- an array of pre-processor defines. |
| 414 includePaths -- an array of path strings used by the | 415 includePaths -- an array of path strings used by the |
| 415 gcc pre-processor. | 416 gcc pre-processor. |
| 416 """ | 417 """ |
| 417 if self._syntax == WEBKIT_SYNTAX: | 418 if self._syntax == WEBKIT_SYNTAX: |
| 418 content = self._pre_process(content, defines, includePaths) | 419 content = self._pre_process(content, defines, includePaths) |
| 419 | 420 |
| 420 return self._pegparser.parse(content) | 421 return self._pegparser.parse(content) |
| OLD | NEW |