aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/regress/roff/de/escname.in
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2022-06-03 12:15:55 +0000
committerIngo Schwarze <schwarze@openbsd.org>2022-06-03 12:15:55 +0000
commitccdf39d9cb63bb341dbb5c88c9090ac8e05b350c (patch)
tree8205e38fed18628857329eecdbd4fda63c7ae21d /regress/roff/de/escname.in
parent3b52bb8d03ff61274832867c905a80a2761859aa (diff)
downloadmandoc-ccdf39d9cb63bb341dbb5c88c9090ac8e05b350c.tar.gz
mandoc-ccdf39d9cb63bb341dbb5c88c9090ac8e05b350c.tar.zst
mandoc-ccdf39d9cb63bb341dbb5c88c9090ac8e05b350c.zip
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.
Diffstat (limited to 'regress/roff/de/escname.in')
-rw-r--r--regress/roff/de/escname.in29
1 files changed, 26 insertions, 3 deletions
diff --git a/regress/roff/de/escname.in b/regress/roff/de/escname.in
index 67d26091..99305eaf 100644
--- a/regress/roff/de/escname.in
+++ b/regress/roff/de/escname.in
@@ -1,5 +1,5 @@
-.\" $OpenBSD: escname.in,v 1.4 2017/07/04 14:53:27 schwarze Exp $
-.Dd $Mdocdate: July 4 2017 $
+.\" $OpenBSD: escname.in,v 1.5 2022/06/03 11:50:25 schwarze Exp $
+.Dd $Mdocdate: June 3 2022 $
.Dt DE-ESCNAME 1
.Os
.Sh NAME
@@ -23,10 +23,33 @@ define first = val1
val1
..
.Pp
-Values (first, second, first\esecond):
+define first\e.second = val_dot
+.de first\.second
+val_dot
+..
+.Pp
+define first\eGsecond = val_inval
+.de first\Gsecond
+val_inval
+..
+.Pp
+Values:
+.Bl -tag -width first_.second -compact
+.It first
.first
+.It second
.second
+.It first\esecond
.first\\second
+.It first.second
+.first.second
+.It first\e.second
+.first\.second
+.It firstGsecond
+.firstGsecond
+.It first\eGsecond
+.first\Gsecond
+.El
.Pp
Remove all but second:
.rm first\\second first\esecond second