Skip to content

Latest commit

 

History

History
34 lines (28 loc) · 699 Bytes

AugmentedAssignment.md

File metadata and controls

34 lines (28 loc) · 699 Bytes

Augmented Assignment Transformation

Overview

Unfold the augmented assignment statement into standard binary operation.

Supported augmented operations:

  • +=+
  • -=-
  • *=*
  • @=@
  • /=/
  • //=//
  • %=%
  • **=**
  • >>=>>
  • <<=<<
  • &=&
  • ^=^
  • |=|

To save the order of operations curly brackets are placed. If the augmented operation value contains one or more binary operation we have to surround the expression with curly brackets.

Example:

x += 3
x *= 2 + 2
x = x + 3
x = x * (2 + 2)