-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Bug
Multiple awk array features are broken, surfaced by eval tasks config_ini_merge, db_csv_join_aggregate, build_script_generator, and config_env_template. All 5 eval models hit these bugs.
1. Array assignment with field references as indices
category[$1] = $3 fails with awk: invalid assignment target. The parser at awk.rs:1020-1082 doesn't recognize FuncCall("__array_access", ...) when field references ($N) are used as subscripts.
echo "a b c" | awk '{ arr[$1] = $3; print arr["a"] }'
# Expected: c
# Actual: awk: invalid assignment target2. Multi-subscript arr[e1, e2] syntax unsupported
POSIX awk a["x","y"] (comma-separated subscripts, concatenated with SUBSEP) fails with expected ']'. The parser at awk.rs:1562 calls parse_expression() which doesn't handle commas as SUBSEP separators inside [].
echo "test" | awk 'BEGIN { a["x","y"] = 1; print a["x","y"] }'
# Expected: 1
# Actual: awk: expected ']'3. SUBSEP variable undefined
The POSIX awk SUBSEP variable (default \034) is never initialized. Grep for "SUBSEP" in awk.rs returns zero matches.
4. Pre-increment of array element ++arr[key] unsupported
++arr[key] fails because the PreIncrement handler at awk.rs:1353 only accepts AwkExpr::Variable(name), but arr[key] parses as FuncCall("__array_access", ...).
echo "a\nb\na" | awk '{ ++count[$1] } END { for (k in count) print k, count[k] }'
# Expected: a 2\nb 1
# Actual: errorImpact
These bugs make any multi-file awk processing with associative arrays impossible. Eval tasks requiring CSV joins, INI merging, or dependency graph processing all fail across all 5 models.
Eval Tasks Affected
config_ini_merge(all 5 models FAIL)db_csv_join_aggregate(Haiku, Opus FAIL)build_script_generator(4/5 FAIL)config_env_template(GPT-5.2, GPT-5.3-Codex FAIL)