22import compute_interfaces_info_individual
23from compute_interfaces_info_individual
import InterfaceInfoCollector
28_logger = logging.getLogger(
'databasebuilder')
33_VIA_ANNOTATION_ATTR_NAME =
'via'
37 """Used in specifying options when importing new interfaces"""
43 rename_operation_arguments_on_merge=False,
44 add_new_interfaces=True,
45 obsolete_old_declarations=False,
46 logging_level=logging.WARNING):
49 idl_defines -- list of definitions for the idl gcc pre-processor
50 source -- the origin of the IDL file, used
for annotating the
52 source_attributes -- this map of attributes
is used
as
53 annotation attributes.
54 rename_operation_arguments_on_merge --
if True, will rename
55 operation arguments when merging using the new name rather
57 add_new_interfaces -- when
False,
if an interface
is a new
58 addition, it will be ignored.
59 obsolete_old_declarations -- when
True,
if a declaration
60 from a certain source
is not re-declared, it will be removed.
66 rename_operation_arguments_on_merge
69 _logger.setLevel(logging_level)
73 exception_list = traceback.format_stack()
74 exception_list = exception_list[:-2]
75 exception_list.extend(traceback.format_tb(sys.exc_info()[2]))
76 exception_list.extend(
77 traceback.format_exception_only(sys.exc_info()[0],
80 exception_str =
"Traceback (most recent call last):\n"
81 exception_str +=
"".
join(exception_list)
83 exception_str = exception_str[:-1]
89def _compile_idl_file(build, file_name, import_options):
91 idl_file_fullpath = os.path.realpath(file_name)
92 idl_definition = build.idl_compiler.compile_file(idl_file_fullpath)
94 except Exception
as err:
95 print(
'ERROR: idl_compiler.py: ' + os.path.basename(file_name))
105def _load_idl_file(build, file_name, import_options):
108 name = os.path.splitext(os.path.basename(file_name))[0]
110 idl_definition = new_asts[name]
111 return IDLFile(idl_definition, file_name)
112 except Exception
as err:
113 print(
'ERROR: loading AST from cache: ' + os.path.basename(file_name))
133 attrib_file = os.path.join(
'Source',
134 idl_validator.EXTENDED_ATTRIBUTES_FILENAME)
139 interfaces_info=provider._info_collector.interfaces_info,
140 only_if_changed=
True)
143 exception_list = traceback.format_stack()
144 exception_list = exception_list[:-2]
145 exception_list.extend(traceback.format_tb(sys.exc_info()[2]))
146 exception_list.extend(
147 traceback.format_exception_only(sys.exc_info()[0],
150 exception_str =
"Traceback (most recent call last):\n"
151 exception_str +=
"".
join(exception_list)
153 exception_str = exception_str[:-1]
159 idl_file_fullpath = os.path.realpath(idl_file)
161 except Exception
as err:
162 print(
'ERROR: idl_compiler.py: ' + os.path.basename(idl_file))
170 return IDLFile(idl_ast, file_name)
176 """DatabaseBuilder is used for importing and merging interfaces into
190 'databasebuilder.global_type_defs', {
191 'Transferable':
'MessagePort',
197 def _resolve_type_defs(self, idl_file):
198 for type_node
in idl_file.all(IDLType):
200 type_name = type_node.id
202 seq_name_typedef =
'sequence<%s>' % typedef
203 if type_name == typedef:
206 elif type_name == seq_name_typedef:
211 for typedef
in idl_file.typeDefs:
212 if type_name == typedef.id:
213 type_node.id = typedef.type.id
216 def _strip_ext_attributes(self, idl_file):
217 """Strips unuseful extended attributes."""
218 for ext_attrs
in idl_file.all(IDLExtAttrs):
222 def _rename_types(self, idl_file, import_options):
223 """Rename interface and type names with names provided in the
224 options. Also clears scopes from scoped names
"""
226 strip_modules = lambda name: name.split(
'::')[-1]
228 def rename_node(idl_node):
229 idl_node.reset_id(strip_modules(idl_node.id))
231 def rename_ext_attrs(ext_attrs_node):
232 for type_valued_attribute_name
in [
'DartSupplemental']:
233 if type_valued_attribute_name
in ext_attrs_node:
234 value = ext_attrs_node[type_valued_attribute_name]
235 if isinstance(value, str):
237 type_valued_attribute_name] = strip_modules(value)
239 list(
map(rename_node, idl_file.all(IDLInterface)))
240 list(
map(rename_node, idl_file.all(IDLType)))
241 list(
map(rename_ext_attrs, idl_file.all(IDLExtAttrs)))
243 def _annotate(self, interface, import_options):
244 """Adds @ annotations based on the source and source_attributes
245 members of import_options."""
247 source = import_options.source
251 def add_source_annotation(idl_node):
253 copy.deepcopy(import_options.source_attributes))
254 idl_node.annotations[source] = annotation
255 if ((isinstance(idl_node, IDLInterface)
or
256 isinstance(idl_node, IDLMember))
and
257 idl_node.is_fc_suppressed):
258 annotation[
'suppressed'] =
None
260 add_source_annotation(interface)
262 list(
map(add_source_annotation, interface.parents))
263 list(
map(add_source_annotation, interface.constants))
264 list(
map(add_source_annotation, interface.attributes))
265 list(
map(add_source_annotation, interface.operations))
267 def _sign(self, node):
268 """Computes a unique signature for the node, for merging purposed, by
269 concatenating types and names
in the declaration.
"""
270 if isinstance(node, IDLType):
272 if res.startswith(
'unsigned '):
273 res = res[
len(
'unsigned '):]
274 if hasattr(node,
'nullable')
and node.nullable:
279 if isinstance(node, IDLInterface):
280 res = [
'interface', node.id]
281 elif isinstance(node, IDLParentInterface):
282 res = [
'parent', self.
_sign(node.type)]
283 elif isinstance(node, IDLOperation):
285 for special
in node.specials:
287 if node.id
is not None:
289 for arg
in node.arguments:
290 res.append(self.
_sign(arg.type))
291 res.append(self.
_sign(node.type))
292 elif isinstance(node, IDLAttribute):
294 if node.is_read_only:
295 res.append(
'readonly')
297 res.append(self.
_sign(node.type))
298 elif isinstance(node, IDLConstant):
302 res.append(node.value)
303 res.append(self.
_sign(node.type))
305 raise TypeError(
"Can't sign input of type %s" %
type(node))
308 def _build_signatures_map(self, idl_node_list):
309 """Creates a hash table mapping signatures to idl_nodes for the
310 given list of nodes"""
312 for idl_node
in idl_node_list:
313 sig = self.
_sign(idl_node)
322 if idl_node.is_fc_suppressed == op.is_fc_suppressed:
324 'Warning: Multiple members have the same '
325 ' signature: "%s"' % sig)
329 def _get_parent_interfaces(self, interface):
330 """Return a list of all the parent interfaces of a given interface"""
333 def recurse(current_interface):
334 if current_interface
in res:
336 res.append(current_interface)
337 for parent
in current_interface.parents:
338 parent_name = parent.type.id
339 if self.
_database.HasInterface(parent_name):
340 recurse(self.
_database.GetInterface(parent_name))
345 def _merge_ext_attrs(self, old_attrs, new_attrs):
346 """Merges two sets of extended attributes.
348 Returns: True if old_attrs has changed.
351 for (name, value)
in new_attrs.items():
352 if name
in old_attrs
and old_attrs[name] == value:
355 if name ==
'ImplementedAs' and name
in old_attrs:
357 old_attrs[name] = value
361 def _merge_nodes(self, old_list, new_list, import_options):
362 """Merges two lists of nodes. Annotates nodes with the source of each
366 True if the old_list has changed.
369 old_list -- the list to merge into.
370 new_list -- list containing more nodes.
371 import_options -- controls how merging
is done.
375 source = import_options.source
381 for (sig, new_node)
in new_signatures_map.items():
382 if sig
not in old_signatures_map:
384 old_list.append(new_node)
388 old_node = old_signatures_map[sig]
389 if (source
not in old_node.annotations
and
390 source
in new_node.annotations):
391 old_node.annotations[source] = new_node.annotations[source]
394 if isinstance(old_node, IDLOperation):
395 for i
in range(0,
len(old_node.arguments)):
396 old_arg = old_node.arguments[i]
397 new_arg = new_node.arguments[i]
399 old_arg_name = old_arg.id
400 new_arg_name = new_arg.id
401 if (old_arg_name != new_arg_name
and
402 (old_arg_name ==
'arg' or
403 old_arg_name.endswith(
'Arg')
or
404 import_options.rename_operation_arguments_on_merge)
406 old_node.arguments[i].id = new_arg_name
416 old_default_value = old_arg.default_value
417 new_default_value = new_arg.default_value
418 old_default_value_is_null = old_arg.default_value_is_null
419 new_default_value_is_null = new_arg.default_value_is_null
420 if old_default_value != new_default_value:
421 old_arg.default_value = new_default_value
423 if old_default_value_is_null != new_default_value_is_null:
424 old_arg.default_value_is_null = new_default_value_is_null
428 old_optional = old_arg.optional
429 new_optional = new_arg.optional
430 if old_optional != new_optional:
431 old_arg.optional = new_optional
434 if (isinstance(old_node, IDLAttribute)
or
435 isinstance(old_node, IDLOperation)):
441 if import_options.obsolete_old_declarations:
442 for (sig, old_node)
in old_signatures_map.items():
443 if (source
in old_node.annotations
and
444 sig
not in new_signatures_map):
446 '%s not available in %s anymore' % (sig, source))
447 del old_node.annotations[source]
452 def _merge_interfaces(self, old_interface, new_interface, import_options):
453 """Merges the new_interface into the old_interface, annotating the
454 interface with the sources of each change.
"""
458 source = import_options.source
459 if (source
and source
not in old_interface.annotations
and
460 source
in new_interface.annotations
and
461 not new_interface.is_supplemental):
462 old_interface.annotations[source] = new_interface.annotations[
466 def merge_list(what):
467 old_list = old_interface.__dict__[what]
468 new_list = new_interface.__dict__[what]
470 if what !=
'parents' and old_interface.id != new_interface.id:
471 for node
in new_list:
472 node.doc_js_interface_name = old_interface.id
473 node.ext_attrs[
'ImplementedBy'] = new_interface.id
475 changed = self.
_merge_nodes(old_list, new_list, import_options)
478 if changed
and import_options.obsolete_old_declarations:
480 def has_annotations(idl_node):
481 return len(idl_node.annotations)
483 old_interface.__dict__[what] = \
484 list(filter(has_annotations, old_list))
489 if merge_list(
'parents'):
491 if merge_list(
'constants'):
493 if merge_list(
'attributes'):
495 if merge_list(
'operations'):
499 new_interface.ext_attrs):
502 _logger.info(
'merged interface %s (changed=%s, supplemental=%s)' %
503 (old_interface.id, changed, new_interface.is_supplemental))
507 def _merge_impl_stmt(self, impl_stmt, import_options):
508 """Applies "X implements Y" statements on the proper places in the
510 implementor_name = impl_stmt.implementor.id
511 implemented_name = impl_stmt.implemented.id
512 _logger.info('merging impl stmt %s implements %s' % (implementor_name,
515 source = import_options.source
516 if self.
_database.HasInterface(implementor_name):
517 interface = self.
_database.GetInterface(implementor_name)
518 if interface.parents
is None:
519 interface.parents = []
520 for parent
in interface.parents:
521 if parent.type.id == implemented_name:
522 if source
and source
not in parent.annotations:
524 import_options.source_attributes)
528 parent.type =
IDLType(implemented_name)
531 import_options.source_attributes)
532 interface.parents.append(parent)
535 """Merges all imported interfaces and loads them into the DB."""
539 for interface, import_options
in imported_interfaces:
540 self.
_annotate(interface, import_options)
543 for interface, import_options
in imported_interfaces:
544 if not interface.is_supplemental:
545 if self.
_database.HasInterface(interface.id):
546 old_interface = self.
_database.GetInterface(interface.id)
550 if import_options.add_new_interfaces:
554 for interface, import_options
in imported_interfaces:
555 if interface.is_supplemental:
556 target = interface.id
558 old_interface = self.
_database.GetInterface(target)
562 _logger.warning(
"Supplemental target '%s' not found",
572 def _compute_dart_idl_implements(self, idl_filename):
573 full_path = os.path.realpath(idl_filename)
575 with open(full_path)
as f:
576 idl_file_contents = f.read()
578 implements_re = (
r'^\s*' r'(\w+)\s+' r'implements\s+' r'(\w+)\s*' r';')
580 implements_matches = re.finditer(implements_re, idl_file_contents,
582 return [match.groups()
for match
in implements_matches]
586 def _blink_compile_idl_files(self, file_paths, import_options, is_dart_idl):
587 if not (is_dart_idl):
588 start_time = time.time()
593 for file_path
in file_paths:
596 end_time = time.time()
597 print(
'Compute dependencies %s seconds' %
round(
598 (end_time - start_time), 2))
605 'implement_pairs': implement_pairs,
609 start_time = time.time()
611 for file_path
in file_paths:
612 file_path = os.path.normpath(file_path)
613 ast = _compile_idl_file(self.
build, file_path, import_options)
615 os.path.splitext(os.path.basename(file_path))[0], ast)
617 end_time = time.time()
618 print(
'Compiled %s IDL files in %s seconds' %
619 (
len(file_paths),
round((end_time - start_time), 2)))
621 def _process_ast(self, filename, ast):
623 ast =
next(iter(ast.values()))
625 print(
'ERROR: Processing AST: ' + os.path.basename(file_name))
626 new_asts[filename] = ast
631 start_time = time.time()
634 for file_path
in file_paths:
635 file_path = os.path.normpath(file_path)
636 idl_file = _load_idl_file(self.
build, file_path, import_options)
637 _logger.info(
'Processing %s' % os.path.splitext(
638 os.path.basename(file_path))[0])
641 end_time = time.time()
644 _logger.warning(warning)
646 print(
'Total %s files %sprocessed in databasebuilder in %s seconds' % \
647 (
len(file_paths),
'',
round((end_time - start_time), 2)))
649 def _process_idl_file(self, idl_file, import_options, dart_idl=False):
655 def enabled(idl_node):
658 for interface
in idl_file.interfaces:
660 _logger.info(
'skipping interface %s (source=%s)' %
661 (interface.id, import_options.source))
664 _logger.info(
'importing interface %s (source=%s file=%s)' %
665 (interface.id, import_options.source,
666 os.path.basename(idl_file.filename)))
668 interface.attributes = list(filter(enabled, interface.attributes))
669 interface.operations = list(filter(enabled, interface.operations))
673 if hasattr(idl_file,
'implementsStatements'):
674 for implStmt
in idl_file.implementsStatements:
677 for enum
in idl_file.enums:
680 for dictionary
in idl_file.dictionaries:
685 for typedef
in idl_file.typeDefs:
688 def _is_node_enabled(self, node, idl_defines):
689 if not 'Conditional' in node.ext_attrs:
692 def enabled(condition):
693 return 'ENABLE_%s' % condition
in idl_defines
695 conditional = node.ext_attrs[
'Conditional']
696 if conditional.find(
'&') != -1:
697 for condition
in conditional.split(
'&'):
698 condition = condition.strip()
700 if not enabled(condition):
704 for condition
in conditional.split(
'|'):
705 condition = condition.strip()
707 if enabled(condition):
712 """E.g. In W3C, something is declared on HTMLDocument but in WebKit
713 its on Document, so we need to mark that something in HTMLDocument
714 with @WebKit(via=Document). The
'via' attribute specifies the
715 parent interface that has the declaration.
"""
717 for interface
in self.
_database.GetInterfaces():
720 _logger.info(
'fixing displacements in %s' % interface.id)
723 _logger.info(
'scanning parent %s of %s' % (parent_interface.id,
726 def fix_nodes(local_list, parent_list):
730 for idl_node
in local_list:
731 sig = self.
_sign(idl_node)
732 if sig
in parent_signatures_map:
733 parent_member = parent_signatures_map[sig]
734 if (source
in parent_member.annotations
and
735 source
not in idl_node.annotations
and
736 _VIA_ANNOTATION_ATTR_NAME
not in
737 parent_member.annotations[source]):
739 _VIA_ANNOTATION_ATTR_NAME:
745 changed = fix_nodes(interface.constants,
746 parent_interface.constants)
or changed
747 changed = fix_nodes(interface.attributes,
748 parent_interface.attributes)
or changed
749 changed = fix_nodes(interface.operations,
750 parent_interface.operations)
or changed
753 'fixed displaced declarations in %s' % interface.id)
756 """Makes the IDLs less verbose by removing annotation attributes
757 that are identical to the ones defined at the interface level.
760 sources -- list of source names to normalize."""
761 for interface
in self.
_database.GetInterfaces():
762 _logger.debug(
'normalizing annotations for %s' % interface.id)
763 for source
in sources:
764 if (source
not in interface.annotations
or
765 not interface.annotations[source]):
767 top_level_annotation = interface.annotations[source]
770 if (source
in idl_node.annotations
and
771 idl_node.annotations[source]):
772 annotation = idl_node.annotations[source]
773 for name, value
in list(annotation.items()):
774 if (name
in top_level_annotation
and
775 value == top_level_annotation[name]):
778 list(
map(normalize, interface.parents))
779 list(
map(normalize, interface.constants))
780 list(
map(normalize, interface.attributes))
781 list(
map(normalize, interface.operations))
784 """Changes the type of operations/constructors arguments from an IDL
785 dictionary to a Dictionary. The IDL dictionary is just an enums of
786 strings which are checked at run-time.
"""
788 def dictionary_to_map(type_node):
789 if self.
_database.HasDictionary(type_node.id):
790 type_node.dictionary = type_node.id
791 type_node.id =
'Dictionary'
794 list(
map(dictionary_to_map, node.all(IDLType)))
796 for interface
in self.
_database.GetInterfaces():
797 list(
map(all_types, interface.all(IDLExtAttrFunctionValue)))
798 list(
map(all_types, interface.attributes))
799 list(
map(all_types, interface.operations))
802 window_interface = self.
_database.GetInterface(
'Window')
803 for attr
in window_interface.attributes:
805 if not type.endswith(
'Constructor'):
807 type = re.sub(
'(Constructor)+$',
'', type)
811 interface = self.
_database.GetInterface(type)
812 if 'V8EnabledPerContext' in attr.ext_attrs:
813 interface.ext_attrs[
'synthesizedV8EnabledPerContext'] = \
814 attr.ext_attrs[
'V8EnabledPerContext']
815 if 'V8EnabledAtRuntime' in attr.ext_attrs:
816 interface.ext_attrs[
'synthesizedV8EnabledAtRuntime'] = \
817 attr.ext_attrs[
'V8EnabledAtRuntime']
or attr.id
828 for dictionary
in self.
_database.GetDictionaries():
830 'dictionary': dictionary,
839 for interface
in self.
_database.GetInterfaces():
840 if interface.is_no_interface_object:
842 'no_interface_object':
847 for interface
in self.
_database.GetInterfaces():
851 for attribute
in interface.attributes:
854 interface, attribute, check_dictionaries=
False)
856 for operation
in interface.operations:
859 interface, operation, check_dictionaries=
False)
868 (READ-ONLY) - read-only attribute has relationship
869 (GET/SET) - attribute has relationship
870 RETURN - operation\'s returned value has relationship
871 (ARGUMENT) - operation\'s argument(s) has relationship
873 (New) - After dictionary name if constructor(s) exist
874 (Ops,Props,New) after a NoInterfaceObject name
is defined
as:
875 Ops - number of operations
for a NoInterfaceObject
876 Props - number of properties
for a NoInterfaceObject
878 F no constructors
for a NoInterfaceObject
879 e.g., an interface 5 operations, 3 properties
and 2
880 constructors would display (5,3,
T(2))
886 def _output_examination(self, check_dictionaries=True):
890 title_bar = [
'Dictionary',
'Used In Interface',
'Usage Operation/Attribute']
if check_dictionaries \
891 else [
'NoInterfaceObject (Ops,Props,New)',
'Used In Interface',
'Usage Operation/Attribute']
895 if not (check_dictionaries):
896 interface = diag[
'no_interface_object']
897 ops_count =
len(interface.operations)
898 properties_count =
len(interface.attributes)
899 any_constructors =
'Constructor' in interface.ext_attrs
900 constructors =
'T(%s)' %
len(interface.ext_attrs[
'Constructor']
901 )
if any_constructors
else 'F'
902 interface_detail =
'%s (%s,%s,%s)' % \
903 (diag[
'no_interface_object'].id,
907 self.
_tabulate([interface_detail,
'',
''])
909 dictionary = diag[
'dictionary']
910 any_constructors =
'Constructor' in dictionary.ext_attrs
912 '%s%s' % (dictionary.id,
913 ' (New)' if any_constructors
else ''),
'',
''
915 for usage
in diag[
'usages']:
917 if 'attribute' in usage:
918 attribute_type =
'READ-ONLY' if not usage[
919 'argument']
else 'GET/SET'
920 detail =
'(%s) %s' % (attribute_type, usage[
'attribute'])
921 elif 'operation' in usage:
922 detail =
'%s %s%s' % (
'RETURN' if usage[
'result']
else '',
923 usage[
'operation'],
'(ARGUMENT)'
924 if usage[
'argument']
else '')
925 self.
_tabulate([
None, usage[
'interface'], detail])
930 def _mark_usage(self,
932 operation_or_attribute=None,
933 check_dictionaries=True):
935 for usage
in diag[
'usages']:
936 if not usage[
'interface']:
937 usage[
'interface'] = interface.id
938 if isinstance(operation_or_attribute, IDLOperation):
939 usage[
'operation'] = operation_or_attribute.id
940 if check_dictionaries:
941 usage[
'result'] = hasattr(operation_or_attribute.type,
'dictionary')
and \
942 operation_or_attribute.type.dictionary == diag[
'dictionary'].id
945 'result'] = operation_or_attribute.type.id == diag[
946 'no_interface_object'].id
947 usage[
'argument'] =
False
948 for argument
in operation_or_attribute.arguments:
949 if check_dictionaries:
951 argument.type,
'dictionary'
952 )
and argument.type.dictionary == diag[
955 arg = argument.type.id == diag[
956 'no_interface_object'].id
958 usage[
'argument'] = arg
959 elif isinstance(operation_or_attribute, IDLAttribute):
960 usage[
'attribute'] = operation_or_attribute.id
961 usage[
'result'] =
True
963 'argument'] =
not operation_or_attribute.is_read_only
964 elif not operation_or_attribute:
966 usage[
'operation'] =
'constructor'
967 usage[
'result'] =
False
968 usage[
'argument'] =
True
970 def _remember_usage(self, node, check_dictionaries=True):
971 if check_dictionaries:
974 diag_name =
'dictionary'
978 diag_name =
'no_interface_object'
980 if len(used_types) > 0:
981 normalized_used = list(
set(used_types))
982 for recorded_id
in normalized_used:
983 for diag
in diag_list:
984 if diag[diag_name].id == recorded_id:
985 diag[
'usages'].
append({
'interface':
None,
'node': node})
989 def _dictionary_used(self, type_node):
990 if hasattr(type_node,
'dictionary'):
991 dictionary_id = type_node.dictionary
992 if self.
_database.HasDictionary(dictionary_id):
994 if diag_dictionary[
'dictionary'].id == dictionary_id:
1000 print(
'DIAGNOSE_ERROR: IDL Dictionary %s doesn\'t exist.' %
1005 def _no_interface_used(self, type_node):
1006 if hasattr(type_node,
'id'):
1007 no_interface_id = type_node.id
1008 if self.
_database.HasInterface(no_interface_id):
1009 no_interface = self.
_database.GetInterface(no_interface_id)
1010 if no_interface.is_no_interface_object:
1012 if diag_no_interface[
1013 'no_interface_object'].id == no_interface_id:
1019 def _constructors(self, interface, check_dictionaries=True):
1020 if check_dictionaries:
1027 list(
map(constructor_function, interface.all(IDLExtAttrFunctionValue)))
1029 self.
_mark_usage(interface, check_dictionaries=check_dictionaries)
1033 def _attribute_operation(self,
1035 operation_attribute,
1036 check_dictionaries=True):
1037 if check_dictionaries:
1044 list(
map(used, operation_attribute.all(IDLType)))
1047 operation_attribute, check_dictionaries=check_dictionaries)
1050 operation_attribute,
1051 check_dictionaries=check_dictionaries)
1055 def _dictionary_constructor_types(self, node):
1062 def _no_interface_constructor_types(self, node):
1068 def _TABULATE_WIDTH(self):
1071 def _tabulate_title(self, row_title):
1073 self.
_tabulate([title_separator, title_separator, title_separator])
1075 self.
_tabulate([title_separator, title_separator, title_separator])
1077 def _tabulate_break(self):
1079 self.
_tabulate([break_separator, break_separator, break_separator])
1081 def _tabulate(self, columns):
1082 """Tabulate a list of columns for a row. Each item in columns
is a column
1083 value each column will be padded up to _TABULATE_WIDTH. Each
1084 column starts/ends
with a vertical bar
'|' the format a row:
1086 | columns[0] | columns[1] | columns[2] | ... |
1088 if len(columns) > 0:
1089 for column
in columns:
1090 value =
'' if not column
else column
1091 sys.stdout.write(
'|{0:^{1}}'.
format(value,
1096 sys.stdout.write(
'|\n')
static void round(SkPoint *p)
static float next(float f)
def format_exception(self, e)
def __init__(self, provider)
def generate_from_idl(self, idl_file)
obsolete_old_declarations
def __init__(self, idl_defines=[], source=None, source_attributes={}, rename_operation_arguments_on_merge=False, add_new_interfaces=True, obsolete_old_declarations=False, logging_level=logging.WARNING)
rename_operation_arguments_on_merge
def __init__(self, database)
def normalize_annotations(self, sources)
def _mark_usage(self, interface, operation_or_attribute=None, check_dictionaries=True)
def _merge_interfaces(self, old_interface, new_interface, import_options)
def _merge_nodes(self, old_list, new_list, import_options)
def _build_signatures_map(self, idl_node_list)
def _tabulate_title(self, row_title)
def _is_node_enabled(self, node, idl_defines)
def _dictionary_constructor_types(self, node)
def _no_interface_used(self, type_node)
def merge_imported_interfaces(self)
def _get_parent_interfaces(self, interface)
def _attribute_operation(self, interface, operation_attribute, check_dictionaries=True)
def _constructors(self, interface, check_dictionaries=True)
def _compute_dart_idl_implements(self, idl_filename)
def fix_displacements(self, source)
_no_interfaces_used_types
def import_idl_files(self, file_paths, import_options, is_dart_idl)
def examine_database(self)
def _output_examination(self, check_dictionaries=True)
def _merge_impl_stmt(self, impl_stmt, import_options)
def _merge_ext_attrs(self, old_attrs, new_attrs)
def _tabulate_break(self)
def _resolve_type_defs(self, idl_file)
def fetch_constructor_data(self, options)
def _blink_compile_idl_files(self, file_paths, import_options, is_dart_idl)
def _remember_usage(self, node, check_dictionaries=True)
def _no_interface_constructor_types(self, node)
def _process_ast(self, filename, ast)
def map_dictionaries(self)
def _process_idl_file(self, idl_file, import_options, dart_idl=False)
def _dictionary_used(self, type_node)
def _annotate(self, interface, import_options)
def _TABULATE_WIDTH(self)
def _tabulate(self, columns)
def _rename_types(self, idl_file, import_options)
static void append(char **dst, size_t *count, const char *src, size_t n)
uint32_t uint32_t * format
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not set
def print(*args, **kwargs)
def report_unions_to_any()
SIN Vec< N, float > normalize(const Vec< N, float > &v)
SI auto map(std::index_sequence< I... >, Fn &&fn, const Args &... args) -> skvx::Vec< sizeof...(I), decltype(fn(args[0]...))>
static SkString join(const CommandLineFlags::StringArray &)