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

Reverse the order of elif clauses in ast (issue #7) #8

Merged
merged 3 commits into from
Jan 25, 2017

Conversation

trotterdylan
Copy link
Contributor

This addressed #7 for me, although I'm not sure it's the best way. I also wasn't sure how to test this, but I'm happy to add one if I can get a little guidance about what's going on here: https://github.com/m-labs/pythonparser/blob/master/pythonparser/test/test_parser.py#L1380

@whitequark
Copy link
Contributor

assertParseX takes three arguments: the AST (that was squashed into hashes and arrays, to make the code to create it simpler), the code to parse, and the desired location spans. You don't need the last one, so adjusting the https://github.com/m-labs/pythonparser/blob/master/pythonparser/test/test_parser.py#L1398-L1403 part is enough.

@trotterdylan
Copy link
Contributor Author

Alright, updated the existing if/elif/else test to include another elif branch. Confirmed that the test failed before the parser.py change and now passes.

@whitequark
Copy link
Contributor

Um, sorry. I meant that you should add another test, just for the elif clause order, and without any location spans (since they're just noise here).

@trotterdylan
Copy link
Contributor Author

Thanks for the info. I added a new assertParsesSuite() without location spans to test_if(). Let me know if you'd rather have a new test method altogether. PTAL

@whitequark whitequark merged commit a82d05d into m-labs:master Jan 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants