xd
This commit is contained in:
parent
427d769aa6
commit
23abf51c5f
18
program.py
18
program.py
@ -30,22 +30,26 @@ class SimpleInterpreter(AbstractInterpreter):
|
|||||||
|
|
||||||
prev = formula.s[i-1] if i>0 else None #None, gdy jesteśmy na pierwszym znaku
|
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)
|
if (char=='(' and isVariable(prev) and prev is not None): #a(b|c)
|
||||||
|
|
||||||
return False
|
return False
|
||||||
if (prev is None):
|
if (prev is None):
|
||||||
if not (isVariable(char) or isParentice(char) or isNegation(char)):
|
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 (not isNegation(char)):
|
||||||
|
|
||||||
if isSign(prev) and not isNegation(prev): # tylko negacje mogą się powtarzać po innym znaku
|
if isSign(prev) and not isNegation(prev): # tylko negacje mogą się powtarzać po innym znaku
|
||||||
return False
|
return False
|
||||||
if isNegation(prev):
|
if isNegation(prev):
|
||||||
|
|
||||||
if not (isNegation(char) or isParentice(char)):
|
if not (isNegation(char) or isParentice(char)):
|
||||||
print("xd")
|
|
||||||
return False
|
return False
|
||||||
if isVariable(prev): #a!
|
if isNegation(char):
|
||||||
return False
|
if isVariable(prev): #a!
|
||||||
|
return False
|
||||||
else:
|
else:
|
||||||
#if current char is a variable
|
#if current char is a variable
|
||||||
if isVariable(prev) and prev is not None: #Obrona abc>d
|
if isVariable(prev) and prev is not None: #Obrona abc>d
|
||||||
|
Loading…
Reference in New Issue
Block a user