Commit Graph

15 Commits

Author SHA1 Message Date
Mikel Ward
8796233de4 Make Concat return a new globPattern.
I don't know if this is fully sufficient, but it seems to fix the specific test
case mentioned.

Fixes #1245
2023-07-16 18:28:32 +01:00
Qi Xiao
ae087dc1e4 pkg/eval: Don't use the new context.Cause API.
Elvish should still be buildable with Go 1.19.
2023-05-07 22:37:08 +01:00
Qi Xiao
da576e221c pkg/eval: Use a Context inside Frame to pass interrupts. 2023-05-07 21:44:28 +01:00
Qi Xiao
51e4d97568 interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
Qi Xiao
097e32b375 pkg/eval/vals: Add ReprPlain, Repr without pretty-printing.
Also de-export NoPretty now that it is no longer needed.
2021-12-31 21:05:07 +00:00
Qi Xiao
6b6d3d5a95 pkg/eval: Improve coverage of glob.go. 2021-09-10 18:57:11 +01:00
Shengjing Zhu
5724ec4c47 Fix typos and add codespell to CI 2021-08-22 23:07:34 +01:00
Qi Xiao
196eea21d4 Change module import path to src.elv.sh 2021-01-27 01:30:25 +00:00
Qi Xiao
6e8ecc8bd5 pkg/eval: Cleanups for reducing the API surface area number of files.
- Move NewEnvListVar to pkg/eval/vars.

- De-export GlobPattern, GlobFlag and ExternalCmd.

- Merge editor.go and chdir.go into eval.go, value_helper.go into compile_value.go.

- Remove eval_internal_test.go and replace it with a new test for $pid.
2021-01-05 04:33:52 +00:00
Kurtis Rader
9c7c9cf7d9 [cleanup] trivial golint suggested changes
As with commit #eb2a792 I acknowledge that `golint` recommendations are
controversial and should not automatically be acted on. Nonetheless,
this change fixes legitimate lint issues such as copy/paste cleanups,
style problems I introduced (`i += 1` versus `i++`) or method/var comments
that are not in the preferred form.
2020-12-25 01:11:33 +00:00
Kurtis Rader
b5b3a0d607 go vet cleanup
Most of the code uses keyed fields in composite literals; i.e., struct
literals. However, running `go vet ./...` reports a few places that use
anonymous fields. This modifies those composite literals to use keyed
fields. This does make the code a bit more verbose without reducing
the likelihood of a bug. But it does make the code more consistent, use
best practices, and make it easier to notice if a potential problem is
introduced when running `go vet ./...` since that command now produces
no diagnostic output.

I considered adding a `make vet` target that explicitly ran

    go vet -composites=false ./...

I decided not to do that since consistently using keyed composite literals
is preferable to having a mix of keyed and unkeyed composite literals.

This also removes the unused `ExampleLoop` function which causes this
`go vet` warning:

    pkg/cli/loop_test.go:130:1: ExampleLoop refers to unknown identifier: Loop
2020-09-03 04:24:06 +01:00
Qi Xiao
088190b4a5 Address remaining feedback of #1018. 2020-06-28 01:33:27 +01:00
Kurtis Rader
e8a8ee04b8 Add a wildcard [type:xxx] modifier
This allows filtering the wildcard expansion by path type. For example,
whether the path is a directory, regular file, or something else. So
instead of `find . -type f` you can now do `**[type:file]`.

Resolves #1015
2020-06-28 01:25:32 +01:00
Qi Xiao
c9458344f1 pkg/eval: Remove unneeded methods of GlobPattern. 2020-04-17 00:20:30 +01:00
Qi Xiao
e45fdf7228 Move all libraries to new pkg/. 2019-12-23 20:00:59 +00:00