Ruk33 / vrJASS

A just-for-fun programming language which compiles down to JASS (Warcraft 3). It aims to improve and replace the beloved vJASS.
6 stars 3 forks source link

handling modules and textmacro replacements #13

Closed Ruk33 closed 8 years ago

Ruk33 commented 9 years ago

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:

  1. check if we come from a runtextmacro
  2. if we do, return the content visiting its childs
  3. if we dont, store the parserrulecontext in a hashmap and return an empty string

when a runtextmacro is visited:

  1. get the textmacro (parserrulecontext) from the hashmap were we store the textmacros
  2. visit that parserrulecontext
  3. 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)