summaryrefslogtreecommitdiff
path: root/chapter17/README.md
diff options
context:
space:
mode:
authorCliff Click <cliffc@acm.org>2026-09-17 16:39:32 -0700
committerCliff Click <cliffc@acm.org>2026-09-17 16:39:32 -0700
commit200162345900136663027b6deae21d72cf30818c (patch)
treea9b26f38b5f920f61837327ab56f97c5f9a01016 /chapter17/README.md
parent42681f41318796afc58bc14ce04620b7c5c7eb18 (diff)
downloadSimple-200162345900136663027b6deae21d72cf30818c.tar.gz
Simple-200162345900136663027b6deae21d72cf30818c.zip
Backport string escapes and many op-assign
Diffstat (limited to 'chapter17/README.md')
-rw-r--r--chapter17/README.md9
1 files changed, 7 insertions, 2 deletions
diff --git a/chapter17/README.md b/chapter17/README.md
index 331cdc3d..cdbca21b 100644
--- a/chapter17/README.md
+++ b/chapter17/README.md
@@ -25,7 +25,12 @@ Allow pre-increment for identifiers only, for now: `--pc`.
## Operator assignment
Along the same lines as post-increment, we now allow `op=` assignment
-with semantics similar to other languages.
+on local variables with semantics similar to other languages. The supported
+operators are `+=`, `-=`, `*=`, `/=`, `&=`, `|=`, `^=`, `<<=`, `>>=`, and `>>>=`.
+Bitwise and shift assignments require integer operands; `>>=` preserves the sign
+while `>>>=` shifts in zeros. The assignment evaluates its right-hand side once,
+stores the result narrowed to the variable's type, and yields that stored value.
+Assignments associate right-to-left, as in `x |= y <<= 2`.
`x += y`
@@ -159,4 +164,4 @@ for( int i=0; i<ary#; i++ )
if( ary[i]==e )
return i;
return -1;
-``` \ No newline at end of file
+```