header.py

changeset 101
745f2c3aec0a
parent 97
7b24ff111cb6
equal deleted inserted replaced
100:62759e5c4554 101:745f2c3aec0a
19 self.bfc = None 19 self.bfc = None
20 self.category = None 20 self.category = None
21 self.keywords = '' 21 self.keywords = ''
22 self.cmdline = None 22 self.cmdline = None
23 self.history = [] 23 self.history = []
24 self.first_occurrence = dict() 24 from collections import defaultdict
25 self.occurrences = defaultdict(list)
25 @property 26 @property
26 def valid(self): 27 def valid(self):
27 return True 28 return True
28 @property 29 @property
29 def effective_filetype(self): 30 def effective_filetype(self):
270 that does not raise exceptions. 271 that does not raise exceptions.
271 ''' 272 '''
272 match = re.search(pattern, self.current()) 273 match = re.search(pattern, self.current())
273 if match: 274 if match:
274 self.order.append(description) 275 self.order.append(description)
275 if description not in self.result.first_occurrence: 276 list.append(self.result.occurrences[description], self.cursor)
276 self.result.first_occurrence[description] = self.cursor
277 return match.groups() 277 return match.groups()
278 else: 278 else:
279 self.parse_error(str.format("couldn't parse {}", description)) 279 self.parse_error(str.format("couldn't parse {}", description))

mercurial