diff --git a/src/export/traverse.rs b/src/export/traverse.rs index c47a6fe..ce87712 100644 --- a/src/export/traverse.rs +++ b/src/export/traverse.rs @@ -199,13 +199,13 @@ pub trait Traverser { SUBSCRIPT => walk!(Subscript), KEYWORD => walk!(Keyword), PROPERTY_DRAWER => walk!(PropertyDrawer), - NODE_PROPERTY => {} BLOCK_CONTENT | LIST_ITEM_CONTENT => { for child in node.children_with_tokens() { self.element(child, ctx); take_control!(); } } + NODE_PROPERTY | AFFILIATED_KEYWORD => {} kind => debug_assert!( !kind.is_element() && !kind.is_object(), diff --git a/src/syntax/block.rs b/src/syntax/block.rs index e9c93c0..b074c10 100644 --- a/src/syntax/block.rs +++ b/src/syntax/block.rs @@ -14,10 +14,12 @@ use super::{ }, element::element_nodes, input::Input, + keyword::affiliated_keyword_nodes, SyntaxKind::*, }; fn block_node_base(input: Input) -> IResult { + let (input, affiliated_keywords) = affiliated_keyword_nodes(input)?; let (input, (block_begin, name)) = block_begin_node(input)?; let (input, pre_blank) = blank_lines(input)?; @@ -36,7 +38,9 @@ fn block_node_base(input: Input) -> IResult { if let Ok((input, block_end)) = block_end_node(input, name) { let (input, post_blank) = blank_lines(input)?; - let mut children = vec![block_begin]; + let mut children = vec![]; + children.extend(affiliated_keywords); + children.push(block_begin); children.extend(pre_blank); if kind.is_greater_element() { children.push(node(BLOCK_CONTENT, element_nodes(contents)?));