|
 |
On 7/5/25 21:42, Josh English wrote:
> And I'm getting an error:
>
> Parse Error: Can't nest directives accessing the same file.
You are missing a couple of closing parens.
#macro WriteTileSet(fname)
#fopen TILE fname write
#for(I, 0, MaxEntropy-1, 1)
#write (TILE, "#declare TileSet[", S(I), "] = dictionary {\n")
#write (TILE, " .name = ", TileSet[I].name, ";\n")
#write (TILE, " .edges = array[", S(TileEdges),"] {" // <--
#for(E, 0, TileEdges-1, 1)
#write (TILE, TileSet[I].edges[E], ", ")
#end
#write (TILE, "};\n")
#write (TILE, " .pidx = ", S(TileSet[I].pidx),";\n")
#write (TILE, " .rot = ", S(TileSet[I].rot), ";\n")
#write (TILE, "}\n" // <---
#end // for I
#fclose TILE
#end
The parser is seeing another #write directive start, while being in the
middle of parsing a prior #write directive. As long as the .edges
element is a string, you should be on your way after adding the closing
parens.
Bill P.
Post a reply to this message
|
 |