Skip to content
Snippets Groups Projects
Commit 74215229 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

mv getter implementations to headers; add test

def exec_getters_to_h(fstem, th, tc):

    for m in re.finditer(r'\n(\S+) (\w+)::([a-z]\w*)\(\) const\n{\n    (return m_\w+;)\n}\n+', tc):
        rtyp = m.group(1)
        clas = m.group(2)
        fctn = m.group(3)
        code = m.group(4)

        old = r'(\nclass '+clas+r'.*?\n    '+rtyp+' '+fctn+'\(\) const);'
        th2 = re.sub(old, r'\1 { '+code+' }', th, 1, re.DOTALL)
        if th2 != th:
            tc = tc.replace(m.group(0), '')
            th = th2

    return th, tc
parent 3d48e1dc
No related branches found
No related tags found
1 merge request!2198mv getter implementations to headers; add test
Pipeline #122441 passed
Showing
with 16 additions and 110 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment