Fixing more errors.
This commit is contained in:
@@ -14,16 +14,21 @@ use nom::multi::many_till;
|
||||
use nom::sequence::tuple;
|
||||
|
||||
use super::org_source::OrgSource;
|
||||
use super::Context;
|
||||
use super::util::exit_matcher_parser;
|
||||
use crate::context::parser_with_context;
|
||||
use crate::context::ContextElement;
|
||||
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::greater_element::NodeProperty;
|
||||
use crate::parser::greater_element::PropertyDrawer;
|
||||
use crate::parser::util::get_consumed;
|
||||
use crate::parser::util::immediate_in_section;
|
||||
use crate::parser::util::maybe_consume_trailing_whitespace_if_not_exiting;
|
||||
use crate::parser::util::start_of_line;
|
||||
use crate::types::NodeProperty;
|
||||
use crate::types::PropertyDrawer;
|
||||
|
||||
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
|
||||
pub fn property_drawer<'r, 's>(
|
||||
@@ -46,13 +51,18 @@ pub fn property_drawer<'r, 's>(
|
||||
line_ending,
|
||||
))(input)?;
|
||||
|
||||
let parser_context = context
|
||||
.with_additional_node(ContextElement::ConsumeTrailingWhitespace(true))
|
||||
.with_additional_node(ContextElement::Context("property-drawer"))
|
||||
.with_additional_node(ContextElement::ExitMatcherNode(ExitMatcherNode {
|
||||
let contexts = [
|
||||
ContextElement::ConsumeTrailingWhitespace(true),
|
||||
ContextElement::Context("property-drawer"),
|
||||
ContextElement::ExitMatcherNode(ExitMatcherNode {
|
||||
class: ExitClass::Alpha,
|
||||
exit_matcher: &property_drawer_end,
|
||||
}));
|
||||
}),
|
||||
];
|
||||
let parser_context = context
|
||||
.with_additional_node(&contexts[0])
|
||||
.with_additional_node(&contexts[1])
|
||||
.with_additional_node(&contexts[2]);
|
||||
|
||||
let node_property_matcher = parser_with_context!(node_property)(&parser_context);
|
||||
let exit_matcher = parser_with_context!(exit_matcher_parser)(&parser_context);
|
||||
@@ -135,11 +145,11 @@ fn node_property_name<'r, 's>(
|
||||
context: RefContext<'_, 'r, 's>,
|
||||
input: OrgSource<'s>,
|
||||
) -> Res<OrgSource<'s>, OrgSource<'s>> {
|
||||
let parser_context =
|
||||
context.with_additional_node(ContextElement::ExitMatcherNode(ExitMatcherNode {
|
||||
class: ExitClass::Beta,
|
||||
exit_matcher: &node_property_name_end,
|
||||
}));
|
||||
let parser_context = ContextElement::ExitMatcherNode(ExitMatcherNode {
|
||||
class: ExitClass::Beta,
|
||||
exit_matcher: &node_property_name_end,
|
||||
});
|
||||
let parser_context = context.with_additional_node(&parser_context);
|
||||
|
||||
let (remaining, name) = recognize(tuple((
|
||||
verify(
|
||||
|
||||
Reference in New Issue
Block a user