summaryrefslogtreecommitdiff
path: root/regress/usr.bin/mandoc
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2014-06-29 23:23:17 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2014-06-29 23:23:17 +0000
commit8040bdb2b85c2f70671fba4e905dd414b403b7f0 (patch)
tree182c098c0c29ec17fab043a252fb028534c2ac3f /regress/usr.bin/mandoc
parent0f3d7063d12da800adfdc9e32f38f6e327efdb8a (diff)
Use the freshly improved roff_getname() function
for the main roff request parsing routine, roff_parse(). In request or macro invocations, escape sequences now terminate the request or macro name; what follows is treated as arguments. Besides, the names of user-defined macros can now contain backslashes (eek!).
Diffstat (limited to 'regress/usr.bin/mandoc')
-rw-r--r--regress/usr.bin/mandoc/roff/de/Makefile4
-rw-r--r--regress/usr.bin/mandoc/roff/de/escname.in42
-rw-r--r--regress/usr.bin/mandoc/roff/de/escname.out_ascii23
3 files changed, 67 insertions, 2 deletions
diff --git a/regress/usr.bin/mandoc/roff/de/Makefile b/regress/usr.bin/mandoc/roff/de/Makefile
index 72c0788535f..390c004849c 100644
--- a/regress/usr.bin/mandoc/roff/de/Makefile
+++ b/regress/usr.bin/mandoc/roff/de/Makefile
@@ -1,6 +1,6 @@
-# $OpenBSD: Makefile,v 1.2 2014/03/30 19:43:19 schwarze Exp $
+# $OpenBSD: Makefile,v 1.3 2014/06/29 23:23:16 schwarze Exp $
-REGRESS_TARGETS=TH Dd
+REGRESS_TARGETS = escname TH Dd
.include <bsd.regress.mk>
diff --git a/regress/usr.bin/mandoc/roff/de/escname.in b/regress/usr.bin/mandoc/roff/de/escname.in
new file mode 100644
index 00000000000..db5b0506254
--- /dev/null
+++ b/regress/usr.bin/mandoc/roff/de/escname.in
@@ -0,0 +1,42 @@
+.Dd June 29, 2014
+.Dt DE-ESCNAME 1
+.Os OpenBSD
+.Sh NAME
+.Nm de-escname
+.Nd escape sequences in macro names
+.Sh DESCRIPTION
+initial text
+.Pp
+define second = val2
+.de second
+val2
+..
+.Pp
+define first\esecond = val3
+.de first\\second end3
+val3
+.end3
+.Pp
+define first = val1
+.de first\esecond
+val1
+..
+.Pp
+Values (first, second, first\esecond):
+.first
+.second
+.first\\second
+.Pp
+Remove all but second:
+.rm first\\second first\esecond second
+.first
+.second
+.first\\second
+.Pp
+macro seperated from argument by an escape sequence:
+.de witharg
+.Dq \\$1
+..
+.witharg\(enargument
+.Pp
+final text
diff --git a/regress/usr.bin/mandoc/roff/de/escname.out_ascii b/regress/usr.bin/mandoc/roff/de/escname.out_ascii
new file mode 100644
index 00000000000..d4a08f59253
--- /dev/null
+++ b/regress/usr.bin/mandoc/roff/de/escname.out_ascii
@@ -0,0 +1,23 @@
+DE-ESCNAME(1) OpenBSD Reference 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
+
+ Values (first, second, first\second): val1 val2 val3
+
+ Remove all but second: val2
+
+ macro seperated from argument by an escape sequence: ``argument''
+
+ final text
+
+OpenBSD June 29, 2014 OpenBSD