Commit Graph

19 Commits

Author SHA1 Message Date
Qi Xiao
0adf0ec147 Use the unix build tag.
The unix build tag is supported by Go 1.19.
2023-03-03 00:01:26 +00:00
Qi Xiao
a3f4384495 Move all elvdocs into .d.elv files.
The elvdocs still use the old format (#elvdoc:fn or #elvdoc:var) for now, but
will be changed to "fn" and "var" forms soon.

Also remove the accidentally committed cmd/mvelvdoc. It has been used to perform
the conversion automatically but is not supposed to be committed.
2022-11-20 21:59:45 +00:00
Qi Xiao
6a1e7b3996 pkg/shell: Add more daemon-related tests.
Also:

- Remove duplicate code for closing daemon client.

- Avoid using (*testing.T).TempDir - it uses test name in the path, which can
  exceed the limit of the address when calling bind(2):
  https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_un.h.html#tag_13_6
7_04
2022-06-19 21:45:36 +01:00
Qi Xiao
51e4d97568 interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
Qi Xiao
f7cb556d9b Require Go 1.18.
- Run "go fix" to remove legacy build tags

- Use staticcheck@master until it has a release that supports Go 1.18

- Turn off autocrlf for Windows tasks
2022-03-20 15:28:23 +00:00
Qi Xiao
7a72b6346a Reorganize pkg/sys into portable and non-portable system utilities.
Non-portable ones are moved into new packages pkg/sys/e{unix windows}. The "e"
prefix is needed to avoid conflict with packages under golang.org/x/sys/ and can
mean "extra".
2021-10-02 13:14:00 +01:00
Qi Xiao
d0be34c227 Run gofmt with Go 1.17.
This has created a lot of //go:build lines.
2021-08-23 00:19:49 +01:00
Kurtis Rader
3ba0397c34 Add buildinfo and version vars
Introduce `builtin:buildinfo` and `builtin:version` vars. This also
changes the `-buildinfo -json` implementation to use the standard
encoding/json package rather than handcrafting the JSON string.

This also fixes three incorrect spellings of "overridden". Normally I would
do those in a separate change but since there are only three instances,
one of which one was legitimately part of this change, I decided to bundle
the other two.
2021-07-03 20:21:40 +01:00
Qi Xiao
a70059aeb6 Test the exec builtin command. 2021-06-15 20:21:47 +01:00
Kurtis Rader
9a576529a3 Replace ErrArgs with more specific errors
This also replaces the slightly awkward "arguments here" reason with
"argument count" as the "what" for a typical errs.ArityMismatch
exception. It also reformats most of the constructors so that the "what"
is on the same line. This makes `grep errs.ArityMismatch **.go` more
useful as a result.
2021-06-13 22:42:04 +01:00
Qi Xiao
196eea21d4 Change module import path to src.elv.sh 2021-01-27 01:30:25 +00:00
Qi Xiao
b77a052e7e pkg/eval: Make Exception an interface.
This change is a preparation step for refining all *Op types to return Exception
as the error.

Keeping Exception as a struct type will make such a change error-prone, since
a (*Exception)(nil) != error(nil), so if an *Op returns a nil *Exception, it
is not nil if the return value is stored in an error-typed variable.
2021-01-08 00:56:45 +00:00
Qi Xiao
3615988408 Change signature of "exec" and "fg" on Windows to match that on Unix.
This fixes #1195.
2020-12-26 22:59:18 +00:00
Qi Xiao
bb122024dd pkg/eval: Move test framework into new evaltest package. 2020-09-03 06:51:21 +01:00
Qi Xiao
9b2b33b429 pkg/eval: Move elvdoc comments before the implementations. 2020-08-16 18:46:29 +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
Qi Xiao
c65e970951 pkg/eval: ComposeExceptionsFromPipeline -> makePipelineError. 2020-04-10 01:25:55 +01:00
Qi Xiao
e45fdf7228 Move all libraries to new pkg/. 2019-12-23 20:00:59 +00:00