diff options
Diffstat (limited to 'src/syntax/node.rs')
| -rw-r--r-- | src/syntax/node.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/syntax/node.rs b/src/syntax/node.rs index afbebe97..3c9bc049 100644 --- a/src/syntax/node.rs +++ b/src/syntax/node.rs @@ -53,6 +53,11 @@ impl SyntaxNode { } } + /// Return `true` if the length is 0. + pub fn is_empty(&self) -> bool { + self.len() == 0 + } + /// The byte length of the node in the source text. pub fn len(&self) -> usize { match &self.0 { |
