MCPcopy Create free account
hub / github.com/compiler-explorer/compiler-explorer / parse_html

Function parse_html

etc/scripts/docenizers/docenizer-amd64.py:285–303  ·  view source on GitHub ↗
(directory)

Source from the content-addressed store, hash-verified

283
284
285def parse_html(directory):
286 print("Parsing instructions...")
287 instructions = []
288 for root, dirs, files in os.walk(directory):
289 for file in files:
290 if file.endswith(".html") and file != 'index.html':
291 with open(os.path.join(root, file), encoding='utf-8') as f2:
292 name = os.path.splitext(file)[0]
293 if name in IGNORED_DUPLICATES or name in IGNORED_FILE_NAMES:
294 continue
295 try:
296 instruction = parse(name, f2)
297 if not instruction:
298 continue
299 patch_instruction(instruction)
300 instructions.append(instruction)
301 except Exception as e:
302 print(f"Error parsing {name}:\n{e}")
303 return instructions
304
305
306def self_test(instructions, directory):

Callers 1

mainFunction · 0.70

Calls 2

patch_instructionFunction · 0.85
parseFunction · 0.70

Tested by

no test coverage detected