diff options
| author | Miquel Sabaté Solà <mssola@mssola.com> | 2026-02-02 23:13:57 +0100 |
|---|---|---|
| committer | Miquel Sabaté Solà <mssola@mssola.com> | 2026-02-02 23:22:47 +0100 |
| commit | 31dd071e927ab4375db6c408c08ab776e4a5c655 (patch) | |
| tree | 36a2d892bcd3162e8cf2ae875ed834cb50431432 /lib/xixanta/src/node.rs | |
| parent | 6ab4d0aa58928bf9a5bc0b60d216e1cebaf9a5a8 (diff) | |
| download | tools.nes-31dd071e927ab4375db6c408c08ab776e4a5c655.tar.gz tools.nes-31dd071e927ab4375db6c408c08ab776e4a5c655.zip | |
Change .fallthrough to __fallthrough__
Implementing it as a control statement has the bad thing that it's
impossible to be compatible with other assemblers such as ca65, as you
cannot create dummy control statements or something like that in
there. Instead of that, we define it with the special underscores which
are still valid for identifiers, and give a "compiler-specific thingie"
flair to it.
This also has the benefit that the parser can be a bit more strict.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
Diffstat (limited to 'lib/xixanta/src/node.rs')
| -rw-r--r-- | lib/xixanta/src/node.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/xixanta/src/node.rs b/lib/xixanta/src/node.rs index 9fbe34c..5093ab3 100644 --- a/lib/xixanta/src/node.rs +++ b/lib/xixanta/src/node.rs @@ -166,7 +166,6 @@ pub enum ControlType { EndIf, Defined, Echo(EchoKind), - Fallthrough, } impl fmt::Display for ControlType { @@ -202,7 +201,6 @@ impl fmt::Display for ControlType { EchoKind::Warning => write!(f, ".warning"), EchoKind::Error => write!(f, ".error"), }, - ControlType::Fallthrough => write!(f, ".fallthrough"), } } } @@ -319,6 +317,9 @@ pub enum NodeType { /// A comment which is relevant for the current session. Comment(CommentType), + + /// Fallthrough pseudo-instruction. + Fallthrough, } impl fmt::Display for NodeType { @@ -333,6 +334,7 @@ impl fmt::Display for NodeType { NodeType::Literal => write!(f, "literal"), NodeType::Label => write!(f, "label"), NodeType::Call => write!(f, "call"), + NodeType::Fallthrough => write!(f, "fallthrough"), NodeType::Operation(op) => match op { OperationType::Add => write!(f, "addition"), OperationType::Sub => write!(f, "subtraction"), |
