summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-06-16 19:45:51 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-06-16 19:45:51 +0000
commita7f2dc1d0e14e61727a4abdb0250b39e016e0705 (patch)
treecdb31d5b93768b5cf7b00e8d9cc1e64704f87814
parent632038c8c98f1c408bb368edf910b849f186dc8a (diff)
downloadmandoc-a7f2dc1d0e14e61727a4abdb0250b39e016e0705.tar.gz
mandoc-a7f2dc1d0e14e61727a4abdb0250b39e016e0705.tar.zst
mandoc-a7f2dc1d0e14e61727a4abdb0250b39e016e0705.zip
Removed MDOC___: moved MDOC_Ap to its index (comments not passed into mdoc parser).
-rw-r--r--mdoc.c12
-rw-r--r--mdoc.h29
-rw-r--r--mdoc_action.c5
-rw-r--r--mdoc_argv.c5
-rw-r--r--mdoc_macro.c5
-rw-r--r--mdoc_term.c12
-rw-r--r--mdoc_validate.c5
7 files changed, 35 insertions, 38 deletions
diff --git a/mdoc.c b/mdoc.c
index 3808f144..4774dd3e 100644
--- a/mdoc.c
+++ b/mdoc.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc.c,v 1.81 2009/06/16 19:13:28 kristaps Exp $ */
+/* $Id: mdoc.c,v 1.82 2009/06/16 19:45:51 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -34,7 +34,7 @@ enum merr {
};
const char *const __mdoc_macronames[MDOC_MAX] = {
- "\\\"", "Dd", "Dt", "Os",
+ "Ap", "Dd", "Dt", "Os",
"Sh", "Ss", "Pp", "D1",
"Dl", "Bd", "Ed", "Bl",
"El", "It", "Ad", "An",
@@ -63,12 +63,12 @@ const char *const __mdoc_macronames[MDOC_MAX] = {
"Tn", "Ux", "Xc", "Xo",
"Fo", "Fc", "Oo", "Oc",
"Bk", "Ek", "Bt", "Hf",
- "Fr", "Ud", "Lb", "Ap",
- "Lp", "Lk", "Mt", "Brq",
+ "Fr", "Ud", "Lb", "Lp",
+ "Lk", "Mt", "Brq", "Bro",
/* LINTED */
- "Bro", "Brc", "\%C", "Es",
+ "Brc", "\%C", "Es", "En",
/* LINTED */
- "En", "Dx", "\%Q"
+ "Dx", "\%Q"
};
const char *const __mdoc_argnames[MDOC_ARG_MAX] = {
diff --git a/mdoc.h b/mdoc.h
index c47d7c70..be1c6594 100644
--- a/mdoc.h
+++ b/mdoc.h
@@ -1,4 +1,4 @@
-/* $Id: mdoc.h,v 1.58 2009/06/15 10:36:01 kristaps Exp $ */
+/* $Id: mdoc.h,v 1.59 2009/06/16 19:45:51 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -29,7 +29,7 @@
/* What follows is a list of ALL possible macros. */
-#define MDOC___ 0
+#define MDOC_Ap 0
#define MDOC_Dd 1
#define MDOC_Dt 2
#define MDOC_Os 3
@@ -136,19 +136,18 @@
#define MDOC_Fr 104
#define MDOC_Ud 105
#define MDOC_Lb 106
-#define MDOC_Ap 107
-#define MDOC_Lp 108
-#define MDOC_Lk 109
-#define MDOC_Mt 110
-#define MDOC_Brq 111
-#define MDOC_Bro 112
-#define MDOC_Brc 113
-#define MDOC__C 114
-#define MDOC_Es 115
-#define MDOC_En 116
-#define MDOC_Dx 117
-#define MDOC__Q 118
-#define MDOC_MAX 119
+#define MDOC_Lp 107
+#define MDOC_Lk 108
+#define MDOC_Mt 109
+#define MDOC_Brq 110
+#define MDOC_Bro 111
+#define MDOC_Brc 112
+#define MDOC__C 113
+#define MDOC_Es 114
+#define MDOC_En 115
+#define MDOC_Dx 116
+#define MDOC__Q 117
+#define MDOC_MAX 118
/* What follows is a list of ALL possible macro arguments. */
diff --git a/mdoc_action.c b/mdoc_action.c
index bfc93da7..d6b6ea14 100644
--- a/mdoc_action.c
+++ b/mdoc_action.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_action.c,v 1.11 2009/06/12 12:52:51 kristaps Exp $ */
+/* $Id: mdoc_action.c,v 1.12 2009/06/16 19:45:51 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -71,7 +71,7 @@ static int pre_dl(PRE_ARGS);
#define nerr(m, n, t) perr((m), (n)->line, (n)->pos, (t))
const struct actions mdoc_actions[MDOC_MAX] = {
- { NULL, NULL }, /* \" */
+ { NULL, NULL }, /* Ap */
{ NULL, post_dd }, /* Dd */
{ NULL, post_dt }, /* Dt */
{ NULL, post_os }, /* Os */
@@ -178,7 +178,6 @@ const struct actions mdoc_actions[MDOC_MAX] = {
{ NULL, NULL }, /* Fr */
{ NULL, NULL }, /* Ud */
{ NULL, NULL }, /* Lb */
- { NULL, NULL }, /* Ap */
{ NULL, NULL }, /* Lp */
{ NULL, post_lk }, /* Lk */
{ NULL, NULL }, /* Mt */
diff --git a/mdoc_argv.c b/mdoc_argv.c
index 1cde4441..0587d9cc 100644
--- a/mdoc_argv.c
+++ b/mdoc_argv.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_argv.c,v 1.4 2009/06/10 20:18:43 kristaps Exp $ */
+/* $Id: mdoc_argv.c,v 1.5 2009/06/16 19:45:51 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -105,7 +105,7 @@ static int mdoc_argvflags[MDOC_ARG_MAX] = {
};
static int mdoc_argflags[MDOC_MAX] = {
- 0, /* \" */
+ 0, /* Ap */
0, /* Dd */
0, /* Dt */
0, /* Os */
@@ -212,7 +212,6 @@ static int mdoc_argflags[MDOC_MAX] = {
0, /* Fr */
0, /* Ud */
0, /* Lb */
- 0, /* Ap */
ARGS_DELIM, /* Lp */
ARGS_DELIM | ARGS_QUOTED, /* Lk */
ARGS_DELIM | ARGS_QUOTED, /* Mt */
diff --git a/mdoc_macro.c b/mdoc_macro.c
index e54aedc0..eb2bf3fc 100644
--- a/mdoc_macro.c
+++ b/mdoc_macro.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_macro.c,v 1.12 2009/06/12 09:18:00 kristaps Exp $ */
+/* $Id: mdoc_macro.c,v 1.13 2009/06/16 19:45:51 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -74,7 +74,7 @@ static int swarn(struct mdoc *, enum mdoc_type, int, int,
/* Central table of library: who gets parsed how. */
const struct mdoc_macro __mdoc_macros[MDOC_MAX] = {
- { NULL, 0 }, /* \" */
+ { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* Ap */
{ in_line_eoln, MDOC_PROLOGUE }, /* Dd */
{ in_line_eoln, MDOC_PROLOGUE }, /* Dt */
{ in_line_eoln, MDOC_PROLOGUE }, /* Os */
@@ -181,7 +181,6 @@ const struct mdoc_macro __mdoc_macros[MDOC_MAX] = {
{ obsolete, 0 }, /* Fr */
{ in_line_eoln, 0 }, /* Ud */
{ in_line_eoln, 0 }, /* Lb */
- { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* Ap */
{ in_line, 0 }, /* Lp */
{ in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Lk */
{ in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Mt */
diff --git a/mdoc_term.c b/mdoc_term.c
index 7cf400f9..5f12c5d6 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_term.c,v 1.13 2009/06/15 20:26:47 kristaps Exp $ */
+/* $Id: mdoc_term.c,v 1.14 2009/06/16 19:45:51 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -183,7 +183,7 @@ struct termact {
};
static const struct termact termacts[MDOC_MAX] = {
- { NULL, NULL }, /* \" */
+ { termp_ap_pre, NULL }, /* Ap */
{ NULL, NULL }, /* Dd */
{ NULL, NULL }, /* Dt */
{ NULL, NULL }, /* Os */
@@ -290,8 +290,7 @@ static const struct termact termacts[MDOC_MAX] = {
{ NULL, NULL }, /* Fr */
{ termp_ud_pre, NULL }, /* Ud */
{ termp_lb_pre, termp_lb_post }, /* Lb */
- { termp_ap_pre, NULL }, /* Lb */
- { termp_pp_pre, NULL }, /* Pp */
+ { termp_pp_pre, NULL }, /* Lp */
{ termp_lk_pre, NULL }, /* Lk */
{ termp_mt_pre, NULL }, /* Mt */
{ termp_brq_pre, termp_brq_post }, /* Brq */
@@ -336,7 +335,10 @@ mdoc_run(struct termp *p, const struct mdoc *m)
*/
print_head(p, mdoc_meta(m));
- print_body(p, NULL, mdoc_meta(m), mdoc_node(m));
+ assert(mdoc_node(m));
+ assert(MDOC_ROOT == mdoc_node(m)->type);
+ if (mdoc_node(m)->child)
+ print_body(p, NULL, mdoc_meta(m), mdoc_node(m)->child);
print_foot(p, mdoc_meta(m));
return(1);
}
diff --git a/mdoc_validate.c b/mdoc_validate.c
index 900f07fc..1be571a8 100644
--- a/mdoc_validate.c
+++ b/mdoc_validate.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_validate.c,v 1.9 2009/06/12 09:18:00 kristaps Exp $ */
+/* $Id: mdoc_validate.c,v 1.10 2009/06/16 19:45:51 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -191,7 +191,7 @@ static v_post posts_bf[] = { hwarn_le1, post_bf, NULL };
static v_post posts_fo[] = { hwarn_eq1, bwarn_ge1, NULL };
const struct valids mdoc_valids[MDOC_MAX] = {
- { NULL, NULL }, /* \" */
+ { NULL, NULL }, /* Ap */
{ pres_dd, posts_text }, /* Dd */
{ pres_dt, NULL }, /* Dt */
{ pres_os, NULL }, /* Os */
@@ -298,7 +298,6 @@ const struct valids mdoc_valids[MDOC_MAX] = {
{ NULL, NULL }, /* Fr */
{ NULL, posts_notext }, /* Ud */
{ pres_lb, posts_lb }, /* Lb */
- { NULL, NULL }, /* Ap */
{ NULL, posts_pp }, /* Lp */
{ NULL, NULL }, /* Lk */
{ NULL, posts_text }, /* Mt */