Commit graph

19 commits

Author SHA1 Message Date
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