From 91bf1b7f657498eafa1a659882ead13f82a73783 Mon Sep 17 00:00:00 2001 From: Martin Haug Date: Wed, 1 Jun 2022 17:58:04 +0200 Subject: Refine `ahead_nontrivia` search Also reintroduces unsafe layers under another name --- src/syntax/mod.rs | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) (limited to 'src/syntax') diff --git a/src/syntax/mod.rs b/src/syntax/mod.rs index 4a163d78..534046e1 100644 --- a/src/syntax/mod.rs +++ b/src/syntax/mod.rs @@ -841,27 +841,24 @@ impl NodeKind { } } - /// Whether this is a node that only appears in markup. - pub fn only_in_markup(&self) -> bool { + /// 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::Text(_) - | Self::Linebreak { .. } - | Self::NonBreakingSpace - | Self::Shy - | Self::EnDash - | Self::EmDash - | Self::Ellipsis - | Self::Quote { .. } - | Self::Escape(_) - | Self::Strong + Self::Strong | Self::Emph | Self::Raw(_) | Self::Math(_) - | Self::Heading - | Self::List - | Self::Enum - | Self::EnumNumbering(_) + | Self::LetExpr + | Self::SetExpr + | Self::ShowExpr + | Self::WrapExpr + | Self::IfExpr + | Self::WhileExpr + | Self::ForExpr + | Self::IncludeExpr + | Self::ImportExpr ) } -- cgit v1.2.3