From cb4c2bc54183563b54eb03c8fb1af174ae0805fd Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Fri, 9 Aug 2019 18:56:58 -0400 Subject: [PATCH] include full string as comment with return value. --- string_compiler.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/string_compiler.py b/string_compiler.py index 86ab3f6..2597761 100644 --- a/string_compiler.py +++ b/string_compiler.py @@ -141,7 +141,8 @@ def generate_asm(asm, d, level): if short_m: asm.emit("longa on", 0) if "" in d: - asm.emit("ldx #{}".format(d[""]), 3) + d = d[""] + asm.emit("ldx #{}\t; '{}'".format(d["__value__"], d["__key__"]), 3) asm.rts() @@ -161,7 +162,7 @@ def process(data, name): current[x] = tmp current = tmp - current[""] = data[k] + current[""] = { "__value__": data[k], "__key__": k } # print(tree); asm = Assembler(name) @@ -190,10 +191,8 @@ def read_data(f, name): err = "{}:{}: Bad data: {}".format(name,ln,line) raise Exception(err) k = m[1] - # if flag_ci: k = k.lower() if flag_ci: k = k.lower() - # k = "".join([chr(ord(x)|0x20) for x in k]) v = int(m[2])