Commit Graph

720 Commits

Author SHA1 Message Date
Qi Xiao
06a00f4a5f pkg/parse: Show deprecation warning when using \ for line continuation.
This addresses #979.
2020-07-01 21:39:29 +01:00
Qi Xiao
e9b4035896 pkg/eval: Move the show command into the builtin namespace.
This will likely become a basic operation in future that can support more types
than exceptions, so putting it in the builtin namespace is appropriate.

Also remove the exc: module altogether as it contains nothing now. All the
introspection features are now implemented as fields of the exception values and
the reason values.
2020-06-30 22:36:27 +01:00
Qi Xiao
1f562505f3 Rework the API for introspecting exception causes.
* Use a "type" field to identify the type, instead of predicates in the exc:
  module.

* Make the reason values behave more like structmaps, including a Repr that
  mimics a map.

This fixes #208.
2020-06-30 22:27:07 +01:00
Qi Xiao
3eda8d2f43 pkg/eval/exc: Make the predicates work on the exception reason.
This brings the Elvish API closer to the Go internal API.
2020-06-29 23:45:54 +01:00
Qi Xiao
7b9f784cd5 pkg/eval: Rename fields of Exception, and expose fields as a pseudomap. 2020-06-29 21:26:10 +01:00
Qi Xiao
5874863991 pkg/eval: Use pseudo-structmap to implement closure introspection. 2020-06-29 00:32:00 +01:00
Qi Xiao
bd8130ee07 pkg/eval/vals: Introduce "pseudo struct maps".
See code comment for details.
2020-06-29 00:22:36 +01:00
Qi Xiao
3c5f34a217 pkg/eval/vals: In operation $op, check the ${op}er interface first.
This is so that structmaps can override the implementation of specific operations.
2020-06-28 11:56:09 +01:00
Qi Xiao
088190b4a5 Address remaining feedback of #1018. 2020-06-28 01:33:27 +01:00
Qi Xiao
bd1a6e98dc pkg/eval/vals: Rework the structmap mechanism.
* Fields may now be exposed via getter methods.

* Field names are automatically converted to dashed-case.

* Assoc behavior is no longer implemented for structmaps.

* The IsStructMap marker method no longer takes a special marker argument. There
  is a little danger of a value accidentally implementing this method.
2020-06-28 01:26:58 +01:00
Kurtis Rader
e8a8ee04b8 Add a wildcard [type:xxx] modifier
This allows filtering the wildcard expansion by path type. For example,
whether the path is a directory, regular file, or something else. So
instead of `find . -type f` you can now do `**[type:file]`.

Resolves #1015
2020-06-28 01:25:32 +01:00
Qi Xiao
ff16eda59f pkg/eval/exc: Add missing unit tests for exc:is-pipeline-exc. 2020-06-24 22:41:59 +01:00
Qi Xiao
df6d741217 pkg/eval/exc: Add exc:is-pipeline-exc. 2020-06-24 22:41:00 +01:00
Qi Xiao
e3387b2be0 pkg/eval/exc: Add missing example for exc:is-fail-exc. 2020-06-24 22:35:44 +01:00
Qi Xiao
abe9fa3aec Fixup for platform:hostname. 2020-06-14 12:24:42 +01:00
Kurtis Rader
90860c1ba2 Implement platform hostname command
Resolves #1028
2020-06-14 12:19:41 +01:00
Qi Xiao
65eeda9ae2 pkg/eval/exc: Rename is-*-error to is-*-exc.
These predicates are for exceptions, not errors. Moreover, Elvish doesn't really
have a concept of errors, only exceptions.

