SPF-OST / pytrnsys_gui

Graphical user interface for pytrnsys
https://pytrnsys.readthedocs.io
GNU Lesser General Public License v3.0
3 stars 4 forks source link

Use `re.Pattern.split` for replacing tokens in (d)dcks. #472

Open zuckerruebe opened 1 year ago

zuckerruebe commented 1 year ago

As a developer I want to replace tokens in replaceAssignStatements.py using Pattern.split. Currently we do:

    for currentMatch in _CHANGE_ASSIGN_STATEMENT_PATTERN.finditer(originalDeckContent):
        _replaceAssignStatementBasedOnUnitVariable(
            previousMatch, currentMatch, unprocessedDeckContent, updatedDeckContent, newStatementsByCaseFoldedName
        )

Use Pattern.split instead: it will simplify the assembly of the new string.