diff --git a/check.anko b/check.anko index 732c8e3..5d91c5a 100644 --- a/check.anko +++ b/check.anko @@ -1,3 +1,5 @@ +var strings = import("strings") + e = 5 v = 53 println(e + v) @@ -6,6 +8,10 @@ for v in Cmd("ls").Stdout().ShSplit() { println("file:", v) } +for v in strings.Split("big dick and me", " ") { + println(v) +} + if v < 55 { println("it fucking works") } diff --git a/go.mod b/go.mod index c84ac99..75637ac 100644 --- a/go.mod +++ b/go.mod @@ -1,9 +1,8 @@ -module github.com/surdeus/goblin +module github.com/mojosa-software/goblin go 1.18 require ( - github.com/surdeus/anko v0.0.0-20230614164331-b18c1239c632 // indirect - github.com/surdeus/gomtool v0.0.0-20230324173629-09da5dcd0204 // indirect - github.com/surdeus/goscript v0.0.0-20230620135552-456d895c0747 // indirect + github.com/mojosa-software/gomtool v0.0.0-20230626085847-176486ff01a2 + github.com/mojosa-software/goscript v0.0.0-20230626091305-86a004b7769c ) diff --git a/go.sum b/go.sum index 60cdcb7..9c14523 100644 --- a/go.sum +++ b/go.sum @@ -1,26 +1,4 @@ -github.com/k1574/gomtool v0.0.0-20220616060224-023d1559d777 h1:r4Wm40GwE7GNC3VbIwVGtD8dPDw5NDsI5xlpcYF5Nv4= -github.com/k1574/gomtool v0.0.0-20220616060224-023d1559d777/go.mod h1:XT2+xWYiSEE6eX/nBgE6UnfIrBfijwPfv4fNJSVD+SA= -github.com/surdeus/anko v0.0.0-20230614164331-b18c1239c632 h1:sbiNV1CbS7LwhLppLn6STcs0PBVHGhjPMPbE/nA1DmE= -github.com/surdeus/anko v0.0.0-20230614164331-b18c1239c632/go.mod h1:4lXky1Kj62zRKAa5nUIwxC19eUZeV4XkEr6MLWd8GMM= -github.com/surdeus/gomtool v0.0.0-20220806023210-bb1d6be89aa1 h1:eTeqQV207H2ho0QFMxgxI75oT8E69aExmX6f6oltl9Y= -github.com/surdeus/gomtool v0.0.0-20220806023210-bb1d6be89aa1/go.mod h1:48d4QXOu0MwH0fbqseBInNdS6WiJ0+EzZU9K5sGu4uo= -github.com/surdeus/gomtool v0.0.0-20221011123848-b7dbc364ea3a h1:fUBhJuFtPNsJCi5//PT+Ni/QMNWzDVig28WK99FTkp0= -github.com/surdeus/gomtool v0.0.0-20221011123848-b7dbc364ea3a/go.mod h1:48d4QXOu0MwH0fbqseBInNdS6WiJ0+EzZU9K5sGu4uo= -github.com/surdeus/gomtool v0.0.0-20221123071619-d67de6873631 h1:dSnG4J2jusYRVnRRmuiqzSkl4vRMIJOQyI04UfKIwIM= -github.com/surdeus/gomtool v0.0.0-20221123071619-d67de6873631/go.mod h1:48d4QXOu0MwH0fbqseBInNdS6WiJ0+EzZU9K5sGu4uo= -github.com/surdeus/gomtool v0.0.0-20230216120523-b00a31dd9887 h1:lKe6TayY2qB50RqPYrHBlHPeJPevNViM+UQn8/2jBxc= -github.com/surdeus/gomtool v0.0.0-20230216120523-b00a31dd9887/go.mod h1:48d4QXOu0MwH0fbqseBInNdS6WiJ0+EzZU9K5sGu4uo= -github.com/surdeus/gomtool v0.0.0-20230324065513-d8d05cb8077d h1:COfpUMABa+RrsD05bOnXDx9FX+oaJ+dnKiLpqOODxl8= -github.com/surdeus/gomtool v0.0.0-20230324065513-d8d05cb8077d/go.mod h1:48d4QXOu0MwH0fbqseBInNdS6WiJ0+EzZU9K5sGu4uo= -github.com/surdeus/gomtool v0.0.0-20230324070550-2fb327b6a6a6 h1:aOXHUmhQS/mCo8r72dERsxAnYrlk/hP61BAyZ79MkDs= -github.com/surdeus/gomtool v0.0.0-20230324070550-2fb327b6a6a6/go.mod h1:48d4QXOu0MwH0fbqseBInNdS6WiJ0+EzZU9K5sGu4uo= -github.com/surdeus/gomtool v0.0.0-20230324073313-c382bc403f8b h1:9IJVeXxRDTPlp12DQ8M76ydoyDCUx6J4up5UM2DwIXQ= -github.com/surdeus/gomtool v0.0.0-20230324073313-c382bc403f8b/go.mod h1:48d4QXOu0MwH0fbqseBInNdS6WiJ0+EzZU9K5sGu4uo= -github.com/surdeus/gomtool v0.0.0-20230324163514-3199e25c3890 h1:mT4VDgCb2AgPfq2k4GfXI8O3I2sIjHJUaJwBvx95AYM= -github.com/surdeus/gomtool v0.0.0-20230324163514-3199e25c3890/go.mod h1:48d4QXOu0MwH0fbqseBInNdS6WiJ0+EzZU9K5sGu4uo= -github.com/surdeus/gomtool v0.0.0-20230324171804-d106f3a7c3da h1:Wm3ZbhHuH/26B4/vde1S/7t3UPdAXVH7aX1LmHtUTWw= -github.com/surdeus/gomtool v0.0.0-20230324171804-d106f3a7c3da/go.mod h1:48d4QXOu0MwH0fbqseBInNdS6WiJ0+EzZU9K5sGu4uo= -github.com/surdeus/gomtool v0.0.0-20230324173629-09da5dcd0204 h1:eNKjFr0w81mb1d3i2P4uAEIzgc6VVTRJJy6BDWq2vK0= -github.com/surdeus/gomtool v0.0.0-20230324173629-09da5dcd0204/go.mod h1:48d4QXOu0MwH0fbqseBInNdS6WiJ0+EzZU9K5sGu4uo= -github.com/surdeus/goscript v0.0.0-20230620135552-456d895c0747 h1:joKa0jw9NNjL2gfMaUP841AGb74737MiQVh0Nsr7NyQ= -github.com/surdeus/goscript v0.0.0-20230620135552-456d895c0747/go.mod h1:zuG5tMqJ18/QMypvrfgaZw3rR/t4mlWPx4pQmQeq6zU= +github.com/mojosa-software/gomtool v0.0.0-20230626085847-176486ff01a2 h1:xbw1/w6ZB8xRmaTS0mQvfTETF8M2/tSBfHJIR+cJyNE= +github.com/mojosa-software/gomtool v0.0.0-20230626085847-176486ff01a2/go.mod h1:cJ6/4rcQ/s22RTLuLtypFh7gubwG4OLSph3NHX3haAw= +github.com/mojosa-software/goscript v0.0.0-20230626091305-86a004b7769c h1:y7RQZz/zJDARRJkn4szD8N2rK6K9NU1vUNPwahtW5zw= +github.com/mojosa-software/goscript v0.0.0-20230626091305-86a004b7769c/go.mod h1:LtBn7lQTgA/TMEL8Y+dGkD6XWHV2gxRPZXiqCZt3HRc= diff --git a/main.go b/main.go index fb60afc..72ab7b3 100644 --- a/main.go +++ b/main.go @@ -1,37 +1,37 @@ package main import ( - "github.com/surdeus/gomtool/src/mtool" + "github.com/mojosa-software/gomtool/src/mtool" - "github.com/surdeus/goblin/src/tool/awk" - "github.com/surdeus/goblin/src/tool/basename" - "github.com/surdeus/goblin/src/tool/cat" - "github.com/surdeus/goblin/src/tool/date" - "github.com/surdeus/goblin/src/tool/ec" - "github.com/surdeus/goblin/src/tool/echo" - "github.com/surdeus/goblin/src/tool/ftest" - "github.com/surdeus/goblin/src/tool/gfalse" - "github.com/surdeus/goblin/src/tool/grange" - "github.com/surdeus/goblin/src/tool/gtrue" - "github.com/surdeus/goblin/src/tool/in" - "github.com/surdeus/goblin/src/tool/ln" - "github.com/surdeus/goblin/src/tool/ls" - "github.com/surdeus/goblin/src/tool/mergelbl" - "github.com/surdeus/goblin/src/tool/mk" - "github.com/surdeus/goblin/src/tool/mkdir" - "github.com/surdeus/goblin/src/tool/noext" - "github.com/surdeus/goblin/src/tool/paths" - "github.com/surdeus/goblin/src/tool/quote" - "github.com/surdeus/goblin/src/tool/read" - "github.com/surdeus/goblin/src/tool/sort" - "github.com/surdeus/goblin/src/tool/tac" - "github.com/surdeus/goblin/src/tool/uniq" - "github.com/surdeus/goblin/src/tool/urlprs" - "github.com/surdeus/goblin/src/tool/useprog" - "github.com/surdeus/goblin/src/tool/wc" - "github.com/surdeus/goblin/src/tool/whoami" - "github.com/surdeus/goblin/src/tool/yes" - "github.com/surdeus/goblin/src/tool/script" + "github.com/mojosa-software/goblin/src/tool/awk" + "github.com/mojosa-software/goblin/src/tool/basename" + "github.com/mojosa-software/goblin/src/tool/cat" + "github.com/mojosa-software/goblin/src/tool/date" + "github.com/mojosa-software/goblin/src/tool/ec" + "github.com/mojosa-software/goblin/src/tool/echo" + "github.com/mojosa-software/goblin/src/tool/ftest" + "github.com/mojosa-software/goblin/src/tool/gfalse" + "github.com/mojosa-software/goblin/src/tool/grange" + "github.com/mojosa-software/goblin/src/tool/gtrue" + "github.com/mojosa-software/goblin/src/tool/in" + "github.com/mojosa-software/goblin/src/tool/ln" + "github.com/mojosa-software/goblin/src/tool/ls" + "github.com/mojosa-software/goblin/src/tool/mergelbl" + "github.com/mojosa-software/goblin/src/tool/mk" + "github.com/mojosa-software/goblin/src/tool/mkdir" + "github.com/mojosa-software/goblin/src/tool/noext" + "github.com/mojosa-software/goblin/src/tool/paths" + "github.com/mojosa-software/goblin/src/tool/quote" + "github.com/mojosa-software/goblin/src/tool/read" + "github.com/mojosa-software/goblin/src/tool/sort" + "github.com/mojosa-software/goblin/src/tool/tac" + "github.com/mojosa-software/goblin/src/tool/uniq" + "github.com/mojosa-software/goblin/src/tool/urlprs" + "github.com/mojosa-software/goblin/src/tool/useprog" + "github.com/mojosa-software/goblin/src/tool/wc" + "github.com/mojosa-software/goblin/src/tool/whoami" + "github.com/mojosa-software/goblin/src/tool/yes" + "github.com/mojosa-software/goblin/src/tool/script" ) func main() { diff --git a/media/goblin.jpg b/media/goblin.jpg index c561ae7..96d90ea 100644 Binary files a/media/goblin.jpg and b/media/goblin.jpg differ diff --git a/src/tool/awk/csv.md b/src/tool/awk/csv.md index ecbd872..f0dfa45 100644 --- a/src/tool/awk/csv.md +++ b/src/tool/awk/csv.md @@ -93,12 +93,12 @@ if err != nil { ... } Note that `INPUTMODE` and `OUTPUTMODE` set using `Vars` or in the `BEGIN` block will override these settings. -See the [full reference documentation](https://pkg.go.dev/github.com/surdeus/goblin/src/tool/awk/interp#Config) for the `interp.Config` struct. +See the [full reference documentation](https://pkg.go.dev/github.com/mojosa-software/goblin/src/tool/awk/interp#Config) for the `interp.Config` struct. ## Examples -Below are some examples using the [testdata/csv/states.csv](https://github.com/surdeus/goblin/src/tool/awk/blob/master/testdata/csv/states.csv) file, which is a simple CSV file whose contents are as follows: +Below are some examples using the [testdata/csv/states.csv](https://github.com/mojosa-software/goblin/src/tool/awk/blob/master/testdata/csv/states.csv) file, which is a simple CSV file whose contents are as follows: ``` "State","Abbreviation" @@ -278,7 +278,7 @@ NY The [csvkit](https://csvkit.readthedocs.io/en/latest/index.html) suite is a set of tools that allow you to quickly analyze and extract fields from CSV files. Each csvkit tool allows you to do a specific task; GoAWK is more low-level and verbose, but also a more general tool ([`csvsql`](https://csvkit.readthedocs.io/en/latest/tutorial/3_power_tools.html#csvsql-and-sql2csv-ultimate-power) being the exception!). GoAWK also runs significantly faster than csvkit (the latter is written in Python). -Below are a few snippets showing how you'd do some of the tasks in the csvkit documentation, but using GoAWK (the input file is [testdata/csv/nz-schools.csv](https://github.com/surdeus/goblin/src/tool/awk/blob/master/testdata/csv/nz-schools.csv)): +Below are a few snippets showing how you'd do some of the tasks in the csvkit documentation, but using GoAWK (the input file is [testdata/csv/nz-schools.csv](https://github.com/mojosa-software/goblin/src/tool/awk/blob/master/testdata/csv/nz-schools.csv)): ### csvkit example: print column names @@ -363,7 +363,7 @@ $ goawk -i csv -H '/Girls/ { d+=@"Decile"; n++ } END { print d/n }' testdata/csv The performance of GoAWK's CSV input and output mode is quite good, on a par with using the `encoding/csv` package from Go directly, and much faster than the `csv` module in Python. CSV input speed is significantly slower than `frawk`, though CSV output speed is significantly faster than `frawk`. -Below are the results of some simple read and write [benchmarks](https://github.com/surdeus/goblin/src/tool/awk/blob/master/scripts/csvbench) using `goawk` and `frawk` as well as plain Python and Go. The output of the write benchmarks is a 1GB, 3.5 million row CSV file with 20 columns (including quoted columns); the input for the read benchmarks uses that same file. Times are in seconds, showing the best of three runs on a 64-bit Linux laptop with an SSD drive: +Below are the results of some simple read and write [benchmarks](https://github.com/mojosa-software/goblin/src/tool/awk/blob/master/scripts/csvbench) using `goawk` and `frawk` as well as plain Python and Go. The output of the write benchmarks is a 1GB, 3.5 million row CSV file with 20 columns (including quoted columns); the input for the read benchmarks uses that same file. Times are in seconds, showing the best of three runs on a 64-bit Linux laptop with an SSD drive: Test | goawk | frawk | Python | Go --------------- | ----- | ----- | ------ | ---- @@ -378,10 +378,10 @@ Writing 1GB CSV | 5.64 | 13.0 | 17.0 | 3.24 - keys would be ordered by `OFIELDS` (eg: `OFIELDS[1] = "name"; OFIELDS[2] = "age"`) or by "smart name" if `OFIELDS` not set ("smart name" meaning numeric if `a` keys are numeric, string otherwise) - `printrow(a)` could take an optional second `fields` array arg to use that instead of the global `OFIELDS` * Consider allowing `-H` to accept an optional list of field names which could be used as headers in the absence of headers in the file itself (either `-H=name,age` or `-i 'csv header=name,age'`). -* Consider adding TrimLeadingSpace CSV input option. See: https://github.com/surdeus/goblin/src/tool/awk/issues/109 +* Consider adding TrimLeadingSpace CSV input option. See: https://github.com/mojosa-software/goblin/src/tool/awk/issues/109 * Consider supporting `@"id" = 42` named field assignment. ## Feedback -Please [open an issue](https://github.com/surdeus/goblin/src/tool/awk/issues) if you have bug reports or feature requests for GoAWK's CSV support. +Please [open an issue](https://github.com/mojosa-software/goblin/src/tool/awk/issues) if you have bug reports or feature requests for GoAWK's CSV support. diff --git a/src/tool/awk/goawk b/src/tool/awk/goawk index 0963ef9..d9fbe96 100755 Binary files a/src/tool/awk/goawk and b/src/tool/awk/goawk differ diff --git a/src/tool/awk/goawk.go b/src/tool/awk/goawk.go index 0e6ac28..a55ce95 100644 --- a/src/tool/awk/goawk.go +++ b/src/tool/awk/goawk.go @@ -38,11 +38,11 @@ import ( "strings" "unicode/utf8" - "github.com/surdeus/goblin/src/tool/awk/interp" - "github.com/surdeus/goblin/src/tool/awk/lexer" - "github.com/surdeus/goblin/src/tool/awk/parser" + "github.com/mojosa-software/goblin/src/tool/awk/interp" + "github.com/mojosa-software/goblin/src/tool/awk/lexer" + "github.com/mojosa-software/goblin/src/tool/awk/parser" - "github.com/surdeus/gomtool/src/mtool" + "github.com/mojosa-software/gomtool/src/mtool" ) const ( diff --git a/src/tool/awk/goawk_test.go b/src/tool/awk/goawk_test.go index 93452b3..7360d65 100644 --- a/src/tool/awk/goawk_test.go +++ b/src/tool/awk/goawk_test.go @@ -18,8 +18,8 @@ import ( "sync" "testing" - "github.com/surdeus/goblin/src/tool/awk/interp" - "github.com/surdeus/goblin/src/tool/awk/parser" + "github.com/mojosa-software/goblin/src/tool/awk/interp" + "github.com/mojosa-software/goblin/src/tool/awk/parser" ) var ( diff --git a/src/tool/awk/internal/ast/ast.go b/src/tool/awk/internal/ast/ast.go index 916fd6b..3ef56fe 100644 --- a/src/tool/awk/internal/ast/ast.go +++ b/src/tool/awk/internal/ast/ast.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - . "github.com/surdeus/goblin/src/tool/awk/lexer" + . "github.com/mojosa-software/goblin/src/tool/awk/lexer" ) // Program is an entire AWK program. diff --git a/src/tool/awk/internal/compiler/compiler.go b/src/tool/awk/internal/compiler/compiler.go index f42b9a1..04ee7d3 100644 --- a/src/tool/awk/internal/compiler/compiler.go +++ b/src/tool/awk/internal/compiler/compiler.go @@ -6,8 +6,8 @@ import ( "math" "regexp" - "github.com/surdeus/goblin/src/tool/awk/internal/ast" - "github.com/surdeus/goblin/src/tool/awk/lexer" + "github.com/mojosa-software/goblin/src/tool/awk/internal/ast" + "github.com/mojosa-software/goblin/src/tool/awk/lexer" ) // Program holds an entire compiled program. diff --git a/src/tool/awk/internal/compiler/disassembler.go b/src/tool/awk/internal/compiler/disassembler.go index 8c8826f..37c2162 100644 --- a/src/tool/awk/internal/compiler/disassembler.go +++ b/src/tool/awk/internal/compiler/disassembler.go @@ -7,8 +7,8 @@ import ( "io" "strings" - "github.com/surdeus/goblin/src/tool/awk/internal/ast" - "github.com/surdeus/goblin/src/tool/awk/lexer" + "github.com/mojosa-software/goblin/src/tool/awk/internal/ast" + "github.com/mojosa-software/goblin/src/tool/awk/lexer" ) // Disassemble writes a human-readable form of the program's virtual machine diff --git a/src/tool/awk/interp/example_test.go b/src/tool/awk/interp/example_test.go index 7605ac2..b2f2fd6 100644 --- a/src/tool/awk/interp/example_test.go +++ b/src/tool/awk/interp/example_test.go @@ -9,8 +9,8 @@ import ( "fmt" "strings" - "github.com/surdeus/goblin/src/tool/awk/interp" - "github.com/surdeus/goblin/src/tool/awk/parser" + "github.com/mojosa-software/goblin/src/tool/awk/interp" + "github.com/mojosa-software/goblin/src/tool/awk/parser" ) func Example() { diff --git a/src/tool/awk/interp/functions.go b/src/tool/awk/interp/functions.go index c5ffa6a..c7f3dbf 100644 --- a/src/tool/awk/interp/functions.go +++ b/src/tool/awk/interp/functions.go @@ -12,8 +12,8 @@ import ( "strings" "unicode/utf8" - "github.com/surdeus/goblin/src/tool/awk/internal/ast" - . "github.com/surdeus/goblin/src/tool/awk/lexer" + "github.com/mojosa-software/goblin/src/tool/awk/internal/ast" + . "github.com/mojosa-software/goblin/src/tool/awk/lexer" ) // Call native-defined function with given name and arguments, return diff --git a/src/tool/awk/interp/fuzz_test.go b/src/tool/awk/interp/fuzz_test.go index 6adef60..fc4ee4c 100644 --- a/src/tool/awk/interp/fuzz_test.go +++ b/src/tool/awk/interp/fuzz_test.go @@ -13,8 +13,8 @@ import ( "testing" "time" - "github.com/surdeus/goblin/src/tool/awk/interp" - "github.com/surdeus/goblin/src/tool/awk/parser" + "github.com/mojosa-software/goblin/src/tool/awk/interp" + "github.com/mojosa-software/goblin/src/tool/awk/parser" ) func isFuzzTest(test interpTest) bool { diff --git a/src/tool/awk/interp/interp.go b/src/tool/awk/interp/interp.go index f373b56..36c1b2e 100644 --- a/src/tool/awk/interp/interp.go +++ b/src/tool/awk/interp/interp.go @@ -28,9 +28,9 @@ import ( "strings" "unicode/utf8" - "github.com/surdeus/goblin/src/tool/awk/internal/ast" - "github.com/surdeus/goblin/src/tool/awk/internal/compiler" - "github.com/surdeus/goblin/src/tool/awk/parser" + "github.com/mojosa-software/goblin/src/tool/awk/internal/ast" + "github.com/mojosa-software/goblin/src/tool/awk/internal/compiler" + "github.com/mojosa-software/goblin/src/tool/awk/parser" ) var ( @@ -250,7 +250,7 @@ type Config struct { // 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/surdeus/goblin/src/tool/awk/blob/master/csv.md + // https://github.com/mojosa-software/goblin/src/tool/awk/blob/master/csv.md InputMode IOMode // Additional options if InputMode is CSVMode or TSVMode. The zero value diff --git a/src/tool/awk/interp/interp_test.go b/src/tool/awk/interp/interp_test.go index e9cd9cf..97768a2 100644 --- a/src/tool/awk/interp/interp_test.go +++ b/src/tool/awk/interp/interp_test.go @@ -18,8 +18,8 @@ import ( "sync" "testing" - "github.com/surdeus/goblin/src/tool/awk/interp" - "github.com/surdeus/goblin/src/tool/awk/parser" + "github.com/mojosa-software/goblin/src/tool/awk/interp" + "github.com/mojosa-software/goblin/src/tool/awk/parser" ) var ( diff --git a/src/tool/awk/interp/io.go b/src/tool/awk/interp/io.go index 8de8ad4..a46ef66 100644 --- a/src/tool/awk/interp/io.go +++ b/src/tool/awk/interp/io.go @@ -17,8 +17,8 @@ import ( "strings" "unicode/utf8" - "github.com/surdeus/goblin/src/tool/awk/internal/ast" - . "github.com/surdeus/goblin/src/tool/awk/lexer" + "github.com/mojosa-software/goblin/src/tool/awk/internal/ast" + . "github.com/mojosa-software/goblin/src/tool/awk/lexer" ) // Print a line of output followed by a newline diff --git a/src/tool/awk/interp/newexecute.go b/src/tool/awk/interp/newexecute.go index f931762..3c4f269 100644 --- a/src/tool/awk/interp/newexecute.go +++ b/src/tool/awk/interp/newexecute.go @@ -6,7 +6,7 @@ import ( "context" "math" - "github.com/surdeus/goblin/src/tool/awk/parser" + "github.com/mojosa-software/goblin/src/tool/awk/parser" ) const checkContextOps = 1000 // for efficiency, only check context every N instructions diff --git a/src/tool/awk/interp/newexecute_test.go b/src/tool/awk/interp/newexecute_test.go index 008a709..347a1e8 100644 --- a/src/tool/awk/interp/newexecute_test.go +++ b/src/tool/awk/interp/newexecute_test.go @@ -10,8 +10,8 @@ import ( "testing" "time" - "github.com/surdeus/goblin/src/tool/awk/interp" - "github.com/surdeus/goblin/src/tool/awk/parser" + "github.com/mojosa-software/goblin/src/tool/awk/interp" + "github.com/mojosa-software/goblin/src/tool/awk/parser" ) // This definitely doesn't test that everything was reset, but it's a good start. diff --git a/src/tool/awk/interp/vm.go b/src/tool/awk/interp/vm.go index f182cfc..0b80253 100644 --- a/src/tool/awk/interp/vm.go +++ b/src/tool/awk/interp/vm.go @@ -10,15 +10,15 @@ import ( "strings" "time" - "github.com/surdeus/goblin/src/tool/awk/internal/ast" - "github.com/surdeus/goblin/src/tool/awk/internal/compiler" - "github.com/surdeus/goblin/src/tool/awk/lexer" + "github.com/mojosa-software/goblin/src/tool/awk/internal/ast" + "github.com/mojosa-software/goblin/src/tool/awk/internal/compiler" + "github.com/mojosa-software/goblin/src/tool/awk/lexer" ) // Execute a block of virtual machine instructions. // // A big switch seems to be the best way of doing this for now. I also tried -// an array of functions (https://github.com/surdeus/goblin/src/tool/awk/commit/8e04b069b621ff9b9456de57a35ff2fe335cf201) +// an array of functions (https://github.com/mojosa-software/goblin/src/tool/awk/commit/8e04b069b621ff9b9456de57a35ff2fe335cf201) // and it was ever so slightly faster, but the code was harder to work with // and it won't be improved when Go gets faster switches via jump tables // (https://go-review.googlesource.com/c/go/+/357330/). @@ -1205,7 +1205,7 @@ func (p *interp) getline(redirect lexer.Token) (float64, string, error) { if err != nil { if _, ok := err.(*os.PathError); ok { // File not found is not a hard error, getline just returns -1. - // See: https://github.com/surdeus/goblin/src/tool/awk/issues/41 + // See: https://github.com/mojosa-software/goblin/src/tool/awk/issues/41 return -1, "", nil } return 0, "", err diff --git a/src/tool/awk/lexer/lexer_test.go b/src/tool/awk/lexer/lexer_test.go index dffd862..4b27cef 100644 --- a/src/tool/awk/lexer/lexer_test.go +++ b/src/tool/awk/lexer/lexer_test.go @@ -8,7 +8,7 @@ import ( "strings" "testing" - . "github.com/surdeus/goblin/src/tool/awk/lexer" + . "github.com/mojosa-software/goblin/src/tool/awk/lexer" ) func TestLexer(t *testing.T) { diff --git a/src/tool/awk/parser/parser.go b/src/tool/awk/parser/parser.go index 303948c..ea534e6 100644 --- a/src/tool/awk/parser/parser.go +++ b/src/tool/awk/parser/parser.go @@ -11,9 +11,9 @@ import ( "strconv" "strings" - "github.com/surdeus/goblin/src/tool/awk/internal/ast" - "github.com/surdeus/goblin/src/tool/awk/internal/compiler" - . "github.com/surdeus/goblin/src/tool/awk/lexer" + "github.com/mojosa-software/goblin/src/tool/awk/internal/ast" + "github.com/mojosa-software/goblin/src/tool/awk/internal/compiler" + . "github.com/mojosa-software/goblin/src/tool/awk/lexer" ) // ParseError (actually *ParseError) is the type of error returned by diff --git a/src/tool/awk/parser/parser_test.go b/src/tool/awk/parser/parser_test.go index 60eef98..1cda9be 100644 --- a/src/tool/awk/parser/parser_test.go +++ b/src/tool/awk/parser/parser_test.go @@ -8,7 +8,7 @@ import ( "strings" "testing" - "github.com/surdeus/goblin/src/tool/awk/parser" + "github.com/mojosa-software/goblin/src/tool/awk/parser" ) // NOTE: apart from TestParseAndString, the parser doesn't have diff --git a/src/tool/awk/parser/resolve.go b/src/tool/awk/parser/resolve.go index c1258e4..eb540f6 100644 --- a/src/tool/awk/parser/resolve.go +++ b/src/tool/awk/parser/resolve.go @@ -7,8 +7,8 @@ import ( "reflect" "sort" - "github.com/surdeus/goblin/src/tool/awk/internal/ast" - . "github.com/surdeus/goblin/src/tool/awk/lexer" + "github.com/mojosa-software/goblin/src/tool/awk/internal/ast" + . "github.com/mojosa-software/goblin/src/tool/awk/lexer" ) type varType int diff --git a/src/tool/awk/readme.md b/src/tool/awk/readme.md index cda9ced..1fee6ca 100644 --- a/src/tool/awk/readme.md +++ b/src/tool/awk/readme.md @@ -1,13 +1,13 @@ # GoAWK: an AWK interpreter with CSV support -[![Documentation](https://pkg.go.dev/badge/github.com/surdeus/goblin/src/tool/awk)](https://pkg.go.dev/github.com/surdeus/goblin/src/tool/awk) -[![GitHub Actions Build](https://github.com/surdeus/goblin/src/tool/awk/workflows/Go/badge.svg)](https://github.com/surdeus/goblin/src/tool/awk/actions?query=workflow%3AGo) +[![Documentation](https://pkg.go.dev/badge/github.com/mojosa-software/goblin/src/tool/awk)](https://pkg.go.dev/github.com/mojosa-software/goblin/src/tool/awk) +[![GitHub Actions Build](https://github.com/mojosa-software/goblin/src/tool/awk/workflows/Go/badge.svg)](https://github.com/mojosa-software/goblin/src/tool/awk/actions?query=workflow%3AGo) 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/surdeus/goblin/src/tool/awk/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/mojosa-software/goblin/src/tool/awk/blob/master/csv.md). You can also read one of the articles I've written about GoAWK: @@ -21,7 +21,7 @@ You can also read one of the articles I've written about GoAWK: To use the command-line version, simply use `go install` to install it, and then run it using `goawk` (assuming `~/go/bin` is in your `PATH`): ```shell -$ go install github.com/surdeus/goblin/src/tool/awk@latest +$ go install github.com/mojosa-software/goblin/src/tool/awk@latest $ goawk 'BEGIN { print "foo", 42 }' foo 42 @@ -82,9 +82,9 @@ if err != nil { // 3:abc ``` -If you need to repeat execution of the same program on different inputs, you can call [`interp.New`](https://pkg.go.dev/github.com/surdeus/goblin/src/tool/awk/interp#New) once, and then call the returned object's `Execute` method as many times as you need. +If you need to repeat execution of the same program on different inputs, you can call [`interp.New`](https://pkg.go.dev/github.com/mojosa-software/goblin/src/tool/awk/interp#New) once, and then call the returned object's `Execute` method as many times as you need. -Read the [package documentation](https://pkg.go.dev/github.com/surdeus/goblin/src/tool/awk) for more details. +Read the [package documentation](https://pkg.go.dev/github.com/mojosa-software/goblin/src/tool/awk) for more details. ## Differences from AWK @@ -93,7 +93,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/surdeus/goblin/src/tool/awk/blob/master/csv.md)). +* It has proper support for CSV and TSV files ([read the documentation](https://github.com/mojosa-software/goblin/src/tool/awk/blob/master/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).) @@ -112,12 +112,12 @@ This project has a good suite of tests, which include my own intepreter tests, t ## AWKGo -The GoAWK repository also includes the creatively-named AWKGo, an AWK-to-Go compiler. This is experimental and is not subject to the stability requirements of GoAWK itself. You can [read more about AWKGo](https://benhoyt.com/writings/awkgo/) or browse the code on the [`awkgo` branch](https://github.com/surdeus/goblin/src/tool/awk/tree/awkgo/awkgo). +The GoAWK repository also includes the creatively-named AWKGo, an AWK-to-Go compiler. This is experimental and is not subject to the stability requirements of GoAWK itself. You can [read more about AWKGo](https://benhoyt.com/writings/awkgo/) or browse the code on the [`awkgo` branch](https://github.com/mojosa-software/goblin/src/tool/awk/tree/awkgo/awkgo). ## License -GoAWK is licensed under an open source [MIT license](https://github.com/surdeus/goblin/src/tool/awk/blob/master/LICENSE.txt). +GoAWK is licensed under an open source [MIT license](https://github.com/mojosa-software/goblin/src/tool/awk/blob/master/LICENSE.txt). ## The end diff --git a/src/tool/awk/testdata/echo b/src/tool/awk/testdata/echo index 6db178e..7493374 100755 Binary files a/src/tool/awk/testdata/echo and b/src/tool/awk/testdata/echo differ diff --git a/src/tool/basename/run.go b/src/tool/basename/run.go index f6b0bbb..3aca3cf 100644 --- a/src/tool/basename/run.go +++ b/src/tool/basename/run.go @@ -4,7 +4,7 @@ package basename import( "fmt" "path" - "github.com/surdeus/gomtool/src/mtool" + "github.com/mojosa-software/gomtool/src/mtool" ) var( diff --git a/src/tool/cat/cat.go b/src/tool/cat/cat.go index eb525b9..5fa3b3c 100644 --- a/src/tool/cat/cat.go +++ b/src/tool/cat/cat.go @@ -4,7 +4,7 @@ import( "os" "io" "fmt" - "github.com/surdeus/gomtool/src/mtool" + "github.com/mojosa-software/gomtool/src/mtool" ) var( diff --git a/src/tool/date/date.go b/src/tool/date/date.go index 4c8b649..9a7db3f 100644 --- a/src/tool/date/date.go +++ b/src/tool/date/date.go @@ -3,7 +3,7 @@ package date import( "fmt" "time" - "github.com/surdeus/gomtool/src/mtool" + "github.com/mojosa-software/gomtool/src/mtool" ) func Run(flagSet *mtool.Flags) { diff --git a/src/tool/ec/run.go b/src/tool/ec/run.go index 38f869d..d391bff 100644 --- a/src/tool/ec/run.go +++ b/src/tool/ec/run.go @@ -6,7 +6,7 @@ import( "os" "bufio" "log" - "github.com/surdeus/gomtool/src/mtool" + "github.com/mojosa-software/gomtool/src/mtool" ) const( diff --git a/src/tool/echo/echo.go b/src/tool/echo/echo.go index 5bf7704..c152f26 100644 --- a/src/tool/echo/echo.go +++ b/src/tool/echo/echo.go @@ -3,7 +3,7 @@ package echo import ( "fmt" - "github.com/surdeus/gomtool/src/mtool" + "github.com/mojosa-software/gomtool/src/mtool" ) var( diff --git a/src/tool/ftest/main.go b/src/tool/ftest/main.go index a406c32..528e630 100644 --- a/src/tool/ftest/main.go +++ b/src/tool/ftest/main.go @@ -5,7 +5,7 @@ import ( "io" "bufio" "fmt" - "github.com/surdeus/gomtool/src/mtool" + "github.com/mojosa-software/gomtool/src/mtool" "path/filepath" ) diff --git a/src/tool/gfalse/false.go b/src/tool/gfalse/false.go index ba9d279..01bcc38 100644 --- a/src/tool/gfalse/false.go +++ b/src/tool/gfalse/false.go @@ -2,7 +2,7 @@ package gfalse import( "os" - "github.com/surdeus/gomtool/src/mtool" + "github.com/mojosa-software/gomtool/src/mtool" ) func Run(flags *mtool.Flags) { diff --git a/src/tool/grange/main.go b/src/tool/grange/main.go index aba21e2..8cf2d24 100644 --- a/src/tool/grange/main.go +++ b/src/tool/grange/main.go @@ -3,7 +3,7 @@ package grange import( "fmt" "strconv" - "github.com/surdeus/gomtool/src/mtool" + "github.com/mojosa-software/gomtool/src/mtool" ) var( diff --git a/src/tool/gtrue/true.go b/src/tool/gtrue/true.go index cf6c67d..d6df09c 100644 --- a/src/tool/gtrue/true.go +++ b/src/tool/gtrue/true.go @@ -1,5 +1,5 @@ package gtrue -import "github.com/surdeus/gomtool/src/mtool" +import "github.com/mojosa-software/gomtool/src/mtool" func Run(flags *mtool.Flags) {} diff --git a/src/tool/in/main.go b/src/tool/in/main.go index f414c3a..d5c58c4 100644 --- a/src/tool/in/main.go +++ b/src/tool/in/main.go @@ -5,7 +5,7 @@ import ( "io" "bufio" "fmt" - "github.com/surdeus/gomtool/src/mtool" + "github.com/mojosa-software/gomtool/src/mtool" ) func Run(flagSet *mtool.Flags) { diff --git a/src/tool/ln/main.go b/src/tool/ln/main.go index 9f542c7..00bd53f 100644 --- a/src/tool/ln/main.go +++ b/src/tool/ln/main.go @@ -3,7 +3,7 @@ package ln import ( "fmt" "os" - "github.com/surdeus/gomtool/src/mtool" + "github.com/mojosa-software/gomtool/src/mtool" "path/filepath" ) diff --git a/src/tool/ls/ls.go b/src/tool/ls/ls.go index aa674c5..7767b44 100644 --- a/src/tool/ls/ls.go +++ b/src/tool/ls/ls.go @@ -5,7 +5,7 @@ import( "strings" "regexp" "path" - "github.com/surdeus/gomtool/src/mtool" + "github.com/mojosa-software/gomtool/src/mtool" ) var( diff --git a/src/tool/mergelbl/main.go b/src/tool/mergelbl/main.go index 3170933..3319a40 100644 --- a/src/tool/mergelbl/main.go +++ b/src/tool/mergelbl/main.go @@ -5,7 +5,7 @@ import( "fmt" "bufio" "log" - "github.com/surdeus/gomtool/src/mtool" + "github.com/mojosa-software/gomtool/src/mtool" ) func Run(flagSet *mtool.Flags) { diff --git a/src/tool/mk/main.go b/src/tool/mk/main.go index 64b1cb7..23a0db0 100644 --- a/src/tool/mk/main.go +++ b/src/tool/mk/main.go @@ -9,8 +9,8 @@ import ( "strings" "sync" - "github.com/surdeus/goblin/src/pathx" - "github.com/surdeus/gomtool/src/mtool" + "github.com/mojosa-software/goblin/src/pathx" + "github.com/mojosa-software/gomtool/src/mtool" ) // True if messages should be printed without fancy colors. diff --git a/src/tool/mk/parse.go b/src/tool/mk/parse.go index c75fb54..ccf4a61 100644 --- a/src/tool/mk/parse.go +++ b/src/tool/mk/parse.go @@ -11,7 +11,7 @@ import ( "regexp" "strings" - "github.com/surdeus/goblin/src/pathx" + "github.com/mojosa-software/goblin/src/pathx" ) type parser struct { diff --git a/src/tool/mkdir/mkdir.go b/src/tool/mkdir/mkdir.go index 53c0573..f53c0f5 100644 --- a/src/tool/mkdir/mkdir.go +++ b/src/tool/mkdir/mkdir.go @@ -5,7 +5,7 @@ import ( "os" "path/filepath" - "github.com/surdeus/gomtool/src/mtool" + "github.com/mojosa-software/gomtool/src/mtool" ) func Run(flagSet *mtool.Flags) { diff --git a/src/tool/noext/noext.go b/src/tool/noext/noext.go index 9633694..02dd5e1 100644 --- a/src/tool/noext/noext.go +++ b/src/tool/noext/noext.go @@ -3,7 +3,7 @@ package noext import( "fmt" - "github.com/surdeus/gomtool/src/mtool" + "github.com/mojosa-software/gomtool/src/mtool" ) var( diff --git a/src/tool/paths/main.go b/src/tool/paths/main.go index 34fe816..a2888d3 100644 --- a/src/tool/paths/main.go +++ b/src/tool/paths/main.go @@ -9,9 +9,9 @@ import ( "path" "strings" - //"github.com/surdeus/goblin/src/pathx" + //"github.com/mojosa-software/goblin/src/pathx" "path/filepath" - "github.com/surdeus/gomtool/src/mtool" + "github.com/mojosa-software/gomtool/src/mtool" ) var ( diff --git a/src/tool/quote/quote.go b/src/tool/quote/quote.go index f61a65f..1252854 100644 --- a/src/tool/quote/quote.go +++ b/src/tool/quote/quote.go @@ -7,7 +7,7 @@ import( "fmt" "unicode" "bufio" - "github.com/surdeus/gomtool/src/mtool" + "github.com/mojosa-software/gomtool/src/mtool" ) func HasWhiteSpace(s string) bool { diff --git a/src/tool/read/main.go b/src/tool/read/main.go index dcdb1f3..16ae7a2 100644 --- a/src/tool/read/main.go +++ b/src/tool/read/main.go @@ -4,7 +4,7 @@ import( "os" "bufio" "fmt" - "github.com/surdeus/gomtool/src/mtool" + "github.com/mojosa-software/gomtool/src/mtool" ) var( diff --git a/src/tool/script/main.go b/src/tool/script/main.go index 719538c..ece27f4 100644 --- a/src/tool/script/main.go +++ b/src/tool/script/main.go @@ -11,12 +11,12 @@ import ( "os" "strings" - "github.com/surdeus/goscript/core" - "github.com/surdeus/goscript/env" - _ "github.com/surdeus/goscript/packages" - "github.com/surdeus/goscript/parser" - "github.com/surdeus/goscript/vm" - "github.com/surdeus/gomtool/src/mtool" + "github.com/mojosa-software/goscript/core" + "github.com/mojosa-software/goscript/env" + _ "github.com/mojosa-software/goscript/packages" + "github.com/mojosa-software/goscript/parser" + "github.com/mojosa-software/goscript/vm" + "github.com/mojosa-software/gomtool/src/mtool" "os/exec" //"bytes" ) @@ -53,7 +53,6 @@ func (o Output) Split(sep string) []string { return strings.Split(o.String(), sep) } - func Run(flagSet *mtool.Flags) { printVersion := flagSet.Bool("v", false, "prints out the version and then exits") diff --git a/src/tool/sort/sort.go b/src/tool/sort/sort.go index 228acf0..b2a63c1 100644 --- a/src/tool/sort/sort.go +++ b/src/tool/sort/sort.go @@ -4,8 +4,8 @@ import ( "fmt" "os" "sort" - "github.com/surdeus/goblin/src/input" - "github.com/surdeus/gomtool/src/mtool" + "github.com/mojosa-software/goblin/src/input" + "github.com/mojosa-software/gomtool/src/mtool" ) func Run(flagSet *mtool.Flags) { diff --git a/src/tool/tac/tac.go b/src/tool/tac/tac.go index b1108db..1ca70c9 100644 --- a/src/tool/tac/tac.go +++ b/src/tool/tac/tac.go @@ -5,7 +5,7 @@ import( "io" "fmt" "bufio" - "github.com/surdeus/gomtool/src/mtool" + "github.com/mojosa-software/gomtool/src/mtool" ) func reverse(a []string) chan string { diff --git a/src/tool/uniq/uniq.go b/src/tool/uniq/uniq.go index eb14f91..570cf21 100644 --- a/src/tool/uniq/uniq.go +++ b/src/tool/uniq/uniq.go @@ -6,7 +6,7 @@ import( "fmt" "bufio" "io" - "github.com/surdeus/gomtool/src/mtool" + "github.com/mojosa-software/gomtool/src/mtool" ) func Run(flagSet *mtool.Flags) { diff --git a/src/tool/urlprs/urlprs.go b/src/tool/urlprs/urlprs.go index 10e8334..16fc297 100644 --- a/src/tool/urlprs/urlprs.go +++ b/src/tool/urlprs/urlprs.go @@ -5,7 +5,7 @@ import ( "fmt" "net" "net/url" - "github.com/surdeus/gomtool/src/mtool" + "github.com/mojosa-software/gomtool/src/mtool" ) var nilStr = "_" diff --git a/src/tool/useprog/main.go b/src/tool/useprog/main.go index 5c3c648..9ab0fe7 100644 --- a/src/tool/useprog/main.go +++ b/src/tool/useprog/main.go @@ -4,7 +4,7 @@ import ( "os" "os/exec" "fmt" - "github.com/surdeus/gomtool/src/mtool" + "github.com/mojosa-software/gomtool/src/mtool" "path/filepath" ) diff --git a/src/tool/wc/main.go b/src/tool/wc/main.go index 3ddbf2d..cf9ecd0 100644 --- a/src/tool/wc/main.go +++ b/src/tool/wc/main.go @@ -7,7 +7,7 @@ import ( "fmt" "unicode" "strconv" - "github.com/surdeus/gomtool/src/mtool" + "github.com/mojosa-software/gomtool/src/mtool" ) var ( diff --git a/src/tool/whoami/main.go b/src/tool/whoami/main.go index c299788..d5bdfe5 100644 --- a/src/tool/whoami/main.go +++ b/src/tool/whoami/main.go @@ -5,7 +5,7 @@ import( "os/user" "fmt" "log" - "github.com/surdeus/gomtool/src/mtool" + "github.com/mojosa-software/gomtool/src/mtool" ) func Run(flagSet *mtool.Flags) { diff --git a/src/tool/yes/yes.go b/src/tool/yes/yes.go index 85844a7..e7b2956 100644 --- a/src/tool/yes/yes.go +++ b/src/tool/yes/yes.go @@ -5,8 +5,8 @@ import( "os" "fmt" "strings" - "github.com/surdeus/goblin/src/input" - "github.com/surdeus/gomtool/src/mtool" + "github.com/mojosa-software/goblin/src/input" + "github.com/mojosa-software/gomtool/src/mtool" ) var( nArg int