This addresses #208.
2020-05-31 13:59:55 +01:00
Qi Xiao
50d0b33e53 pkg/eval/exc: Add exc:is-fail-error.
This addresses #208.
2020-05-31 13:57:27 +01:00
Qi Xiao
270c7f230e pkg/eval: Support passing any value to "fail". 2020-05-31 13:56:59 +01:00
Qi Xiao
4bf795a08d pkg/eval/exc: Introduce is-{external-cmd-error nonzero-exit killed}.
This addresses #208.
2020-05-30 12:05:07 +01:00
Qi Xiao
e13ee5aba4 pkg/eval: Fix a nil pointer panic.
The preExit function is not checking whether fm.DaemonClient is nil, which
causes "exit" and "exec" to panic in non-interactive mode.
2020-05-29 00:20:12 +01:00
Kurtis Rader
720181be03 Fix two typos 2020-05-26 21:24:57 +01:00
Qi Xiao
ff292d43ce pkg/eval: Make the sorting of "order" always stable. 2020-05-25 21:50:09 +01:00
Qi Xiao
1cd192daaf pkg/eval: Implement "order".
This fixes #651.
2020-05-25 17:45:08 +01:00
Qi Xiao
0724478faf pkg/eval/testutils.go: Print outputs using Repr when they don't match. 2020-05-25 17:44:49 +01:00
Kurtis Rader
2d86a2453d Clarify the rules for using styled #RGB values
Document that an unqouted `#` character has special meaning to the Elvish
parser in the context of passing `#RGB` values to the `styled` command.
Also document the `fg-` color name prefix.
2020-05-18 00:25:05 +01:00
Qi Xiao
a4875de822 pkg/eval: Document {from to}-lines.
This fixes #1023.
2020-05-17 16:35:44 +01:00
Kurtis Rader
83ab9fe9c0 Remove obsolete, broken, "narrow" module
Related #1021
2020-05-17 16:05:43 +01:00
Kurtis Rader
1d85b7fced Cleanups to previous commit 2020-05-14 23:46:24 +01:00
Kurtis Rader
3e4cb1ed6e Implement math:min and math:max
Resolves #727
2020-05-14 23:46:24 +01:00
Qi Xiao
eb37f92300 pkg/eval: Use eval.ChopLineEnding everywhere for removing line ending. 2020-05-06 23:10:57 +01:00
Qi Xiao
5a09222cf7 pkg/eval: Implement read-line.
This fixes #975.
2020-05-06 23:03:49 +01:00
Qi Xiao
05156ea239 Add make-map command.
This fixes #943.
2020-05-05 23:23:23 +01:00
Qi Xiao
92cb80d89a Support rethrowing an exception with "fail".
This fixes #941.
2020-05-05 00:43:50 +01:00
Qi Xiao
e72f7183a0 pkg/eval/go_fn.go: Surface errors in option parsing.
This fixes #958.
2020-05-03 23:39:16 +01:00
Qi Xiao
ba7bedcbd9 Support \r\n everywhere output is processed as individual lines.
This fixes #970.
2020-05-03 23:30:23 +01:00
Kurtis Rader
d9ec0447fc Implement math:pow and math:pow10
To facilitate using the `^` character for line continuation we need to
remove its use an an exponentiation function. So introduce `math:pow`
and `math:pow10` as alternatatives and mark `^` as deprecated.

Related #989
2020-05-03 21:40:10 +01:00
Qi Xiao
0bbbd70cf1 pkg/eval/exc: Add newline in the output of exc:show; expand doc. 2020-05-02 23:46:36 +01:00
Qi Xiao
0b5b210d24 Add exc:show for showing exceptions.
This addresses #945.
2020-05-02 23:28:42 +01:00
Kurtis Rader
098e0e6880 Document base command 2020-04-27 10:33:02 +01:00
Qi Xiao
663b10d8e2 Suppress deprecations by default.
The behavior is controlled by a global flag that will be flipped for the release
branch. A flag is available to force deprecations to be shown or hidden.
2020-04-26 21:26:53 +01:00
Qi Xiao
90a34f2d19 pkg/eval: Support specifying a callback for the "time" builtin.
This fixes #295.
2020-04-26 21:11:01 +01:00
Qi Xiao
c211679f0c Move all variable creations to start of lexical scope.
Commit 8c71635ca3 moved the creation to the start
of pipelines; the approach works for simplistic cases like "x = 1 | nop", but
fails in more complex cases, such as "nop (x = 1) | nop".

The correct place to hoist variable creations is the lexical scope, and this
commit implements this approach.

This fixes #623.
2020-04-26 19:05:16 +01:00
Qi Xiao
3e9d5e9e60 pkg/eval/str: Add join, replace and split.
The implementations are mostly copied from the builtin joins, replaces and
splits, with small changes to the error behavior in the join function.

