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

@@ -4,6 +4,8 @@ from smnp.program.interpreter import Interpreter
def loadStandardLibrary():
source = resource_string('smnp.library.code', 'main.mus').decode("utf-8")
return Interpreter.interpretString(source)
mainSource = resource_string('smnp.library.code', 'main.mus').decode("utf-8")
boolSource = resource_string('smnp.library.code', 'bool.mus').decode("utf-8")
env = Interpreter.interpretString(mainSource)
return Interpreter.interpretString(boolSource, baseEnvironment=env)