Unify the standard properties checks in diff.
Instead of copy+pasting them into each compare function, we now call a shared function from a handful of places.
This commit is contained in:
@@ -24,6 +24,7 @@ use crate::error::CustomError;
|
||||
use crate::error::MyError;
|
||||
use crate::error::Res;
|
||||
use crate::parser::util::start_of_line;
|
||||
use crate::types::BabelCall;
|
||||
use crate::types::Keyword;
|
||||
|
||||
const ORG_ELEMENT_AFFILIATED_KEYWORDS: [&'static str; 13] = [
|
||||
@@ -103,8 +104,16 @@ pub(crate) fn affiliated_keyword<'b, 'g, 'r, 's>(
|
||||
pub(crate) fn babel_call_keyword<'b, 'g, 'r, 's>(
|
||||
_context: RefContext<'b, 'g, 'r, 's>,
|
||||
input: OrgSource<'s>,
|
||||
) -> Res<OrgSource<'s>, Keyword<'s>> {
|
||||
filtered_keyword(babel_call_key)(input)
|
||||
) -> Res<OrgSource<'s>, BabelCall<'s>> {
|
||||
let (remaining, kw) = filtered_keyword(babel_call_key)(input)?;
|
||||
Ok((
|
||||
remaining,
|
||||
BabelCall {
|
||||
source: kw.source,
|
||||
key: kw.key,
|
||||
value: kw.value,
|
||||
},
|
||||
))
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
|
||||
|
||||
Reference in New Issue
Block a user