The versions in the builtin module are now deprecated.
2020-04-26 17:01:10 +01:00
Qi Xiao
43054831e6 pkg/eval/vals: Support float64 in Kind. 2020-04-26 15:38:09 +01:00
Qi Xiao
c767f92d01 Support compile-time deprecation.
This fixes #898.
2020-04-26 13:14:51 +01:00
Qi Xiao
cf6e048e58 pkg/eval: Support eval-time deprecation warning.
This addresses #898.
2020-04-26 01:13:05 +01:00
Qi Xiao
3fb0098fed pkg/eval: Support checking stderr in tests. 2020-04-26 00:13:06 +01:00
Qi Xiao
88122a019e pkg: Simplify some APIs by using parse.Tree. 2020-04-25 19:36:35 +01:00
Qi Xiao
20979b44a2 pkg/parse: Use Source values, not pointers.
The Source type is small enough that using values is likely more efficient.
2020-04-25 19:22:38 +01:00
Qi Xiao
13f7b29707 pkg/parse: Add a new Parse function and a Tree type.
This replaces the AsChunk function. All current users of parse.AsChunk has been
changed to use parse.Parse instead.
2020-04-25 19:16:22 +01:00
Qi Xiao
21f5a6f7c3 pkg/parse: Turn most public methods of Node into functions.
This make the godoc of the parse package much cleaner and removes some
boilerplate.
2020-04-25 18:55:44 +01:00
Qi Xiao
b8505c7065 pkg/eval/source.go -> pkg/parse/source.go. 2020-04-25 18:26:17 +01:00
Qi Xiao
53a1eca9af pkg/eval: Remove New*Source functions.
All call sites of such functions are replaced with simple &Source{...}
expressions.
2020-04-25 13:22:07 +01:00
Qi Xiao
c112223611 pkg/eval: Simplify API of "src".
Remove the Type and Root fields, and add a new IsFile field.
2020-04-25 12:50:07 +01:00
Qi Xiao
28a7ca5a15 Document read-upto.
This fixes #938.
2020-04-19 14:28:37 +01:00
Qi Xiao
5cdff82883 pkg/eval: Fix stack trace, and add tests. 2020-04-18 00:28:48 +01:00
Kurtis Rader
ab3e7d6169 Implement the three inverse hyperbolic functions
Related #727
2020-04-17 22:08:17 +01:00
Qi Xiao
9869557aee pkg/eval: Add a few tests for builtin string functions.
This addresses #944.
2020-04-17 01:15:45 +01:00
Qi Xiao
e8368127b7 pkg/eval: Add more tests against glob.go.
This addresses #944.
2020-04-17 00:47:00 +01:00
Qi Xiao
fbc18ba55d pkg/eval: Rewrite glob tests. 2020-04-17 00:40:47 +01:00
Qi Xiao
c9458344f1 pkg/eval: Remove unneeded methods of GlobPattern. 2020-04-17 00:20:30 +01:00
Kurtis Rader
094a03ac5b Normalize count implementation arity exception
Add some comments that clarify why the `count` implmentation does not
use the `Inputs` API. Change the mismatched arg count exception to match
that of the `Inputs` API. Add a couple more unit tests.

Resolves #966
2020-04-16 15:56:20 +01:00
Qi Xiao
0c50e93ebd pkg/eval: Remove (*Evaler).EvalInTTY.
This is so that pkg/program/shell can get rid of the dependency on the standard
streams and can dependency-inject the files.
2020-04-16 00:11:23 +01:00
Qi Xiao
b1d9efbe47 pkg/eval: Tighten the type of Frame.intCh. 2020-04-15 23:03:58 +01:00
Qi Xiao
a99d930424 pkg/eval: Add test for source.go.
Also fix a small bug in printing internal Elvish sources.

