version 1.42, 2011/03/20 16:02:05 |
version 1.44, 2011/03/28 23:52:13 |
Line 507 mandoc_hyph(const char *start, const char *c) |
|
Line 507 mandoc_hyph(const char *start, const char *c) |
|
} |
} |
|
|
/* |
/* |
* Check if a string is a punctuation delimiter. This only applies to |
* Find out whether a line is a macro line or not. If it is, adjust the |
* mdoc(7) documents, but as it's used in both front-ends and back-ends, |
* current position and return one; if it isn't, return zero and don't |
* it needs to go here (instead of, say, in libmdoc.h). |
* change the current position. |
*/ |
*/ |
enum mdelim |
int |
mandoc_isdelim(const char *p) |
mandoc_getcontrol(const char *cp, int *ppos) |
{ |
{ |
|
int pos; |
|
|
if ('\0' == p[0]) |
pos = *ppos; |
return(DELIM_NONE); |
|
|
|
if ('\0' == p[1]) |
if ('\\' == cp[pos] && '.' == cp[pos + 1]) |
switch (p[0]) { |
pos += 2; |
case('('): |
else if ('.' == cp[pos] || '\'' == cp[pos]) |
/* FALLTHROUGH */ |
pos++; |
case('['): |
else |
return(DELIM_OPEN); |
return(0); |
case('|'): |
|
return(DELIM_MIDDLE); |
|
case('.'): |
|
/* FALLTHROUGH */ |
|
case(','): |
|
/* FALLTHROUGH */ |
|
case(';'): |
|
/* FALLTHROUGH */ |
|
case(':'): |
|
/* FALLTHROUGH */ |
|
case('?'): |
|
/* FALLTHROUGH */ |
|
case('!'): |
|
/* FALLTHROUGH */ |
|
case(')'): |
|
/* FALLTHROUGH */ |
|
case(']'): |
|
return(DELIM_CLOSE); |
|
default: |
|
return(DELIM_NONE); |
|
} |
|
|
|
if ('\\' != p[0]) |
while (' ' == cp[pos] || '\t' == cp[pos]) |
return(DELIM_NONE); |
pos++; |
|
|
if (0 == strcmp(p + 1, ".")) |
*ppos = pos; |
return(DELIM_CLOSE); |
return(1); |
if (0 == strcmp(p + 1, "*(Ba")) |
|
return(DELIM_MIDDLE); |
|
|
|
return(DELIM_NONE); |
|
} |
} |