Skip to content
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

Problem with assert testing two ranges #317

Open
dmcqfano opened this issue May 31, 2020 · 2 comments
Open

Problem with assert testing two ranges #317

dmcqfano opened this issue May 31, 2020 · 2 comments
Labels
boolean expressions Complex boolean expresions with "and", "or", and chained comparisons, control flow Python 3.7 Python 3.8 volunteer wanted Volunteer wanted to fix if a bug or to implement if a new feature. Works on decompyle3

Comments

@dmcqfano
Copy link

Description

Fails after an assert with and of two (a<= b <c) type conditions with message
Parse error at or near `CALL_METHOD_1' instruction at offset 60

How to Reproduce

I've attached a zip with the source, code and output

test.zip

Source test.py

#! python3

def bug(cfg, dst, src):
    assert (0 <= dst <= cfg.WIDTH and
        0 <= src <= cfg.WIDTH);
    cfg.trace("hello bug");

Expected behavior

Well - that it wouldn't give a parse error but sonething reasonably similar to the input!

Environment

uncompyle6 3.7.0
python 3.8.3
on Windows 10

Additional Environment or Context

rocky added a commit to rocky/python-decompile3 that referenced this issue May 31, 2020
@rocky rocky added control flow Python 3.7 Python 3.8 boolean expressions Complex boolean expresions with "and", "or", and chained comparisons, labels May 31, 2020
@rocky
Copy link
Owner

rocky commented May 31, 2020

This has been addressed over in the decompyle3 project which reorganizes the grammar to better handle things like this.

I will leave so someone else to back port it here. The commit should give some sense of what needs to happen.

@rocky rocky added the volunteer wanted Volunteer wanted to fix if a bug or to implement if a new feature. label May 31, 2020
@dmcqfano
Copy link
Author

dmcqfano commented Jun 2, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
boolean expressions Complex boolean expresions with "and", "or", and chained comparisons, control flow Python 3.7 Python 3.8 volunteer wanted Volunteer wanted to fix if a bug or to implement if a new feature. Works on decompyle3
Projects
None yet
Development

No branches or pull requests

2 participants