Begin removing the MyError type.

This commit is contained in:
Tom Alexander
2023-10-17 09:45:18 -04:00
parent 8417b5fc9d
commit c9d7251e3b
33 changed files with 12 additions and 76 deletions

View File

@@ -28,7 +28,6 @@ use crate::context::ExitClass;
use crate::context::ExitMatcherNode;
use crate::context::RefContext;
use crate::error::CustomError;
use crate::error::MyError;
use crate::error::Res;
use crate::parser::element_parser::element;
use crate::parser::util::blank_line;
@@ -232,6 +231,9 @@ fn greater_block_body<'c, 'b, 'g, 'r, 's>(
context_name: &'c str,
) -> Res<OrgSource<'s>, (&'s str, Vec<Element<'s>>)> {
if in_section(context, context_name) {
return Err(CustomError::Static(
"Cannot nest objects of the same element",
));
return Err(nom::Err::Error(CustomError::MyError(MyError(
"Cannot nest objects of the same element",
))));