summaryrefslogtreecommitdiffstatshomepage
path: root/action.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-01-20 13:44:05 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-01-20 13:44:05 +0000
commitf0efcfb7750a1c0ab3108c5a759de5c050166035 (patch)
tree42c4f3dfff406eb906a633e4b8588959e74dd9ae /action.c
parentd7fbb7d096f24634fd2aa0c5146e6fbf55acb09e (diff)
downloadmandoc-f0efcfb7750a1c0ab3108c5a759de5c050166035.tar.gz
mandoc-f0efcfb7750a1c0ab3108c5a759de5c050166035.tar.zst
mandoc-f0efcfb7750a1c0ab3108c5a759de5c050166035.zip
Re-merged old port-building routines.
Diffstat (limited to 'action.c')
-rw-r--r--action.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/action.c b/action.c
index f04e650d..3d4e9ba5 100644
--- a/action.c
+++ b/action.c
@@ -1,4 +1,4 @@
-/* $Id: action.c,v 1.13 2009/01/20 12:51:28 kristaps Exp $ */
+/* $Id: action.c,v 1.14 2009/01/20 13:44:05 kristaps Exp $ */
/*
* Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -22,6 +22,11 @@
#include "private.h"
+/*
+ * Actions are executed on macros after they've been post-validated: in
+ * other words, a macro will not be "acted upon" until all of its
+ * children have been filled in (post-fix order).
+ */
struct actions {
int (*post)(struct mdoc *);
@@ -149,6 +154,11 @@ const struct actions mdoc_actions[MDOC_MAX] = {
};
+/*
+ * The `Nm' macro sets the document's name when used the first time with
+ * an argument. Subsequent calls without a value will result in the
+ * name value being used.
+ */
static int
post_nm(struct mdoc *mdoc)
{
@@ -169,6 +179,10 @@ post_nm(struct mdoc *mdoc)
}
+/*
+ * We keep track of the current section in order to provide warnings on
+ * section ordering, per-section macros, and so on.
+ */
static int
post_sh(struct mdoc *mdoc)
{
@@ -188,6 +202,9 @@ post_sh(struct mdoc *mdoc)
}
+/*
+ * Prologue title must be parsed into document meta-data.
+ */
static int
post_dt(struct mdoc *mdoc)
{
@@ -233,6 +250,9 @@ post_dt(struct mdoc *mdoc)
}
+/*
+ * Prologue operating system must be parsed into document meta-data.
+ */
static int
post_os(struct mdoc *mdoc)
{
@@ -253,6 +273,9 @@ post_os(struct mdoc *mdoc)
}
+/*
+ * Prologue date must be parsed into document meta-data.
+ */
static int
post_dd(struct mdoc *mdoc)
{
@@ -299,6 +322,10 @@ post_dd(struct mdoc *mdoc)
}
+/*
+ * The end document shouldn't have the prologue macros as part of the
+ * syntax tree (they encompass only meta-data).
+ */
static int
post_prologue(struct mdoc *mdoc)
{