diff --git a/README.md b/README.md index 7c94289a..9bb589d3 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ AWK is a fascinating text-processing language, and somehow after reading the delightfully-terse [*The AWK Programming Language*](https://ia802309.us.archive.org/25/items/pdfy-MgN0H1joIoDVoIC7/The_AWK_Programming_Language.pdf) I was inspired to write an interpreter for it in Go. So here it is, feature-complete and tested against "the one true AWK" and GNU AWK test suites. -GoAWK is a POSIX-compatible version of AWK, and additionally has a CSV mode for reading and writing CSV and TSV files. This feature was sponsored by the [library of the University of Antwerp](https://www.uantwerpen.be/en/library/). Read the [CSV documentation](https://github.com/benhoyt/goawk/blob/master/csv.md). +GoAWK is a POSIX-compatible version of AWK, and additionally has a CSV mode for reading and writing CSV and TSV files. This feature was sponsored by the [library of the University of Antwerp](https://www.uantwerpen.be/en/library/). Read the [CSV documentation](https://github.com/benhoyt/goawk/blob/master/docs/csv.md). You can also read one of the articles I've written about GoAWK: @@ -92,7 +92,7 @@ The intention is for GoAWK to conform to `awk`'s behavior and to the [POSIX AWK Additional features GoAWK has over AWK: -* It has proper support for CSV and TSV files ([read the documentation](https://github.com/benhoyt/goawk/blob/master/csv.md)). +* It has proper support for CSV and TSV files ([read the documentation](https://github.com/benhoyt/goawk/blob/master/docs/csv.md)). * It supports negative field indexes to access fields from the right, for example, `$-1` refers to the last field. * It's embeddable in your Go programs! You can even call custom Go functions from your AWK scripts. * Most AWK scripts are faster than `awk` and on a par with `gawk`, though usually slower than `mawk`. (See [recent benchmarks](https://benhoyt.com/writings/goawk-compiler-vm/#virtual-machine-results).) diff --git a/cover.md b/docs/cover.md similarity index 100% rename from cover.md rename to docs/cover.md diff --git a/cover.png b/docs/cover.png similarity index 100% rename from cover.png rename to docs/cover.png diff --git a/csv.md b/docs/csv.md similarity index 100% rename from csv.md rename to docs/csv.md diff --git a/goawk_test.go b/goawk_test.go index 60ec7922..69badeaa 100644 --- a/goawk_test.go +++ b/goawk_test.go @@ -652,7 +652,7 @@ age,email,name Sarah 25 } func TestCSVDocExamples(t *testing.T) { - f, err := os.Open("csv.md") + f, err := os.Open("docs/csv.md") if err != nil { t.Fatalf("error opening examples file: %v", err) } diff --git a/internal/ast/walk.go b/internal/ast/walk.go index a209ac88..5ff509a4 100644 --- a/internal/ast/walk.go +++ b/internal/ast/walk.go @@ -28,7 +28,6 @@ func WalkStmtList(v Visitor, stmts []Stmt) { // v.Visit(node) is not nil, Walk is invoked recursively with visitor // w for each of the non-nil children of node, followed by a call of // w.Visit(nil). -// func Walk(v Visitor, node Node) { if node == nil { return diff --git a/interp/interp.go b/interp/interp.go index cd7e916c..49806264 100644 --- a/interp/interp.go +++ b/interp/interp.go @@ -256,8 +256,8 @@ type Config struct { // You can also enable CSV or TSV input mode by setting INPUTMODE to "csv" // or "tsv" in Vars or in the BEGIN block (those override this setting). // - // For further documentation about GoAWK's CSV support, see the full docs: - // https://github.com/benhoyt/goawk/blob/master/csv.md + // For further documentation about GoAWK's CSV support, see the full docs + // in "../docs/csv.md". InputMode IOMode // Additional options if InputMode is CSVMode or TSVMode. The zero value diff --git a/scripts/make_binaries.sh b/scripts/make_binaries.sh index 769aae39..a43da7d6 100755 --- a/scripts/make_binaries.sh +++ b/scripts/make_binaries.sh @@ -4,18 +4,18 @@ go build VERSION="$(./goawk -version)" GOOS=windows GOARCH=386 go build -ldflags="-w" -zip "goawk_${VERSION}_windows_386.zip" goawk.exe README.md csv.md LICENSE.txt +zip "goawk_${VERSION}_windows_386.zip" goawk.exe README.md LICENSE.txt docs/* GOOS=windows GOARCH=amd64 go build -ldflags="-w" -zip "goawk_${VERSION}_windows_amd64.zip" goawk.exe README.md csv.md LICENSE.txt +zip "goawk_${VERSION}_windows_amd64.zip" goawk.exe README.md LICENSE.txt docs/* GOOS=linux GOARCH=386 go build -ldflags="-w" -tar -cvzf "goawk_${VERSION}_linux_386.tar.gz" goawk README.md csv.md LICENSE.txt +tar -cvzf "goawk_${VERSION}_linux_386.tar.gz" goawk README.md LICENSE.txt docs/* GOOS=linux GOARCH=amd64 go build -ldflags="-w" -tar -cvzf "goawk_${VERSION}_linux_amd64.tar.gz" goawk README.md csv.md LICENSE.txt +tar -cvzf "goawk_${VERSION}_linux_amd64.tar.gz" goawk README.md LICENSE.txt docs/* GOOS=darwin GOARCH=amd64 go build -ldflags="-w" -tar -cvzf "goawk_${VERSION}_darwin_amd64.tar.gz" goawk README.md csv.md LICENSE.txt +tar -cvzf "goawk_${VERSION}_darwin_amd64.tar.gz" goawk README.md LICENSE.txt docs/* GOOS=darwin GOARCH=arm64 go build -ldflags="-w" -tar -cvzf "goawk_${VERSION}_darwin_arm64.tar.gz" goawk README.md csv.md LICENSE.txt +tar -cvzf "goawk_${VERSION}_darwin_arm64.tar.gz" goawk README.md LICENSE.txt docs/* rm -f goawk goawk.exe