diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-03-22 05:59:32 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-03-22 05:59:32 +0000 |
commit | 32cbe85d8ce6eee87446621fa65138ae97b24bb8 (patch) | |
tree | ef7a96e354ccaf6e84ec022230ad8840df8ef74d /man_macro.c | |
parent | 1f06d7b1d7dc62d0276312c7c411ee4ed3b842f8 (diff) | |
download | mandoc-32cbe85d8ce6eee87446621fa65138ae97b24bb8.tar.gz |
Accomodate (libman) for next-line macros followed by non-text macros `na', `sp', and `br'.
Based on a patch by Ingo Schwarze.
Diffstat (limited to 'man_macro.c')
-rw-r--r-- | man_macro.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/man_macro.c b/man_macro.c index 6f2e8348..dfd521e3 100644 --- a/man_macro.c +++ b/man_macro.c @@ -40,7 +40,7 @@ static int rew_block(int, enum man_type, const struct man_node *); const struct man_macro __man_macros[MAN_MAX] = { - { in_line_eoln, 0 }, /* br */ + { in_line_eoln, MAN_NSCOPED }, /* br */ { in_line_eoln, 0 }, /* TH */ { blk_imp, MAN_SCOPED }, /* SH */ { blk_imp, MAN_SCOPED }, /* SS */ @@ -61,9 +61,9 @@ const struct man_macro __man_macros[MAN_MAX] = { { in_line_eoln, MAN_SCOPED }, /* I */ { in_line_eoln, 0 }, /* IR */ { in_line_eoln, 0 }, /* RI */ - { in_line_eoln, 0 }, /* na */ + { in_line_eoln, MAN_NSCOPED }, /* na */ { in_line_eoln, 0 }, /* i */ - { in_line_eoln, 0 }, /* sp */ + { in_line_eoln, MAN_NSCOPED }, /* sp */ { in_line_eoln, 0 }, /* nf */ { in_line_eoln, 0 }, /* fi */ { in_line_eoln, 0 }, /* r */ @@ -320,14 +320,29 @@ in_line_eoln(MACRO_PROT_ARGS) return(0); } + /* + * If no arguments are specified and this is MAN_SCOPED (i.e., + * next-line scoped), then set our mode to indicate that we're + * waiting for terms to load into our context. + */ + if (n == m->last && MAN_SCOPED & man_macros[tok].flags) { + assert( ! (MAN_NSCOPED & man_macros[tok].flags)); m->flags |= MAN_ELINE; return(1); } + /* Set ignorable context, if applicable. */ + + if (MAN_NSCOPED & man_macros[tok].flags) { + assert( ! (MAN_SCOPED & man_macros[tok].flags)); + m->flags |= MAN_ILINE; + } + /* - * Note that when TH is pruned, we'll be back at the root, so - * make sure that we don't clobber as its sibling. + * Rewind our element scope. Note that when TH is pruned, we'll + * be back at the root, so make sure that we don't clobber as + * its sibling. */ for ( ; m->last; m->last = m->last->parent) { |