boseiju/
lib.rs

1//! Boseiju - A Magic: The Gathering (MTG) oracle text parser.
2//!
3//! The goal of this project is to parse a pure text MTG ability into an abstract
4//! syntax tree (AST) that respects the meaning of the ability.
5//!
6//! The AST can then be easily used by other that require some comprehension of what
7//! the ability does.
8//!
9//! This library expose two useful structures:
10//!
11//! - the [`AbilityTree`] which is the AST representation of a MTG ability.
12//! - the [`Card`] structure, which holds additional informations about an MTG
13//! card, (such as name, layout, color identity) while using ability trees for
14//! ability representations.
15
16pub mod ability_tree;
17pub mod card;
18pub mod utils;
19
20pub use ability_tree::AbilityTree;
21pub use card::Card;
22
23#[cfg(feature = "lexer")]
24pub mod lexer;
25#[cfg(feature = "lexer")]
26pub use lexer::lex;
27#[cfg(feature = "lexer")]
28pub use lexer::preprocess;
29
30#[cfg(feature = "parser")]
31pub mod parser;
32#[cfg(feature = "parser")]
33pub use parser::parse;
34#[cfg(feature = "parser")]
35pub mod error;