diff --git a/src/code_.py b/src/code_.py index f8f4bb7b1cd0b500417a38df4ef5f6350e936ad0..3b2ead5f75d7babf18b7c4f612534d4a00e0414a 100644 --- a/src/code_.py +++ b/src/code_.py @@ -130,8 +130,7 @@ class Code: _, end_line = match.span(0) all = match.group(0) extarcted = match.group(2).strip() - - if(extarcted!="" and extarcted[0] not in ["{"] and extarcted[-1] not in ["{", "}"]): + if(extarcted!="" and extarcted[0] not in ["{"] and extarcted[-1] not in ["{", "}"] and not bool(re.fullmatch(r"if *\(.+", extarcted))): new = f"else {{\n{extarcted}\n}}\n" to_replace.append((all, new))