Problem:
The language has no mutation syntax separate from declaration. To update a variable you must write bhadwa count matlb count - 1 which is semantically a redeclaration, not a reassignment. This is incorrect behavior — redeclaring an already-defined variable should either error or at minimum be a separate syntax from first declaration.
Expected behavior:
A dedicated assignment syntax for mutation without bhadwa:
Should update the existing variable in the current scope, not redeclare it.
Current behavior:
count matlb count - 1 without bhadwa produces a parse error because the parser only accepts matlb after bhadwa as an assignment. The token matlb is not handled as a standalone statement opener.
Fix required in:
src/parser/parser.cc — parseStatement() needs to handle Identifier followed by Assign as a mutation statement
src/interpreter/evaluator.cc — needs a separate VarAssignStmt execution path that errors if the variable is not already defined
include/ast.h — new VarAssignStmt node separate from VarDeclStmt
Priority: Medium — affects loop patterns, making common programs unwritable without the workaround.
Problem:
The language has no mutation syntax separate from declaration. To update a variable you must write
bhadwa count matlb count - 1which is semantically a redeclaration, not a reassignment. This is incorrect behavior — redeclaring an already-defined variable should either error or at minimum be a separate syntax from first declaration.Expected behavior:
A dedicated assignment syntax for mutation without
bhadwa:Should update the existing variable in the current scope, not redeclare it.
Current behavior:
count matlb count - 1withoutbhadwaproduces a parse error because the parser only acceptsmatlbafterbhadwaas an assignment. The tokenmatlbis not handled as a standalone statement opener.Fix required in:
src/parser/parser.cc—parseStatement()needs to handleIdentifierfollowed byAssignas a mutation statementsrc/interpreter/evaluator.cc— needs a separateVarAssignStmtexecution path that errors if the variable is not already definedinclude/ast.h— newVarAssignStmtnode separate fromVarDeclStmtPriority: Medium — affects loop patterns, making common programs unwritable without the workaround.