Reformat evaluator #1

This commit is contained in:
Bartłomiej Pluta
2019-07-04 17:57:12 +02:00
parent f0cbf37fe9
commit 34a0eda199
36 changed files with 470 additions and 270 deletions

View File

@@ -1,6 +1,8 @@
from enum import Enum
from smnp.error.syntax import SyntaxException
class NotePitch(Enum):
C = 0
CIS = 1
@@ -46,7 +48,7 @@ class NotePitch(Enum):
try:
return stringToPitch[string.lower()]
except KeyError as e:
raise SyntaxException(None, f"Note '{string}' does not exist")
raise SyntaxException(f"Note '{string}' does not exist") #TODO jakis inny exception
stringToPitch = {
'c': NotePitch.C,