Skip to content

Commit

Permalink
Extract instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
jiegec committed Dec 14, 2023
1 parent 5981b75 commit e1bed8d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1835,7 +1835,7 @@ def all_intrinsics(render=True):
{
"name": intrinsic,
"content": markdown.markdown(
body,
body.strip(),
extensions=[
"fenced_code",
"codehilite",
Expand All @@ -1847,13 +1847,22 @@ def all_intrinsics(render=True):
}
)
else:
insts = []
for line in body.split("\n"):
if line.startswith("Instruction:"):
# check instruction format
inst = line[12:].strip()
for name in inst.split(";"):
insts.append(name.strip().split(" ")[0])

# do not render
result.append(
{
"name": intrinsic.split("(")[0]
.strip()
.split(" ")[-1],
"full_name": intrinsic,
"c_intrinsic": intrinsic,
"instructions": insts,
"content": body.strip(),
"group": title,
"extension": extension,
Expand Down

0 comments on commit e1bed8d

Please sign in to comment.