diff options
author | Bryan Bishop <kanzure@gmail.com> | 2015-03-12 12:03:17 -0500 |
---|---|---|
committer | Bryan Bishop <kanzure@gmail.com> | 2015-03-12 12:03:17 -0500 |
commit | 46492bd9075313a52622cc585fe7b2ca404cbdcd (patch) | |
tree | a85173de577ad9511728a13d25f8d2e39d3b2b18 /pokemontools/wram.py | |
parent | 2c2ceb74567664379cebfb121e0db929718a4ba2 (diff) | |
parent | 8d86abe8823acc8c44780ae15646ebb7f719c5ec (diff) |
Merge pull request #86 from yenatch/master
Refactor the LZ tools and fix BSSReader's eval shenanigans.
Diffstat (limited to 'pokemontools/wram.py')
-rw-r--r-- | pokemontools/wram.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pokemontools/wram.py b/pokemontools/wram.py index e25ca37..b6d7fc6 100644 --- a/pokemontools/wram.py +++ b/pokemontools/wram.py @@ -58,7 +58,7 @@ class BSSReader: if token in ['ds', 'db', 'dw']: if any(params): - length = eval(rgbasm_to_py(params[0]), self.constants) + length = eval(rgbasm_to_py(params[0]), self.constants.copy()) else: length = {'ds': 1, 'db': 1, 'dw': 2}[token] self.address += length @@ -172,7 +172,7 @@ class BSSReader: real = split_line[index] name, value = map(' '.join, [split_line[:index], split_line[index+1:]]) value = rgbasm_to_py(value) - self.constants[name] = eval(value, self.constants) + self.constants[name] = eval(value, self.constants.copy()) else: self.read_bss_line(line) @@ -195,7 +195,7 @@ def scrape_constants(text): bss = BSSReader() bss.read_bss_sections(text) constants = bss.constants - return constants + return {v: k for k, v in constants.items()} def read_constants(filepath): """ |