summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-07-22 14:59:02 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-07-22 14:59:02 +0000
commitbf7102688102ef67c2fde9e395308692aa679c51 (patch)
treeead3a3ce6b26846c12147b2a46fa295231ef38c1
parenta45ffeccc960ff652ba7f2aeebec3a920827306b (diff)
downloadmandoc-bf7102688102ef67c2fde9e395308692aa679c51.tar.gz
Check for and throw away `gfont' eqn macros.
-rw-r--r--eqn.712
-rw-r--r--eqn.c17
2 files changed, 26 insertions, 3 deletions
diff --git a/eqn.7 b/eqn.7
index a4fc3be8..71045263 100644
--- a/eqn.7
+++ b/eqn.7
@@ -66,6 +66,7 @@ eqn : box | eqn box
box : text
| "{" eqn "}"
| "define" text text
+ | "gfont" text
| "gsize" text
| "set" text text
| "undef" text
@@ -142,18 +143,25 @@ foo bar 'baz'
.Ed
.Pp
Self-referencing definitions will raise an error.
+.It Cm gfont
+Set the default font of subsequent output.
+Its syntax is as follows:
+.Pp
+.D1 gfont Ar font
+.Pp
+In mandoc, this value is discarded.
.It Cm gsize
Set the default size of subsequent output.
Its syntax is as follows:
.Pp
-.D1 define Ar size
+.D1 gsize Ar size
.Pp
The
.Ar size
value should be an integer.
.It Cm set
Set an equation mode.
-Both arguments are thrown away.
+In mandoc, both arguments are thrown away.
Its syntax is as follows:
.Pp
.D1 set Ar key val
diff --git a/eqn.c b/eqn.c
index 81628e35..1fb8d81f 100644
--- a/eqn.c
+++ b/eqn.c
@@ -126,6 +126,7 @@ enum eqnpartt {
EQN_DEFINE = 0,
EQN_SET,
EQN_UNDEF,
+ EQN_GFONT,
EQN_GSIZE,
EQN__MAX
};
@@ -136,6 +137,7 @@ static struct eqn_box *eqn_box_alloc(struct eqn_node *,
static void eqn_box_free(struct eqn_box *);
static struct eqn_def *eqn_def_find(struct eqn_node *,
const char *, size_t);
+static int eqn_do_gfont(struct eqn_node *);
static int eqn_do_gsize(struct eqn_node *);
static int eqn_do_define(struct eqn_node *);
static int eqn_do_set(struct eqn_node *);
@@ -152,7 +154,8 @@ static const struct eqnpart eqnparts[EQN__MAX] = {
{ { "define", 6 }, eqn_do_define }, /* EQN_DEFINE */
{ { "set", 3 }, eqn_do_set }, /* EQN_SET */
{ { "undef", 5 }, eqn_do_undef }, /* EQN_UNDEF */
- { { "gsize", 5 }, eqn_do_gsize }, /* EQN_UNDEF */
+ { { "gfont", 5 }, eqn_do_gfont }, /* EQN_GFONT */
+ { { "gsize", 5 }, eqn_do_gsize }, /* EQN_GSIZE */
};
static const struct eqnstr eqnmarks[EQNMARK__MAX] = {
@@ -765,6 +768,18 @@ eqn_do_define(struct eqn_node *ep)
}
static int
+eqn_do_gfont(struct eqn_node *ep)
+{
+ const char *start;
+
+ if (NULL == (start = eqn_nextrawtok(ep, NULL))) {
+ EQN_MSG(MANDOCERR_EQNEOF, ep);
+ return(0);
+ }
+ return(1);
+}
+
+static int
eqn_do_gsize(struct eqn_node *ep)
{
const char *start;