Commit Graph

32 Commits

Author SHA1 Message Date
Jonathan Turner
fbd980f8b0 Add descriptions to arguments 2019-10-28 18:15:35 +13:00
Jonathan Turner
193b00764b
Stream support (#812)
* Moves off of draining between filters. Instead, the sink will pull on the stream, and will drain element-wise. This moves the whole stream to being lazy.
* Adds ctrl-c support and connects it into some of the key points where we pull on the stream. If a ctrl-c is detect, we immediately halt pulling on the stream and return to the prompt.
* Moves away from having a SourceMap where anchor locations are stored. Now AnchorLocation is kept directly in the Tag.
* To make this possible, split tag and span. Span is largely used in the parser and is copyable. Tag is now no longer copyable.
2019-10-13 17:12:43 +13:00
est31
9891e5ab81 Use async-stream crate to replace most async_stream_block invocations 2019-09-26 02:39:20 +02:00
Yehuda Katz
ab915f1c44 Revert "Revert "Migrate most uses of the Span concept to Tag""
This reverts commit bee7c5639c.
2019-09-14 11:30:24 -05:00
Jonathan Turner
bee7c5639c
Revert "Migrate most uses of the Span concept to Tag" 2019-09-11 19:53:05 +12:00
Yehuda Katz
58b7800172 Migrate most uses of the Span concept to Tag
Also migrate mv, rm and commands like that to taking a
SyntaxType::Pattern instead of a SyntaxType::Path for their first
argument.
2019-09-10 20:41:03 -07:00
Jonathan Turner
dcd97b6346 Move internal terminology to tables/rows 2019-09-06 04:23:42 +12:00
Yehuda Katz
8a29c9e6ab Migrated numerics to BigInt/BigDecimal
This commit migrates Value's numeric types to BigInt and BigDecimal. The
basic idea is that overflow errors aren't great in a shell environment,
and not really necessary.

The main immediate consequence is that new errors can occur when
serializing Nu values to other formats. You can see this in changes to
the various serialization formats (JSON, TOML, etc.). There's a new
`CoerceInto` trait that uses the `ToPrimitive` trait from `num_traits`
to attempt to coerce a `BigNum` or `BigDecimal` into a target type, and
produces a `RangeError` (kind of `ShellError`) if the coercion fails.

Another possible future consequence is that certain performance-critical
numeric operations might be too slow. If that happens, we can introduce
specialized numeric types to help improve the performance of those
situations, based on the real-world experience.
2019-09-01 21:00:30 -07:00
Andrés N. Robalino
ca0c6eaf58 This commit introduces a basic help feature. We can go to it
with the `help` command to explore and list all commands available.

Enter will also try to see if the location to be entered is an existing
Nu command, if it is it will let you inspect the command under `help`.

This provides baseline needed so we can iterate on it.
2019-08-31 19:06:11 -05:00
Yehuda Katz
138b5af82b Basic support for decimal numbers
This commit is more substantial than it looks: there was basically no
real support for decimals before, and that impacted values all the way
through.

I also made Size contain a decimal instead of an integer (`1.6kb` is a
reasonable thing to type), which impacted a bunch of code.

The biggest impact of this commit is that it creates many more possible
ways for valid nu types to fail to serialize as toml, json, etc. which
typically can't support the full range of Decimal (or Bigint, which I
also think we should support). This commit makes to-toml fallible, and a
similar effort is necessary for the rest of the serializations.

We also need to figure out how to clearly communicate to users what has
happened, but failing to serialize to toml seems clearly superior to me
than weird errors in basic math operations.
2019-08-30 21:05:32 -07:00
Patrick Meredith
481722b80a Fix from_json to use Nothing 2019-08-30 17:34:35 -04:00
Andrés N. Robalino
b502954558 [from|to]json additions/refactoring. 2019-08-27 06:05:51 -05:00
Jonathan Turner
bb794dcfec Add expansion to from-* for lists 2019-08-24 19:38:38 +12:00
Jonathan Turner
e3e4e30fb3 Lots of fixes ahead of release 2019-08-21 18:39:57 +12:00
Odin Dutton
d71206ed9e Implement WholeStreamCommand for all remaining commands 2019-08-19 15:16:39 +10:00
Jonathan Turner
aadacc2d36 Merge master 2019-08-09 16:51:21 +12:00
Jonathan Turner
99671b8ffc Move more parts to tags and away from spans 2019-08-05 20:54:29 +12:00
Jonathan Turner
462f783fac initial change to Tagged<Value> 2019-08-01 13:58:42 +12:00
Yehuda Katz
5a8e041a48 Tests pass! 2019-07-23 15:22:11 -07:00
Jonathan Turner
15507f00fc Introduce CallInfo, which abstracts args, name_span, and source_map 2019-07-20 14:27:10 +12:00
Yehuda Katz
6bf55c0f1e Remove more dead code and clean up JSON 2019-07-12 19:20:26 -07:00
Yehuda Katz
7c2a1c619e Tests pass 2019-07-12 19:20:26 -07:00
Yehuda Katz
2da12aed56 Tests pass 2019-07-12 19:20:26 -07:00
Yehuda Katz
7b68739b52 WIP 2019-07-12 19:20:26 -07:00
Yehuda Katz
34033afce4 WIP improve error infrastructure
Also simplify commands and reduce papercuts
2019-07-12 19:20:26 -07:00
Jonathan Turner
0180769971 WIP now load plugins automatically 2019-07-04 05:37:09 +12:00
Yehuda Katz
d0860837d2 Merge branch 'nom2' into nom4 2019-06-22 18:20:13 -04:00
Yehuda Katz
4036bf1ffd &str -> Text 2019-06-22 16:46:16 -04:00
Jonathan Turner
eae83d85d2 Add more error checking 2019-06-16 11:03:49 +12:00
Jonathan Turner
c050ce852b Lots of misc improvements 2019-06-03 19:41:28 +12:00
Jonathan Turner
a62de9356c Add support for magic open 2019-06-02 07:20:48 +12:00
Jonathan Turner
420b840cd6 Add missing files 2019-05-28 16:00:00 +12:00