From 1b5648bb064d4f002db56cd691baa667d2b537b2 Mon Sep 17 00:00:00 2001 From: Rangi Date: Thu, 1 Jul 2021 17:56:49 -0400 Subject: [PATCH] Line continuations *do* work inside strings The rgbasm.5(5) documentation was outdated here --- src/asm/rgbasm.5 | 11 ++--------- test/asm/line-continuation-string.err | 0 test/asm/line-continuation-string.out | 1 + 3 files changed, 3 insertions(+), 9 deletions(-) create mode 100644 test/asm/line-continuation-string.err create mode 100644 test/asm/line-continuation-string.out diff --git a/src/asm/rgbasm.5 b/src/asm/rgbasm.5 index fcba105c..cd41284d 100644 --- a/src/asm/rgbasm.5 +++ b/src/asm/rgbasm.5 @@ -66,15 +66,8 @@ To do so, put a backslash at the end of the line: DB 1, 2, 3,\ \[rs] 4, 5, 6,\ \[rs]\ ;\ Put it before any comments 7, 8, 9 -.Ed -.Pp -This works anywhere in the code except inside of strings. -To split strings it is needed to use -.Fn STRCAT -like this: -.Bd -literal -offset indent - db STRCAT("Hello ",\ \[rs] - "world!") + DB "Hello,\ \[rs]\ \ ;\ Space before the \[rs] is included +world!"\ \ \ \ \ \ \ \ \ \ \ ;\ Any leading space is included .Ed .Sh EXPRESSIONS An expression can be composed of many things. diff --git a/test/asm/line-continuation-string.err b/test/asm/line-continuation-string.err new file mode 100644 index 00000000..e69de29b diff --git a/test/asm/line-continuation-string.out b/test/asm/line-continuation-string.out new file mode 100644 index 00000000..4f1edef2 --- /dev/null +++ b/test/asm/line-continuation-string.out @@ -0,0 +1 @@ +Line continuations work!