From 5d06ba11c981430aca68f2ea31771fca7f18529b Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Wed, 22 Jan 2025 22:22:46 +0100 Subject: Implement echo control statements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miquel Sabaté Solà --- lib/xixanta/src/opcodes.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/xixanta/src/opcodes.rs') diff --git a/lib/xixanta/src/opcodes.rs b/lib/xixanta/src/opcodes.rs index 865b5cd..752f8ea 100644 --- a/lib/xixanta/src/opcodes.rs +++ b/lib/xixanta/src/opcodes.rs @@ -1,4 +1,4 @@ -use crate::node::ControlType; +use crate::node::{ControlType, EchoKind}; use std::collections::HashMap; use std::fmt; @@ -765,6 +765,10 @@ lazy_static! { functions.insert(String::from(".endif"), Control { control_type: ControlType::EndIf, has_identifier: None, required_args: Some((0, 0)), touches_context: false, only_string: false }); functions.insert(String::from(".def"), Control { control_type: ControlType::Defined, has_identifier: None, required_args: Some((1, 1)), touches_context: false, only_string: false }); functions.insert(String::from(".defined"), Control { control_type: ControlType::Defined, has_identifier: None, required_args: Some((1, 1)), touches_context: false, only_string: false }); + functions.insert(String::from(".info"), Control { control_type: ControlType::Echo(EchoKind::Info), has_identifier: None, required_args: Some((1, 1)), touches_context: false, only_string: true }); + functions.insert(String::from(".out"), Control { control_type: ControlType::Echo(EchoKind::Info), has_identifier: None, required_args: Some((1, 1)), touches_context: false, only_string: true }); + functions.insert(String::from(".warning"), Control { control_type: ControlType::Echo(EchoKind::Warning), has_identifier: None, required_args: Some((1, 1)), touches_context: false, only_string: true }); + functions.insert(String::from(".error"), Control { control_type: ControlType::Echo(EchoKind::Error), has_identifier: None, required_args: Some((1, 1)), touches_context: false, only_string: true }); functions }; -- cgit v1.2.3