summaryrefslogtreecommitdiff
path: root/preprocessor.py
diff options
context:
space:
mode:
authoryenatch <yenatch@gmail.com>2013-12-08 17:05:28 -0500
committeryenatch <yenatch@gmail.com>2013-12-09 01:40:04 -0500
commit94052ab5b94a8817c62f1d3d06da2e1c9d5be658 (patch)
tree8e6afbab081a940e4a7803967c36a0c4c844c9b2 /preprocessor.py
parent9eb2cf3d217e8f9e0e86b8d41eac21ce54dd2ba4 (diff)
prequeue: dont initialize a new preprocessor for each file
Diffstat (limited to 'preprocessor.py')
-rw-r--r--preprocessor.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/preprocessor.py b/preprocessor.py
index b5f2e3a4a..c9f90553b 100644
--- a/preprocessor.py
+++ b/preprocessor.py
@@ -51,17 +51,16 @@ def load_pokecrystal_macros():
return ourmacros
-def preprocess(config, macros, lines=None):
- """
- Entry point for the preprocessor.
- """
+def setup_processor():
+ config = configuration.Config()
+ macros = load_pokecrystal_macros()
processor = preprocessor.Preprocessor(config, macros)
- return processor.preprocess(lines=lines)
+ return processor
def main():
- config = configuration.Config()
- macros = load_pokecrystal_macros()
- return preprocess(config, macros)
+ processor = setup_processor()
+ processor.preprocess()
+ processor.update_globals
# only run against stdin when not included as a module
if __name__ == "__main__":