aboutsummaryrefslogtreecommitdiff
path: root/lib/xixanta/src/node.rs
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mikisabate@gmail.com>2025-01-05 08:57:26 +0100
committerMiquel Sabaté Solà <mikisabate@gmail.com>2025-01-05 08:57:26 +0100
commitec8b709fa24c3386dae919cf0c33a51468efbae5 (patch)
tree846b5354e75efb776eac66e5c781662c1800f01c /lib/xixanta/src/node.rs
parent1f8a6becc7cdca285333d51b4548373974df7dd3 (diff)
downloadtools.nes-ec8b709fa24c3386dae919cf0c33a51468efbae5.tar.gz
tools.nes-ec8b709fa24c3386dae919cf0c33a51468efbae5.zip
Implement block bodies inside of the assembler
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à <mikisabate@gmail.com>
Diffstat (limited to 'lib/xixanta/src/node.rs')
-rw-r--r--lib/xixanta/src/node.rs9
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.