2019-05-28 06:45:18 +00:00
|
|
|
crate mod ast;
|
2019-05-15 16:12:38 +00:00
|
|
|
crate mod completer;
|
2019-05-29 15:26:45 +00:00
|
|
|
crate mod lexer;
|
2019-05-26 06:54:41 +00:00
|
|
|
crate mod parser;
|
|
|
|
crate mod registry;
|
2019-05-11 04:45:57 +00:00
|
|
|
|
2019-05-28 06:45:18 +00:00
|
|
|
crate use ast::{ParsedCommand, Pipeline};
|
2019-05-26 06:54:41 +00:00
|
|
|
crate use registry::{CommandConfig, CommandRegistry};
|
|
|
|
|
|
|
|
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)))
|
|
|
|
}
|