summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc/mdoc_hash.c
AgeCommit message (Collapse)Author
2016-07-15add missing prototypes, no code change;Ingo Schwarze
noticed by Christos Zoulas with -Wmissing-prototypes
2015-10-06modernize style: "return" is not a function; ok cmp(1)Ingo Schwarze
2015-04-19Decouple the token code for "no request or macro" from the individualIngo Schwarze
high-level parsers to allow further unification of functions that only need to recognize this code, but that don't care about different high-level macrosets beyond that.
2015-04-18Move mdoc_hash_init() and man_hash_init() to libmandoc.hIngo Schwarze
and call them from mparse_alloc() and choose_parser(), preparing unified allocation of struct roff_man.
2015-04-02Second step towards parser unification:Ingo Schwarze
Replace struct mdoc_node and struct man_node by a unified struct roff_node. To be able to use the tok member for both mdoc(7) and man(7) without defining all the macros in roff.h, sacrifice a tiny bit of type safety and make tok an int rather than an enum. Almost mechanical, no functional change. Written on the Eurostar from Bruxelles to London on the way to p2k15.
2015-04-02First step towards parser unification:Ingo Schwarze
Replace enum mdoc_type and enum man_type by a unified enum roff_type. Almost mechanical, no functional change. Written on the ICE train from Frankfurt to Bruxelles on the way to p2k15.
2014-11-28Add some missing OpenBSD RCS markersIngo Schwarze
and a few missing <sys/types.h> inclusions; no code change.
2014-04-20KNF: case (FOO): -> case FOO, remove /* LINTED */ and /* ARGSUSED */,Ingo Schwarze
remove trailing whitespace and blanks before tabs, improve some indenting; no functional change
2014-03-21The files mandoc.c and mandoc.h contained both specialised low-levelIngo Schwarze
functions used for multiple languages (mdoc, man, roff), for example mandoc_escape(), mandoc_getarg(), mandoc_eos(), and generic auxiliary functions. Split the auxiliaries out into their own file and header. While here, do some #include cleanup.
2011-09-18sync to version 1.11.7 from kristaps@Ingo Schwarze
main new feature: support the roff(7) .tr request plus various bugfixes and some refactoring regressions are so minor that it's better to get this in and fix them in the tree
2011-04-24Merge version 1.11.1:Ingo Schwarze
Again lots of cleanup and maintenance work by kristaps@. - simplify error reporting: less function pointers, more mandoc_[v]msg - main: split document parsing out of main.c into read.c - roff, mdoc, man: improved recognition of control characters - roff: better handling of if/else stack overflows - roff: add some predefined strings for backward compatibility - mdoc, man: empty sections are not errors - mdoc: move delimiter handling to libmdoc - some header restructuring and some minor features and fixes This merge causes two minor regressions that i will fix in separate commits right afterwards.
2010-07-31Correct Copyright lines in the rarely touched files:Ingo Schwarze
* add missing years (only where substantial changes were committed) * update Kristaps' email address in the remaining places No code changes.
2010-05-23Unified error and warning message system for all of mandoc,Ingo Schwarze
featuring three message levels, as agreed during the mandoc hackathon: * FATAL parser failure, cannot produce any output from this input file: eventually, we hope to convert most of these to ERRORs. * ERROR, meaning mandoc cannot cope fully with the input syntax and will probably lose information or produce structurally garbled output; it will try to produce output anyway but exit non-zero at the end, which is eventually intended to make the ports infrastructure happy. * WARNING, meaning you should clean up the input file, but output is probably mostly OK, so this will not cause error-exit at the end. This commit is mostly just converting the old system to the new one; before the classification will become really reliable, we must check all messages. In particular, * set up a new central message string table in main.c * drop the old message string tables from man.c and mdoc.c * get rid of the piece-meal merr enums in libman and libmdoc * reduce number of error/warning functions from 16 to 6 (still a lot...) While here, handle a few problems more gracefully: * allow .Rv and .Ex to work without a prior .Nm * allow .An to ignore extra arguments * allow undeclared columns in .Bl -column Written by kristaps@.
2010-05-14merge 1.9.24, keeping local patches; some changes:Ingo Schwarze
* preserve multiple consecutive space characters in input * do not restrict .Cd and .Rv to certain sections (requested by Joerg) * do not run lookup() on quoted words * enum return types for mdoc_args and mdoc_argv * fix auto-closing of LINK tag in -Txhtml (from Daniel Friesel) * various lint and manual fixes
2010-04-02merge 1.9.22, keeping local patchesIngo Schwarze
* convert mdoc tokens from #define to enum * fix a segfault with .Xo/.Xc in explicit blocks * Thorn is \*(Th, not \*(TH; noticed by Joerg Sonnenberger
2010-03-02Proper inter-sentence spacing for mdoc(7).Ingo Schwarze
When a text line or a non-block macro line in the source code ends in any of ".!?", consider that an end of sentence (EOS). This makes Jason's rule "new sentence, new line" even more important. Let the parser detect the EOS and insert a token into the AST. Let the -Tascii frontend render the EOS token as a double space before the next word.
2009-09-21sync to 1.9.5: lookup hashes are now static tablesIngo Schwarze
shortening the code, and, according to kristaps@, speeding it up
2009-08-09sync to 1.8.3: u_char needs <sys/types.h>;Ingo Schwarze
found in FreeBSD by uqs at sporlein dot net
2009-07-26sync to 1.8.1: modify macro hash tables to deal with lowercase macro names;Ingo Schwarze
kristaps@ thinks the tables are too sparse and need more work later
2009-06-18sync to 1.7.19: improved comment handlingIngo Schwarze
2009-06-14sync to 1.7.16: comments, whitespace and spelling fixes; no functional changeIngo Schwarze
2009-04-06Initial check-in of mandoc for formatting manuals. ok deraadt@kristaps