From da6633e8c5db9f71ef2499ad46bc43e3854c2ac9 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Mon, 30 May 2022 23:03:47 +0000 Subject: Dummy implementation of the roff(7) \V (interpolate environment variable) escape sequence. This is needed to get \V into the correct parsing class, ESCAPE_EXPAND. It is intentional that mandoc(1) output is *not* influenced by environment variables, so interpolate the name of the variable with some decorating punctuation rather than interpolating its value. --- regress/roff/esc/Makefile | 11 ++++++++--- regress/roff/esc/V1.in | 10 ++++++++++ regress/roff/esc/V1.out_ascii | 11 +++++++++++ regress/roff/esc/V1.out_lint | 3 +++ 4 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 regress/roff/esc/V1.in create mode 100644 regress/roff/esc/V1.out_ascii create mode 100644 regress/roff/esc/V1.out_lint (limited to 'regress') diff --git a/regress/roff/esc/Makefile b/regress/roff/esc/Makefile index bd39e378..dd816f58 100644 --- a/regress/roff/esc/Makefile +++ b/regress/roff/esc/Makefile @@ -1,10 +1,10 @@ -# $OpenBSD: Makefile,v 1.21 2022/05/20 13:06:27 schwarze Exp $ +# $OpenBSD: Makefile,v 1.22 2022/05/30 22:50:40 schwarze Exp $ REGRESS_TARGETS = one two multi comment -REGRESS_TARGETS += B bs_man bs_mdoc c c_man E1 e f h hneg l O1 o p r w z +REGRESS_TARGETS += B bs_man bs_mdoc c c_man E1 e f h hneg l O1 o p r V1 w z REGRESS_TARGETS += ignore invalid unsupp HTML_TARGETS = f -LINT_TARGETS = comment B h l O1 r w ignore invalid unsupp +LINT_TARGETS = comment B h l O1 r V1 w ignore invalid unsupp # mandoc defects: # - \h with a negative argument replaces output characters @@ -13,4 +13,9 @@ LINT_TARGETS = comment B h l O1 r w ignore invalid unsupp SKIP_GROFF = hneg r +# intentional difference: +# - mandoc does not inspect the environment + +SKIP_GROFF += V1 + .include diff --git a/regress/roff/esc/V1.in b/regress/roff/esc/V1.in new file mode 100644 index 00000000..3f1d76f7 --- /dev/null +++ b/regress/roff/esc/V1.in @@ -0,0 +1,10 @@ +.\" $OpenBSD: V1.in,v 1.1 2022/05/30 22:50:40 schwarze Exp $ +.TH ESC-V1 1 "May 31, 2022" +.SH NAME +esc-V1 \- interpolate environment variables +.SH DESCRIPTION +single-character name: "\VN" +.br +double-character name: "\V(VN" +.br +multi-character name: "\V[VARNAME]" diff --git a/regress/roff/esc/V1.out_ascii b/regress/roff/esc/V1.out_ascii new file mode 100644 index 00000000..2f22e58e --- /dev/null +++ b/regress/roff/esc/V1.out_ascii @@ -0,0 +1,11 @@ +ESC-V1(1) General Commands Manual ESC-V1(1) + +NNAAMMEE + esc-V1 - interpolate environment variables + +DDEESSCCRRIIPPTTIIOONN + single-character name: "${N}" + double-character name: "${VN}" + multi-character name: "${VARNAME}" + +OpenBSD May 31, 2022 ESC-V1(1) diff --git a/regress/roff/esc/V1.out_lint b/regress/roff/esc/V1.out_lint new file mode 100644 index 00000000..f580e4d2 --- /dev/null +++ b/regress/roff/esc/V1.out_lint @@ -0,0 +1,3 @@ +mandoc: V1.in:6:25: UNSUPP: unsupported feature: \VN +mandoc: V1.in:8:25: UNSUPP: unsupported feature: \V(VN +mandoc: V1.in:10:24: UNSUPP: unsupported feature: \V[VARNAME] -- cgit v1.2.3-56-ge451