Commit Graph

4805 Commits

Author SHA1 Message Date
Qi Xiao
74ed0d5c2f Update the xiaq/persistent dependency. 2020-08-20 22:48:40 +01:00
Qi Xiao
1bbb04b171 Document breaking changes in introspection of rest arguments. 2020-08-20 13:33:10 +01:00
Qi Xiao
1e2ead56e2 pkg/eval: Rewrite the lvalue parsing code.
Also lift the restriction on rest variables and rest arguments - they may now
appear anywhere, as long as there is only one.
2020-08-20 13:15:00 +01:00
Qi Xiao
ce19bca599 Makefile: Don't run go test with -race on Windows.
Running "go test -race" on Windows requires GCC, and it appears not all GCC
builds are compatible. Since we can't reliably determine whether the environment
has a good GCC for running the race detector, just don't enable it.

This resolves #1108.
2020-08-18 21:35:30 +01:00
Qi Xiao
821e414fc9 pkg/eval/errs: Change OutOfRange.Valid{Low High} to strings. 2020-08-18 21:23:26 +01:00
Qi Xiao
f2264ee4df Update reference to removed "explode" command to refer to "all" instead. 2020-08-18 21:13:59 +01:00
Kurtis Rader
da16162cc8 Increase umask code coverage from 62% to 100%
Related #1062
2020-08-18 21:13:27 +01:00
Qi Xiao
ceda0d052b Update more examples to reference new slice syntax. 2020-08-17 05:34:06 +01:00
Qi Xiao
a7934a6810 Remove references to old slice syntax, and the unimplemented "@" index. 2020-08-17 05:31:46 +01:00
Qi Xiao
cfcc53ac97 pkg/parse: Make \ a valid bareword character.
This fixes #979.
2020-08-17 05:01:53 +01:00
Qi Xiao
4659d9bcc6 Introduce a use-mod command.
This fixes #1113.
2020-08-17 00:11:25 +01:00
Qi Xiao
944948beab website/ref: Expand the doc for modules. 2020-08-17 00:08:15 +01:00
Qi Xiao
ea31426a9a pkg/eval: Refactor to reuse code between "use" and "eval". 2020-08-16 23:32:51 +01:00
Qi Xiao
ff7c500506 Deprecate the -source command. 2020-08-16 23:07:30 +01:00
Qi Xiao
735d30c0ff Introduce a new eval command.
This fixes #230.
2020-08-16 23:04:10 +01:00
Qi Xiao
dca782d573 pkg/eval: Document and test the ns builtin.
Also return a structured error with errs.BadValue.
2020-08-16 22:01:03 +01:00
Qi Xiao
497d987c68 website: Update first ttyshot to avoid deprecated "explode".
This fixes #1101.
2020-08-16 21:24:33 +01:00
Qi Xiao
9b2b33b429 pkg/eval: Move elvdoc comments before the implementations. 2020-08-16 18:46:29 +01:00
Qi Xiao
d5736120e5 Fixup for removal of "joins" and "splits".
* Migrate epm

* Fix docs
2020-08-16 17:29:09 +01:00
Qi Xiao
7d1c6cf5ec ref/re.md: Link to the godoc of regexp/syntax instead of regexp.
This fixes #1090.
2020-08-16 17:09:47 +01:00
Qi Xiao
37e36f61be Rename coverage file to "cover". 2020-08-16 17:04:02 +01:00
Kurtis Rader
79973a4aa1 Add make cover target
While working on issue #1062 I found myself wanting to generate coverage
reports on my local system. I wrote a trivial shell script to do that.
This simply converts that script into a `make` target.
2020-08-16 17:02:47 +01:00
Kurtis Rader
6c07af8dab Add randint command unit tests
This results in pkg/eval/builtin_fn_num.go having only
one untested statement and that is being discussed in
https://github.com/elves/elvish/issues/1099.

Related #1062
2020-08-16 16:57:41 +01:00
Kurtis Rader
5d78bab127 Add basic tests for the *-external builtins
This adds basic tests for three functions in pkg/eval/builtin_fn_cmd.go
that implement the `external`, `has-external`, and `search-external`
builtin commands. TBD is how to test those commands on MS Windows.

Related #1062
2020-08-16 16:54:33 +01:00
Kurtis Rader
1b200c4bd9 Validate a for loop corner case
This exercises the first failure condition in the `evalForVar` function.
Thus bringing coverage of pkg/eval/value_helper.go to 100%.

