mirror of
https://github.com/nushell/nushell.git
synced 2025-02-28 08:22:43 +01:00
The original purpose of this PR was to modernize the external parser to
use the new Shape system.
This commit does include some of that change, but a more important
aspect of this change is an improvement to the expansion trace.
Previous commit 6a7c00ea
adding trace infrastructure to the syntax coloring
feature. This commit adds tracing to the expander.
The bulk of that work, in addition to the tree builder logic, was an
overhaul of the formatter traits to make them more general purpose, and
more structured.
Some highlights:
- `ToDebug` was split into two traits (`ToDebug` and `DebugFormat`)
because implementations needed to become objects, but a convenience
method on `ToDebug` didn't qualify
- `DebugFormat`'s `fmt_debug` method now takes a `DebugFormatter` rather
than a standard formatter, and `DebugFormatter` has a new (but still
limited) facility for structured formatting.
- Implementations of `ExpandSyntax` need to produce output that
implements `DebugFormat`.
Unlike the highlighter changes, these changes are fairly focused in the
trace output, so these changes aren't behind a flag.
47 lines
1.2 KiB
Rust
47 lines
1.2 KiB
Rust
#![recursion_limit = "1024"]
|
|
|
|
#[cfg(test)]
|
|
#[macro_use]
|
|
extern crate indexmap;
|
|
|
|
#[macro_use]
|
|
mod prelude;
|
|
|
|
mod cli;
|
|
mod commands;
|
|
mod context;
|
|
mod data;
|
|
mod env;
|
|
mod errors;
|
|
mod evaluate;
|
|
mod format;
|
|
mod fuzzysearch;
|
|
mod git;
|
|
mod parser;
|
|
mod plugin;
|
|
mod shell;
|
|
mod stream;
|
|
mod traits;
|
|
mod utils;
|
|
|
|
pub use crate::commands::command::{CallInfo, ReturnSuccess, ReturnValue};
|
|
pub use crate::context::AnchorLocation;
|
|
pub use crate::env::host::BasicHost;
|
|
pub use crate::parser::hir::SyntaxShape;
|
|
pub use crate::parser::parse::token_tree_builder::TokenTreeBuilder;
|
|
pub use crate::plugin::{serve_plugin, Plugin};
|
|
pub use crate::traits::{DebugFormatter, FormatDebug, ToDebug};
|
|
pub use crate::utils::{did_you_mean, AbsoluteFile, AbsolutePath, RelativePath};
|
|
pub use cli::cli;
|
|
pub use data::base::{Primitive, Value};
|
|
pub use data::config::{config_path, APP_INFO};
|
|
pub use data::dict::{Dictionary, TaggedDictBuilder};
|
|
pub use data::meta::{
|
|
tag_for_tagged_list, HasFallibleSpan, HasSpan, Span, Spanned, SpannedItem, Tag, Tagged,
|
|
TaggedItem,
|
|
};
|
|
pub use errors::{CoerceInto, ShellError};
|
|
pub use num_traits::cast::ToPrimitive;
|
|
pub use parser::parse::text::Text;
|
|
pub use parser::registry::{EvaluatedArgs, NamedType, PositionalType, Signature};
|