update preprocessor to use a class

This commit is contained in:
Bryan Bishop
2013-09-02 10:41:50 -05:00
parent d4aa6edfa7
commit 5c46972ebe
3 changed files with 12 additions and 7 deletions

View File

@@ -7,11 +7,14 @@ a single process.
import os
import sys
import extras.pokemontools.config as conf
import preprocessor
def main():
config = conf.Config()
macros = preprocessor.load_pokecrystal_macros()
macro_table = preprocessor.preprocessor.make_macro_table(macros)
stdout = sys.stdout
@@ -19,7 +22,7 @@ def main():
dest = os.path.splitext(source)[0] + '.tx'
sys.stdin = open(source, 'r')
sys.stdout = open(dest, 'w')
preprocessor.preprocess(macro_table)
preprocessor.preprocess(config, macros)
# reset stdout
sys.stdout = stdout