Commit graph

29 commits

Author SHA1 Message Date
John Kerl
60b1f1b451
Let mlr help take pre-flags, such as --always-color (#1292)
* Let `mlr help` take pre-flags, such as `--always-color`

* Better on-line help for auxents and terminals

* Support `mlr help flag --foo`
2023-05-15 01:14:59 -04:00
John Kerl
2d00b44ead
Better error message on unparseable TZ environment variable (#1249) 2023-03-30 08:37:33 -04:00
John Kerl
ff659b8a7e
Add optional second base argument to int DSL function (#1244)
* Add optional second base argument to `int` DSL function

* artifacts from `make dev`

* unit-test cases

* typofix
2023-03-24 00:28:39 -04:00
John Kerl
31fdc1c3ed
Fix #1164: regression on CSV blank-line handling (#1168)
* Fix #1164: regression on CSV blank lines

* unit-test case
2023-01-01 16:49:14 -05:00
John Kerl
95be06b752 make fmt 2022-11-26 00:23:12 -05:00
John Kerl
64b3cbfcfe
mlr summary verb (#1056)
* mlr summary verb

* doc content

* iterating on more summarizers; needs work as noted in the PR

* mlr summary with selectable accumulators

* code-review feedback

* iterating on transposed output

* extend unit-test cases

* doc extensions
2022-07-12 00:57:34 -04:00
John Kerl
6b32e1f419
Reduce number of os.Exit callsites, part 1 of n (#1055)
* neaten some uses of os.Exit

* iterating

* iterating

* iterating

* iterating

* iterating

* iterating

* iterating
2022-07-09 18:53:24 -04:00
John Kerl
23aefb5646
Fix issue 1032 (#1048)
* Fix issue 1032

* test files
2022-07-04 16:07:12 -04:00
John Kerl
18a6977749
Fix ASCII vs UTF-8 in TSV writer (#1023)
* Fix ASCII vs UTF-8 in TSV writer

* regression-test case
2022-05-02 20:52:34 -04:00
John Kerl
2408915160
DSL functions and verbs for UTF-8 <-> Latin-1 (#997)
* latin1_to_utf8 and utf8_to_latin1 DSL functions

* doc-build artifacts for previous commit

* Test cases for latin1_to_utf8 and utf8_to_latin1

* extend on-line help

* latin1_to_utf8 and utf8_to_latin1 verbs

* unit-test cases for verbs

* Keep with kebab-case naming convention for verbs

* webdocs
2022-03-20 17:29:40 -04:00
John Kerl
8eeb82809e
Webdoc information on Unicode string literals (#935) 2022-02-09 00:28:04 -05:00
John Kerl
66c4a077fd
Make TSV finally true TSV (#923)
* Spec-TSV

* doc mods; more test cases
2022-02-06 00:13:55 -05:00
John Kerl
fe8d65fe1a
Include \U support in addition to \u for DSL Unicode string literals (#917) 2022-02-02 09:35:29 -05:00
John Kerl
595e182751
Support unicode literals in the Miller DSL (#916)
* neaten lib/unbackslash_test.go

* Support unicode literals in the Miller DSL
2022-02-02 00:00:32 -05:00
Stephen Kitt
1beacbd381
More dead code removal (#905)
Signed-off-by: Stephen Kitt <steve@sk2.org>
2022-01-30 12:03:41 -05:00
Stephen Kitt
46d013d44f
Remove unreachable code (#903)
These lines are unreachable, all paths above them lead to earlier
returns.

Signed-off-by: Stephen Kitt <steve@sk2.org>

Co-authored-by: John Kerl <kerl.john.r@gmail.com>
2022-01-27 12:23:00 -05:00
Stephen Kitt
d536318ed6
Use int64 wherever "64-bit integer" is assumed (#902)
Miller assumes 64-bit integers, but in Go, the int type varies in size
depending on the architecture: 32-bit architectures have int
equivalent to int32. As a result, the supported range of integer
values is greatly reduced on 32-bit architectures compared to what is
suggested by the documentation.

This patch explicitly uses int64 wherever 64-bit integers are
assumed.

Test cases affected by the behaviour of the random generator are
updated to reflect the new values (the existing seed doesn't produce
the same behaviour since the way random values are generated has
changed).

Signed-off-by: Stephen Kitt <steve@sk2.org>
2022-01-27 12:06:25 -05:00
John Kerl
dedc7ff06f replace - with _ in *.go filenames 2022-01-23 23:22:55 -05:00
Stephen Kitt
9c5e3ee190
Use raw strings to avoid escapes (#885)
Especially for regexes, raw strings improve readability since they
aren't escaped.

While we're at it, use MustCompile instead of handling the error and
exiting.

Signed-off-by: Stephen Kitt <steve@sk2.org>
2022-01-18 20:49:00 -05:00
John Kerl
0c75713b94
Fix codespell config to skip multiple files (#837)
* trying to get codespell to trigger before merge to main

* iterating

* https://github.com/codespell-project/actions-codespell

* iterating

* iterating

* iterating

* iterating

* iterating

* more

* more

* more
2022-01-03 23:16:43 -05:00
John Kerl
1b9526e585
More codespell fixes (#834)
* Fix mlr tail -n4

* More codespell fixes
2022-01-03 21:40:53 -05:00
John Kerl
a977617797
Address some staticcheck issues (#823)
* address some staticcheck issues

* address some staticcheck issues

* address some staticcheck issues

* address some staticcheck issues
2022-01-01 14:28:19 -05:00
John Kerl
e10fee0724
Improve type-inference performance (#809)
* To-do items for broader platform/go-version benchmarking

* neaten inferrer API

* extend type-inference unit-test cases

* Add benchmark scripts for comparing compiler versions

* mlr version in addition to mlr --version

* some go-benchmark files for Mac/Linux perf comparisons

* neaten perf-scripts

* merge

* type-scan optimization tests

* type-scan optimization infra

* test new inferrer

* mlr --time option

* include --cpuprofile and --traceprofile in on-line help

* sharpen inferred/deferred-type API distinction

* replace old inferrer with newer/faster

* update docs for new type-inferrer
2021-12-27 00:54:21 -05:00
John Kerl
bca738a781
Work around Go strconv's allowance of underscores in int/float literals (#801)
* Function-pointerize IXS/IXSRegex to reduce runtime iffelsing

* remove IsRegexString and SuppressIXSRegex

* regression tests passing

* doc updates

* Don't use sed -I in ./configure

* Work around Go strconv's allowance of _ in int/float literals
2021-12-25 00:38:13 -05:00
John Kerl
096bb9bc12
Make --ifs-regex and --ips-regex explicit command-line flags (#799)
* Function-pointerize IXS/IXSRegex to reduce runtime iffelsing

* remove IsRegexString and SuppressIXSRegex

* regression tests passing

* doc updates
2021-12-25 00:00:18 -05:00
John Kerl
7a97c9b868
Performance improvement by JIT type inference (#786)
* JIT mlrval type-interfence: mlrval package

* mlrmap refactor

* complete merge from #779

* iterating

* mlrval/format.go

* mlrval/copy.go

* bifs/arithmetic_test.go

* iterate on bifs/collections_test.go

* mlrval_cmp.go

* mlrval JSON iterate

* iterate applying mlrval refactors to dependent packages

* first clean compile in a long while on this branch

* results of first post-compile profiling

* testing

* bugfix in ofmt formatting

* bugfix in octal-supporess

* go fmt

* neaten

* regression tests all passing
2021-12-20 23:56:04 -05:00
John Kerl
7c9cc61ac9
Fix issue with pipe or dot as IFS for DKVP/NIDX/CSV-lite (#778) 2021-12-12 23:25:16 -05:00
John Kerl
bc72cd1857
More Go-package restructuring (#748) 2021-11-12 12:49:55 -05:00
John Kerl
e2b6ec2391
Standardize Go-package structure (#746) 2021-11-11 14:15:13 -05:00