diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-05-31 10:28:04 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-05-31 10:28:04 +0000 |
commit | 72b03dec1c3cb23cc1f97c902936f91bd60b582a (patch) | |
tree | cfb7e1d636b7bc8ecfcefab4084381e7a15eaa38 /mdoc_argv.c | |
parent | 5153e9ff95f0f8f3a7d46b4efd5d75801c84bab2 (diff) | |
download | mandoc-72b03dec1c3cb23cc1f97c902936f91bd60b582a.tar.gz mandoc-72b03dec1c3cb23cc1f97c902936f91bd60b582a.tar.zst mandoc-72b03dec1c3cb23cc1f97c902936f91bd60b582a.zip |
Remove enum mdocargerr from phrase() (unused).
Add `Ta' macro, which is basically a NULL case everywhere but in
mdoc_macro.c, where it closes out an existing `It' body scope and opens
a new one, then continues parsing as in phrase() (TODO: merge these
two?).
Fix where scope-breaking was silently just dying instead of printing an
error.
Fix where trailing `Ta' or tab weren't creating a new MDOC_BODY context.
We now support arbitrarily complex `It' contents for `Bl -column'.
Diffstat (limited to 'mdoc_argv.c')
-rw-r--r-- | mdoc_argv.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/mdoc_argv.c b/mdoc_argv.c index ceba9873..ccc6ed10 100644 --- a/mdoc_argv.c +++ b/mdoc_argv.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_argv.c,v 1.50 2010/05/30 23:59:59 kristaps Exp $ */ +/* $Id: mdoc_argv.c,v 1.51 2010/05/31 10:28:04 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se> * @@ -210,6 +210,7 @@ static int mdoc_argflags[MDOC_MAX] = { 0, /* br */ 0, /* sp */ 0, /* %U */ + 0, /* Ta */ }; @@ -347,6 +348,13 @@ mdoc_args(struct mdoc *m, int line, int *pos, if (MDOC_It != tok) return(args(m, line, pos, buf, fl, v)); + /* + * We know that we're in an `It', so it's reasonable to expect + * us to be sitting in a `Bl'. Someday this may not be the case + * (if we allow random `It's sitting out there), so provide a + * safe fall-back into the default behaviour. + */ + for (n = m->last; n; n = n->parent) if (MDOC_Bl == n->tok) break; @@ -455,7 +463,7 @@ args(struct mdoc *m, int line, int *pos, break; if (pp > *v && ' ' != *(pp - 1)) continue; - if (' ' == *(pp + 2) || 0 == *(pp + 2)) + if (' ' == *(pp + 2) || '\0' == *(pp + 2)) break; } |