MCPcopy Create free account
hub / github.com/Samsung/UTopia / parse

Method parse

helper/buildparser.py:109–136  ·  view source on GitHub ↗
(self, real: bool = True)

Source from the content-addressed store, hash-verified

107 return self.output_dir / "build.log"
108
109 def parse(self, real: bool = True) -> Tuple[Dict, Dict, Dict, Dict]:
110 with open(self.build_log_path) as f:
111 lines = f.read().replace("\\\n", "").split("\n")
112
113 compiles, links, assems = [], [], []
114 for line in lines:
115 if not line:
116 continue
117 command = self.parse_command(line)
118 if command.is_link():
119 links.append(command)
120 else:
121 compiles.append(command)
122 if command.is_assemble():
123 assems.append(command)
124
125 srcs = dict()
126 for cmd in compiles:
127 for src in cmd.sources(True):
128 srcs[src] = cmd
129
130 compiles = {
131 compile_cmd.output(real): compile_cmd for compile_cmd in compiles
132 }
133 links = {link_cmd.output(real): link_cmd for link_cmd in links}
134 assems = {assem_cmd.output(real): assem_cmd for assem_cmd in assems}
135
136 return srcs, compiles, links, assems
137
138 def parse_command(self, captured_command: str) -> CMD:
139 tokens = [

Callers 2

build_ast_irFunction · 0.95
__init__Method · 0.45

Calls 5

parse_commandMethod · 0.95
is_linkMethod · 0.80
is_assembleMethod · 0.80
sourcesMethod · 0.80
outputMethod · 0.80

Tested by

no test coverage detected