Commit Graph

518 Commits

Author SHA1 Message Date
est31
cf0efb811e Trim trailing whitespace and set it in editorconfig 2019-09-03 02:52:52 +02:00
Jonathan Turner
3d912a2c1d
Merge pull request #575 from nushell/remove-unused-code
Remove unused code
2019-09-02 20:24:18 +12:00
Andrés N. Robalino
2cb290b77b
Merge pull request #573 from androbtech/embed
can embed a new field to the table.
2019-09-02 01:14:06 -05:00
Yehuda Katz
7fa09f59c2 Remove unused code
Closes #467
2019-09-01 23:11:05 -07:00
Yehuda Katz
246c9c06dc
Merge pull request #569 from est31/serde_instead_of_specialization
Remove use of ExtractType in deserialize_any
2019-09-01 22:39:13 -07:00
Andrés N. Robalino
9488c41dcd can embed a new field to the table 2019-09-02 00:37:13 -05:00
Yehuda Katz
ca0183a136 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 22:14:41 -07:00
Yehuda Katz
3d5e31c55d
Merge pull request #571 from nushell/bigint
Migrated numerics to BigInt/BigDecimal
2019-09-01 22:08:48 -07: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
est31
113c2c380f deserialize_any isn't used any more 2019-09-02 04:07:02 +02:00
est31
bbde86c20d Use serde to deserialize bare bools
There are still tagged bools in use so we can't
remove the ExtractType implementation.
2019-09-02 03:45:00 +02:00
est31
a69a0bc5ee Use serde to deserialize options 2019-09-02 03:40:21 +02:00
est31
e8bbd330e0 Deserialize tuples with serde 2019-09-02 03:40:18 +02:00
est31
79a779dbea Deserialize vecs with serde 2019-09-02 03:37:30 +02:00
est31
5491b54859 Make key and struct_field optional in DeserializerItem
The main point of this struct seems to be debugging,
as key_struct_field is unused except for debugging.
2019-09-02 03:31:11 +02:00
Jonathan Turner
f9d54c2f25 Allow % in bare words 2019-09-02 12:32:15 +12:00
Jonathan Turner
abfd417430 Fix unwrap in open 2019-09-02 11:55:33 +12:00
Jonathan Turner
6e0cb6b809
Merge pull request #563 from est31/field_shorthand
Adopt field init shorthand in a few places
2019-09-02 11:45:32 +12:00
est31
ad3234a9a0 Remove some commented out code 2019-09-01 23:41:08 +02:00
est31
8504c7a8e6 Adopt field init shorthand in a few places
Found by running 'egrep "(\b[a-zA-Z]+): \1\b" -R src'
2019-09-01 23:39:59 +02:00
Dirkjan Ochtman
8523ce3d01 Get rid of feature(crate_visibility_modifier) (see #362) 2019-09-01 21:56:17 +02:00
Jonathan Turner
7d46f9e860 Another attempt to fix the zombie processes 2019-09-02 04:45:30 +12:00
Jonathan Turner
a7e378d1c9 Fix unwraps in post 2019-09-01 18:44:56 +12: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
Jonathan Turner
1a67ac6102 Random fixes 2019-09-01 09:19:59 +12:00
est31
5b7940b88c Update bson to 0.14 2019-08-31 18:47:14 +02:00
Jonathan Turner
0d6b85b5bf
Merge branch 'master' into post 2019-08-31 16:39:24 +12:00
Jonathan Turner
ad18c7f61a Finish magic post and magic receive 2019-08-31 16:08:59 +12:00
Yehuda Katz
6f5ddbd6ae Fixed comparison between bytes and decimals
The previous commit introduced a new decimal type as well as comparison
coercions between decimals and integers, but not between decimals and
bytes.
2019-08-30 21:05:32 -07: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
Jonathan Turner
1d77595576 Merge branch 'master' into post 2019-08-31 15:12:03 +12:00
Jonathan Turner
f274df6753
Merge pull request #547 from jonathandturner/expand_list_sqlite
Expand lists loaded from sqlite
2019-08-31 14:49:07 +12:00
Jonathan Turner
2470e6dc24 Expand lists loaded from sqlite 2019-08-31 14:23:29 +12:00
Jonathan Turner
2cde4da43f Partially fix list support 2019-08-31 13:35:53 +12:00
Jonathan Turner
2cec8168c7 Merge master 2019-08-31 13:30:41 +12:00
Jonathan Turner
761cc3db14 Finish up enter and save 2019-08-31 12:59:21 +12:00
Patrick Meredith
3d147d1143 Add SQLite support 2019-08-30 20:54:45 -04:00
Jonathan Turner
fa2c6ec227 Merge master 2019-08-31 10:13:09 +12:00
Patrick Meredith
481722b80a Fix from_json to use Nothing 2019-08-30 17:34:35 -04:00
Jonathan Turner
c3abb3b687 Fix unwrap 2019-08-31 07:28:10 +12:00
Jonathan Turner
60bfa277d0 Experiment with async/await-enabled ps 2019-08-31 07:07:07 +12:00
Jonathan Turner
9e167713b3 Add post command 2019-08-31 06:27:15 +12:00
svartalf
213db54378 Update to heim v0.0.7. 2019-08-30 18:08:57 +03:00
Jonathan Turner
3fba30f2dc
Merge pull request #537 from jonathandturner/tabs_in_textview
Add tab support to textview
2019-08-30 16:20:40 +12:00
Jonathan Turner
729051fdd2
Merge pull request #407 from iamcodemaker/vi
WIP: add support for vi mode
2019-08-30 15:54:30 +12:00
Jonathan Turner
8db21ddf99 Add tab support to textview 2019-08-30 15:47:30 +12:00
Taiki Endo
58a32490c5 Remove usage of in_band_lifetimes feature 2019-08-30 01:32:31 +09:00
Jonathan Turner
f393938515
Merge pull request #531 from est31/no_specialization
Remove unused functions that use specialization
2019-08-30 04:02:20 +12:00
Jonathan Turner
b6db233c73 Start working on save 2019-08-30 03:39:16 +12:00
est31
7df48110ab Remove unused functions that use specialization 2019-08-29 16:14:43 +02:00