12c1d874b9
Merge branch 'master' into refactor-preprocessor
...
Conflicts:
preprocessor.py
Also bump the extras submodule to a version of pokemontools with a
suitable version of the preprocessor. The changes from 'master' for
preprocessor.py have been inserted into pokemontools prior to the
submodule bump.
2013-08-31 12:47:23 -05:00
c0a01c9982
Merge pull request #185 from kanzure/preprocessor-performance
...
Preprocessor performance improvements.
This recliams 0.4 seconds.
2013-08-31 10:19:17 -07:00
6191559c53
give preprocessor.py a main()
2013-08-31 12:12:09 -05:00
a74462bc52
even better performance for read_line
2013-08-31 12:03:48 -05:00
473bd192d9
better read_line performance in preprocessor
...
Jump out of read_line early if the line is an empty string or a newline.
2013-08-31 11:57:01 -05:00
70be18427b
don't call load_pokecrystal_macros 2000 times
...
Also, don't call make_macro_table 2000 times by only calling it once and
passing the result.
2013-08-31 11:04:27 -05:00
2fd792bbda
move macro sanity check into separate function
...
This moves out from macro_translator the macro/param length sanity check
into a function called check_macro_sanity.
2013-08-31 10:39:49 -05:00
a429bce189
Merge branch 'master' into preprocessor-macro-function
2013-08-31 10:22:35 -05:00
ba67d3ba46
Merge branch 'master' into preprocessor-asserts
2013-08-31 10:17:25 -05:00
5815edf382
refactor preprocessor macros into a function
...
Remove the "macros" global and instead use a function to construct a
list of macros.
2013-08-31 10:13:17 -05:00
ebb591a7ec
make a MacroException more verbose in preprocessor
2013-08-31 09:56:24 -05:00
93514b1862
convert a macro_translator assert in preprocessor
...
AssertionError -> PreprocessorException
2013-08-31 09:54:03 -05:00
95f7270141
raise MacroException instead of Exception
...
A more specific exception means that error handling can actually work in
the future.
2013-08-31 09:51:31 -05:00
2c22d9220c
fix "raise Exception" formatting in preprocessor
2013-08-31 09:50:17 -05:00
ecedde1993
replace an assert in macro_translator
...
Use a MacroException instead of an AssertionError.
2013-08-31 09:46:11 -05:00
1ce2bccd37
generic preprocessor-specific exception classes
...
These are basic python Exception subclasses that can be used to throw
more specific errors and exceptions from within the preprocessor.
AssertionError is not a good idea.
2013-08-31 09:45:12 -05:00
998fa0b198
remove the do_macro_sanity_check global
2013-08-31 09:37:55 -05:00
0f28e96e4d
remove the show_original_lines global
2013-08-31 09:37:02 -05:00
a6237d6825
remove an Exception from preprocessor
...
It wasn't meant to be left in there anyway.
2013-08-31 09:29:54 -05:00
5e70ac56ea
remove ItemFragment from preprocessor
...
It's not required.
see #178
2013-08-30 18:36:14 -05:00
69adf48a54
remove "skippable_macros" from preprocessor
...
The preprocessor no longer has the concept of skippable_macros and now
always skips any line that starts with "db" or "dw" because neither of
these should be treated as macros.
fixes #178
2013-08-30 18:27:03 -05:00
8fe7f4c3a5
HACK: re-instate the ItemFragment macro hack
...
This is to fix the preprocessor temporarily. Maybe ItemFragment can be
removed completely.
2013-08-30 17:23:43 -05:00
c32cc3dcb8
move main preprocessor into pokemontools
...
Only pokecrystal-specific preprocessor stuff lives in preprocessor.py
now. The other stuff lives in pokemontools.
2013-08-28 22:48:44 -05:00
3fb03e9981
two more unused imports from preprocessor
2013-08-28 20:31:17 -05:00
e4d3ea7256
don't use globals in the preprocessor
...
Macros are now passed around as lists and dicts.
2013-08-28 17:53:26 -05:00