Commit Graph

54 Commits

Author SHA1 Message Date
Qi Xiao
71d050b31c newedit: Hook up with its Store dependency. 2019-03-18 22:41:38 +00:00
Qi Xiao
a2cf05a463 On Windows, enable VT100 escape sequence on startup.
This fixes #798.
2019-03-14 21:42:21 +00:00
Qi Xiao
5979fd5c4f eval/vars: Cleanups. 2018-11-18 15:23:31 +01:00
Qi Xiao
6a0267a6b6 eval/vars: Always guard variable access with mutexes. 2018-11-18 15:13:50 +01:00
Qi Xiao
980bc4792d parse: Cleanups.
* Unexport the Parser type, and remove an unused field.

* parse.ParseAs -> parse.As; parse.Parse -> parse.AsChunk.
2018-10-13 17:27:39 +01:00
Qi Xiao
24e0449318 s/Pprint/PPrint/ everywhere. 2018-10-13 16:51:00 +01:00
Qi Xiao
217ed4b9e0 eval: Refactor Evaler API.
EvalWithStdPorts and Eval have been merged into EvalInTTY; the original
eval method is renamed Eval.

Also factor the logic for relaying interrupts.
2018-10-13 14:04:13 +01:00
Qi Xiao
fb80862ec4 Add a new package diag for diagnostic utils. 2018-10-11 00:20:32 +08:00
Qi Xiao
cdd5576760 eval: Introduce an Op type that combines effectOp and Source. 2018-10-10 19:43:42 +08:00
Qi Xiao
4b603bf8ec Move the handling of $-exports- to program/shell. 2018-09-29 00:27:54 +01:00
Qi Xiao
ac00b2e60d newedit: Add prompt API. 2018-09-20 02:22:45 +01:00
Qi Xiao
31e22206a4 newedit: Add very basic API. 2018-07-31 22:59:54 +01:00
Qi Xiao
81b36ecebf program: -newedit uses the new line editor. 2018-07-31 22:59:54 +01:00
Qi Xiao
95e6589d81 program: Add a -newedit flag. 2018-07-31 22:59:54 +01:00
Qi Xiao
8a49c8fa27 program: Add Go version to output of -buildinfo. 2018-07-03 00:36:40 +01:00
Qi Xiao
510675af1b -version is no longer deprecated \o/
This addresses #709.
2018-07-03 00:09:01 +01:00
Ian Woloschin
67568e2b8c Add support for -norc flag (#707)
* Add support for -norc flag

* Style fixes

* Clean up shell.New declaration
2018-06-27 11:56:11 +02:00
Qi Xiao
84377247a6 build -> buildinfo; include GOROOT and GOPATH and remove builder. 2018-06-15 00:35:10 +01:00
Diego Zamboni
d120747bbf Fix JSON produced by -buildinfo -json (#682) 2018-05-27 22:48:27 +01:00
Qi Xiao
4d252db2e9 eval: Pour $-exports- in rc.elv into interactive namespace.
This fixes #613.
2018-03-01 11:03:02 -05:00
Qi Xiao
d925c5c8e8 eval: More cleanups. 2018-02-28 21:50:27 -05:00
Qi Xiao
5a714929e8 eval: Remove default ports from Evaler.
The ports are now made anew each time EvalWithStdPorts is called. This
fixes #571.
2018-02-28 21:35:32 -05:00
Qi Xiao
596816f8cf eval/types: Remove the Value type.
Just use the good old interface{} type...
2018-01-29 17:39:41 +00:00
Qi Xiao
e7a29d9955 program/web: Rewrite HTML and CSS parts. 2018-01-27 01:30:32 +00:00
Qi Xiao
cb0ed60c36 Command arguments in $args.
This fixes #556.
2018-01-09 01:12:44 +01:00
Qi Xiao
f33f3ff2ae program/shell: Cleanup. 2018-01-09 01:06:42 +01:00
Qi Xiao
085fe8b18c eval: Add a Source type for exposing source info.
A builtin src has been provided to expose this info. This fixes #327.
2018-01-05 04:07:11 +00:00
Qi Xiao
ebdd2c8303 program/clientcommon -> runtime 2018-01-02 23:36:18 +00:00
Qi Xiao
acb157d929 program/web: Update codegen script. 2018-01-01 15:05:48 +00:00
Qi Xiao
29b13a917c eval: Move Value interfaces to eval/types. 2017-12-31 20:31:45 +00:00
Qi Xiao
6c1113fa3d daemon/: Merge daemon/ with daemon/api. 2017-12-28 21:30:19 +00:00
Qi Xiao
8db0115692 eval: Make out chan relaying part of Evaler. 2017-12-27 20:43:43 +00:00
Qi Xiao
86534000d8 Merge module imports into the main namespace.
A module called x is now the same as a variable called $x:, much like
how a function called f is the same as a variable called $f~.

Such module variables are not accessible yet though, due to limitations
of the current variable name resolution rules. However, those will be
fixed later.
2017-12-23 23:51:32 +00:00
Qi Xiao
f8b1c6f084 program/clientcommon: Add empty test for accurate coverage. 2017-12-23 14:30:28 +00:00
Qi Xiao
14ca5756d1 program/clientcommon: Improve error handling of daemon-spawning code. 2017-12-23 14:23:08 +00:00
Qi Xiao
07fa612759 eval: NewEvaler now requires no arg.
All the initialization steps that were related to the args are not
optional, and can be done separately by calling the relevant methods of
the Evaler.
2017-12-23 00:07:12 +00:00
Qi Xiao
0ded0b92ec Fix daemon build on Windows. 2017-12-15 22:12:59 +01:00
Qi Xiao
5465aceb3e daemon: No need for triple forking. 2017-12-15 21:13:18 +01:00
Qi Xiao
d10e1daf66 Fix Unix build, again :-/ 2017-12-15 01:12:53 +00:00
Qi Xiao
b1f33314bf Make daemon work on Windows.
The following are done on Windows:

1) Daemon listens on a TCP socket on 127.0.0.1, and writes the address
   to the sock file. Client reads the sock file and interpretes it as
   a TCP address.

2) Daemon only forks once, with an environment containing the SystemRoot
   variable (which for some reason is required for net.Listen to
   function).

The code is far from ideal, but it works \o/
2017-12-15 00:52:03 +00:00
Qi Xiao
b181ba1fbc daemon: On Windows, let daemon cd to c:\ instead of /. 2017-12-15 00:52:02 +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
81617e8ef2 Fix minor issues found by gofmt, go vet, and misspell. 2017-12-14 01:28:07 +00:00
Qi Xiao
75b5ea18f4 Fix running of binary by striping out first arg. 2017-12-09 01:48:55 +00:00
Qi Xiao
c44e2d7321 Use build tags in a more compact way. 2017-12-08 00:45:10 +00:00
Qi Xiao
84caac010d program: Add tests, and some small cleanup. 2017-12-08 00:23:56 +00:00
Qi Xiao
37362c602e program: Use a FlagSet for easier testing. 2017-12-07 23:55:33 +00:00
Qi Xiao
ca6adbc130 program: Move Web and Shell to their own packages. 2017-12-07 00:26:00 +00:00
Qi Xiao
a5ca67b3e2 Remove unnecessary api.Client when Evaler is present. 2017-12-07 00:00:48 +00:00
Qi Xiao
6e126f2dd2 program: Put daemon, shell and web into their own Program types. 2017-12-06 23:52:12 +00:00