feat: support augmented assignment (+=, -=, *=) in Python→Laurel translation#573
Merged
aqjune-aws merged 3 commits intomainfrom Mar 19, 2026
Merged
feat: support augmented assignment (+=, -=, *=) in Python→Laurel translation#573aqjune-aws merged 3 commits intomainfrom
aqjune-aws merged 3 commits intomainfrom
Conversation
6e2fcd9 to
1dfa712
Compare
…slation Translates Python augmented assignment to x = x op rhs: - += → PAdd - -= → PSub - *= → PMul - Other operators → Hole (conservative abstraction)
878e5e9 to
8ccfd37
Compare
shigoel
reviewed
Mar 19, 2026
- x //= y → PFloorDiv, x %= y → PMod (consistent with BinOp handling) - Add comment explaining test_augmented_assign is skipped in sarif because PythonToCore doesn't yet support AugAssign
8b0458f to
854a962
Compare
shigoel
approved these changes
Mar 19, 2026
aqjune-aws
approved these changes
Mar 19, 2026
Contributor
|
For the future: we could support this at the Laurel level as well right? I think the meaning of these operators is similar enough across our input languages. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Translates Python augmented assignment (
x += y,x -= y,x *= y) tox = x op rhs.How
AugAssignfor+,-,*operators precisely**,//) fall back toHole(uninterpreted value)Tests
Added
test_augmented_assign.pyverifying+=,-=,*=.