-
-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GH-111485: Factor out tier 2 code generation from the rest of the interpreter code generator #112968
Conversation
markshannon
commented
Dec 11, 2023
•
edited by bedevere-app
bot
Loading
edited by bedevere-app
bot
- Issue: The code generated for the interpreter(s) is too fragile #111485
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few nits. Please also use black on all files you touched.
@@ -138,145 +57,6 @@ def declare_variables(inst: Instruction, out: CWriter) -> None: | |||
out.emit(f"{type}{var.name};\n") | |||
|
|||
|
|||
def emit_to(out: CWriter, tkn_iter: Iterator[Token], end: str) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you make any changes to the code that you moved to generators_common.py or stack.py? Or is it strictly a move?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is strictly a move
@@ -17,3 +33,143 @@ def write_header(generator: str, source: str, outfile: TextIO) -> None: | |||
// Do not edit! | |||
""" | |||
) | |||
|
|||
|
|||
def emit_to(out: CWriter, tkn_iter: Iterator[Token], end: str) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be a method on CWriter
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about that, but it tracks the parentheses in the tkn_iter
input, which seems out of scope for a writer.
…he interpreter code generator (pythonGH-112968)
…he interpreter code generator (pythonGH-112968)