diff options
| author | Martin Haug <mhaug@live.de> | 2022-06-01 17:58:04 +0200 |
|---|---|---|
| committer | Martin Haug <mhaug@live.de> | 2022-06-01 17:58:04 +0200 |
| commit | 91bf1b7f657498eafa1a659882ead13f82a73783 (patch) | |
| tree | 608d90c7dfa688d9138a233e9e78331581db9fdd /src/syntax | |
| parent | a937462491a63f5cff3551b5bb8bc45fb350f0b6 (diff) | |
Refine `ahead_nontrivia` search
Also reintroduces unsafe layers under another name
Diffstat (limited to 'src/syntax')
| -rw-r--r-- | src/syntax/mod.rs | 29 |
1 files changed, 13 insertions, 16 deletions
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 ) } |
