Actually make the reference implementation follow spec

Technically true and false were being represented in variable expansion as True and False because Python is weird; this has now been rectified.
This commit is contained in:
Robert Miles 2020-10-31 08:22:18 +00:00
parent f61d38cc1a
commit 79cc290c90
1 changed files with 7 additions and 1 deletions

View File

@ -100,9 +100,15 @@ class Evaluator:
if t.type=="TARGET":
targets[t.value]=i
return targets
def str(self,value):
if value is True:
return "true"
if value is False:
return "false"
return str(value)
def expand_values(self,s):
for key, value in self.values.items():
s = s.replace("{{"+key+"}}",str(value))
s = s.replace("{{"+key+"}}",self.str(value))
return s
def command_goto(self):
target = self.next("STEM")