Fix five defects the port uncovered in the reference parser and scanner
Chained subtraction and exponentiation fold left instead of abandoning the rest of the line -- `1 - 2 - 3` gave -1 and dropped the `- 3`. A unary leaf's operand moves to .left, so a negative literal is one argument again and a second argument no longer overwrites it. An operator in a line's final column survives. Hex literals reach the parser whole. A leading zero is padding, not a radix. Item 16 stays pinned: the fix works and costs an upstream golden case, which is a decision rather than a defect. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -453,7 +453,8 @@ akerr_ErrorContext *akbasic_runtime_evaluate(akbasic_Runtime *obj, akbasic_ASTLe
|
||||
SUCCEED_RETURN(errctx);
|
||||
|
||||
case AKBASIC_LEAF_UNARY:
|
||||
PASS(errctx, akbasic_runtime_evaluate(obj, expr->right, &rval));
|
||||
/* .left: a unary leaf's operand, kept clear of the argument chain. */
|
||||
PASS(errctx, akbasic_runtime_evaluate(obj, expr->left, &rval));
|
||||
PASS(errctx, akbasic_environment_new_value(obj->environment, &scratch));
|
||||
if ( expr->operator_ == AKBASIC_TOK_MINUS ) {
|
||||
PASS(errctx, akbasic_value_invert(rval, scratch, dest));
|
||||
|
||||
Reference in New Issue
Block a user