diff --git a/src/code_.py b/src/code_.py index d4d4b4b332be45cf655f55435a1d4124f9dab2e0..7a9dd14daa845eb13852d5c66742c1ec9acc4159 100644 --- a/src/code_.py +++ b/src/code_.py @@ -73,7 +73,7 @@ class Code: exp1, exp2 = match.group(4).strip(), match.group(5).strip() old = match.group(0) new = f"if ({condition}) {{\n{def_variable} {variable} = {exp1}\n}}\n" - new += f"else {{\n{def_variable} {variable} = {exp2}\n}}\n\n" + new += f"if (!({condition})) {{\n{def_variable} {variable} = {exp2}\n}}\n\n" #else {{\n{variable} = {exp2}\n}}\n" #Here we check that it's worked correctly -> that we have done a good parsing if(get_parenthese_count(condition)==0 and get_parenthese_count(exp1)==0 and get_parenthese_count(exp2)==0 and get_curly_count(condition)==0 and get_curly_count(exp1)==0 and get_curly_count(exp2)==0):