From c7d5c89a60e93da3f189170283ff249e426ab822 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Mon, 4 Sep 2023 17:16:08 -0400 Subject: [PATCH] Passing the setupfile contents to the document parser. --- src/parser/document.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/parser/document.rs b/src/parser/document.rs index 6e03cc9..aaadfbb 100644 --- a/src/parser/document.rs +++ b/src/parser/document.rs @@ -34,6 +34,7 @@ use crate::context::GlobalSettings; use crate::context::List; use crate::context::RefContext; use crate::error::CustomError; +use crate::error::MyError; use crate::error::Res; use crate::parser::comment::comment; use crate::parser::element_parser::element; @@ -88,6 +89,11 @@ fn document_org_source<'b, 'g, 'r, 's>( .file_access .read_file(Into::<&str>::into(setup_file)) .map_err(|err| nom::Err::>>::Failure(err.into()))?; + let parsed_setup_file = _document(context, setup_file_contents.as_str().into()); + if parsed_setup_file.is_err() { + return Err(nom::Err::Error(CustomError::MyError(MyError("Failed to parse the setup file.".into())))); + } + let (_remaining, parsed_setup_file) = parsed_setup_file.expect("The if-statement proves this is ok."); println!("TODO: Process setup_file: {}", setup_file); }