Closed lmwang9527 closed 4 years ago
Assignments are statements, not expressions (in Python, and also in general, with C being a prominent exception).
Ahh, I hope you can forgive the stupid questions from a novice.
So pymbolic cannot parse statement? Thanks!
Nope. What you can do is use Python's parser
library and process the expressions occurring there with pymbolic, as in this demo.
Yes, I found the code snippet that does statement in the ast interop section of the pymbolic document. Thanks again!
When I parse an assignment expression, I am getting a "ParseError: leftover input after completed parse at index 1: ...=x+1...", while it works fine if I parse only the rhs of the assignment. Is this the expected behavior, or am I missing something? Thanks!