Home | History | Annotate | Download | only in cindex

Lines Matching refs:tu

20     tu = TranslationUnit.from_source(path)
21 assert tu.spelling == path
25 tu = get_tu(path)
26 c = tu.cursor
32 tu = TranslationUnit.from_source(path, ['-DDECL_ONE=hello', '-DDECL_TWO=hi'])
33 spellings = [c.spelling for c in tu.cursor.get_children()]
39 tu = TranslationUnit.from_source(path, ['-DDECL_ONE=hello', '-DDECL_TWO=hi'])
40 tu.reparse()
41 spellings = [c.spelling for c in tu.cursor.get_children()]
46 tu = TranslationUnit.from_source('fake.c', ['-I./'], unsaved_files = [
56 spellings = [c.spelling for c in tu.cursor.get_children()]
62 tu = TranslationUnit.from_source('fake.c', unsaved_files = [
64 spellings = [c.spelling for c in tu.cursor.get_children()]
87 tu = TranslationUnit.from_source(src)
88 for i in zip(inc, tu.get_includes()):
91 def save_tu(tu):
105 tu.save(path)
112 tu = get_tu('int foo();')
114 path = save_tu(tu)
122 tu = get_tu('int foo();')
128 tu.save(path)
137 tu = get_tu('int foo();')
138 assert len(tu.diagnostics) == 0
139 path = save_tu(tu)
158 tu = index.parse(path)
159 assert isinstance(tu, TranslationUnit)
162 """Ensure tu.get_file() works appropriately."""
164 tu = get_tu('int foo();')
166 f = tu.get_file('t.c')
171 f = tu.get_file('foobar.cpp')
178 """Ensure tu.get_source_location() works."""
180 tu = get_tu('int foo();')
182 location = tu.get_location('t.c', 2)
187 location = tu.get_location('t.c', (1, 3))
194 """Ensure tu.get_source_range() works."""
196 tu = get_tu('int foo();')
198 r = tu.get_extent('t.c', (1,4))
205 r = tu.get_extent('t.c', ((1,2), (1,3)))
214 start = tu.get_location('t.c', 0)
215 end = tu.get_location('t.c', 5)
217 r = tu.get_extent('t.c', (start, end))
227 tu = get_tu('int foo();')
228 r = tu.get_extent('t.c', (0, 10))
229 tokens = list(tu.get_tokens(extent=r))
247 tu = TranslationUnit.from_source(path)
249 tu = None
250 assert tu == None
255 tu = TranslationUnit.from_ast_file(path)
257 tu = None
258 assert tu == None