scripts: Some minor regex cleanup

Just trying to make regex in scripts a bit more consistent. Though regex
being regex this may be fruitless.
This commit is contained in:
Christopher Haster
2024-12-04 01:02:50 -06:00
parent 28d89eb009
commit b90b2953ea
6 changed files with 42 additions and 44 deletions

View File

@ -420,12 +420,12 @@ def collect_dwarf_info(obj_path, tags=None, *,
objdump_path=OBJDUMP_PATH,
**args):
info_pattern = re.compile(
'^\s*(?:<(?P<level>[^>]*)>'
'^\s*<(?P<level>[^>]*)>'
'\s*<(?P<off>[^>]*)>'
'.*\(\s*(?P<tag>[^)]*?)\s*\)'
'|\s*<(?P<off_>[^>]*)>'
'.*\(\s*(?P<tag>[^)]*?)\s*\)\s*$'
'|' '^\s*<(?P<off_>[^>]*)>'
'\s*(?P<at>[^>:]*?)'
'\s*:(?P<v>.*))\s*$')
'\s*:(?P<v>.*)\s*$')
# collect dwarf entries
info = co.OrderedDict()