diff options
Diffstat (limited to 'src/syntax/kind.rs')
| -rw-r--r-- | src/syntax/kind.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/syntax/kind.rs b/src/syntax/kind.rs index b3948c66..c973632c 100644 --- a/src/syntax/kind.rs +++ b/src/syntax/kind.rs @@ -314,6 +314,18 @@ impl NodeKind { matches!(self, NodeKind::Error(_, _)) } + /// Does this node need termination through a semicolon or linebreak? + pub fn is_stmt(&self) -> bool { + matches!( + self, + NodeKind::LetBinding + | NodeKind::SetRule + | NodeKind::ShowRule + | NodeKind::ModuleImport + | NodeKind::ModuleInclude + ) + } + /// A human-readable name for the kind. pub fn name(&self) -> &'static str { match self { |
