MCPcopy
hub / github.com/compiler-explorer/compiler-explorer / parse

Function parse

etc/scripts/docenizers/docenizer-python.py:82–98  ·  view source on GitHub ↗
(f)

Source from the content-addressed store, hash-verified

80
81
82def parse(f):
83 doc = BeautifulSoup(f, 'html.parser')
84 table = doc.find('section', {'id': 'python-bytecode-instructions'})
85
86 opcodes = table.findAll('dl', {'class': 'std opcode'})
87 instructions = []
88 for opcode in opcodes:
89 opcode_name = opcode.find('dt').find('span').text
90 opcode_tooltip = get_first_description_paragraph(opcode)
91 opcode_desc = get_description(opcode)
92 instructions.append(Instruction(
93 opcode_name,
94 [opcode_name],
95 opcode_tooltip,
96 opcode_desc,
97 ))
98 return instructions
99
100
101def parse_html(directory):

Callers 1

parse_htmlFunction · 0.70

Calls 4

get_descriptionFunction · 0.85
findMethod · 0.80
InstructionClass · 0.70

Tested by

no test coverage detected