This addresses #944.
2020-04-15 00:47:35 +01:00
Qi Xiao
8292a5b166 pkg/eval: Remove Evaler.EvalSourceInTTY. 2020-04-15 00:04:23 +01:00
Kurtis Rader
60fa63c383 Implement inverse trigonometric math functions
Related #727
2020-04-14 23:59:11 +01:00
Kurtis Rader
9b1c2783a7 Implement hyperbolic trigonometric math functions
Related #727
2020-04-14 23:58:10 +01:00
Kurtis Rader
2c6a90601c Fix two typos in my previous change 2020-04-14 23:57:33 +01:00
Qi Xiao
d77ad829b6 pkg/eval: Add Evaler.ParseAndCompile.
Also require a name argument in NewInteractiveSource.
2020-04-14 23:54:45 +01:00
Qi Xiao
6597d38834 pkg/eval: Test more error cases. 2020-04-13 16:29:01 +01:00
Qi Xiao
a36a372624 pkg: Fix small issues found by staticcheck. 2020-04-13 13:56:10 +01:00
Qi Xiao
64e282c828 pkg/eval: Replace ValuesUnwrapper with simple functions.
Also add structured BadValue error type to pkg/eval/errs.
2020-04-13 13:27:55 +01:00
Kurtis Rader
f9d90f0225 Fix formatting of the styled documentation 2020-04-13 02:32:08 +01:00
Qi Xiao
887967a7bb pkg/eval: Fix elvdoc for the "all" builtin. 2020-04-13 00:52:21 +01:00
Qi Xiao
7ad3f6aa24 pkg/eval: Test GoFn's Elvish value methods. 2020-04-13 00:50:03 +01:00
Qi Xiao
07a9e781a6 pkg/eval: Report detailed ArityMismatch errors. 2020-04-13 00:47:33 +01:00
Qi Xiao
56e36ad77e pkg/eval: Add and use a structured OutOfRange error type.
This commit introduces new pkg/eval/errs package, where structured error types
will be added.
2020-04-12 19:12:05 +01:00
Qi Xiao
8811be7e44 pkg/eval: Support testing stack traces in exceptions.
Currently only one test case tests the stack trace, but all the tests against
compile_*.go will be changed to test stack traces.
2020-04-10 21:20:57 +01:00
Qi Xiao
bd2ffa75cc pkg/eval: Make exception matching more explicit.
Don't match implicitly by Cause. Instead, use a new .ThrowsCause method to
explicitly match for the cause.
2020-04-10 20:55:31 +01:00
Qi Xiao
79ed2c5549 pkg/eval: Fix the indentation in the styled doc. 2020-04-10 18:27:37 +01:00
Kurtis Rader
f59e96204e Document and add math functions
In addition to documenting the `math:` module introduced by commit 2d8a045c
two months ago this also:

a) restructures the code to match that of the `re:` and `str:` modules, and

b) adds many more useful constants and functions.

I don't think this completely addresses issue #727 so I'm marking this
as related to, rather than fixing, that issue.

