mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-23 16:34:06 +00:00
(Proposal) Adjustments to "decomp" language (#308)
* Adjustments to "decomp" language * Fix a comment * Fix accidental clang-formatting * Fix order * Fix order * Remove junk * Fix OFFSET * Adjustments based on new suggestions * Annotate globals * Globals in ISLE * More globals * Merge from parser2 branch * Allow prepending space for exact marker match * To eliminate noise, require the 0x prefix on offset for marker match * fix test from previous * Count tab stops for indented functions to reduce MISSED_END_OF_FUNCTION noise * FUNCTION to SYNTHETIC where needed * Missed marker conversion on SetAtomId * pylint cleanup, remove unused code * Fix unexpected function end, add more unit tests * Be more strict about synthetic name syntax * Revert "Missed marker conversion on SetAtomId" This reverts commitd87d665127
. * Revert "FUNCTION to SYNTHETIC where needed" This reverts commit8c815418d2
. * Implicit lookup by name for functions * Fix VTABLE SYNTHETIC and other decomp markers * Get vtable class name * Vtable marker should identify struct * No colon for SIZE comment * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update CONTRIBUTING.md * Fix destructor/annotation * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md --------- Co-authored-by: disinvite <disinvite@users.noreply.github.com>
This commit is contained in:

committed by
GitHub

parent
4f5b70013f
commit
494a556f8e
@@ -10,7 +10,7 @@ import re
|
||||
|
||||
from isledecomp import (
|
||||
Bin,
|
||||
find_code_blocks,
|
||||
DecompParser,
|
||||
get_file_in_script_dir,
|
||||
OffsetPlaceholderGenerator,
|
||||
print_diff,
|
||||
@@ -313,18 +313,20 @@ if __name__ == "__main__":
|
||||
# Generate basename of original file, used in locating OFFSET lines
|
||||
basename = os.path.basename(os.path.splitext(original)[0])
|
||||
|
||||
parser = DecompParser()
|
||||
for srcfilename in walk_source_dir(source):
|
||||
parser.reset()
|
||||
with open(srcfilename, "r", encoding="utf-8") as srcfile:
|
||||
blocks = find_code_blocks(srcfile)
|
||||
parser.read_lines(srcfile)
|
||||
|
||||
for block in blocks:
|
||||
if block.is_stub:
|
||||
for fun in parser.functions:
|
||||
if fun.is_stub:
|
||||
continue
|
||||
|
||||
if block.module != basename:
|
||||
if fun.module != basename:
|
||||
continue
|
||||
|
||||
addr = block.offset
|
||||
addr = fun.offset
|
||||
# Verbose flag handling
|
||||
if verbose:
|
||||
if addr == verbose:
|
||||
@@ -332,13 +334,13 @@ if __name__ == "__main__":
|
||||
else:
|
||||
continue
|
||||
|
||||
if block.is_template:
|
||||
recinfo = syminfo.get_recompiled_address_from_name(block.signature)
|
||||
if fun.lookup_by_name:
|
||||
recinfo = syminfo.get_recompiled_address_from_name(fun.name)
|
||||
if not recinfo:
|
||||
continue
|
||||
else:
|
||||
recinfo = syminfo.get_recompiled_address(
|
||||
srcfilename, block.start_line
|
||||
srcfilename, fun.line_number
|
||||
)
|
||||
if not recinfo:
|
||||
continue
|
||||
|
Reference in New Issue
Block a user