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 <mahmmoud.hassanein@gmail.com>
This commit is contained in:
2025-01-22 14:10:54 +02:00
parent 03e5a56d62
commit b6d43ebe49

View File

@@ -43,12 +43,15 @@ pub fn (action Action) heroscript() string {
if action.comments.len > 0 { if action.comments.len > 0 {
out += texttools.indent(action.comments, '// ') out += texttools.indent(action.comments, '// ')
} }
if action.actiontype == .sal {
if action.actiontype == .dal {
out += '!'
} else if action.actiontype == .sal {
out += '!!' out += '!!'
} else if action.actiontype == .macro { } else if action.actiontype == .macro {
out += '!!!' out += '!!!'
} else { } else {
panic('only action sal and macro supported for now,\n${action}') panic('only action sal and macro supported for now')
} }
if action.actor != '' { if action.actor != '' {