| 528 | self.runtime_function_call_pattern = self.CreateRuntimeFunctionCallMatcher() |
| 529 | |
| 530 | def CreateRuntimeFunctionCallMatcher(self): |
| 531 | runtime_h_path = join(dirname(TOOLS_PATH), 'src/runtime/runtime.h') |
| 532 | pattern = re.compile(r'\s+F\(([^,]*),.*\)') |
| 533 | runtime_functions = [] |
| 534 | with open(runtime_h_path) as f: |
| 535 | for line in f.readlines(): |
| 536 | m = pattern.match(line) |
| 537 | if m: |
| 538 | runtime_functions.append(m.group(1)) |
| 539 | if len(runtime_functions) < 250: |
| 540 | print ("Runtime functions list is suspiciously short. " |
| 541 | "Consider updating the presubmit script.") |
| 542 | sys.exit(1) |
| 543 | str = '(\%\s+(' + '|'.join(runtime_functions) + '))[\s\(]' |
| 544 | return re.compile(str) |
| 545 | |
| 546 | # Overwriting the one in the parent class. |
| 547 | def FindFilesIn(self, path): |