Skip to content

Commit

Permalink
guard all if kissCache
Browse files Browse the repository at this point in the history
  • Loading branch information
NQNStudios committed Apr 22, 2024
1 parent f3a4059 commit 877dd0f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/kiss/AsyncEmbeddedScript2.hx
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ class AsyncEmbeddedScript2 {

var hscriptInstructions:Map<String,String> = [];
var cache:Map<String,String> = [];
#if kissCache
#if (kissCache && !lua)
var cacheFile = scriptFile.withoutExtension().withoutDirectory() + ".cache.json";
if (sys.FileSystem.exists(cacheFile)) {
var cacheJson:haxe.DynamicAccess<String> = haxe.Json.parse(sys.io.File.getContent(cacheFile));
Expand Down Expand Up @@ -519,7 +519,7 @@ class AsyncEmbeddedScript2 {
$expr;
};
// If the expression didn't change the KissState when macroExpanding, it can be cached
#if kissCache
#if (kissCache && !lua)
if (!stateChanged) {
var expr = Kiss._try(()->Kiss.readerExpToHaxeExpr(nextExp, k.forHScript()));
cache[cacheKey] = expr.toString();
Expand Down Expand Up @@ -559,7 +559,7 @@ class AsyncEmbeddedScript2 {
})
});

#if kissCache
#if (kissCache && !lua)
sys.io.File.saveContent(cacheFile, haxe.Json.stringify(cache));
sys.io.File.saveContent(hscriptInstructionFile, haxe.Json.stringify(hscriptInstructions));
#end
Expand Down

0 comments on commit 877dd0f

Please sign in to comment.