use thiserror::Error;
#[derive(Debug, Error)]
pub enum WorldInfoError {
#[error("Parser error: {0}")]
ParserError(ParserError),
#[error("Processor error: {0}")]
ProcessorError(String),
#[error("Evaluation error: {0}")]
EvaluationError(String),
}
#[derive(Error, Debug)]
pub enum ParserError {
#[error("Parsing error: {0}")]
PestParse(#[from] pest::error::Error<Rule>),
#[error("JSON processing error: {0}")]
Json(#[from] serde_json::Error),
#[error("Processor '{0}' not found or failed to instantiate: {1}")]
ProcessorInstantiation(String, String),
#[error("Invalid parsing rule encountered: {0:?}")]
InvalidRule(Rule),
#[error("Processor execution failed: {0}")]
ProcessorExecution(String),
#[error("Trigger tag missing 'id' attribute: {0}")]
MissingTriggerId(String),
#[error("Processing error: {0}")]
Processing(String),
#[error("Undefined variable: {0}")]
UndefinedVariable(String),
#[error("Variable already exists: {0}")]
VariableAlreadyExists(String),
#[error("Insufficient permissions: {0}")]
InsufficientPermissions(String),
#[error("Type error: {0}")]
TypeError(String),
#[error("Evaluation error: {0}")] Evaluation(String),
#[error("Internal parser error: {0}")]
Internal(String),
#[error("Regex compilation error: {0}")]
RegexCompilation(String, String),
}
use crate::parser::Rule;