aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--libroff.h3
-rw-r--r--roff.c18
-rw-r--r--tbl.c10
3 files changed, 28 insertions, 3 deletions
diff --git a/libroff.h b/libroff.h
index e4d6a4ba..fbd69160 100644
--- a/libroff.h
+++ b/libroff.h
@@ -1,4 +1,4 @@
-/* $Id: libroff.h,v 1.5 2010/12/29 14:38:14 kristaps Exp $ */
+/* $Id: libroff.h,v 1.6 2010/12/29 14:53:31 kristaps Exp $ */
/*
* Copyright (c) 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -84,6 +84,7 @@ struct tbl {
(*(tblp)->msg)((type), (tblp)->data, (line), (col), NULL)
struct tbl *tbl_alloc(void *, mandocmsg);
+void tbl_restart(struct tbl *);
void tbl_free(struct tbl *);
void tbl_reset(struct tbl *);
enum rofferr tbl_read(struct tbl *, int, const char *, int);
diff --git a/roff.c b/roff.c
index 1e62be4e..d62ebcc3 100644
--- a/roff.c
+++ b/roff.c
@@ -1,4 +1,4 @@
-/* $Id: roff.c,v 1.111 2010/12/29 01:16:57 kristaps Exp $ */
+/* $Id: roff.c,v 1.112 2010/12/29 14:53:31 kristaps Exp $ */
/*
* Copyright (c) 2010 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
@@ -59,6 +59,7 @@ enum rofft {
ROFF_tr,
ROFF_TS,
ROFF_TE,
+ ROFF_T_,
ROFF_cblock,
ROFF_ccond, /* FIXME: remove this. */
ROFF_USERDEF,
@@ -143,6 +144,7 @@ static void roff_setstr(struct roff *,
static enum rofferr roff_so(ROFF_ARGS);
static enum rofferr roff_TE(ROFF_ARGS);
static enum rofferr roff_TS(ROFF_ARGS);
+static enum rofferr roff_T_(ROFF_ARGS);
static enum rofferr roff_userdef(ROFF_ARGS);
/* See roff_hash_find() */
@@ -175,6 +177,7 @@ static struct roffmac roffs[ROFF_MAX] = {
{ "tr", roff_line_ignore, NULL, NULL, 0, NULL },
{ "TS", roff_TS, NULL, NULL, 0, NULL },
{ "TE", roff_TE, NULL, NULL, 0, NULL },
+ { "T&", roff_T_, NULL, NULL, 0, NULL },
{ ".", roff_cblock, NULL, NULL, 0, NULL },
{ "\\}", roff_ccond, NULL, NULL, 0, NULL },
{ NULL, roff_userdef, NULL, NULL, 0, NULL },
@@ -1123,6 +1126,19 @@ roff_TE(ROFF_ARGS)
/* ARGSUSED */
static enum rofferr
+roff_T_(ROFF_ARGS)
+{
+
+ if (NULL == r->tbl)
+ (*r->msg)(MANDOCERR_NOSCOPE, r->data, ln, ppos, NULL);
+ else
+ tbl_restart(r->tbl);
+
+ return(ROFF_IGN);
+}
+
+/* ARGSUSED */
+static enum rofferr
roff_TS(ROFF_ARGS)
{
diff --git a/tbl.c b/tbl.c
index 1e7f564b..0d992f16 100644
--- a/tbl.c
+++ b/tbl.c
@@ -1,4 +1,4 @@
-/* $Id: tbl.c,v 1.6 2010/12/29 14:38:14 kristaps Exp $ */
+/* $Id: tbl.c,v 1.7 2010/12/29 14:53:31 kristaps Exp $ */
/*
* Copyright (c) 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -120,3 +120,11 @@ tbl_reset(struct tbl *tbl)
tbl_init(tbl);
}
+void
+tbl_restart(struct tbl *tbl)
+{
+
+ tbl_clear(tbl);
+ tbl->part = TBL_PART_LAYOUT;
+}
+