From b905048d4bb497252028df6d21b525fefb6b64c3 Mon Sep 17 00:00:00 2001 From: Martin Haug Date: Wed, 1 Jun 2022 18:42:44 +0200 Subject: Switch bounded condition, delete `only_at_start` --- src/syntax/mod.rs | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'src/syntax') diff --git a/src/syntax/mod.rs b/src/syntax/mod.rs index 534046e1..9114872d 100644 --- a/src/syntax/mod.rs +++ b/src/syntax/mod.rs @@ -841,25 +841,25 @@ impl NodeKind { } } - /// Whether this is a node that is not clearly delimited by a character and - /// may appear in markup. - pub fn is_unbounded(&self) -> bool { - matches!( - self, - Self::Strong - | Self::Emph - | Self::Raw(_) - | Self::Math(_) - | Self::LetExpr - | Self::SetExpr - | Self::ShowExpr - | Self::WrapExpr - | Self::IfExpr - | Self::WhileExpr - | Self::ForExpr - | Self::IncludeExpr - | Self::ImportExpr - ) + /// Whether this is a node that is clearly delimited by a character and may + /// appear in markup. + pub fn is_bounded(&self) -> bool { + match self { + Self::CodeBlock + | Self::ContentBlock + | Self::Linebreak { .. } + | Self::NonBreakingSpace + | Self::Shy + | Self::EnDash + | Self::EmDash + | Self::Ellipsis + | Self::Quote { .. } + | Self::BlockComment + | Self::Space(_) + | Self::Escape(_) => true, + Self::Text(t) => t != "-" && !t.ends_with('.'), + _ => false, + } } /// A human-readable name for the kind. -- cgit v1.2.3