Commit Graph

1022 Commits

Author SHA1 Message Date
Qi Xiao
cbe45b815d Break builtin_fn.go into many files. 2017-12-17 05:21:41 +00:00
Qi Xiao
ea2d5635ef eval: Move setup into testmain_test.go. 2017-12-17 04:30:15 +00:00
Qi Xiao
d9bdd3b308 Remove some duplicate test cases. 2017-12-17 03:50:23 +00:00
Qi Xiao
5649db68f6 eval: Break up eval_test.go into multiple files. 2017-12-17 03:41:25 +00:00
Qi Xiao
93ef9ddc9d Fix sys.IsATTY, and enable Editor on windows (broken for now) 2017-12-14 19:50:41 +00:00
Qi Xiao
3e99b28604 eval: Fix test for windows.
Tests for wildcard are made hermetic by using a temporary directory for
testing.

A test that relies on "sort" has been commented out for now.
2017-12-09 00:52:13 +00:00
Qi Xiao
c44e2d7321 Use build tags in a more compact way. 2017-12-08 00:45:10 +00:00
Qi Xiao
55d7b6f944 Fix build on Windows. 2017-12-05 00:54:32 +01:00
Qi Xiao
a5fb775ed1 eval: Make EnvList (mostly) compatible with Windows.
Quoting is not handled yet.
2017-12-05 00:53:14 +01:00
Qi Xiao
9fe0250955 Use os/exec.LookPath to fix external command search on Windows. 2017-12-05 00:48:38 +01:00
Qi Xiao
b568be5c74 eval/re: Add a dummy test file. 2017-12-04 21:09:49 +01:00
Qi Xiao
79dc756ee5 Moving packages around.
Logics of the main package is now in program/. Subprograms are subpackages of
program/. For instance, daemon/ is now program/daemon.

The daemon/service package is now simply daemon/.

The version string has been moved into its own package, build/.
2017-12-04 21:08:45 +01:00
Qi Xiao
8fc4841246 eval: daemon:spawn now throws any spawning error. 2017-12-04 20:13:17 +01:00
Qi Xiao
c496324653 eval: Use os.DevNull instead of hardcoding /dev/null.
/dev/null does not exist on Windows.
2017-12-03 22:47:29 +01:00
Qi Xiao
7f4e1450cc eval: Use os.StartProcess; this package now builds on Windows! 2017-12-03 22:07:10 +01:00
Qi Xiao
f9fb318df3 edit: All files except external_cmd.go now build on Windows. 2017-12-02 18:52:57 +00:00
Qi Xiao
a218171192 eval: Dummy implementation of "fg" and "exec" on Windows. 2017-12-02 18:45:45 +00:00
Qi Xiao
2d671dce06 eval: More detailed error for "all". 2017-11-22 01:14:47 +00:00
Qi Xiao
c84dbf4501 eval: In "all", always wait for valuesDone before return. 2017-11-22 01:05:43 +00:00
Qi Xiao
0daebfaad0 eval: Add "all", a pipeline identity function. 2017-11-18 14:59:13 +01:00
Qi Xiao
dd2d36a6d3 Support not blocking on (r)prompt beyond a timeout.
A new variable $-prompts-max-wait has been added. When the execution of
(r)prompt takes longer than this many of seconds, the editor does not wait for
it to finish; instead, it shows the last value of (r)prompt, with a stale
marker. When the (r)prompt has finishes execution, the display will be updated
again.

Use of this feature is subject to the thread unsafety of the current runtime
implementation, hence it has been marked "internal" with a leading dash.

This fixes #482.
2017-11-12 04:02:20 +01:00
Qi Xiao
d103a97e4e daemon/*: Comment and cleanup. 2017-11-11 16:08:45 +00:00
Net Gusto
f3cabf3891 Fixed typo (#508) 2017-11-08 13:58:17 +00:00
Qi Xiao
2c089151ea Add builtin run-parallel.
This addresses #485.
2017-10-11 17:08:19 +08:00
Qi Xiao
904eb11a64 Fix access to qualified function names from upper scope.
This fixes #487.
2017-10-10 22:29:28 +08:00
Qi Xiao
cba1557e33 Special form now works with redir and temp assignment.
This fixes #486.
2017-10-01 05:29:14 +02:00
Qi Xiao
adee0feb2f Add a to-string builtin. 2017-10-01 05:15:42 +02:00
Qi Xiao
ac8e943128 Add builtin $value-out-indicator for changing the ▶ symbol.
This fixes #473.
2017-10-01 09:05:13 +08:00
Qi Xiao
90292e6e4e Reduce use of reflect in scanValueToGo, and handle String vs string correctly. 2017-10-01 09:04:13 +08:00
Qi Xiao
a4073c602b eval: Add new backedVariable for easier Variable building. 2017-10-01 08:55:09 +08:00
Qi Xiao
cffef43644 eval: Put conversion utilites in conversion.go. 2017-10-01 08:45:16 +08:00
Qi Xiao
01d611aabd Don't crash the compiler when redirection sign is invalid.
This fixes #484.
2017-09-30 21:01:39 +08:00
Qi Xiao
d9dfd69788 eval: More tests against scan.go. 2017-09-29 23:13:19 +08:00
Qi Xiao
90e0cf4454 eval: More tests against scan.go. 2017-09-29 22:16:21 +08:00
Qi Xiao
41018bd1ab util: Thrown.Error -> .Wrapped; implement Error() 2017-09-29 22:14:55 +08:00
Qi Xiao
df603b6856 eval: Add tests against scan.go. 2017-09-29 21:35:22 +08:00
Qi Xiao
f137524cad More renamings. 2017-09-29 21:35:05 +08:00
Qi Xiao
51040541bb eval: Renaming identifiers in scan.go. 2017-09-29 21:09:36 +08:00
Qi Xiao
e47612a13c eval: Put Scan* in a separate scan.go. 2017-09-29 20:20:26 +08:00
Qi Xiao
bca09d0e0d Revert "eval: Implement a short path for pipelines containing one form."
This reverts commit a691ee9112.

For reason not understood, this optimization causes performance regression on
the following code:

for i [(range 1000)] {
  for j [(range 1000)] {
  }
}
2017-09-29 17:59:58 +08:00
Qi Xiao
7a3b5c688a Fix build.
This fixes #491.
2017-09-27 02:00:12 +02:00
Qi Xiao
e722800f44 Remove more uses of fmt.Sprintf 2017-09-22 22:06:27 +01:00
Qi Xiao
aa41c5dda5 Don't use Sprintf for EvalCtx name when executing pipeline. 2017-09-22 01:51:03 +01:00
Qi Xiao
a691ee9112 eval: Implement a short path for pipelines containing one form.
The run time of the following code has been reduced from 900ms to 550ms on my
local computer:

range 100000 | each [_]{ nop }
2017-09-22 01:27:28 +01:00
Qi Xiao
040e248939 Fix pkgindex URL in epm.elv. 2017-09-21 20:05:47 +01:00
Qi Xiao
f4878bbfb7 Bundle epm, Elvish package manager. 2017-09-21 02:11:36 +01:00
Qi Xiao
6de8c45c57 Embedded modules -> bundled modules. 2017-09-21 02:10:09 +01:00
Qi Xiao
7863d69683 Enable importing the same module under different names. 2017-09-21 01:52:16 +01:00
Qi Xiao
e24ee44162 Support relative uses. 2017-09-21 00:37:17 +01:00
Qi Xiao
151da537f6 Module uses are now lexically scoped. 2017-09-21 00:10:21 +01:00