Commit Graph

130 Commits

Author SHA1 Message Date
Jonathan Turner
9f702fe01a Move the remainder of the plugins to crates 2019-12-10 07:39:51 +13:00
Jonathan Turner
38cbfdb8a9 Remove partial docker plugin. Embed->wrap 2019-12-09 17:41:09 +13:00
Jonathan Turner
251c3e103d Move format/parse to core commands 2019-12-09 14:57:53 +13:00
Jonathan Turner
38b7a3e32b WIP move post/fetch to plugins 2019-12-07 16:46:05 +13:00
Jonathan Turner
6893850fce Move edit and insert to core 2019-12-06 09:15:41 +13:00
Sebastian Jung
59510a85d1 fix build warnings 2019-12-04 17:13:21 +01:00
Sebastian Jung
bda5db59c8 Merge remote-tracking branch 'upstream/master' into range 2019-12-03 20:23:49 +01:00
Sebastian Jung
8390cc97e1 add range command 2019-12-02 20:15:14 +01:00
Yehuda Katz
e4226def16 Extract core stuff into own crates
This commit extracts five new crates:

- nu-source, which contains the core source-code handling logic in Nu,
  including Text, Span, and also the pretty.rs-based debug logic
- nu-parser, which is the parser and expander logic
- nu-protocol, which is the bulk of the types and basic conveniences
  used by plugins
- nu-errors, which contains ShellError, ParseError and error handling
  conveniences
- nu-textview, which is the textview plugin extracted into a crate

One of the major consequences of this refactor is that it's no longer
possible to `impl X for Spanned<Y>` outside of the `nu-source` crate, so
a lot of types became more concrete (Value became a concrete type
instead of Spanned<Value>, for example).

This also turned a number of inherent methods in the main nu crate into
plain functions (impl Value {} became a bunch of functions in the
`value` namespace in `crate::data::value`).
2019-12-02 10:54:12 -08:00
Andrés N. Robalino
1c830b5c95 default command introduced. 2019-11-24 04:20:08 -05:00
Andrés N. Robalino
1a0b339897 compact command introduced. 2019-11-23 19:05:44 -05:00
Andrés N. Robalino
c8aa8cb842 debug command facelift. 2019-11-22 03:31:58 -05:00
Yehuda Katz
cdb0eeafa2 --no-edit 2019-11-21 14:22:32 -08:00
David Mason
b3c021899c combine functions behind to/from-c/tsv commands
fixes #969, admittedly without a --delimiter alias

moves from_structured_data.rs to from_delimited_data.rs to better
identify its scope and adds to_delimited_data.rs. Now csv and tsv both
use the same code, tsv passes in a fixed '\t' argument where csv passes
in the value of --separator
2019-11-19 16:02:35 +00:00
Jonathan Turner
90aeb700ea Add from_xlsx for importing excel files 2019-11-17 16:18:41 +13:00
Thomas Hartmann
0401087175 Refactors out structured parsing logic to a separate module. 2019-11-12 16:04:55 +01:00
Andrés N. Robalino
00b3c2036a This is part of on-going work with capabilities when working with
tables and able to work with them for data processing & viewing
purposes. At the moment, certain ways to process said tables we
are able to view a histogram of a given column.

As usage matures, we may find certain core commands that could
be used ergonomically when working with tables on Nu.
2019-11-12 03:39:30 -05:00
Andrés N. Robalino
3163b0d362 Data processing mvp histogram. 2019-11-12 02:08:28 -05:00
Andrés N. Robalino
21f48577ae Reductions placeholder. 2019-11-12 02:08:28 -05:00
Andrés N. Robalino
f966394b63
Merge pull request #888 from andrasio/data-primitives
WIP [data processing]
2019-11-03 16:52:21 -05:00
Andrés N. Robalino
889d2bb378 Isolate feature. 2019-11-03 16:36:47 -05:00
Jonathan Turner
81691e07c6 Add prepend and append commands 2019-10-30 19:54:06 +13:00
Andrés N. Robalino
392ff286b2 This commit is ongoing work for making Nu working with data processing
a joy. Fundamentally we embrace functional programming principles for
transforming the dataset from any format picked up by Nu. This table
processing "primitive" commands will build up and make pipelines
composable with data processing capabilities allowing us the valuate,
reduce, and map, the tables as far as even composing this declartively.

