| 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 copy | 6 import copy |
| 7 import database | 7 import database |
| 8 import idlparser | 8 import idlparser |
| 9 import logging | 9 import logging |
| 10 import multiprocessing | 10 import multiprocessing |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 | 60 |
| 61 def _load_idl_file(file_name, import_options): | 61 def _load_idl_file(file_name, import_options): |
| 62 """Loads an IDL file into memory""" | 62 """Loads an IDL file into memory""" |
| 63 idl_parser = idlparser.IDLParser(import_options.idl_syntax) | 63 idl_parser = idlparser.IDLParser(import_options.idl_syntax) |
| 64 | 64 |
| 65 try: | 65 try: |
| 66 f = open(file_name, 'r') | 66 f = open(file_name, 'r') |
| 67 content = f.read() | 67 content = f.read() |
| 68 f.close() | 68 f.close() |
| 69 | 69 |
| 70 idl_ast = idl_parser.parse( | 70 idl_ast = idl_parser.parse(content) |
| 71 content, | |
| 72 defines=import_options.idl_defines) | |
| 73 return IDLFile(idl_ast, file_name) | 71 return IDLFile(idl_ast, file_name) |
| 74 except SyntaxError, e: | 72 except SyntaxError, e: |
| 75 raise RuntimeError('Failed to load file %s: %s: Content: %s[end]' | 73 raise RuntimeError('Failed to load file %s: %s: Content: %s[end]' |
| 76 % (file_name, e, content)) | 74 % (file_name, e, content)) |
| 77 | 75 |
| 78 | 76 |
| 79 class DatabaseBuilder(object): | 77 class DatabaseBuilder(object): |
| 80 def __init__(self, database): | 78 def __init__(self, database): |
| 81 """DatabaseBuilder is used for importing and merging interfaces into | 79 """DatabaseBuilder is used for importing and merging interfaces into |
| 82 the Database""" | 80 the Database""" |
| (...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 # TODO(antonm): Ideally we'd like to have pristine copy of WebKit IDLs and
fetch | 567 # TODO(antonm): Ideally we'd like to have pristine copy of WebKit IDLs and
fetch |
| 570 # this information directly from it. Unfortunately right now database is
massaged | 568 # this information directly from it. Unfortunately right now database is
massaged |
| 571 # a lot so it's difficult to maintain necessary information on Window itse
lf. | 569 # a lot so it's difficult to maintain necessary information on Window itse
lf. |
| 572 interface = self._database.GetInterface(type) | 570 interface = self._database.GetInterface(type) |
| 573 if 'V8EnabledPerContext' in attr.ext_attrs: | 571 if 'V8EnabledPerContext' in attr.ext_attrs: |
| 574 interface.ext_attrs['synthesizedV8EnabledPerContext'] = \ | 572 interface.ext_attrs['synthesizedV8EnabledPerContext'] = \ |
| 575 attr.ext_attrs['V8EnabledPerContext'] | 573 attr.ext_attrs['V8EnabledPerContext'] |
| 576 if 'V8EnabledAtRuntime' in attr.ext_attrs: | 574 if 'V8EnabledAtRuntime' in attr.ext_attrs: |
| 577 interface.ext_attrs['synthesizedV8EnabledAtRuntime'] = \ | 575 interface.ext_attrs['synthesizedV8EnabledAtRuntime'] = \ |
| 578 attr.ext_attrs['V8EnabledAtRuntime'] or attr.id | 576 attr.ext_attrs['V8EnabledAtRuntime'] or attr.id |
| OLD | NEW |