diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-09-21 14:07:07 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-09-21 14:07:07 +0000 |
commit | 29580f6bb757a73803c2045973d9662097988ab1 (patch) | |
tree | beb6fead5feb32bafd4c031ca30d160cc1ce0468 /mdoc_term.c | |
parent | 84d661915150fb271e81f789e1ba20d8809e4be9 (diff) | |
download | mandoc-29580f6bb757a73803c2045973d9662097988ab1.tar.gz |
Consolidation of Pp/sp/br/Lp stuff.
Diffstat (limited to 'mdoc_term.c')
-rw-r--r-- | mdoc_term.c | 42 |
1 files changed, 13 insertions, 29 deletions
diff --git a/mdoc_term.c b/mdoc_term.c index 4441a1cb..5fc88bde 100644 --- a/mdoc_term.c +++ b/mdoc_term.c @@ -113,7 +113,6 @@ static int termp_bd_pre(DECL_ARGS); static int termp_bf_pre(DECL_ARGS); static int termp_bold_pre(DECL_ARGS); static int termp_bq_pre(DECL_ARGS); -static int termp_br_pre(DECL_ARGS); static int termp_brq_pre(DECL_ARGS); static int termp_bt_pre(DECL_ARGS); static int termp_cd_pre(DECL_ARGS); @@ -133,7 +132,6 @@ static int termp_nm_pre(DECL_ARGS); static int termp_ns_pre(DECL_ARGS); static int termp_op_pre(DECL_ARGS); static int termp_pf_pre(DECL_ARGS); -static int termp_pp_pre(DECL_ARGS); static int termp_pq_pre(DECL_ARGS); static int termp_qq_pre(DECL_ARGS); static int termp_rs_pre(DECL_ARGS); @@ -155,7 +153,7 @@ static const struct termact termacts[MDOC_MAX] = { { NULL, NULL }, /* Os */ { termp_sh_pre, termp_sh_post }, /* Sh */ { termp_ss_pre, termp_ss_post }, /* Ss */ - { termp_pp_pre, NULL }, /* Pp */ + { termp_sp_pre, NULL }, /* Pp */ { termp_d1_pre, termp_d1_post }, /* D1 */ { termp_d1_pre, termp_d1_post }, /* Dl */ { termp_bd_pre, termp_bd_post }, /* Bd */ @@ -256,7 +254,7 @@ static const struct termact termacts[MDOC_MAX] = { { NULL, NULL }, /* Fr */ { termp_ud_pre, NULL }, /* Ud */ { NULL, termp_lb_post }, /* Lb */ - { termp_pp_pre, NULL }, /* Lp */ + { termp_sp_pre, NULL }, /* Lp */ { termp_lk_pre, NULL }, /* Lk */ { termp_under_pre, NULL }, /* Mt */ { termp_brq_pre, termp_brq_post }, /* Brq */ @@ -267,7 +265,7 @@ static const struct termact termacts[MDOC_MAX] = { { NULL, NULL }, /* En */ { termp_xx_pre, NULL }, /* Dx */ { NULL, NULL }, /* %Q */ - { termp_br_pre, NULL }, /* br */ + { termp_sp_pre, NULL }, /* br */ { termp_sp_pre, NULL }, /* sp */ }; @@ -1163,16 +1161,6 @@ termp_ns_pre(DECL_ARGS) /* ARGSUSED */ static int -termp_pp_pre(DECL_ARGS) -{ - - term_vspace(p); - return(1); -} - - -/* ARGSUSED */ -static int termp_rs_pre(DECL_ARGS) { @@ -1878,12 +1866,18 @@ termp_sp_pre(DECL_ARGS) { int i, len; - if (NULL == node->child) { - term_vspace(p); - return(0); + switch (node->type) { + case (MDOC_sp): + len = node->child ? atoi(node->child->string) : 1; + break; + case (MDOC_br): + len = 0; + break; + default: + len = 1; + break; } - len = atoi(node->child->string); if (0 == len) term_newln(p); for (i = 0; i < len; i++) @@ -1895,16 +1889,6 @@ termp_sp_pre(DECL_ARGS) /* ARGSUSED */ static int -termp_br_pre(DECL_ARGS) -{ - - term_newln(p); - return(1); -} - - -/* ARGSUSED */ -static int termp_brq_pre(DECL_ARGS) { |