[BACK]Return to name.in CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc / regress / roff / string

File: [cvsweb.bsd.lv] / mandoc / regress / roff / string / name.in (download)

Revision 1.3, Fri Jun 3 12:16:02 2022 UTC (2 years ago) by schwarze
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +12 -2 lines

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.

.\" $OpenBSD: name.in,v 1.5 2022/06/03 11:50:25 schwarze Exp $
.Dd $Mdocdate: June 3 2022 $
.Dt STRING-NAME 1
.Os
.Sh NAME
.Nm string-name
.Nd torturing .ds with weird string names
.Sh DESCRIPTION
.ds norm value of norm
.ds "quot" value of "quot"
.ds bs\e value of bs\ee
.ds bs\\e value of bs\e\ee
.ds dot. value of dot.
.ds bl\ e value of bl\e e
.ds inval\\G value of inval\eG
norm: \*[norm]
.br
norm without closing brace: \*[norm
.br
quot: \*[quot]
.br
"quot": \*["quot"]
.br
bs\e\ee: \*[bs\\e]
.\".br
.\"bs\ee: \*[bs\e]
.br
bse: \*[bse]
.br
bs: \*[bs]
.br
dot.: \*[dot.]
.br
dot\e.: \*[dot\.]
.\".br
.\"bl\e e: \*[bl\ e]
.br
bl e: \*[bl e]
.br
ble: \*[ble]
.br
bl: \*[bl]
.br
inval\e\eG: \*[inval\\G]
.br
inval\eG: \*[inval\G]