From: kristaps@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: mdocml: Add \v and \h to ignored escapes.
Date: Mon, 16 Aug 2010 05:37:58 -0400 (EDT) [thread overview]
Message-ID: <201008160937.o7G9bwfi029182@krisdoz.my.domain> (raw)
Log Message:
-----------
Add \v and \h to ignored escapes. These are in the category of \s.
Also made sign-less \s-style escapes be ok (this is technically against
what's in the groff.7 manual, but seems pretty widespread). Noted by
Thomas Jeunet as uglifying the gcc.1 manual.
Modified Files:
--------------
mdocml:
mandoc.c
out.c
Revision Data
-------------
Index: mandoc.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mandoc.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -Lmandoc.c -Lmandoc.c -u -p -r1.27 -r1.28
--- mandoc.c
+++ mandoc.c
@@ -57,8 +57,6 @@ mandoc_special(char *p)
/* FALLTHROUGH */
case ('w'):
/* FALLTHROUGH */
- case ('v'):
- /* FALLTHROUGH */
case ('S'):
/* FALLTHROUGH */
case ('R'):
@@ -91,13 +89,19 @@ mandoc_special(char *p)
term = '\'';
break;
#endif
+ case ('h'):
+ /* FALLTHROUGH */
+ case ('v'):
+ /* FALLTHROUGH */
case ('s'):
if (ASCII_HYPH == *p)
*p = '-';
- if ('+' == *p || '-' == *p)
- p++;
- i = ('s' != *(p - 1));
+ i = 0;
+ if ('+' == *p || '-' == *p) {
+ p++;
+ i = 1;
+ }
switch (*p++) {
case ('('):
@@ -110,7 +114,7 @@ mandoc_special(char *p)
term = '\'';
break;
case ('0'):
- i++;
+ i = 1;
/* FALLTHROUGH */
default:
len = 1;
@@ -121,13 +125,11 @@ mandoc_special(char *p)
if (ASCII_HYPH == *p)
*p = '-';
if ('+' == *p || '-' == *p) {
- if (i++)
+ if (i)
return(0);
p++;
}
- if (0 == i)
- return(0);
break;
#if 0
case ('Y'):
Index: out.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/out.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -Lout.c -Lout.c -u -p -r1.23 -r1.24
--- out.c
+++ out.c
@@ -240,11 +240,16 @@ a2roffdeco(enum roffdeco *d, const char
break;
}
break;
+ case ('h'):
+ /* FALLTHROUGH */
+ case ('v'):
+ /* FALLTHROUGH */
case ('s'):
- if ('+' == wp[i] || '-' == wp[i])
+ j = 0;
+ if ('+' == wp[i] || '-' == wp[i]) {
i++;
-
- j = ('s' != wp[i - 1]);
+ j = 1;
+ }
switch (wp[i++]) {
case ('('):
@@ -257,7 +262,7 @@ a2roffdeco(enum roffdeco *d, const char
term = '\'';
break;
case ('0'):
- j++;
+ j = 1;
/* FALLTHROUGH */
default:
i--;
@@ -266,13 +271,11 @@ a2roffdeco(enum roffdeco *d, const char
}
if ('+' == wp[i] || '-' == wp[i]) {
- if (j++)
+ if (j)
return(i);
i++;
}
- if (0 == j)
- return(i);
break;
case ('['):
*d = DECO_SPECIAL;
--
To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv
reply other threads:[~2010-08-16 9:38 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201008160937.o7G9bwfi029182@krisdoz.my.domain \
--to=kristaps@mdocml.bsd.lv \
--cc=source@mdocml.bsd.lv \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).