From 200162345900136663027b6deae21d72cf30818c Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Thu, 17 Sep 2026 16:39:32 -0700 Subject: Backport string escapes and many op-assign --- chapter17/README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'chapter17/README.md') 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