diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-07-22 14:59:02 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-07-22 14:59:02 +0000 |
commit | bf7102688102ef67c2fde9e395308692aa679c51 (patch) | |
tree | ead3a3ce6b26846c12147b2a46fa295231ef38c1 | |
parent | a45ffeccc960ff652ba7f2aeebec3a920827306b (diff) | |
download | mandoc-bf7102688102ef67c2fde9e395308692aa679c51.tar.gz |
Check for and throw away `gfont' eqn macros.
-rw-r--r-- | eqn.7 | 12 | ||||
-rw-r--r-- | eqn.c | 17 |
2 files changed, 26 insertions, 3 deletions
@@ -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 @@ -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; |