nushell/crates/nu-errors/Cargo.toml

33 lines
839 B
TOML
Raw Normal View History

[package]
name = "nu-errors"
2020-01-29 03:17:02 +01:00
version = "0.9.0"
authors = ["Yehuda Katz <wycats@gmail.com>", "Jonathan Turner <jonathan.d.turner@gmail.com>", "Andrés N. Robalino <andres@androbtech.com>"]
edition = "2018"
description = "Core error subsystem for Nushell"
license = "MIT"
[lib]
doctest = false
[dependencies]
2020-01-29 03:17:02 +01:00
nu-source = { path = "../nu-source", version = "0.9.0" }
ansi_term = "0.12.1"
bigdecimal = { version = "0.1.0", features = ["serde"] }
derive-new = "0.5.8"
language-reporting = "0.4.0"
num-bigint = { version = "0.2.3", features = ["serde"] }
2019-12-08 18:56:21 +01:00
num-traits = "0.2.10"
serde = { version = "1.0.103", features = ["derive"] }
nom = "5.0.1"
nom_locate = "1.0.0"
Restructure and streamline token expansion (#1123) Restructure and streamline token expansion The purpose of this commit is to streamline the token expansion code, by removing aspects of the code that are no longer relevant, removing pointless duplication, and eliminating the need to pass the same arguments to `expand_syntax`. The first big-picture change in this commit is that instead of a handful of `expand_` functions, which take a TokensIterator and ExpandContext, a smaller number of methods on the `TokensIterator` do the same job. The second big-picture change in this commit is fully eliminating the coloring traits, making coloring a responsibility of the base expansion implementations. This also means that the coloring tracer is merged into the expansion tracer, so you can follow a single expansion and see how the expansion process produced colored tokens. One side effect of this change is that the expander itself is marginally more error-correcting. The error correction works by switching from structured expansion to `BackoffColoringMode` when an unexpected token is found, which guarantees that all spans of the source are colored, but may not be the most optimal error recovery strategy. That said, because `BackoffColoringMode` only extends as far as a closing delimiter (`)`, `]`, `}`) or pipe (`|`), it does result in fairly granular correction strategy. The current code still produces an `Err` (plus a complete list of colored shapes) from the parsing process if any errors are encountered, but this could easily be addressed now that the underlying expansion is error-correcting. This commit also colors any spans that are syntax errors in red, and causes the parser to include some additional information about what tokens were expected at any given point where an error was encountered, so that completions and hinting could be more robust in the future. Co-authored-by: Jonathan Turner <jonathandturner@users.noreply.github.com> Co-authored-by: Andrés N. Robalino <andres@androbtech.com>
2020-01-21 23:45:03 +01:00
getset = "0.0.9"
# implement conversions
serde_yaml = "0.8"
toml = "0.5.5"
2019-12-08 18:56:21 +01:00
serde_json = "1.0.44"
2019-12-02 22:14:51 +01:00
[build-dependencies]
2020-01-29 03:17:02 +01:00
nu-build = { version = "0.9.0", path = "../nu-build" }