Populate inline babel call fields.

This commit is contained in:
Tom Alexander 2023-10-09 19:25:00 -04:00
parent 6bc6fdc87b
commit 0d0b9863c3
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

View File

@ -34,10 +34,11 @@ pub(crate) fn inline_babel_call<'b, 'g, 'r, 's>(
input: OrgSource<'s>, input: OrgSource<'s>,
) -> Res<OrgSource<'s>, InlineBabelCall<'s>> { ) -> Res<OrgSource<'s>, InlineBabelCall<'s>> {
let (remaining, _) = tag_no_case("call_")(input)?; let (remaining, _) = tag_no_case("call_")(input)?;
let (remaining, _name) = name(context, remaining)?; let (remaining, name) = name(context, remaining)?;
let (remaining, _header1) = opt(parser_with_context!(header)(context))(remaining)?; let (remaining, inside_header) = opt(parser_with_context!(header)(context))(remaining)?;
let (remaining, _argument) = argument(context, remaining)?; let (remaining, arguments) = argument(context, remaining)?;
let (remaining, _header2) = opt(parser_with_context!(header)(context))(remaining)?; let (remaining, end_header) = opt(parser_with_context!(header)(context))(remaining)?;
let value = get_consumed(input, remaining);
let (remaining, _trailing_whitespace) = let (remaining, _trailing_whitespace) =
maybe_consume_object_trailing_whitespace_if_not_exiting(context, remaining)?; maybe_consume_object_trailing_whitespace_if_not_exiting(context, remaining)?;
let source = get_consumed(input, remaining); let source = get_consumed(input, remaining);
@ -45,11 +46,15 @@ pub(crate) fn inline_babel_call<'b, 'g, 'r, 's>(
remaining, remaining,
InlineBabelCall { InlineBabelCall {
source: source.into(), source: source.into(),
value: todo!(), value: value.into(),
call: todo!(), call: name.into(),
inside_header: todo!(), inside_header: inside_header.map(Into::<&str>::into),
arguments: todo!(), arguments: if arguments.len() > 0 {
end_header: todo!(), Some(arguments.into())
} else {
None
},
end_header: end_header.map(Into::<&str>::into),
}, },
)) ))
} }