diff options
| author | Miquel Sabaté Solà <mikisabate@gmail.com> | 2025-01-22 22:22:46 +0100 |
|---|---|---|
| committer | Miquel Sabaté Solà <mikisabate@gmail.com> | 2025-01-22 22:22:46 +0100 |
| commit | 5d06ba11c981430aca68f2ea31771fca7f18529b (patch) | |
| tree | 8ef437976a615ed942ea1a339000fb274419e0b6 /lib/xixanta/src/node.rs | |
| parent | 4a7e8db884fdaa80f6a026ec4c0c8409ea975d81 (diff) | |
| download | tools.nes-5d06ba11c981430aca68f2ea31771fca7f18529b.tar.gz tools.nes-5d06ba11c981430aca68f2ea31771fca7f18529b.zip | |
Implement echo control statements
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
Diffstat (limited to 'lib/xixanta/src/node.rs')
| -rw-r--r-- | lib/xixanta/src/node.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/xixanta/src/node.rs b/lib/xixanta/src/node.rs index 243b478..8273967 100644 --- a/lib/xixanta/src/node.rs +++ b/lib/xixanta/src/node.rs @@ -121,6 +121,13 @@ impl PString { } } +#[derive(Debug, Clone, PartialEq)] +pub enum EchoKind { + Info, + Warning, + Error, +} + /// The type of control function being used. Use this enum in order to detect /// which control function was detected instead of the node value. #[derive(Debug, Clone, PartialEq)] @@ -150,6 +157,7 @@ pub enum ControlType { Else, EndIf, Defined, + Echo(EchoKind), } impl fmt::Display for ControlType { @@ -180,6 +188,11 @@ impl fmt::Display for ControlType { ControlType::Else => write!(f, ".else"), ControlType::EndIf => write!(f, ".endif"), ControlType::Defined => write!(f, ".defined"), + ControlType::Echo(t) => match t { + EchoKind::Info => write!(f, ".info"), + EchoKind::Warning => write!(f, ".warning"), + EchoKind::Error => write!(f, ".error"), + }, } } } |
