diff options
| author | Martin Haug <mhaug@live.de> | 2022-06-01 18:42:44 +0200 |
|---|---|---|
| committer | Martin Haug <mhaug@live.de> | 2022-06-01 19:39:23 +0200 |
| commit | b905048d4bb497252028df6d21b525fefb6b64c3 (patch) | |
| tree | 907a695f90e25f727a75442cf92aebb7649865c7 /src/syntax/mod.rs | |
| parent | 91bf1b7f657498eafa1a659882ead13f82a73783 (diff) | |
Switch bounded condition, delete `only_at_start`
Diffstat (limited to 'src/syntax/mod.rs')
| -rw-r--r-- | src/syntax/mod.rs | 38 |
1 files changed, 19 insertions, 19 deletions
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. |
