summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libroff.h1
-rw-r--r--roff.c16
-rw-r--r--tbl.c8
3 files changed, 25 insertions, 0 deletions
diff --git a/libroff.h b/libroff.h
index 1ab4cd49..05889954 100644
--- a/libroff.h
+++ b/libroff.h
@@ -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 bf1dbf0c..a481619e 100644
--- a/roff.c
+++ b/roff.c
@@ -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 537c7182..db468617 100644
--- a/tbl.c
+++ b/tbl.c
@@ -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;
+}
+