Require parenthesized assignment expressions in condition of 'if' statements #2716 (#2729)

* Require parenthesized assignment expressions in condition of 'if' statements #2716

* Move analysis to semantic checker and also check while. And update tests and release notes.

---------

Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
This commit is contained in:
VarunVF
2026-01-15 07:43:58 +08:00
committed by GitHub
parent cd4c586c3f
commit 64ef33f09b
6 changed files with 31 additions and 7 deletions

View File

@@ -249,7 +249,7 @@ fn JsonTokenType? advance(JsonContext* context) @local
{
char c;
// Skip whitespace
while WS: (c = read_next(context)!)
while WS: ((c = read_next(context)!))
{
switch (c)
{
@@ -272,12 +272,12 @@ fn JsonTokenType? advance(JsonContext* context) @local
while COMMENT: (true)
{
// Skip to */
while (c = read_next(context)!)
while ((c = read_next(context)!))
{
if (c == '\n') context.line++;
if (c != '*') continue;
// Skip through all the '*'
while (c = read_next(context)!)
while ((c = read_next(context)!))
{
if (c == '\n') context.line++;
if (c != '*') break;