2019-05-15 18:12:38 +02:00
|
|
|
crate mod completer;
|
2019-05-26 08:54:41 +02:00
|
|
|
crate mod parser;
|
|
|
|
crate mod registry;
|
|
|
|
crate mod tokens;
|
2019-05-11 06:45:57 +02:00
|
|
|
|
2019-05-26 08:54:41 +02:00
|
|
|
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)))
|
|
|
|
}
|