pddl_ish_parser/parser/
effect.rs1use crate::models::parser_error::ParserError;
2use super::{error_context::get_error_context, utils::extract_balanced};
3
4pub fn extract_effects(input: &str) -> Result<String, ParserError> {
5 let start = input.find(":effect").ok_or_else(|| ParserError::new("Keyword :effect not found".to_string(), get_error_context(input)))? + ":effect".len();
6 let block = extract_balanced(&input[start..], '(', ')')?;
7 Ok(block.trim().to_string())
8}
9
10pub fn parse_effects(input: &str) -> Result<Vec<String>, ParserError> {
13 let effects = vec![input.to_string()];
14 Ok(effects)
15}