MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / find_code_boundaries

Function find_code_boundaries

scripts/check_header_guards.py:33–53  ·  view source on GitHub ↗
(lines: List[str])

Source from the content-addressed store, hash-verified

31logger = logging.getLogger("check_header_guards")
32
33def find_code_boundaries(lines: List[str]) -> (int, int):
34 inside_comment : bool = False
35
36 start = len(lines)
37 end = -1
38 line_num = 0
39 for line in lines:
40 stripped_line : str = line.strip()
41 if stripped_line.startswith("/*"): # block comment start
42 inside_comment = True
43
44 if not inside_comment and not stripped_line.startswith("//") and stripped_line != "":
45 start = min(line_num, start)
46 end = line_num
47
48 if inside_comment and stripped_line.endswith("*/"):
49 inside_comment = False
50
51 line_num += 1
52
53 return start, end
54
55
56def is_define(line: str) -> bool:

Callers 1

fix_header_guardFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected