From f1a1415f2ac83d7454ab33bab918fe77f90664bd 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/args/man.out_lint | 2 +- regress/roff/args/mdoc.out_lint | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'regress/roff/args') diff --git a/regress/roff/args/man.out_lint b/regress/roff/args/man.out_lint index 6d6bbd84..5aaebd9e 100644 --- a/regress/roff/args/man.out_lint +++ b/regress/roff/args/man.out_lint @@ -6,4 +6,4 @@ mandoc: man.in:87:26: STYLE: whitespace at end of input line mandoc: man.in:91:27: STYLE: whitespace at end of input line mandoc: man.in:104:5: STYLE: unterminated quoted argument mandoc: man.in:107:9: STYLE: unterminated quoted argument -mandoc: man.in:131:1: ERROR: escaped character not allowed in a name: IB\( +mandoc: man.in:131:1: ERROR: escaped character not allowed in a name: IB\(lq diff --git a/regress/roff/args/mdoc.out_lint b/regress/roff/args/mdoc.out_lint index 4422d754..1691cf2d 100644 --- a/regress/roff/args/mdoc.out_lint +++ b/regress/roff/args/mdoc.out_lint @@ -14,4 +14,4 @@ mandoc: mdoc.in:112:5: STYLE: unterminated quoted argument mandoc: mdoc.in:112:11: STYLE: whitespace at end of input line mandoc: mdoc.in:113:9: STYLE: unterminated quoted argument mandoc: mdoc.in:113:15: STYLE: whitespace at end of input line -mandoc: mdoc.in:121:1: ERROR: escaped character not allowed in a name: Fl\( +mandoc: mdoc.in:121:1: ERROR: escaped character not allowed in a name: Fl\(lq -- cgit