Exemplo n.º 1
0
 def all_needles(self):
     return iterable_per_line(
         with_start_and_end(
             split_into_lines(
                 chain(
                     self.file_needles("function", "functions"),
                     self.file_needles("function_ref", "function_refs"),
                     self.file_needles("var", "variables"),
                     self.file_needles("var_ref", "variable_refs"),
                     self.file_needles("type", "types"),
                     self.file_needles("type_ref", "type_refs"),
                     self.file_needles("module", "modules"),
                     self.file_needles("module_ref", "module_refs"),
                     self.file_needles("module_alias_ref", "module_aliases"),
                     self.alias_needles(),
                     self.module_use_needles(),
                     self.file_needles("extern_ref", "unknown_refs"),
                     self.impl_needles(),
                     self.fn_impls_needles(),
                     self.inherit_needles(self.tree_index.super_traits, "derived"),
                     self.inherit_needles(self.tree_index.sub_traits, "bases"),
                     self.call_needles(self.tree_index.callees, "callers"),
                 )
             )
         )
     )
Exemplo n.º 2
0
 def all_needles(self):
     return iterable_per_line(
         with_start_and_end(
             split_into_lines(
                 chain(
                     self.file_needles('function', 'functions'),
                     self.file_needles('function_ref', 'function_refs'),
                     self.file_needles('var', 'variables'),
                     self.file_needles('var_ref', 'variable_refs'),
                     self.file_needles('type', 'types'),
                     self.file_needles('type_ref', 'type_refs'),
                     self.file_needles('module', 'modules'),
                     self.file_needles('module_ref', 'module_refs'),
                     self.file_needles('module_alias_ref',
                                       'module_aliases'),
                     self.alias_needles(),
                     self.module_use_needles(),
                     self.file_needles('extern_ref', 'unknown_refs'),
                     self.impl_needles(),
                     self.fn_impls_needles(),
                     self.inherit_needles(self.tree_index.super_traits,
                                          'derived'),
                     self.inherit_needles(self.tree_index.sub_traits,
                                          'bases'),
                     self.call_needles(self.tree_index.callees, 'callers'),
                 ))))
Exemplo n.º 3
0
 def needles_by_line(self):
     return iterable_per_line(
         with_start_and_end(
             split_into_lines(
                 self.visitor.needles
             )
         )
     )
Exemplo n.º 4
0
 def all_needles(self):
     return iterable_per_line(with_start_and_end(split_into_lines(chain(
         self.file_needles('function', 'functions'),
         self.file_needles('function_ref', 'function_refs'),
         self.file_needles('var', 'variables'),
         self.file_needles('var_ref', 'variable_refs'),
         self.file_needles('type', 'types'),
         self.file_needles('type_ref', 'type_refs'),
         self.file_needles('module', 'modules'),
         self.file_needles('module_ref', 'module_refs'),
         self.file_needles('module_alias_ref', 'module_aliases'),
         self.alias_needles(),
         self.module_use_needles(),
         self.file_needles('extern_ref', 'unknown_refs'),
         self.impl_needles(),
         self.fn_impls_needles(),
         self.inherit_needles(self.tree_index.super_traits, 'derived'),
         self.inherit_needles(self.tree_index.sub_traits, 'bases'),
         self.call_needles(self.tree_index.callees, 'callers'),
     ))))
Exemplo n.º 5
0
def all_needles(condensed, overrides, overriddens, parents, children):
    return iterable_per_line(with_start_and_end(split_into_lines(chain(
            needles(condensed, 'function', include_typeless_qualname=True),
            ref_needles(condensed, 'function', include_typeless_qualname=True),

            # Classes:
            needles(condensed, 'type'),
            ref_needles(condensed, 'type'),

            # Typedefs:
            needles(condensed, 'type', kind='typedef'),
            ref_needles(condensed, 'type', subkind='typedef'),

            needles(condensed, 'var', kind='variable'),
            ref_needles(condensed, 'var', subkind='variable'),

            needles(condensed, 'namespace'),
            ref_needles(condensed, 'namespace'),

            needles(condensed, 'namespace_alias'),
            ref_needles(condensed, 'namespace_alias'),

            macro_needles(condensed),
            ref_needles(condensed, 'macro', include_qualname=False),

            decl_needles(condensed, 'var', subkind='variable'),
            decl_needles(condensed, 'function', include_typeless_qualname=True),
            decl_needles(condensed, 'type'),

            warning_needles(condensed),
            warning_opt_needles(condensed),

            caller_needles(condensed, overriddens),

            overrides_needles(condensed, overrides),
            overridden_needles(condensed, overriddens),

            member_needles(condensed),

            inheritance_needles(condensed, parents, children),
    ))))
Exemplo n.º 6
0
def all_needles(condensed, overrides, overriddens, parents, children):
    return iterable_per_line(with_start_and_end(split_into_lines(chain(
            needles(condensed, 'function', include_typeless_qualname=True),
            ref_needles(condensed, 'function', include_typeless_qualname=True),

            # Classes:
            needles(condensed, 'type'),
            ref_needles(condensed, 'type'),

            # Typedefs:
            needles(condensed, 'type', kind='typedef'),
            ref_needles(condensed, 'type', subkind='typedef'),

            needles(condensed, 'var', kind='variable'),
            ref_needles(condensed, 'var', subkind='variable'),

            needles(condensed, 'namespace'),
            ref_needles(condensed, 'namespace'),

            needles(condensed, 'namespace_alias'),
            ref_needles(condensed, 'namespace_alias'),

            macro_needles(condensed),
            ref_needles(condensed, 'macro', include_qualname=False),

            decl_needles(condensed, 'var', subkind='variable'),
            decl_needles(condensed, 'function', include_typeless_qualname=True),
            decl_needles(condensed, 'type'),

            warning_needles(condensed),
            warning_opt_needles(condensed),

            caller_needles(condensed, overriddens),

            overrides_needles(condensed, overrides),
            overridden_needles(condensed, overriddens),

            member_needles(condensed),

            inheritance_needles(condensed, parents, children),
    ))))
Exemplo n.º 7
0
 def needles_by_line(self):
     return iterable_per_line(
         with_start_and_end(split_into_lines(self.idl.needles if self.idl else [])))
Exemplo n.º 8
0
 def needles_by_line(self):
     return iterable_per_line(
         with_start_and_end(split_into_lines(self.visitor.needles)))
Exemplo n.º 9
0
def test_split_into_lines():
    list_eq(split_into_lines([('k', {'m': 'ap'}, Extent(Position(1, 5), Position(3, 7)))]),
        [('k', {'m': 'ap'}, Extent(Position(1, 5), Position(1, None))),
         ('k', {'m': 'ap'}, Extent(Position(2, 0), Position(2, None))),
         ('k', {'m': 'ap'}, Extent(Position(3, 0), Position(3, 7)))])