summaryrefslogtreecommitdiff
path: root/usr.bin/m4/m4.1
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2005-09-06 15:33:22 +0000
committerMarc Espie <espie@cvs.openbsd.org>2005-09-06 15:33:22 +0000
commitd81b4678132dfbd4a881b6621e80cc598edfa62c (patch)
treeb59bc096daed41023067e54aba0b0ed9a191399e /usr.bin/m4/m4.1
parent71442aed77bb01f56d28f6cbc9fdeb82acfe9212 (diff)
finally make our m4 SusV3-compliant.
- changecom and changequote have a simple definition (that matches gnu-m4, coincidentally, so we no longer need two distinct modes for these) - off-by-one bug in -s, this finally works. - reorder main parser loop, so that we can use alphabetic constructs in quotes/comments. - rename putback to pushback, this matches comments, and makes more sense. - more uniform (and updated) description of changequote/changecom. - new, systematic regression tests of comments/quotes. - framework to test -s: one perl script to reconstitute `full' files with all line numbers, so that we can verify the output without needing a complete match. okay otto@, fries@
Diffstat (limited to 'usr.bin/m4/m4.1')
-rw-r--r--usr.bin/m4/m4.142
1 files changed, 23 insertions, 19 deletions
diff --git a/usr.bin/m4/m4.1 b/usr.bin/m4/m4.1
index c5ade9f0a7a..1a7383b5051 100644
--- a/usr.bin/m4/m4.1
+++ b/usr.bin/m4/m4.1
@@ -1,4 +1,4 @@
-.\" @(#) $OpenBSD: m4.1,v 1.38 2005/03/02 10:12:15 espie Exp $
+.\" @(#) $OpenBSD: m4.1,v 1.39 2005/09/06 15:33:21 espie Exp $
.\"
.\" Copyright (c) 1989, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -155,17 +155,29 @@ Calls a built-in by its
.Fa name ,
overriding possible redefinitions.
.It Fn changecom startcomment endcomment
-Change the start and end comment sequences.
-The default is the pound sign
-.Pq Sq #
+Changes the start comment and end comment sequences.
+Comment sequences may be up to five characters long.
+The default values are the pound sign
and the newline character.
-With no arguments comments are turned off.
-The maximum length for a comment marker is five characters.
+.Bd -literal -offset indent
+# This is a comment
+.Ed
+.Pp
+With no arguments, comments are turned off.
+With one single argument, the end comment sequence is set
+to the newline character.
.It Fn changequote beginquote endquote
-Defines the quote symbols to be the first and second arguments.
-The symbols may be up to five characters long.
-If no arguments are
-given it restores the default open and close single quotes.
+Defines the open quote and close quote sequences.
+Quote sequences may be up to five characters long.
+The default values are the backquote character and the quote
+character.
+.Bd -literal -offset indent
+`Here is a quoted string'
+.Ed
+.Pp
+With no arguments, the default quotes are restored.
+With one single argument, the close quote sequence is set
+to the newline character.
.It Fn decr arg
Decrements the argument
.Fa arg
@@ -386,18 +398,10 @@ Returns the current file's name.
.El
.Sh STANDARDS
.Nm
-follows the Single Unix 2 specification, along with a few extensions taken
+follows the Single Unix 3 specification, along with a few extensions taken
from
.Nm gnu-m4 .
.Pp
-The
-.Fl s
-option
-.Po
-.Xr cpp 1 's
-#line directives
-.Pc
-is currently not supported.
Flags
.Fl I ,
.Fl d ,