Commit Graph

5163 Commits

Author SHA1 Message Date
Qi Xiao
9cd90c49bb Minor fixup for #1274. 2021-05-02 00:22:28 +01:00
Qi Xiao
3658c589cc
Merge pull request #1274 from krader1961/issue-1248
Initialize a lambda var to $nop~
2021-05-01 19:17:25 -04:00
Qi Xiao
698d55ef07
Merge branch 'master' into issue-1248 2021-05-01 19:17:17 -04:00
Qi Xiao
7b66e9f104 Minor fixups for #1273.
Also fix a test broken by bad merge.
2021-05-02 00:13:22 +01:00
Qi Xiao
2f4a259091
Merge pull request #1273 from krader1961/readonly-var-msg
Include name in error msg setting a readonly var
2021-05-01 19:07:59 -04:00
Qi Xiao
82f1912c5e
Merge branch 'master' into readonly-var-msg 2021-05-01 19:06:39 -04:00
Qi Xiao
ac2924ed41 Fix markdown style. 2021-04-26 01:07:18 +01:00
Qi Xiao
5f787d83aa pkg/edit: Make the emptying of PATH part of the common setup. 2021-04-25 23:09:24 +01:00
Qi Xiao
90acb4a242 Minor fixup for path:temp-{dir file}.
* Remove `MatchesRegexp` from eval/vals since it is not part of the
  Elvish value protocol.

* Simplify implementation of value matching in `eval/evaltest`.

* Documentation wording tweaks.
2021-04-25 23:03:44 +01:00
Kurtis Rader
bc37099c92 Add equivalent of mktemp as builtin commands.
This implements `path:temp-dir` and `path:temp-file`.

Resolves #1255
2021-04-25 17:34:23 -04:00
Qi Xiao
210da2abea pkg/edit: Use an empty PATH for nav mode tests. 2021-04-25 15:24:08 +01:00
Kurtis Rader
df3e7a9268 Add a -i CLI option
POSIX shells have a `-i` short option to force interactive mode. Some
programs, such as the `script` command, assume that option is recognized
by the shell it spawns. There isn't any reason elvish shouldn't silently
ignore that option.

Resolves #1292
2021-04-20 16:15:22 -04:00
Qi Xiao
a2ba33f6c5 Remove unneeded tests.
These tests exercise the arity checking logic, which is implemented
generically for every builtin function and does not need to be tested
individually.
2021-04-19 23:49:09 +01:00
Supreet
8f2accb0b9 File module with pipe function. Pipe command marked deprecated in compiler.go and builtin_fn_io.go
Prclose and pwclose with Deprecation marked in specific file. Give
feedback regarding the test cases.

File module now has prclose and pwclose

Wrote test cases for prclose and pwclose, need better test cases

Deprecation for prclose and pwclose marked in respective files.
2021-04-19 18:48:22 -04:00
Qi Xiao
5a4934cf5e Document that exceptions also convert to $false. 2021-04-11 03:37:58 +01:00
Qi Xiao
2a1eda6bb0
Fix elvdoc of the src command 2021-04-11 01:17:39 +01:00
Qi Xiao
9b276a3431 Replace references to f{open close} in file module's elvdoc. 2021-04-09 13:03:47 +01:00
Qi Xiao
42d6e94dd7 Remove support for $-exports-. 2021-04-09 00:02:40 +01:00
Qi Xiao
c30a6a2fbe Remove support for using a lone "a=b" for assignment. 2021-04-08 23:57:40 +01:00
Qi Xiao
b53a92b964 Remove all builtin commands deprecated since 0.15.0. 2021-04-08 23:07:50 +01:00
Qi Xiao
318c4c14fd Clean up temporary files properly in the test for the file: module. 2021-04-08 23:07:11 +01:00
Qi Xiao
e1552ab4f5 Minor fixes for the file module:
* Add to release notes.

* Fix the deprecation level of fopen and fclose.

* Fix format of elvdoc and add ref doc.

