Passing the setupfile contents to the document parser.

This commit is contained in:
Tom Alexander 2023-09-04 17:16:08 -04:00
parent ee02e07717
commit c7d5c89a60
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

View File

@ -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::<CustomError<OrgSource<'_>>>::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);
}