summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-08-20 09:07:24 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-08-20 09:07:24 +0000
commit3585b83d67b5ef20e17f299831c92d657f1e0767 (patch)
tree603f55c85d89be78e8e8000398757a2b4544135f
parentf24d1eb949107ccd1cf44312815cdf8e34915d21 (diff)
downloadmandoc-3585b83d67b5ef20e17f299831c92d657f1e0767.tar.gz
mandoc-3585b83d67b5ef20e17f299831c92d657f1e0767.tar.zst
mandoc-3585b83d67b5ef20e17f299831c92d657f1e0767.zip
Documented ARGS_ handling in args().
-rw-r--r--libmdoc.h8
-rw-r--r--mdoc_argv.c17
2 files changed, 20 insertions, 5 deletions
diff --git a/libmdoc.h b/libmdoc.h
index eca0f54d..bd4ccad8 100644
--- a/libmdoc.h
+++ b/libmdoc.h
@@ -1,4 +1,4 @@
-/* $Id: libmdoc.h,v 1.25 2009/08/20 08:59:12 kristaps Exp $ */
+/* $Id: libmdoc.h,v 1.26 2009/08/20 09:07:24 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -172,9 +172,9 @@ int mdoc_args(struct mdoc *, int,
int *, char *, int, char **);
int mdoc_zargs(struct mdoc *, int,
int *, char *, int, char **);
-#define ARGS_DELIM (1 << 1)
-#define ARGS_TABSEP (1 << 2)
-#define ARGS_NOWARN (1 << 3)
+#define ARGS_DELIM (1 << 1) /* See args(). */
+#define ARGS_TABSEP (1 << 2) /* See args(). */
+#define ARGS_NOWARN (1 << 3) /* See args(). */
#define ARGS_ERROR (-1)
#define ARGS_EOLN (0)
#define ARGS_WORD (1)
diff --git a/mdoc_argv.c b/mdoc_argv.c
index 1efed9c4..6e2c48b3 100644
--- a/mdoc_argv.c
+++ b/mdoc_argv.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_argv.c,v 1.23 2009/08/20 08:59:12 kristaps Exp $ */
+/* $Id: mdoc_argv.c,v 1.24 2009/08/20 09:07:24 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -375,6 +375,21 @@ args(struct mdoc *m, int line, int *pos,
int i;
char *p, *pp;
+ /*
+ * Parse out the terms (like `val' in `.Xx -arg val' or simply
+ * `.Xx val'), which can have all sorts of properties:
+ *
+ * ARGS_DELIM: use special handling if encountering trailing
+ * delimiters in the form of [[::delim::][ ]+]+.
+ *
+ * ARGS_NOWARN: don't post warnings. This is only used when
+ * re-parsing delimiters, as the warnings have already been
+ * posted.
+ *
+ * ARGS_TABSEP: use special handling for tab/`Ta' separated
+ * phrases like in `Bl -column'.
+ */
+
assert(*pos);
assert(' ' != buf[*pos]);