* Minor style adjustments.
2021-04-08 22:55:33 +01:00
Supreet
77c40b9abb Links file module, marks fopen and fclose deprecation in compiler.go
aand builtin_fn_io.go
2021-04-08 22:45:16 +01:00
Qi Xiao
79c2a11d9c Document the new number system in the release notes. 2021-04-08 00:48:10 +01:00
Qi Xiao
c2a232a156 Merge branch 'num'
This fixes #241.
2021-04-08 00:43:19 +01:00
Qi Xiao
5eec2c049d Remove special treatment of the builtin: namespace.
This fixes #1227.
2021-04-08 00:42:58 +01:00
Qi Xiao
fd212c1f75 More doc, and add exact-num. 2021-04-07 07:05:08 +01:00
Qi Xiao
6997b06bb5 Expand the doc on the number type. 2021-04-06 23:31:56 +01:00
Qi Xiao
a5baad65f8 pkg/eval/vals: Clean up FromGo. 2021-04-06 22:38:56 +01:00
Qi Xiao
6052a4dc4a Remove the "fix int" terminology; just call it "int". 2021-04-06 22:35:58 +01:00
Qi Xiao
e2c4030728 pkg/eval: Handle non-positive step and overflow in the range builtin. 2021-04-06 22:33:02 +01:00
Qi Xiao
5c643181a4 Cleanup, docs and tests. 2021-04-05 20:48:22 +01:00
Qi Xiao
8a7073a20f pkg/cli/mode: Revise a comment. 2021-04-05 15:33:18 +01:00
Kurtis Rader
12980c2719 Some golint cleanups 2021-04-05 15:31:53 +01:00
Qi Xiao
da67ba8a4a Use machine word (int) instead of int64 for fixnum. 2021-04-04 13:37:38 +01:00
Qi Xiao
4612b58759 Support exact integer and rational numbers. 2021-04-04 00:58:53 +01:00
Kurtis Rader
e2759f777b Initialize a command var to $nop~
You cannot assign $nil to a command var so that should not be the initial
value of `var x~`. Instead, assign $builtin:nop~.

Fixes #1248
2021-03-28 22:51:30 -07:00
Qi Xiao
29034c20e9 website/learn/faq.md: Document name of Elvish as a backronym. 2021-03-29 01:09:03 +01:00
Qi Xiao
2995898c4b website/learn/tour.md: List some primitives that work with value IO 2021-03-29 01:05:33 +01:00
Qi Xiao
0745463ae7 Merge branch 'query'
This fixes #1051.
2021-03-29 00:10:21 +01:00
Qi Xiao
650161157e pkg/cli/mode: Refactor the handling of default FilterSpec.Maker. 2021-03-29 00:09:32 +01:00
Qi Xiao
6376a88a9a Document the new filter DSL. 2021-03-29 00:03:36 +01:00
Qi Xiao
b43e5b8793 Rename the query DSL to the filter DSL. 2021-03-28 23:52:25 +01:00
Kurtis Rader
ddf9bf040e Correctly highlight read-only except var
Using a read-only variable as the target of an `except` clause should
highlight just the var name rather than the entire `try...except...`
statement.

Resolves #1258
2021-03-28 22:01:31 +01:00
Qi Xiao
3e512a6dd6 pkg/edit/query: Add test for Highlight.
This package now has 100% unit test coverage.
2021-03-27 02:42:14 +00:00
Qi Xiao
cfb05588c7 Merge branch 'master' into query 2021-03-27 02:06:47 +00:00
Qi Xiao
f5aaba0691 pkg/cli/mode: Deflake stub_test.go by adding an app.Redraw call. 2021-03-27 02:06:35 +00:00
Qi Xiao
dea300f9d6 pkg/{cli edit}: Use the query DSL for location, completion and navigation modes. 2021-03-27 01:55:03 +00:00
Kurtis Rader
1e0885310e Include name in error msg setting a readonly var
When attempting to update a read-only var return an error struct rather
than a simple string (i.e., a Go `error` type).  This makes it possible
to include the var name in the error message.  This builds on commit
a33ecb2d that highlights the offending var name in the stack trace but
does not include the var name in the error message. With this change the
error message includes the offending var name.

Related #255
2021-03-26 18:38:22 -07:00
Qi Xiao
8870defc98 pkg/cli: Refactor how config for custom filters are passed. 2021-03-27 01:21:53 +00:00