diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2008-12-28 23:07:04 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2008-12-28 23:07:04 +0000 |
commit | 308c02a7b450dc85799bda674cb5adb9f001084f (patch) | |
tree | 6eb3728f6998687cbfb88d5b461bacc12e16db54 | |
parent | 8152d04e0f0a42a8b75100cc7b3b8b46497d046f (diff) | |
download | mandoc-308c02a7b450dc85799bda674cb5adb9f001084f.tar.gz |
*** empty log message ***
-rw-r--r-- | macro.c | 13 | ||||
-rw-r--r-- | mdoc.c | 12 | ||||
-rw-r--r-- | mdoc.h | 1 | ||||
-rw-r--r-- | mdocml.c | 3 |
4 files changed, 22 insertions, 7 deletions
@@ -154,7 +154,9 @@ append_scoped(struct mdoc *mdoc, int tok, int pos, case (MDOC_Bd): assert(mdoc->last); - for (node = mdoc->last->parent; node; node = node->parent) { + node = mdoc->last->parent; + /* LINTED */ + for ( ; node; node = node->parent) { if (node->type != MDOC_BLOCK) continue; if (node->data.block.tok != MDOC_Bd) @@ -791,6 +793,11 @@ again: } +/* + * Partial-line scope is identical to line scope (macro_scoped_line()) + * except that trailing punctuation is appended to the BLOCK, instead of + * contained within the HEAD. + */ int macro_scoped_pline(MACRO_PROT_ARGS) { @@ -803,6 +810,10 @@ macro_scoped_pline(MACRO_PROT_ARGS) /* Token pre-processing. */ switch (tok) { + case (MDOC_Ql): + if ( ! mdoc_warn(mdoc, tok, ppos, WARN_COMPAT_TROFF)) + return(0); + break; default: break; } @@ -137,18 +137,18 @@ const struct mdoc_macro __mdoc_macros[MDOC_MAX] = { { NULL, 0 }, /* %V */ { NULL, 0 }, /* Ac */ { NULL, 0 }, /* Ao */ - { NULL, 0 }, /* Aq */ + { macro_scoped_pline, MDOC_CALLABLE }, /* Aq */ { NULL, 0 }, /* At */ { NULL, 0 }, /* Bc */ { NULL, 0 }, /* Bf */ { NULL, 0 }, /* Bo */ - { NULL, 0 }, /* Bq */ + { macro_scoped_pline, MDOC_CALLABLE }, /* Bq */ { NULL, 0 }, /* Bsx */ { NULL, 0 }, /* Bx */ { NULL, 0 }, /* Db */ { NULL, 0 }, /* Dc */ { NULL, 0 }, /* Do */ - { NULL, 0 }, /* Dq */ + { macro_scoped_pline, MDOC_CALLABLE }, /* Dq */ { NULL, 0 }, /* Ec */ { NULL, 0 }, /* Ef */ { macro_text, MDOC_CALLABLE }, /* Em */ @@ -162,16 +162,16 @@ const struct mdoc_macro __mdoc_macros[MDOC_MAX] = { { NULL, 0 }, /* Pc */ { NULL, 0 }, /* Pf */ { NULL, 0 }, /* Po */ - { NULL, 0 }, /* Pq */ + { macro_scoped_pline, MDOC_CALLABLE }, /* Pq */ { NULL, 0 }, /* Qc */ - { NULL, 0 }, /* Ql */ + { macro_scoped_pline, MDOC_CALLABLE }, /* Ql */ { NULL, 0 }, /* Qo */ { macro_scoped_pline, MDOC_CALLABLE }, /* Qq */ { NULL, 0 }, /* Re */ { NULL, 0 }, /* Rs */ { NULL, 0 }, /* Sc */ { NULL, 0 }, /* So */ - { NULL, 0 }, /* Sq */ + { macro_scoped_pline, MDOC_CALLABLE }, /* Sq */ { NULL, 0 }, /* Sm */ { NULL, 0 }, /* Sx */ { NULL, 0 }, /* Sy */ @@ -224,6 +224,7 @@ enum mdoc_warn { WARN_SEC_OO, WARN_ARGS_GE1, WARN_ARGS_EQ0, + WARN_COMPAT_TROFF }; struct mdoc_arg { @@ -491,6 +491,9 @@ msg_warn(void *arg, int tok, int col, enum mdoc_warn type) case (WARN_IGN_BEFORE_BLK): fmt = "ignore: macro before block macro `%s' ignored"; break; + case (WARN_COMPAT_TROFF): + fmt = "compat: macro `%s' behaves differently in troff and nroff"; + break; default: abort(); /* NOTREACHED */ |