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

Side by Side Diff: tools/dom/scripts/databasebuilder.py

Issue 14049015: Allow spaces around conditions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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 | tools/dom/scripts/fremontcutbuilder.py » ('j') | 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 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 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 def _is_node_enabled(self, node, idl_defines): 467 def _is_node_enabled(self, node, idl_defines):
468 if not 'Conditional' in node.ext_attrs: 468 if not 'Conditional' in node.ext_attrs:
469 return True 469 return True
470 470
471 def enabled(condition): 471 def enabled(condition):
472 return 'ENABLE_%s' % condition in idl_defines 472 return 'ENABLE_%s' % condition in idl_defines
473 473
474 conditional = node.ext_attrs['Conditional'] 474 conditional = node.ext_attrs['Conditional']
475 if conditional.find('&') != -1: 475 if conditional.find('&') != -1:
476 for condition in conditional.split('&'): 476 for condition in conditional.split('&'):
477 condition = condition.strip()
477 self.conditionals_met.add(condition) 478 self.conditionals_met.add(condition)
478 if not enabled(condition): 479 if not enabled(condition):
479 return False 480 return False
480 return True 481 return True
481 482
482 for condition in conditional.split('|'): 483 for condition in conditional.split('|'):
484 condition = condition.strip()
483 self.conditionals_met.add(condition) 485 self.conditionals_met.add(condition)
484 if enabled(condition): 486 if enabled(condition):
485 return True 487 return True
486 return False 488 return False
487 489
488 def fix_displacements(self, source): 490 def fix_displacements(self, source):
489 """E.g. In W3C, something is declared on HTMLDocument but in WebKit 491 """E.g. In W3C, something is declared on HTMLDocument but in WebKit
490 its on Document, so we need to mark that something in HTMLDocument 492 its on Document, so we need to mark that something in HTMLDocument
491 with @WebKit(via=Document). The 'via' attribute specifies the 493 with @WebKit(via=Document). The 'via' attribute specifies the
492 parent interface that has the declaration.""" 494 parent interface that has the declaration."""
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 # 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
566 # this information directly from it. Unfortunately right now database is massaged 568 # this information directly from it. Unfortunately right now database is massaged
567 # a lot so it's difficult to maintain necessary information on DOMWindow i tself. 569 # a lot so it's difficult to maintain necessary information on DOMWindow i tself.
568 interface = self._database.GetInterface(type) 570 interface = self._database.GetInterface(type)
569 if 'V8EnabledPerContext' in attr.ext_attrs: 571 if 'V8EnabledPerContext' in attr.ext_attrs:
570 interface.ext_attrs['synthesizedV8EnabledPerContext'] = \ 572 interface.ext_attrs['synthesizedV8EnabledPerContext'] = \
571 attr.ext_attrs['V8EnabledPerContext'] 573 attr.ext_attrs['V8EnabledPerContext']
572 if 'V8EnabledAtRuntime' in attr.ext_attrs: 574 if 'V8EnabledAtRuntime' in attr.ext_attrs:
573 interface.ext_attrs['synthesizedV8EnabledAtRuntime'] = \ 575 interface.ext_attrs['synthesizedV8EnabledAtRuntime'] = \
574 attr.ext_attrs['V8EnabledAtRuntime'] or attr.id 576 attr.ext_attrs['V8EnabledAtRuntime'] or attr.id
OLDNEW
« no previous file with comments | « no previous file | tools/dom/scripts/fremontcutbuilder.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698