This commit is contained in:
emile 2019-05-30 20:53:08 +02:00
parent 427d769aa6
commit 23abf51c5f

View File

@ -30,22 +30,26 @@ class SimpleInterpreter(AbstractInterpreter):
prev = formula.s[i-1] if i>0 else None #None, gdy jesteśmy na pierwszym znaku
if (char=='(' and isVariable(prev) and prev is not None): #a(b|c)
return False
if (prev is None):
if not (isVariable(char) or isParentice(char) or isNegation(char)):
return False
if isSign(char):
return False
if isSign(char) and prev is not None:
if (not isNegation(char)):
if isSign(prev) and not isNegation(prev): # tylko negacje mogą się powtarzać po innym znaku
return False
if isNegation(prev):
if not (isNegation(char) or isParentice(char)):
print("xd")
return False
if isVariable(prev): #a!
return False
return False
if isNegation(char):
if isVariable(prev): #a!
return False
else:
#if current char is a variable
if isVariable(prev) and prev is not None: #Obrona abc>d