diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2010-05-15 08:54:04 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2010-05-15 08:54:04 +0000 |
commit | 63754be3d9019deac1f78cdebeff57c4a0d9c617 (patch) | |
tree | fd2309c50b8d3287a4ae6061d5f0505e5b0f9aa2 /mdoc_strings.c | |
parent | cb2511813cb340eccf84d29f8f39c3c5a9a24090 (diff) | |
download | mandoc-63754be3d9019deac1f78cdebeff57c4a0d9c617.tar.gz mandoc-63754be3d9019deac1f78cdebeff57c4a0d9c617.tar.zst mandoc-63754be3d9019deac1f78cdebeff57c4a0d9c617.zip |
Distinguish OPEN, MIDDLE and CLOSE delimiters (using an enum).
Only OPEN are drawn before the beginning of a macro;
this is new, before this, MIDDLE ('|') were drawn in front, too.
Only CLOSE are pushed after the end of a macro (as before).
ok kristaps@
Diffstat (limited to 'mdoc_strings.c')
-rw-r--r-- | mdoc_strings.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/mdoc_strings.c b/mdoc_strings.c index ff8eba1f..2b669e29 100644 --- a/mdoc_strings.c +++ b/mdoc_strings.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_strings.c,v 1.19 2010/05/12 08:41:17 kristaps Exp $ */ +/* $Id: mdoc_strings.c,v 1.20 2010/05/15 08:54:04 schwarze Exp $ */ /* * Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se> * @@ -57,17 +57,17 @@ static const char * const secnames[SEC__MAX] = { * FIXME: this is repeated in print_text() (html.c) and term_word() * (term.c). */ -int +enum mdelim mdoc_iscdelim(char p) { switch (p) { - case('|'): - /* FALLTHROUGH */ case('('): /* FALLTHROUGH */ case('['): - return(1); + return(DELIM_OPEN); + case('|'): + return(DELIM_MIDDLE); case('.'): /* FALLTHROUGH */ case(','): @@ -83,16 +83,16 @@ mdoc_iscdelim(char p) case(')'): /* FALLTHROUGH */ case(']'): - return(2); + return(DELIM_CLOSE); default: break; } - return(0); + return(DELIM_NONE); } -int +enum mdelim mdoc_isdelim(const char *p) { @@ -106,7 +106,7 @@ mdoc_isdelim(const char *p) * is treated in exactly the same way as the vertical bar. This * is the only function that checks for this. */ - return(0 == strcmp(p, "\\*(Ba")); + return(strcmp(p, "\\*(Ba") ? DELIM_NONE : DELIM_MIDDLE); } |