Home | History | Annotate | Download | only in cindex

Lines Matching refs:tu

21     tu = TranslationUnit.from_source(path)
22 assert tu.spelling == path
26 tu = get_tu(path)
27 c = tu.cursor
33 tu = TranslationUnit.from_source(path, ['-DDECL_ONE=hello', '-DDECL_TWO=hi'])
34 spellings = [c.spelling for c in tu.cursor.get_children()]
40 tu = TranslationUnit.from_source(path, ['-DDECL_ONE=hello', '-DDECL_TWO=hi'])
41 tu.reparse()
42 spellings = [c.spelling for c in tu.cursor.get_children()]
47 tu = TranslationUnit.from_source('fake.c', ['-I./'], unsaved_files = [
57 spellings = [c.spelling for c in tu.cursor.get_children()]
63 tu = TranslationUnit.from_source('fake.c', unsaved_files = [
65 spellings = [c.spelling for c in tu.cursor.get_children()]
88 tu = TranslationUnit.from_source(src)
89 for i in zip(inc, tu.get_includes()):
92 def save_tu(tu):
98 tu.save(path)
105 tu = get_tu('int foo();')
107 path = save_tu(tu)
115 tu = get_tu('int foo();')
121 tu.save(path)
130 tu = get_tu('int foo();')
131 assert len(tu.diagnostics) == 0
132 path = save_tu(tu)
151 tu = index.parse(path)
152 assert isinstance(tu, TranslationUnit)
155 """Ensure tu.get_file() works appropriately."""
157 tu = get_tu('int foo();')
159 f = tu.get_file('t.c')
164 f = tu.get_file('foobar.cpp')
171 """Ensure tu.get_source_location() works."""
173 tu = get_tu('int foo();')
175 location = tu.get_location('t.c', 2)
180 location = tu.get_location('t.c', (1, 3))
187 """Ensure tu.get_source_range() works."""
189 tu = get_tu('int foo();')
191 r = tu.get_extent('t.c', (1,4))
198 r = tu.get_extent('t.c', ((1,2), (1,3)))
207 start = tu.get_location('t.c', 0)
208 end = tu.get_location('t.c', 5)
210 r = tu.get_extent('t.c', (start, end))
220 tu = get_tu('int foo();')
221 r = tu.get_extent('t.c', (0, 10))
222 tokens = list(tu.get_tokens(extent=r))
240 tu = TranslationUnit.from_source(path)
242 tu = None
243 assert tu == None
248 tu = TranslationUnit.from_ast_file(path)
250 tu = None
251 assert tu == None