Update all elements to the new AffiliatedKeywords.

This commit is contained in:
Tom Alexander
2023-10-11 14:44:25 -04:00
parent aa33fe42a8
commit 9523365090
19 changed files with 162 additions and 97 deletions

View File

@@ -18,9 +18,9 @@ use nom::multi::many_till;
use nom::sequence::tuple;
use nom::InputTake;
use super::affiliated_keyword::parse_affiliated_keywords;
use super::keyword::affiliated_keyword;
use super::org_source::OrgSource;
use super::util::get_name;
use super::util::maybe_consume_trailing_whitespace_if_not_exiting;
use crate::context::parser_with_context;
use crate::context::ContextElement;
@@ -103,7 +103,10 @@ pub(crate) fn verse_block<'b, 'g, 'r, 's>(
remaining,
VerseBlock {
source: source.into(),
name: get_name(&affiliated_keywords),
affiliated_keywords: parse_affiliated_keywords(
context.get_global_settings(),
affiliated_keywords,
),
data: parameters.map(|parameters| Into::<&str>::into(parameters)),
children,
},
@@ -145,7 +148,10 @@ pub(crate) fn comment_block<'b, 'g, 'r, 's>(
remaining,
CommentBlock {
source: source.into(),
name: get_name(&affiliated_keywords),
affiliated_keywords: parse_affiliated_keywords(
context.get_global_settings(),
affiliated_keywords,
),
contents: contents.into(),
},
))
@@ -213,7 +219,10 @@ pub(crate) fn example_block<'b, 'g, 'r, 's>(
remaining,
ExampleBlock {
source: source.into(),
name: get_name(&affiliated_keywords),
affiliated_keywords: parse_affiliated_keywords(
context.get_global_settings(),
affiliated_keywords,
),
switches,
number_lines,
preserve_indent,
@@ -266,7 +275,10 @@ pub(crate) fn export_block<'b, 'g, 'r, 's>(
remaining,
ExportBlock {
source: source.into(),
name: get_name(&affiliated_keywords),
affiliated_keywords: parse_affiliated_keywords(
context.get_global_settings(),
affiliated_keywords,
),
export_type: export_type.map(Into::<&str>::into),
data: parameters.map(|parameters| Into::<&str>::into(parameters)),
contents,
@@ -332,7 +344,10 @@ pub(crate) fn src_block<'b, 'g, 'r, 's>(
remaining,
SrcBlock {
source: source.into(),
name: get_name(&affiliated_keywords),
affiliated_keywords: parse_affiliated_keywords(
context.get_global_settings(),
affiliated_keywords,
),
language: language.map(Into::<&str>::into),
switches,
parameters: parameters.map(Into::<&str>::into),