From b6d43ebe49f00ce429ee0b037af87ef346da6cb8 Mon Sep 17 00:00:00 2001 From: mariobassem Date: Wed, 22 Jan 2025 14:10:54 +0200 Subject: [PATCH] refactor: improve action heroscript output - Update `action.heroscript()` to handle `dal` actions. - Remove buggy action print from panic message which led to an infinite recursive call. Co-authored-by: mahmmoud.hassanein --- lib/core/playbook/action.v | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/core/playbook/action.v b/lib/core/playbook/action.v index f6498139..d9fbe347 100644 --- a/lib/core/playbook/action.v +++ b/lib/core/playbook/action.v @@ -43,12 +43,15 @@ pub fn (action Action) heroscript() string { if action.comments.len > 0 { out += texttools.indent(action.comments, '// ') } - if action.actiontype == .sal { + + if action.actiontype == .dal { + out += '!' + } else if action.actiontype == .sal { out += '!!' } else if action.actiontype == .macro { out += '!!!' } else { - panic('only action sal and macro supported for now,\n${action}') + panic('only action sal and macro supported for now') } if action.actor != '' {