diff options
Diffstat (limited to 'lib/xixanta/src/node.rs')
| -rw-r--r-- | lib/xixanta/src/node.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/xixanta/src/node.rs b/lib/xixanta/src/node.rs index 575b4bb..6afb424 100644 --- a/lib/xixanta/src/node.rs +++ b/lib/xixanta/src/node.rs @@ -166,6 +166,15 @@ impl ControlType { pub fn must_be_global(&self) -> bool { matches!(self, ControlType::StartMacro | ControlType::Segment) } + + /// Returns true if the control type guarantees that a body is going to be + /// present under an inner node. + pub fn has_body(&self) -> bool { + matches!( + self, + ControlType::StartMacro | Self::StartProc | Self::StartScope + ) + } } /// The type of operation being used. |