Related #727
2020-04-10 18:15:38 +01:00
Qi Xiao
33da89f34f pkg/eval: Clean up API.
Unexport some of the test utilities, and remove unused AddDirer.
2020-04-10 18:10:42 +01:00
Qi Xiao
c65e970951 pkg/eval: ComposeExceptionsFromPipeline -> makePipelineError. 2020-04-10 01:25:55 +01:00
Qi Xiao
096ee354d6 pkg/eval: Simplify API for output capture. 2020-04-10 01:12:25 +01:00
Qi Xiao
af6b523e02 pkg/eval: Remove Frame.{eval,Call}. 2020-04-09 21:01:14 +01:00
Qi Xiao
ffa9727f14 pkg/eval: Remove Frame.srcRange.
Maintaining a state of current range is error-prone. Instead, always keep track
of range information explicitly.
2020-04-09 20:44:09 +01:00
Qi Xiao
3037f6c8bf pkg/util: Move the wcwidth utilities to a new package, and add more tests.
This addresses #944.
2020-04-06 12:00:01 +01:00
Qi Xiao
b9a37a8001 pkg/eval/platform: Fix the package godoc. 2020-04-05 23:19:11 +01:00
Kurtis Rader
d802ed3a70 Replace NewNs() with Ns{} to improve consistency
There are just a handful of NewNs() uses and more than twenty Ns{} uses.
NewNS() doesn't, and probably never will, do anything that can't done by
the Ns{} syntax so we can simplify the code and improve consistency by
removing it.
2020-04-05 14:49:59 +01:00
Qi Xiao
04e296bb10 pkg/program/daemon: Merge with pkg/daemon. 2020-04-04 16:50:25 +01:00
Qi Xiao
90f4c9b0fd pkg/eval/unix: Remove unix_test.go as it's no longer useful. 2020-04-03 02:32:06 +01:00
Qi Xiao
ca864a440d pkg/eval/unix: Fix godoc comments. 2020-04-03 02:23:14 +01:00
Kurtis Rader
946b5c7ff4
Introduce a unix module and implement $unix:umask (#949)
* Introduce a unix module and implement $unix:umask

Resolves #681

* Address review feedback

* More review feedback tweaks

* goimports reformat
2020-04-03 02:21:01 +01:00
Qi Xiao
01db0a9553 pkg/eval: Add more tests for resolve.go.
This addresses #944.
2020-04-02 05:42:22 +01:00
Qi Xiao
9661106cc6 pkg/eval: Add more tests for "del", and fix existing tests.
This addresses #944.
2020-04-02 05:42:11 +01:00
Qi Xiao
730bd969d8 pkg/eval: Fix position information in spacey assignments.
Also add more tests against spacey assignments.
2020-04-02 00:29:18 +01:00
Kurtis Rader
a14d859a09 Implement $platform:is-unix and is-windows
This will facilitate elvish scripts determining whether it is safe to
`use unix` or `use windows`. The implementation of the `unix` module is
out for review in a separate commit. The `windows` module is likely to
be implemented in the near future.
2020-04-01 22:46:25 +01:00
Qi Xiao
5588cda927 pkg/ui: Style.ImportFromOptions -> .MergeFromOptions. 2020-04-01 00:39:02 +01:00
Qi Xiao
9d10c2ce73 pkg/eval: Test purely_eval.go. 2020-03-31 05:28:51 +01:00
Qi Xiao
bca4c8062c [cleanup] pkg/eval: Simplify PurelyEvalPartialCompound.
This makes the function easier to test.
2020-03-31 05:13:00 +01:00
Qi Xiao
f49cf9f80e pkg/eval: More tests, especially against error cases.
Also fix a bug in handling redirections from invalid types.

This addresses #944.
2020-03-31 04:58:42 +01:00
Qi Xiao
c4ab45468c pkg/eval: Test errors in compound expressions.
This addresses #944.
2020-03-31 01:02:14 +01:00
Qi Xiao
bc25c6fe1a pkg/eval: Test all Error methods of the error types.
Also fix a bug in Flow.Error that results in infinite recursion.

This addresses #944.
2020-03-31 00:36:55 +01:00
Qi Xiao
c05f11d3dc [cleanup] pkg/diag: PPrint -> Show. 2020-03-31 00:27:08 +01:00
Qi Xiao
d44363d8cd [cleanup]: Move pkg/util/pprinter.go to pkg/diag. 2020-03-30 23:48:22 +01:00
Qi Xiao
e098617c28 pkg/eval: Fix test on BSD. 2020-03-30 23:48:22 +01:00
Qi Xiao
4f26803226 pkg/eval: Test all branches of ExternalCmdExit.Error.
This addresses #944.
2020-03-30 23:39:03 +01:00
Qi Xiao
0d30e926c9 [cleanup] pkg/eval: Simplify ExternalCmdExit to always contain a PID. 2020-03-30 23:38:40 +01:00
Qi Xiao
20afffed18 pkg/eval: Fix test on Windows. 2020-03-29 23:20:51 +01:00
Qi Xiao
8c47630af3 pkg/eval: Improve test coverage for exception.go.
This addresses #944.
2020-03-29 17:54:05 +01:00
Qi Xiao
9d280e9231 [cleanup] pkg/eval: Small stackTrace cleanup. 2020-03-29 14:53:34 +01:00
Qi Xiao
bcd1c1df6f pkg/eval: Move intCh from Evaler to Frame.
This avoids a race condition when using EvalInTTY concurrently.

This addresses #73.
2020-03-28 23:56:47 +00:00
Qi Xiao
8c71635ca3 pkg/eval: Move all assignments to the start of the pipeline they belong in.
This avoids race conditions of accessing the local scope. The test case
"x = 1", "put $x | y = (all)" used to contain a race condition but no longer
does.

This addresses #73.
2020-03-28 23:49:30 +00:00
Qi Xiao
9bebf49b40 pkg/diag: Let NewContext accept a Ranging. 2020-03-28 22:12:42 +00:00
Qi Xiao
72234e70fa [cleanup] pkg/eval: Replace frame.{begin,end} with a Ranging. 2020-03-28 22:03:42 +00:00
Qi Xiao
3abfc42a8e [cleanup] pkg/eval: Remove boilerplate.go. 2020-03-28 21:33:55 +00:00
Qi Xiao
e6b7d06e80 [cleanup] pkg/eval: Remove compiler.errorf and compiler.compiling.
All errors are now written using compiler.errorpf.
2020-03-28 21:33:55 +00:00
Qi Xiao
d306f33af6 [cleanup] pkg/eval: Let compiler.errorpf accept a single diag.Ranger. 2020-03-28 21:33:55 +00:00
Qi Xiao
11919e83ec [cleanup] pkg/eval: use diag.Ranging in op types. 2020-03-28 21:33:55 +00:00
Qi Xiao
6b6029452f Revert "Validate namespace and function names"
This breaks the use of meta characters in names of user-defined functions. See
b.elv.sh/946 on how to resolve the inconsistency on the restrictions in variable
names.

This reverts commit 02f5433789.
2020-03-22 22:06:14 +00:00
Kurtis Rader
02f5433789 Validate namespace and function names
Resolves #561
2020-03-20 23:15:02 +00:00
Qi Xiao
c125104210 pkg/eval/platform: Format. 2020-03-20 16:22:22 +00:00
Kurtis Rader
a7ed45f546 Cleanup after renaming the package 2020-03-19 23:56:16 +00:00
Kurtis Rader
f0411457cd Add platform: module to expose platform data
Resolves #916
2020-03-19 23:56:16 +00:00
Kurtis Rader
6d405cb191
Document the str: module and add unit tests (#928)
* Tiny step to documenting the str: module

* Document another block of str: functions

* Document another block of str: functions

* Document another block of str: functions

* Add str: unit tests

* Address review feedback

* Address PR review feedback
2020-03-19 09:24:56 +00:00
Qi Xiao
88ccec5475 pkg/eval/vals: Use the same algorithm as ToString in the Repr of float numbers. 2020-02-02 16:10:41 +00:00
Qi Xiao
41985123d3 Move all docs for builtins to the Go code. 2020-01-18 08:12:50 -05:00
Qi Xiao
feadbc2330 Introduce a new "one" builtin. 2020-01-17 09:00:23 -05:00
Qi Xiao
8a8db45230 pkg/eval: Make all take an optional argument.
Also make `all` no longer preserve byte inputs but turn them into values.
2020-01-17 08:45:34 -05:00
Qi Xiao
a3adcbf11e Add a test for #754.
The test now fails with "go test -race".
2020-01-14 08:13:49 -05:00
Qi Xiao
6d4abe1666 pkg/eval: Handle ~username/* correctly.
This fixes #793.
2020-01-14 08:03:41 -05:00
Qi Xiao
570bf0f42a pkg/eval: Factor all exception logic to (*Frame).makeException. 2020-01-12 18:00:45 -05:00
Qi Xiao
1788c13489 pkg/eval: Do not catch exceptions from panics in Evaler.
Nowhere uses this mechanism now. Delete the util in pkg/util.

This fixes #570.
2020-01-12 17:57:27 -05:00
Qi Xiao
4ef43e0bde pkg/eval: Inline the use of util.{Throw,Catch} in the compiler. 2020-01-12 17:55:17 -05:00
Qi Xiao
06f9a2fdbe pkg/eval: Add test to reveal data races in Evaler. 2020-01-12 16:52:12 -05:00
Qi Xiao
0d58fea6fd pkg/eval/vals: Further refine the float printing algorithm.
This fixes #811 (for real).
2020-01-12 11:11:47 -05:00
Qi Xiao
9ad6eba476 pkg/eval/vals: Print floats with exponents between -4 and 13 with %f.
This fixes #811.
2020-01-12 10:28:31 -05:00
Qi Xiao
4fb04bc27a pkg/eval: Catch index write access to nonexistent variables.
This fixes #889.
2020-01-12 08:23:37 -05:00
Qi Xiao
2e74150dda pkg/eval: Add more test for variable use. 2020-01-12 12:39:25 +00:00
Qi Xiao
6189fd372f Fix crash when running external command with port table nil values.
This fixes #788 (for real; a regression test has been added).
2020-01-12 12:32:25 +00:00
Qi Xiao
5550819ac0 pkg/eval: Check FD when using it as redir source.
This fixes #788.
2020-01-12 00:42:18 +00:00
Qi Xiao
64b104f533 Support dynamic command names for unambiguous external commands.
This fixes #764.
2020-01-11 18:57:39 +00:00
Qi Xiao
b3a48ed510 pkg/eval: Revamp Source. 2020-01-11 03:01:30 +00:00
Qi Xiao
433b5f2d96 pkg/eval: Lift the restriction of relative "use" from scripts. 2020-01-11 02:27:43 +00:00
Qi Xiao
8cf6cc0747 pkg/eval: Add test for background job. 2020-01-08 23:29:00 +00:00
Qi Xiao
b1deb03234 pkg/eval: More tests. 2020-01-08 23:21:36 +00:00
Qi Xiao
12b396d8c4 pkg/eval: Support testing that a piece of code does not compile. 2020-01-08 23:09:41 +00:00
Qi Xiao
ca945dcb7f pkg/eval: TestCase.Errors{With,} -> Throws{,Any}.
This is in preparation for supporting compilation errors. Also did some
cleanups.
2020-01-08 23:09:19 +00:00
Qi Xiao
8c0c6d182b pkg/eval/vals: More tests. 2020-01-08 10:32:51 +00:00
Qi Xiao
2d609bd5b4 pkg/eval/vals: Add methods to ValueTester; use it to test StructMap. 2020-01-08 10:20:43 +00:00
Qi Xiao
d19b9c5ab7 pkg/eval/vals: Change TestValue to a method-style API. 2020-01-07 09:58:49 +00:00
Qi Xiao
3cbbe120aa pkg/eval/vals: Add TestValue, and use it to test Pipe. 2020-01-06 23:51:55 +00:00
Qi Xiao
0bb6088790 pkg/eval/vals: eq -> Eq. 2020-01-06 23:28:23 +00:00
Qi Xiao
b8513f75b3 pkg/eval/vals: Move the "any" matcher to pkg/tt. 2020-01-06 23:19:00 +00:00
Qi Xiao
843e7f3d99 pkg/eval/vals: Do dot-imports from pkg/tt. 2020-01-06 23:14:51 +00:00
Qi Xiao
a8950535eb pkg/eval/vals: Always return structured errors.
Also match errors accurately in tests.
2020-01-06 23:02:26 +00:00
Qi Xiao
b496591e7c pkg/eval: Slightly simplify implementation of fopen. 2020-01-06 22:17:48 +00:00
Qi Xiao
10b4baf89c pkg/eval: NewInternalSource -> NewInternalGoSource. 2020-01-05 14:07:03 +00:00
Qi Xiao
44f266f92c pkg/eval: De-export SrcType. 2020-01-05 13:54:08 +00:00
Qi Xiao
2d8a045cf1 pkg/{eval,runtime}: Introduce a basic math module. 2020-01-04 17:24:00 +00:00
Qi Xiao
3de813c21c pkg/eval/vals: Check float64 indicies.
This fixes #852.
2020-01-02 23:03:26 +00:00
Qi Xiao
e9a8d1be91 pkg/edit: Support a &full flag in edit:redraw.
Also use it in readline-binding. This fixes #883.
2019-12-30 23:45:30 +00:00
Qi Xiao
770904b2c0 pkg/eval: Introduce new builtin read-upto for reading up to a byte.
This fixes #831.
2019-12-30 23:11:41 +00:00
Qi Xiao
83d1e95aa1 pkg/eval: Simplify Test with subtests. 2019-12-30 23:08:48 +00:00
Qi Xiao
6b876e559d pkg/store: Interface -> Store. 2019-12-26 18:09:26 +00:00
Qi Xiao
cbe0e3e7e7 Merge pkg/store/storedefs into pkg/store. 2019-12-26 18:05:13 +00:00
Qi Xiao
012b779ca7 pkg/daemon: Make Client an interface. 2019-12-26 17:23:18 +00:00
Qi Xiao
e45fdf7228 Move all libraries to new pkg/. 2019-12-23 20:00:59 +00:00