summaryrefslogtreecommitdiffstats
path: root/term.c
diff options
context:
space:
mode:
Diffstat (limited to 'term.c')
-rw-r--r--term.c42
1 files changed, 5 insertions, 37 deletions
diff --git a/term.c b/term.c
index a106224b..2e24eb3d 100644
--- a/term.c
+++ b/term.c
@@ -463,29 +463,9 @@ term_word(struct termp *p, const char *word)
sv = word;
- if (word[0] && '\0' == word[1])
- switch (word[0]) {
- case('.'):
- /* FALLTHROUGH */
- case(','):
- /* FALLTHROUGH */
- case(';'):
- /* FALLTHROUGH */
- case(':'):
- /* FALLTHROUGH */
- case('?'):
- /* FALLTHROUGH */
- case('!'):
- /* FALLTHROUGH */
- case(')'):
- /* FALLTHROUGH */
- case(']'):
- if ( ! (TERMP_IGNDELIM & p->flags))
- p->flags |= TERMP_NOSPACE;
- break;
- default:
- break;
- }
+ if (DELIM_CLOSE == mandoc_isdelim(word))
+ if ( ! (TERMP_IGNDELIM & p->flags))
+ p->flags |= TERMP_NOSPACE;
if ( ! (TERMP_NOSPACE & p->flags)) {
if ( ! (TERMP_KEEP & p->flags)) {
@@ -548,20 +528,8 @@ term_word(struct termp *p, const char *word)
p->flags |= TERMP_NOSPACE;
}
- /*
- * Note that we don't process the pipe: the parser sees it as
- * punctuation, but we don't in terms of typography.
- */
- if (sv[0] && '\0' == sv[1])
- switch (sv[0]) {
- case('('):
- /* FALLTHROUGH */
- case('['):
- p->flags |= TERMP_NOSPACE;
- break;
- default:
- break;
- }
+ if (DELIM_OPEN == mandoc_isdelim(sv))
+ p->flags |= TERMP_NOSPACE;
}