diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2022-06-03 12:15:55 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2022-06-03 12:15:55 +0000 |
commit | f1a1415f2ac83d7454ab33bab918fe77f90664bd (patch) | |
tree | cca4619f0ecb728de9a8697ed509838d8c4186bd /regress/roff/cond/register.out_ascii | |
parent | 4de2134e6e8bcf00651ea443b38238baef53467e (diff) | |
download | mandoc-f1a1415f2ac83d7454ab33bab918fe77f90664bd.tar.gz |
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/cond/register.out_ascii')
-rw-r--r-- | regress/roff/cond/register.out_ascii | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/regress/roff/cond/register.out_ascii b/regress/roff/cond/register.out_ascii index 928c6138..673b9f12 100644 --- a/regress/roff/cond/register.out_ascii +++ b/regress/roff/cond/register.out_ascii @@ -7,8 +7,14 @@ DDEESSCCRRIIPPTTIIOONN not yet defined now defined - identifier + identifier: myreg is defined + tab after identifier: myreg is defined escape sequence after identifier: -myreg is defined -OpenBSD February 6, 2019 REGISTER(1) + backslash in name: \ is defined + + dot in name: . is defined \. is defined + + invalid escape in name: G is defined \G is defined + +OpenBSD June 3, 2022 REGISTER(1) |