-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
parsing(c_parser): added support for unary operators and outermost parenthesized expression #19140
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
Conversation
|
✅ Hi, I am the SymPy bot (v158). I'm here to help you write a release notes entry. Please read the guide on how to write release notes. Your release notes are in good order. Here is what the release notes will look like:
This will be added to https://github.com/sympy/sympy/wiki/Release-Notes-for-1.6. Note: This comment will be updated with the latest check if you edit the pull request. You need to reload the page to see it. Click here to see the pull request description that was parsed.
Update The release notes on the wiki have been updated. |
Codecov Report
@@ Coverage Diff @@
## master #19140 +/- ##
=============================================
- Coverage 75.709% 75.652% -0.057%
=============================================
Files 650 651 +1
Lines 169166 169384 +218
Branches 39909 39985 +76
=============================================
+ Hits 128075 128144 +69
- Misses 35494 35632 +138
- Partials 5597 5608 +11 |
|
Please review @Sc0rpi0n101 @certik |
Sc0rpi0n101
left a comment
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.
Looks good.
Is there anything else left to be done here?
|
No. It is better to merge now, though I wanted to parse unary operators which are children of binary operators. But, using operator precedence parsing, it seems difficult to achieve. |
certik
left a comment
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.
Looks ok to me.
|
Also, can you add some tests for errorneous behaviour to see if the errors are raised correctly. |
|
Sure! working on it now... :) |
|
Should I write tests for binary operators and var decl also in this PR? I didn't write those for raising exceptions in earlier PR |
Yeah, sure. It'd be great if you can do that. |
|
ping |
Sc0rpi0n101
left a comment
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.
LGTM
Can you squash your commits now?
|
Sure! |
1d1cf48 to
04d463c
Compare
|
If there is anything else, do comment. Otherwise it is good to go now... |
- Added support for unary operators:
- unary plus(+), unary minus(-), pre/post increment(++), pre/post decrement(--) and logical NOT(!)
- Added support for parenthesized expression
- Added corresponding tests
- Added tests for unary operators
- Added tests for parenthesized expression
- Added tests for Exceptions raised in parsing binary operators, variable declarations and unary operators
- Improved error messages of Exceptions raised in parsing binary operators, variable declarations and unary operators
Other notes:
- Dereferencing operator(*), Address operator(&) and bitwise NOT(~) are the unary operators that have not been implemented because of unavailability of such nodes or classes in SymPy
- If unary operators are the children of binary operator in AST, it is not possible to parse yet!
|
Merging it now. Thank you for the contribution. |
References to other Issues or PRs
Brief description of what is fixed or changed
+), unary minus(-), pre/post increment(++), pre/post decrement(--) and logical NOT(!)Other comments
*), Address operator(&) and bitwise NOT(~) are the unary operators that have not been implemented because of unavailability of such nodes or classes in SymPyRelease Notes
+), unary minus(-), pre/post increment(++), pre/post decrement(--) and logical NOT(!) in C parser