Related #1062
2020-08-16 16:52:47 +01:00
Kurtis Rader
28798ac053 Convert "XXX" to "TODO" comments
I stumbled across a comment that began with "XXX". It was clearly meant as
a "TODO" comment. This changes all such occurrences. However, a few "XXX"
comments are ambiguous and a better prefix might be "WARNING". The "TODO"
prefix at least ensures someone, eventually, looks into the situation
and either rewords the comment or fixes the problem. This change means
everyone can assume searching for "// TODO" will find all such comments
rather than requiring they also know to search for "// XXX".
2020-08-16 16:29:34 +01:00
Qi Xiao
d5df47f986 Deprecate has-{prefix suffix}. 2020-08-16 16:27:24 +01:00
Qi Xiao
9b754d44d8 Remove the path attribute of the output of src. 2020-08-16 16:23:01 +01:00
Qi Xiao
e28ba5d6cd Remove support for &display-suffix in edit:complex-candidate. 2020-08-16 16:21:29 +01:00
Qi Xiao
0c2d05f260 Remove support for using \ for line continuation. 2020-08-16 16:16:24 +01:00
Qi Xiao
bb24b63356 Remove builtin commands deprecated in v0.14.0. 2020-08-16 16:10:58 +01:00
Qi Xiao
2fb2c8e4a3 Fix the deprecation warnings for "ord" and "chr". 2020-08-16 16:02:48 +01:00
Qi Xiao
ba36492d16 .cirrus.yml: Bump test time scale to 20. 2020-08-16 15:50:46 +01:00
Qi Xiao
de64aa9db3 Release 0.14.1. 2020-08-16 14:40:38 +01:00
Qi Xiao
a90e8eb75d Revert "Eliminate sys.Ioctl"
Results in "failed to put myself in foreground" errors.

This reverts commit bea90271b0.
2020-08-16 14:23:37 +01:00
Kurtis Rader
bea90271b0 Eliminate sys.Ioctl
I started by writing tests for sys.Ioctl but after I had 100% coverage
of that function it occurred to me the function could be eliminated.

Related #1062
2020-08-16 14:14:48 +01:00
Qi Xiao
8f410a24be pkg/util: Move environment variable names to a new package.
Also document that this package should be broken up.
2020-08-16 14:12:48 +01:00
Qi Xiao
8aa9c26ba2 Small fixup for #1092.
* Call decSHLVL from execFn.

* Rephrase doc comment.
2020-08-16 14:08:48 +01:00
Kurtis Rader
30d1161ded Replace "USERNAME" literals with a constant 2020-08-16 14:05:13 +01:00
Kurtis Rader
a4e539c823 Replace "ELVISH_TEST_TIME_SCALE" literals with a constant 2020-08-16 14:05:13 +01:00
Kurtis Rader
947ac39876 Replace "XDG_RUNTIME_DIR" literals with a constant 2020-08-16 14:05:13 +01:00
Kurtis Rader
e04c503431 Replace "LS_COLORS" literals with a constant 2020-08-16 14:05:13 +01:00
Kurtis Rader
b9d515dd78 Replace "PATHEXT" literals with a constant 2020-08-16 14:05:13 +01:00
Kurtis Rader
b2c7746bf6 Replace "PATH" literals with a constant 2020-08-16 14:05:13 +01:00
Kurtis Rader
19f315e28a Replace "PWD" literals with a constant 2020-08-16 14:05:13 +01:00
Kurtis Rader
f656f9511b Replace "HOME" literals with a constant 2020-08-16 14:05:13 +01:00
Kurtis Rader
ade5fa6c76 Fix exec handling of $E:SHLVL
Fixes #1091
2020-08-16 14:05:13 +01:00
Qi Xiao
af92608f07 Document style guide for the doc comment of unexported types and functions. 2020-08-16 14:00:04 +01:00
Qi Xiao
239ce3ec0d pkg/eval/testutil.go: Expand the comments on the Throws* methods. 2020-08-16 13:51:48 +01:00
Qi Xiao
e2f08af91b Change slice syntax to use .. instead of :.
Also support ..= for closed-range slices, a la Rust.

The old syntax is still supported, but deprecated.

This fixes #669.
2020-08-15 22:52:50 +01:00