Skip to content

Commit

Permalink
Fix upstream, fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Fidget-Spinner committed Jan 13, 2025
1 parent 70db5e9 commit eac485f
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 40 deletions.
103 changes: 66 additions & 37 deletions Python/generated_tail_call_handlers.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Tools/cases_generator/tier1_tail_call_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ def generate_label_handlers(infile: TextIO, outfile: TextIO) -> None:
out = CWriter(outfile, 0, False)
str_in = infile.read()
# https://stackoverflow.com/questions/8303488/regex-to-match-any-character-including-new-lines
eval_framedefault = re.findall("_PyEval_EvalFrameDefault\(.*\)\n({[\s\S]*\/\* END_BASE_INTERPRETER \*\/)", str_in)[0]
function_protos = re.findall(f"{TARGET_LABEL}\((\w+)\):", eval_framedefault)
eval_framedefault = re.findall(r"_PyEval_EvalFrameDefault\(.*\)\n({[\s\S]*\/\* END_BASE_INTERPRETER \*\/)", str_in)[0]
function_protos = re.findall(rf"{TARGET_LABEL}\((\w+)\):", eval_framedefault)
for proto in function_protos:
out.emit(f"{function_proto(proto)};\n")
out.emit("\n")
Expand All @@ -53,7 +53,7 @@ def generate_label_handlers(infile: TextIO, outfile: TextIO) -> None:
for line in lines:
if TARGET_LABEL in line:
break
if label := re.findall("goto (\w+);", line):
if label := re.findall(r"goto (\w+);", line):
out.emit(f"CEVAL_GOTO({label[0]});\n")
else:
out.emit_text(line)
Expand Down

0 comments on commit eac485f

Please sign in to comment.