summaryrefslogtreecommitdiffstatshomepage
path: root/term.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-03-08 19:38:08 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-03-08 19:38:08 +0000
commite2892275c699cbcc5427072ac3a59c6c690a8f6b (patch)
tree0a8ec7c5d23635c37abbd51263cabbccb9b547a6 /term.c
parent82ebd2e467651cc6ec63d8a1bc9b6e5cedb01410 (diff)
downloadmandoc-e2892275c699cbcc5427072ac3a59c6c690a8f6b.tar.gz
mandoc-e2892275c699cbcc5427072ac3a59c6c690a8f6b.tar.zst
mandoc-e2892275c699cbcc5427072ac3a59c6c690a8f6b.zip
Front-end handling of `Lb'.
Diffstat (limited to 'term.c')
-rw-r--r--term.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/term.c b/term.c
index 0aeaecfb..fa8e58cc 100644
--- a/term.c
+++ b/term.c
@@ -1,4 +1,4 @@
-/* $Id: term.c,v 1.46 2009/03/08 14:01:46 kristaps Exp $ */
+/* $Id: term.c,v 1.47 2009/03/08 19:38:08 kristaps Exp $ */
/*
* Copyright (c) 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -120,6 +120,7 @@ DECL_PREPOST(termp_fo);
DECL_PREPOST(termp_ft);
DECL_PREPOST(termp_in);
DECL_PREPOST(termp_it);
+DECL_PREPOST(termp_lb);
DECL_PREPOST(termp_op);
DECL_PREPOST(termp_pf);
DECL_PREPOST(termp_pq);
@@ -164,7 +165,6 @@ DECL_PRE(termp_xr);
DECL_POST(termp___);
DECL_POST(termp_bl);
DECL_POST(termp_bx);
-DECL_POST(termp_lb);
const struct termact __termacts[MDOC_MAX] = {
{ NULL, NULL }, /* \" */
@@ -273,7 +273,7 @@ const struct termact __termacts[MDOC_MAX] = {
{ NULL, NULL }, /* Hf */
{ NULL, NULL }, /* Fr */
{ termp_ud_pre, NULL }, /* Ud */
- { NULL, termp_lb_post }, /* lb */
+ { termp_lb_pre, termp_lb_post }, /* Lb */
};
const struct termact *termacts = __termacts;
@@ -970,6 +970,27 @@ termp_bt_pre(DECL_ARGS)
/* ARGSUSED */
+static int
+termp_lb_pre(DECL_ARGS)
+{
+ const char *lb;
+
+ if (NULL == node->child)
+ errx(1, "expected text line argument");
+ if (MDOC_TEXT != node->child->type)
+ errx(1, "expected text line argument");
+
+ if ((lb = mdoc_a2lib(node->child->string))) {
+ word(p, lb);
+ return(0);
+ }
+
+ word(p, "library");
+ return(1);
+}
+
+
+/* ARGSUSED */
static void
termp_lb_post(DECL_ARGS)
{