From 43f4c5200e7fd840040e72285e7b7d233f1f9054 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Thu, 12 Dec 2019 12:22:38 -0500 Subject: [PATCH] basic: don't choke on ':' in '"' literals --- apps/basic/tok.asm | 1 + apps/basic/util.asm | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/apps/basic/tok.asm b/apps/basic/tok.asm index e6adf41..afe4967 100644 --- a/apps/basic/tok.asm +++ b/apps/basic/tok.asm @@ -56,6 +56,7 @@ toEnd: cp ':' jr z, .havesep inc hl + call skipQuoted jr toEnd .havesep: inc a ; unset Z diff --git a/apps/basic/util.asm b/apps/basic/util.asm index 37bee03..0c2f831 100644 --- a/apps/basic/util.asm +++ b/apps/basic/util.asm @@ -11,5 +11,22 @@ spitQuoted: inc hl cp '"' ret z + or a + ret z call stdioPutC jr .loop + +; Same as spitQuoted, but without the spitting +skipQuoted: + ld a, (hl) + cp '"' + ret nz + inc hl +.loop: + ld a, (hl) + inc hl + cp '"' + ret z + or a + ret z + jr .loop