Commit Graph

10 Commits

Author SHA1 Message Date
Qi Xiao
196eea21d4 Change module import path to src.elv.sh 2021-01-27 01:30:25 +00:00
Qi Xiao
6e8ecc8bd5 pkg/eval: Cleanups for reducing the API surface area number of files.
- Move NewEnvListVar to pkg/eval/vars.

- De-export GlobPattern, GlobFlag and ExternalCmd.

- Merge editor.go and chdir.go into eval.go, value_helper.go into compile_value.go.

- Remove eval_internal_test.go and replace it with a new test for $pid.
2021-01-05 04:33:52 +00:00
Qi Xiao
a2790af67a pkg/eval: Clean up the structure and methods of Evaler and Frame.
- Make Evaler mostly thread-safe. The only remaining thread-unsafe part is the
  modules field, which is more tricky than other fields.

- Remove the state and evalerScopes type, and move their fields into Evaler.

- Expose valuePrefix via a get method, and change PortsFromFiles to take the
  prefix instead of a *Evaler. Also expose a PortsFromStdFiles.

- Make Evaler a normal field of Frame, instead of an embedded field. This makes
  access to global states more explicit.
2021-01-05 00:22:09 +00:00
Qi Xiao
6419f4524a Implement namespaces using slices instead of maps.
More related improvements and cleanups will be done in followup commits.

This fixes #1139.
2020-12-25 17:46:46 +00:00
Qi Xiao
5ec11cfe2b Update docs for $_ and $nil. 2020-09-04 22:45:04 +01:00
Qi Xiao
a88ac31b39 pkg/eval: De-export PwdVariable. 2020-09-04 22:32:41 +01:00
Qi Xiao
f1efae4f5f pkg/eval: De-export EnvList. 2020-09-04 22:24:24 +01:00
Kurtis Rader
0f6b4bb737 Test $pwd behavior
Related #1062
Resolves #1120
2020-09-03 04:25:38 +01:00
Qi Xiao
41985123d3 Move all docs for builtins to the Go code. 2020-01-18 08:12:50 -05:00
Qi Xiao
e45fdf7228 Move all libraries to new pkg/. 2019-12-23 20:00:59 +00:00