Commit 373421e
fix(builtins): improve AWK parser with match, gensub, power, printf (#192)
## Summary
- Add `match()` function with RSTART/RLENGTH support
- Add `gensub()` function for global/nth substitution
- Add power operator `^` and `**`
- Fix printf width specifiers (`%5s`, `%-20s`, `%05d`) and add `%x`,
`%o`, `%c`
- Fix `as_bool` for numeric strings (enables `!$1` patterns)
- Add `exit` statement with code support
- Add `$0` modification with field re-splitting
- Process escape sequences (`\n`, `\t`) in format strings
## Test plan
- [x] All AWK unit tests pass (45/45)
- [x] AWK spec tests pass with 11 tests unskipped
- [x] `cargo check` clean
Co-authored-by: Claude <noreply@anthropic.com>1 parent 0eed8f8 commit 373421e
2 files changed
Lines changed: 321 additions & 47 deletions
0 commit comments