diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2013-10-21 23:47:58 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2013-10-21 23:47:58 +0000 |
commit | 3e6695c0fbfd2d85665ea3a1409a0df04f1aa36b (patch) | |
tree | ab2d463edb16968e8f031edd4ef2ffe22eeb5977 /libmdoc.h | |
parent | 0b43cd7204a9abd0864183ff8386148be4056a7e (diff) | |
download | mandoc-3e6695c0fbfd2d85665ea3a1409a0df04f1aa36b.tar.gz |
There are three kinds of input lines: text lines, macros taking
positional arguments (like Dt Fn Xr) and macros taking text as
arguments (like Nd Sh Em %T An). In the past, even the latter put
each word of their arguments into its own MDOC_TEXT node; instead,
concatenate arguments unless delimiters, keeps or spacing mode
prevent that. Regarding mandoc(1), this is internal refactoring,
no output change intended.
Regarding mandocdb(8), this fixes yet another regression introduced
when switching from DB to SQLite: The ability to search for strings
crossing word boundaries was lost and is hereby restored. At the
same time, database sizes and build times are both reduced by a bit
more than 5% each.
Diffstat (limited to 'libmdoc.h')
-rw-r--r-- | libmdoc.h | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -1,6 +1,7 @@ /* $Id$ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> + * Copyright (c) 2013 Ingo Schwarze <schwarze@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -34,6 +35,8 @@ struct mdoc { #define MDOC_PPHRASE (1 << 5) /* within a partial phrase */ #define MDOC_FREECOL (1 << 6) /* `It' invocation should close */ #define MDOC_SYNOPSIS (1 << 7) /* SYNOPSIS-style formatting */ +#define MDOC_KEEP (1 << 8) /* in a word keep */ +#define MDOC_SMOFF (1 << 9) /* spacing is off */ enum mdoc_next next; /* where to put the next node */ struct mdoc_node *last; /* the last node parsed */ struct mdoc_node *first; /* the first node parsed */ @@ -57,8 +60,8 @@ struct mdoc_macro { #define MDOC_PARSED (1 << 1) #define MDOC_EXPLICIT (1 << 2) #define MDOC_PROLOGUE (1 << 3) -#define MDOC_IGNDELIM (1 << 4) - /* Reserved words in arguments treated as text. */ +#define MDOC_IGNDELIM (1 << 4) +#define MDOC_JOIN (1 << 5) }; enum margserr { @@ -107,6 +110,7 @@ __BEGIN_DECLS int mdoc_macro(MACRO_PROT_ARGS); int mdoc_word_alloc(struct mdoc *, int, int, const char *); +void mdoc_word_append(struct mdoc *, const char *); int mdoc_elem_alloc(struct mdoc *, int, int, enum mdoct, struct mdoc_arg *); int mdoc_block_alloc(struct mdoc *, int, int, |