1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
#![allow(dead_code)]
/// Validates a `.cgp` file, returning () or the ParseError
pub fn validate<S: AsRef<str>>(s: S) -> Result<(), parser::ParseError> {
parser::parse(s)?;
Ok(())
}
#[cfg(feature = "draw2d")]
pub mod draw2d;
/// Parser for the ULTRAKILL cyber grind pattern (cgp) format
pub mod parser;
/// Utilities for drawing patterns (extracting a colour from height information)
pub mod util;
#[cfg(test)]
mod test {
use crate::parser::parse;
use super::*;
#[test]
fn test_validate() {
dbg!(parse(include_str! ("../example.cgp")).unwrap().to_pattern_string());
}
}