This repository has been archived on 2024-05-26. You can view files and clone it, but cannot push or open issues or pull requests.
2023-12-23 17:57:10 +00:00
|
|
|
|
2023-12-23 15:07:17 +00:00
|
|
|
use error::TrixyError;
|
|
|
|
|
|
|
|
use crate::lexing::TokenStream;
|
|
|
|
|
|
|
|
use self::command_spec::checked::CommandSpec;
|
|
|
|
|
2023-12-24 10:28:30 +00:00
|
|
|
pub mod command_spec;
|
2023-12-23 15:07:17 +00:00
|
|
|
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)
|
2023-12-24 10:28:30 +00:00
|
|
|
.map_err(Into::<TrixyError>::into)?
|
|
|
|
.parse_unchecked()
|
|
|
|
.map_err(Into::<TrixyError>::into)?
|
|
|
|
.process(input.to_owned())
|
2023-12-23 15:07:17 +00:00
|
|
|
.map_err(Into::<TrixyError>::into)?;
|
|
|
|
Ok(input_tokens)
|
|
|
|
}
|