Create evaluator for function call
This commit is contained in:
@@ -7,7 +7,7 @@ from smnp.note.model import Note
|
||||
class Type(Enum):
|
||||
INTEGER = (int, lambda x: str(x))
|
||||
STRING = (str, lambda x: x)
|
||||
LIST = (list, lambda x: f"({', '.join([e.stringify() for e in x])})")
|
||||
LIST = (list, lambda x: f"[{', '.join([e.stringify() for e in x])}]")
|
||||
PERCENT = (float, lambda x: f"{int(x * 100)}%")
|
||||
NOTE = (Note, lambda x: x.note.name)
|
||||
VOID = (type(None), lambda x: _failStringify(Type.VOID))
|
||||
@@ -17,7 +17,7 @@ class Type(Enum):
|
||||
|
||||
|
||||
def _failStringify(t):
|
||||
raise RuntimeException(f"Not able to interpret {t.name}'")
|
||||
raise RuntimeException(f"Not able to interpret {t.name}'", None)
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user