Add support for evaluating BOOL and introduce basic logical operators as functions

This commit is contained in:
Bartłomiej Pluta
2019-07-10 14:08:28 +02:00
parent 9408c63e06
commit 578141c7b8
6 changed files with 23 additions and 5 deletions

View File

@@ -12,7 +12,7 @@ def _function1(env, list, index):
raise RuntimeException(f"Attempt to access item which is outside the list", None)
_signature2 = signature(ofType(Type.MAP), ofTypes(Type.INTEGER, Type.STRING, Type.NOTE, Type.TYPE))
_signature2 = signature(ofType(Type.MAP), ofTypes(Type.INTEGER, Type.STRING, Type.NOTE, Type.BOOL, Type.TYPE))
def _function2(env, map, key):
try:
return map.value[key]