mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 19:07:42 +02:00
A real parser (lalrpop)
This commit is contained in:
@ -1,4 +1,18 @@
|
||||
crate mod completer;
|
||||
crate mod parse;
|
||||
crate mod parser;
|
||||
crate mod registry;
|
||||
crate mod tokens;
|
||||
|
||||
crate use self::parse::{shell_parser, Item};
|
||||
crate use registry::{CommandConfig, CommandRegistry};
|
||||
crate use tokens::{ParsedCommand, Pipeline};
|
||||
|
||||
use crate::errors::ShellError;
|
||||
use parser::PipelineParser;
|
||||
|
||||
pub fn parse(input: &str, _registry: &dyn CommandRegistry) -> Result<Pipeline, ShellError> {
|
||||
let parser = PipelineParser::new();
|
||||
|
||||
parser
|
||||
.parse(input)
|
||||
.map_err(|e| ShellError::string(format!("{:?}", e)))
|
||||
}
|
||||
|
Reference in New Issue
Block a user