From ec8b709fa24c3386dae919cf0c33a51468efbae5 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Sun, 5 Jan 2025 08:57:26 +0100 Subject: Implement block bodies inside of the assembler MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Following 1f8a6becc7cd ("parser: Implement block bodies"), the support for the new way of managing block bodies have also been added into the assembler. There are still some things to iron out, but they will be fixed in later commits. Signed-off-by: Miquel Sabaté Solà --- lib/xixanta/src/node.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/xixanta/src/node.rs') 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. -- cgit v1.2.3