On this regard, `split-by` expects some table with grouped data and we
can use it further in interesting ways (Eg. collecting labels for
visualizing the data in charts and/or suit it for a particular chart
of our interest).
2019-10-29 16:04:31 -05:00
Jonathan Turner
aed386b3cd Always save history, add history command 2019-10-28 05:58:39 +13:00
Andrés N. Robalino
0611f56776 Can group cells by given column name. 2019-10-20 18:42:07 -05:00
Andrés N. Robalino
821ee5e726 count command introduced. 2019-10-15 05:19:06 -05:00
Thomas Hartmann
65546646a7 Pull in upstream changes. 2019-10-14 23:05:52 +02:00
Thomas Hartmann
648d4865b1 Adds unimplemented module, tests. 2019-10-13 21:15:30 +02:00
Yehuda Katz
1ad9d6f199 Overhaul the expansion system
The main thrust of this (very large) commit is an overhaul of the
expansion system.

The parsing pipeline is:

- Lightly parse the source file for atoms, basic delimiters and pipeline
  structure into a token tree
- Expand the token tree into a HIR (high-level intermediate
  representation) based upon the baseline syntax rules for expressions
  and the syntactic shape of commands.

Somewhat non-traditionally, nu doesn't have an AST at all. It goes
directly from the token tree, which doesn't represent many important
distinctions (like the difference between `hello` and `5KB`) directly
into a high-level representation that doesn't have a direct
correspondence to the source code.

At a high level, nu commands work like macros, in the sense that the
syntactic shape of the invocation of a command depends on the
definition of a command.

However, commands do not have the ability to perform unrestricted
expansions of the token tree. Instead, they describe their arguments in
terms of syntactic shapes, and the expander expands the token tree into
HIR based upon that definition.

For example, the `where` command says that it takes a block as its first
required argument, and the description of the block syntactic shape
expands the syntax `cpu > 10` into HIR that represents
`{ $it.cpu > 10 }`.

This commit overhauls that system so that the syntactic shapes are
described in terms of a few new traits (`ExpandSyntax` and
`ExpandExpression` are the primary ones) that are more composable than
the previous system.

The first big win of this new system is the addition of the `ColumnPath`
shape, which looks like `cpu."max ghz"` or `package.version`.
Previously, while a variable path could look like `$it.cpu."max ghz"`,
the tail of a variable path could not be easily reused in other
contexts. Now, that tail is its own syntactic shape, and it can be used
as part of a command's signature.

This cleans up commands like `inc`, `add` and `edit` as well as
shorthand blocks, which can now look like `| where cpu."max ghz" > 10`
2019-10-10 08:27:51 -07:00
Jonathan Turner
5ff94004c6 Add urlencode/urldecode 2019-09-19 16:25:29 +12:00
Jonathan Turner
f6b82e4c0c Replace vtable with pivot command 2019-09-17 19:07:11 +12:00
Jonathan Turner
17855d37a4 Add env command 2019-09-16 19:52:58 +12:00
Jonathan Turner
448b1a4848 Make some plugins optional, move ps to plugin 2019-09-08 19:06:15 +12:00
Jonathan Turner
4cdaed1ad4 Add echo command 2019-09-08 11:43:53 +12:00
Pradeep Chhetri
ee301f9f54 Adds pwd command 2019-09-07 23:53:56 +08:00
Jonathan Turner
479f0a566e Covert to_* commands to work on whole table 2019-09-04 18:48:40 +12:00
Jonathan Turner
8a9cdcab17 Split fetch command away from open 2019-09-03 18:04:46 +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
1d77595576 Merge branch 'master' into post 2019-08-31 15:12:03 +12:00
Jonathan Turner
2cec8168c7 Merge master 2019-08-31 13:30:41 +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
Jonathan Turner
9e167713b3 Add post command 2019-08-31 06:27:15 +12:00
est31
c87fa14fc8 Replace crate visibility identifier with pub(crate)
Result of running:

find src -name *.rs -exec sed -i 's/crate /pub(crate) /g' {} \;
2019-08-29 13:09:09 +02:00
Andrés N. Robalino
f1e8c433c2 [from/to]tsv support. 2019-08-29 04:02:16 -05:00
Jonathan Turner
f730296e45 WIP supporting from/to automatically 2019-08-29 15:53:45 +12:00
Patrick Meredith
87a99bbabf Implement to-bson 2019-08-26 20:07:59 -04:00
Dirkjan Ochtman
b77effa434 Fix formatting with cargo fmt 2019-08-26 20:19:05 +02:00
Jonathan Turner
dda4a707a7
Merge pull request #421 from ramonsnir/reverse
add reverse
2019-08-26 05:41:07 +12:00
Ramon Snir
9735c3fcea
add reverse 2019-08-25 12:14:17 -04:00