- nexthiera = item["items"]
- if value:
- print (value, end="", file=outfile)
- process_file_layer(source, outfile, globals, nexthiera)
+ # determine line end
+ end = "\n"
+ if "end" in item["attrs"]:
+ end = item["attrs"]["end"]
+ # check "pre"
+ if "pre" in item["attrs"]:
+ text = item["attrs"]["pre"]
+ if text.startswith(r"\n"):
+ print (file=outfile)
+ text = text[2:]
+ print (text, end="", file=outfile)
+ if "exec" in item["attrs"]:
+ # call function
+ store_current_node = source.currentNode
+ l = {"out" : None, "source":source}
+ exec(functions[item["attrs"]["exec"]], globals(), l)
+ # proceed on previous position
+ source.currentNode = store_current_node
+ print (l["out"], file=outfile)
+ else:
+ # proceed working
+ nexthiera = item["items"]
+ if value:
+ print (value, end="", file=outfile)
+ process_file_layer(source, outfile, global_defs, nexthiera, functions, target)
+ # check "post"
+ if "post" in item["attrs"]:
+ print (item["attrs"]["post"], end="", file=outfile)
+ print (end=end, file=outfile)