-
Notifications
You must be signed in to change notification settings - Fork 11
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
source code generation bugs #22
Comments
jepler
added a commit
to jepler/astmonkey
that referenced
this issue
Sep 25, 2022
This was reported in mutpy#22 as not working, but it seems OK now
jepler
added a commit
to jepler/astmonkey
that referenced
this issue
Sep 25, 2022
This was reported broken in mutpy#22
jepler
added a commit
to jepler/astmonkey
that referenced
this issue
Sep 25, 2022
This was reported in mutpy#22 as not working, but it seems OK now
jepler
added a commit
to jepler/astmonkey
that referenced
this issue
Sep 25, 2022
This was reported broken in mutpy#22
jepler
added a commit
to jepler/astmonkey
that referenced
this issue
Sep 25, 2022
This was reported broken in mutpy#22
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi! I was using
astmonkey
for the purposes of my project and notice several bugs in code generation (visitors.to_source
) function. The code snippets below (the original code and the code generated from the original's AST) illustrate the problems:visitors.to_source
doesn't distinguish single-quoted strings (like 'hello') from double-quoted strings (like "hello"). This is a problem because statements like'this is "double quotes" inside single quotes'
won't be proceeded correctly.E.g. code generated from AST of the code below
will become
and that will be a SyntaxError.
visitors.to_source
doesn't accountasync
's in comprehension's (like[i async for i in some_iterable]
)will become
i.e.
async
is lost.a: int = 1
) which was introduced in Python 3.6will become
and that will be a SyntaxError.
visitors.to_source
works incorrectly on more than one decorator (both for functions and classes). Example with function:will become
and that will be a SyntaxError.
visitors.to_source
still works incorrectly onelse
intry except
stmt. Example:will become
and that will be a SyntaxError.
Best regards,
Nick
The text was updated successfully, but these errors were encountered: