Skip to content

Commit 63dd3d3

Browse files
libretroadminLibretroAdmin
authored andcommitted
tools/settings_migrate_group: extract fieldless reference rows by token
Action rows have no field argument, so a referenced action's literal extraction anchored on an empty field and matched nothing; the head pattern now adapts.
1 parent 3cd35fe commit 63dd3d3

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

tools/settings_migrate_group.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,8 @@ def guard_of(text, pat):
218218
_tail = [r for r in rows if r[2] in ref_tokens]
219219
_ref_literals = {}
220220
for _k3, _f3, _t3, _a3 in _tail:
221-
_rm3 = re.search(r'[ \t]*SDESC_\w+_ROW(?:_P|_DS|_EX|_LV)?\(\s*%s,\s*%s,(?:[^()]|\((?:[^()]|\([^()]*\))*\))*\),?' % (_f3, _t3), body)
221+
_head3 = (r'\s*%s,\s*%s,' % (_f3, _t3)) if _f3 else (r'\s*%s,' % _t3)
222+
_rm3 = re.search(r'[ \t]*SDESC_\w+_ROW(?:_P|_DS|_EX|_LV)?\(%s(?:[^()]|\((?:[^()]|\([^()]*\))*\))*\),?' % _head3, body)
222223
assert _rm3, _t3
223224
_rl3 = _rm3.group(0).strip()
224225
for _g3 in reversed(guards.get(_f3 or _t3, ())):

0 commit comments

Comments
 (0)