Skip to content

Commit 2a9f163

Browse files
sliceleafo
authored andcommitted
document new bitwise update assignment operators (#291)
1 parent b8244cb commit 2a9f163

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

docs/reference.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ variable, or shadow an existing one.
5555

5656
## Update Assignment
5757

58-
`+=`, `-=`, `/=`, `*=`, `%=`, `..=`, `or=`, `and=` operators have been added
59-
for updating and assigning at the same time. They are aliases for their
60-
expanded equivalents.
58+
`+=`, `-=`, `/=`, `*=`, `%=`, `..=`, `or=`, `and=`, `&=`, `|=`, `>>=`, and
59+
`<<=` operators have been added for updating and assigning at the same time.
60+
They are aliases for their expanded equivalents.
6161

6262
```moon
6363
x = 0
@@ -68,6 +68,12 @@ s ..= "world"
6868
6969
b = false
7070
b and= true or false
71+
72+
p = 50
73+
p &= 5
74+
p |= 3
75+
p >>= 3
76+
p <<= 3
7177
```
7278

7379
## Comments

0 commit comments

Comments
 (0)