From 804bced6da6758fcb6178778a9a4aa0ac13ecadb Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Tue, 5 Jul 2022 00:14:55 +0000 Subject: [PATCH] removeFiles --- kiss/src/kiss/SpecialForms.hx | 3 +++ projects/nat-archive-tool/src/nat/Lib.kiss | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/kiss/src/kiss/SpecialForms.hx b/kiss/src/kiss/SpecialForms.hx index b1dca406..de85f203 100644 --- a/kiss/src/kiss/SpecialForms.hx +++ b/kiss/src/kiss/SpecialForms.hx @@ -457,6 +457,9 @@ class SpecialForms { macro null; }; + // TODO these macro forms cause the compiler errors to give line numbers + // pointing back to SpecialForms.hx, which aren't helpful. withMacroPosOf should be used + // to wrap them macro if ($condition) $thenExp else diff --git a/projects/nat-archive-tool/src/nat/Lib.kiss b/projects/nat-archive-tool/src/nat/Lib.kiss index 45cbda54..3cc8cd39 100644 --- a/projects/nat-archive-tool/src/nat/Lib.kiss +++ b/projects/nat-archive-tool/src/nat/Lib.kiss @@ -105,6 +105,11 @@ file pathInArchive))) (e.files.push pathWithoutDir)))))) +(function removeFiles [:nat.Archive archive :nat.Entry e :Array files] + (withWritableEntry archive e + (doFor file files + (e.files.remove file)))) + (function addTags [:nat.Archive archive :nat.Entry e :Array tagsToAdd] (if (hasComponent e Tags) (withWritableComponents archive e [tags Tags]