From a6fb96c3afed654a51cceff72ef3a7d814fc7a95 Mon Sep 17 00:00:00 2001 From: Piotr Wiszowaty Date: Fri, 25 Jul 2014 19:22:13 +0200 Subject: [PATCH] Fix 6a255534 leftovers --- foco65 | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/foco65 b/foco65 index 3a3ed4e..07187d3 100755 --- a/foco65 +++ b/foco65 @@ -172,7 +172,8 @@ class Word: def output(self, section): if self.used and self.section == section: if self.code: - return "%s\n dta a(*+2)\n%s\n" % (self.label, self.code) + cout = self.code.output(section) + return "%s\n dta a(*+2)\n%s\n" % (self.label, cout) else: s = "\n".join(map(lambda l: " dta a(%s)" % l, self.thread)) return "%s\n%s\n\n" % (self.label, s) @@ -400,7 +401,12 @@ class Forth: self.push(x1 / x2) elif token == "]": self.word.add("lit") - self.word.add(self.pop(token).output(self.text_section)) + tos = self.pop(token) + if isinstance(tos, int): + txt = str(tos) + else: + txt = tos.output(self.text_section) + self.word.add(txt) self.set_state("compile") elif self.isnumber(token): self.push(self.tonumber(token.text)) @@ -786,7 +792,7 @@ until_end """ basewords_text = """ -[text-section] code +[text-section] text : drop [code]