From ccdf39d9cb63bb341dbb5c88c9090ac8e05b350c Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Fri, 3 Jun 2022 12:15:55 +0000 Subject: During identifier parsing, handle undefined escape sequences in the same way as groff: * \\ is always reduced to \ * \. is always reduced to . * other undefined escape sequences are usually reduced to the escape name, for example \G to G, except during the expansion of expanding escape sequences having the standard argument form (in particular \* and \n), in which case the backslash is preserved literally. Yes, this is confusing indeed. For example, the following have the same meaning: * .ds \. and .ds . which is not the same as .ds \\. * \*[\.] and \*[.] which is not the same as \*[\\.] * .ds \G and .ds G which is not the same as .ds \\G * \*[\G] and \*[\\G] which is not the same as \*[G] <- sic! To feel less dirty, have a leaning toothpick, if you are so inclined. This patch also slightly improves the string shown by the "escaped character not allowed in a name" error message. --- regress/roff/ds/Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'regress/roff/ds/Makefile') diff --git a/regress/roff/ds/Makefile b/regress/roff/ds/Makefile index 773105e8..68a8b3bf 100644 --- a/regress/roff/ds/Makefile +++ b/regress/roff/ds/Makefile @@ -1,4 +1,9 @@ -# $OpenBSD: Makefile,v 1.6 2019/02/06 20:54:28 schwarze Exp $ +# $OpenBSD: Makefile,v 1.7 2022/06/03 11:50:25 schwarze Exp $ +# +# This directory is intended for tests of string *definitions*, +# in particular testing the behaviour of the .ds and .as macros. +# Tests of string *expansion* are better placed in the roff/string +# directory. REGRESS_TARGETS = append escname nested quoting tab -- cgit v1.2.3-56-ge451