22 lines
520 B
Rust
22 lines
520 B
Rust
|
|
use error::TrixyError;
|
|
|
|
use crate::lexing::TokenStream;
|
|
|
|
use self::command_spec::checked::CommandSpec;
|
|
|
|
pub mod command_spec;
|
|
pub mod error;
|
|
pub mod lexing;
|
|
pub mod parsing;
|
|
|
|
pub fn parse_trixy_lang(input: &str) -> Result<CommandSpec, Box<TrixyError>> {
|
|
let input_tokens = TokenStream::lex(input)
|
|
.map_err(Into::<TrixyError>::into)?
|
|
.parse_unchecked()
|
|
.map_err(Into::<TrixyError>::into)?
|
|
.process(input.to_owned())
|
|
.map_err(Into::<TrixyError>::into)?;
|
|
Ok(input_tokens)
|
|
}
|