[BACK]Return to escname.out_ascii CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc / regress / roff / de

File: [cvsweb.bsd.lv] / mandoc / regress / roff / de / escname.out_ascii (download)

Revision 1.4, Fri Jun 3 12:15:58 2022 UTC (2 years, 3 months ago) by schwarze
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +13 -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.

DE-ESCNAME(1)               General Commands Manual              DE-ESCNAME(1)

NNAAMMEE
     ddee--eessccnnaammee - escape sequences in macro names

DDEESSCCRRIIPPTTIIOONN
     initial text

     define second = val2

     define first\second = val3

     define first = val1

     define first\.second = val_dot

     define first\Gsecond = val_inval

     Values:
     first          val1
     second         val2
     first\second   val3
     first.second   val_dot
     first\.second  val_dot
     firstGsecond   val_inval
     first\Gsecond  val_inval

     Remove all but second: val2

     macro seperated from argument by an escape sequence: "argument"

     final text

OpenBSD                          June 3, 2022                          OpenBSD