diff options
-rw-r--r-- | main.c | 7 | ||||
-rw-r--r-- | roff.3 | 5 | ||||
-rw-r--r-- | roff.c | 13 | ||||
-rw-r--r-- | roff.h | 4 |
4 files changed, 15 insertions, 14 deletions
@@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.129 2011/01/01 15:45:18 kristaps Exp $ */ +/* $Id: main.c,v 1.130 2011/01/01 16:18:39 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org> @@ -527,10 +527,7 @@ fdesc(struct curparse *curp) } assert(curp->roff); - if ( ! roff_endparse(curp->roff)) { - assert(MANDOCLEVEL_FATAL <= file_status); - goto cleanup; - } + roff_endparse(curp->roff); /* * With -Wstop and warnings or errors of at least @@ -1,4 +1,4 @@ -.\" $Id: roff.3,v 1.9 2011/01/01 15:45:18 kristaps Exp $ +.\" $Id: roff.3,v 1.10 2011/01/01 16:18:39 kristaps Exp $ .\" .\" Copyright (c) 2010 Kristaps Dzonsons <kristaps@bsd.lv> .\" @@ -35,7 +35,7 @@ .Fa "void *data" .Fa "mandocmsg msgs" .Fc -.Ft int +.Ft void .Fn roff_endparse "struct roff *roff" .Ft void .Fn roff_free "struct roff *roff" @@ -141,7 +141,6 @@ This line should not contain the trailing newline. Returns 0 on failure, 1 on success. .It Fn roff_endparse Signals that the parse is complete. -Returns 0 on failure, 1 on success. .It Fn roff_span If .Fn roff_parseln @@ -1,4 +1,4 @@ -/* $Id: roff.c,v 1.116 2011/01/01 16:10:40 kristaps Exp $ */ +/* $Id: roff.c,v 1.117 2011/01/01 16:18:39 kristaps Exp $ */ /* * Copyright (c) 2010 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org> @@ -515,15 +515,20 @@ roff_parseln(struct roff *r, int ln, char **bufp, } -int +void roff_endparse(struct roff *r) { - /* FIXME: if r->tbl */ if (r->last) (*r->msg)(MANDOCERR_SCOPEEXIT, r->data, r->last->line, r->last->col, NULL); - return(1); + + if (r->tbl) { + (*r->msg)(MANDOCERR_SCOPEEXIT, r->data, + r->tbl->line, r->tbl->pos, NULL); + tbl_end(r->tbl); + r->tbl = NULL; + } } @@ -1,4 +1,4 @@ -/* $Id: roff.h,v 1.21 2010/12/31 18:19:43 kristaps Exp $ */ +/* $Id: roff.h,v 1.22 2011/01/01 16:18:39 kristaps Exp $ */ /* * Copyright (c) 2010 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -37,7 +37,7 @@ struct roff *roff_alloc(struct regset *, void *, mandocmsg); void roff_reset(struct roff *); enum rofferr roff_parseln(struct roff *, int, char **, size_t *, int, int *); -int roff_endparse(struct roff *); +void roff_endparse(struct roff *); const struct tbl_span *roff_span(const struct roff *); __END_DECLS |