1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
use crate::syntax::*; use crate::*; use std::option::NoneError; #[derive(Debug)] pub enum GenerationError { TraversalFailure, InvalidNode(Node, String), OutOfScope(Id), } impl From<NoneError> for GenerationError { fn from(_: NoneError) -> Self { #[cfg(debug_assertions)] panic!("Generation stopped because of faulty syntax tree."); #[cfg(not(debug_assertions))] GenerationError::TraversalFailure } }