From 63754be3d9019deac1f78cdebeff57c4a0d9c617 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sat, 15 May 2010 08:54:04 +0000 Subject: 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@ --- mdoc_strings.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'mdoc_strings.c') 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 * @@ -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); } -- cgit v1.2.3-56-ge451