Releases: benhoyt/goawk
Version 1.23.1
This is a patch release that fixes a bug in 1.23.0 -- there was a bug that caused a panic in the resolver step with code like function f1(A) {} function f2(x, A) { x[0]; f1(a); f2(a) }
. Fixed in #178.
While we're at it, also fix a panic with certain obscure regexes (#179) and limit ARGC
to a reasonable maximum (#180).
All three of these issues were found by fuzzing: go test ./interp -fuzz=FuzzSource
Version 1.23.0
This release adds a single new feature: support for length(array)
in addition to length(string)
(#176). Calling length()
on an array is quite useful and is supported by all other awk versions (onetrueawk, Gawk, mawk, busybox awk, frawk). In addition, it's been accepted for inclusion into POSIX, though not yet added to the main spec (which seems to take forever).
This release also includes a complete rewrite of the type resolver (#175). Before the code was quite messy and hard to read, now with the two passes I think it's easier to understand and work with. It was certainly easier to add the length(array)
feature with the rewritten resolver than before.
Version 1.22.0
A fairly minor release, fixing some edge cases and adding support for nextfile
:
- Make constructs like
$++lvalue
not an error (#168) - Optimize constant integer array indexes to avoid
toString()
at runtime (#169) - Allow parsing of
cond && var=value
and similar expressions (#170) - Add GroupingExpr to fix
(a)++b
parsing issue; pretty-print precedence (#172) - Add support for
nextfile
(#173)
See full list of commits.
Version 1.21.0
Significant changes in this release:
- Added code coverage support! Thanks, @xonixx, for the idea and implementation.
- Made
-d
,-da
, and-dt
print to stdout and exit (#155). Thanks, @xonixx. - Allowed semicolon as terminator for normal pattern without action. Thanks @juntuu for the bug report and fix.
- Bumped minimum Go version to 1.15.
Version 1.20.0
New features and bug fixes (thanks @paulapatience for the reports):
- Add support for -E argument (like Gawk's -E/--exec).
- Make FNR behavior with and without hyphen argument consistent with other AWKs.
- Set FILENAME to "-" for stdin to be consistent with other AWKs.
Minor changes:
Version 1.19.0
Notable changes in this release:
- Resolve types using topological sort to avoid O(N^2) worst case during parsing
- Ignore UTF-8 BOM at start of CSV files (this is often added by the likes of Excel)
- Interpret escapes in -v and var=value arguments: #132 and #134
- Make regexes match multi-line strings like other AWKs
- Add support for hex and hex floating point number conversions
In other news, check out awk-demo, an amazing "old skool demo" written in AWK by @patsie75. It now works under GoAWK, at least on Linux. Clone that repo and run it with awk=goawk ./demo.sh
!
Thanks to @ko1nksm for several bug reports.
Version 1.18.0
Relatively minor release with the following changes:
- Test on Go 1.18 and update the minimum Go and CI-tested version from 1.13 to 1.14.
- Wire up stdin in system() and don't buffer stdout in goawk command if stdout is a terminal so that you can now play Tetris with GoAWK. :-)
- Wire up ctx through system() for
ExecuteContext
. - Various test and documentation improvements, including a comparison to csvkit in the CSV docs, updating CSV benchmarks to avoid
huge.csv
, and adding explicit tests using ASCII and Unicode unit and record separators. - Repo cleanup: moved the
awkgo
directory and code to a branch and removed it in the master branch; removed the unnecessaryexamples
directory.
Version 1.17.1
Minor test fixes, no change in functionality:
Version 1.17.0
Now with proper CSV input and output support! For example, a simple example showing CSV input parsing and the new @"named-field"
syntax:
$ goawk -i csv -H '{ print @"Abbreviation" }' testdata/csv/states.csv
AL
AK
AZ
...
This feature was sponsored by the library of the University of Antwerp -- many thanks!
Version 1.16.0
- Add
interp.New
...Execute
API to speed up and reduce allocations when executing the same program multiple times. #100 - Add
ExecuteContext
API to support timeout and cancellation. #103 - Optimized string concatenation when concatenating more than two strings, for example
x = "a" "," "b"
. #99 - Reduce allocations in a few other places, such as
print
,printf
,sprintf()
, and field parsing. #102 - Add proper Go 1.18 fuzzing support for fuzzing the AWK source and input. #103