first of all, move all textmacro definition blocks at the top of the script (right below define blocks) using reg expr.
when a textmacro is visited:
check if we come from a runtextmacro
if we do, return the content visiting its childs
if we dont, store the parserrulecontext in a hashmap and return an empty string
when a runtextmacro is visited:
get the textmacro (parserrulecontext) from the hashmap were we store the textmacros
visit that parserrulecontext
do the variable replacements
when a module is visited, do the same as if it were a textmacro but also define the symbol
when a implement module is visited, do the same as if it were a runtextmacro (avoiding replacements of course)
first of all, move all textmacro definition blocks at the top of the script (right below define blocks) using reg expr.
when a textmacro is visited:
when a runtextmacro is visited:
when a module is visited, do the same as if it were a textmacro but also define the symbol when a implement module is visited, do the same as if it were a runtextmacro (avoiding replacements of course)