summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/mdoc_action.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge mdoc_action.c into mdoc_validate.c, because having two places to doschwarze2010-12-011-1063/+0
| | | | | | basically the same things just causes code duplication and confusion. Work by kristaps@, including a few bugfixes he found during the merge, and reapplying OpenBSD changes on top.
* Downgrade nearly 20 ERRORS to WARNINGS.schwarze2010-10-261-8/+2
| | | | | | | | All these indicate problems in the mdoc(7) or man(7) source code, but they can't cause relevant information loss or clobbered formatting. While here, error message improve wording and make it more uniform, don't throw MANDOCERR_NOWIDTHARG twice when there is one single issue, and consolidate MANDOCERR_WIDTHARG into MANDOCERR_IGNARGV.
* Do not throw FATAL errors when there is no need to:schwarze2010-10-241-6/+8
| | | | | | | | - when encountering nested displays (.Bd containing .Bd, .D1, .D1) - when a block end macro was forgotten - when ending a block that was never started - when the uname(3) system call failed along with a little related cleanup
* Support tbl(1) code embedded into mdoc(7) input files.schwarze2010-10-161-4/+23
| | | | | | Very similar to what i have done in man(7) yesterday. Allows to build cpu(4) on HPPA, wi(4), and phantasia(6). Now we are able to build all tbl code in base.
* Merge bsd.lv version 1.10.5: last larger batch of bug fixes before release.schwarze2010-07-311-1/+13
| | | | | | | | | | | | | NOT including Kristaps' .Bd -literal changes which cause regressions. Features: * -Tpdf now fully working Bugfixes: * proper handling of quoted strings by .ds in roff(7) * allow empty .Dd * make .Sm start no-spacing after the first output word * underline .Ad * minor fixes in -Thtml and some optimisations in terminal output.
* Merge release 1.10.4 (all code by kristaps@), providing four new features:schwarze2010-07-131-26/+21
| | | | | | | | | | 1) Proper .Bk support: allow output line breaks at input line breaks, but keep input lines together in the output, finally fixing synopses like aucat(1), mail(1) and tmux(1). 2) Mostly finished -Tps (PostScript) output. 3) Implement -Thtml output for .Nm blocks and .Bk -words. 4) Allow iterative interpolation of user-defined roff(7) strings. Also contains some minor bugfixes and some performance improvements.
* In the mdoc(7) parser, inspect roff registers early such that all partsschwarze2010-07-011-1/+12
| | | | | | | | | | | | of the parser can use the resulting cues. In particular, this allows to use .nr nS to force SYNOPSIS-style .Nm indentation outside the SYNOPSIS as needed by ifconfig(8). To actually make this useable, .Pp must rewind .Nm, or the rest of the section would end up indented. Implement a quick hack for now, a generic solution can be designed later. ok kristaps@ sobrado@
* merge release 1.10.2schwarze2010-06-261-111/+74
| | | | | | | | | | | | * bug fixes: - interaction of ASCII_HYPH with special chars (found by Ulrich Spoerlein) - handling of roff conditionals (found by Ulrich Spoerlein) - .Bd -offset will no more default to 6n * maintenance: - more caching of .Bd and .Bl arguments for efficiency - deconstify man(7) validation routines - add FreeBSD library names (provided by Ulrich Spoerlein) * start PostScript font-switching
* Merge bsd.lv version 1.10.1 (to be released soon).schwarze2010-06-061-63/+11
| | | | | | | | | | | | | | | | | | | | The main step forward is that this now has *much* better .Bl -column support, now supporting many manuals that previously errored out without producing any output. Other fixes include: * do not die from multiple list types, use the first and warn * in .Bl without a type, default to -item * various tweaks to .Dt * fix .In, .Fd, .Ft, .Fn and .Fo formatting * some documentation fixes and additions * and fix a couple of bugs reported by Ulrich Spoerlein: * better support for roff block-end "\}" without a preceding dot * .In must not break the line outside SYNOPSIS * spelling in some error messages While merging, fix one regression in .In spacing that needs to go to bsd.lv, too.
* Merge bsd.lv release 1.10.0,schwarze2010-06-061-2/+24
| | | | | | | | | | | | | | | | which is mostly the post-hackathon release, bringing in the OpenBSD changes to bsd.lv, but which also has a few additional minor fixes: * .Lb is an in-line macro, not in_line_eoln * .Bt, .Ud now warn when discarding arguments * allow bad -man dates to flow verbatim into the front-ends - so far all reported by Ulrich Spoerlein * .Ar, .Fl and .Li starting with closing punctuation emit an empty element * empty .Li macros print nothing, but may cause spacing * proper EOS handling for .Bt, .Ex, .Rv, and .Ud. * cleanup: collapse posts_xr into posts_wtext (which is the same) * efficiency: very simple table lookup for roff.c
* The inputschwarze2010-05-241-3/+6
| | | | | | | | | | .Bl -tag .Sm off .It ... triggered an assertion, which it shouldn't; the warning that .Bl -tag "requires the width argument" is enough. From Joerg Sonnenberger.
* Increase performance by saving the list type in struct mdoc_node.schwarze2010-05-241-4/+59
| | | | | | | | | | | This will eventually be used so that mdoc_macro can know whether to dump list line arguments into the body (`Bl -column' overflowing). Remove a2list() and arg_listtype() because of this. From kristaps@. While merging, fix a regression in mdoc_term.c, print_bvspace(): The bsd.lv version of this broke vertical spacing in .Bl -column.
* Unified error and warning message system for all of mandoc,schwarze2010-05-231-22/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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@.
* allow non-numeric manual sections in -mdoc;schwarze2010-05-151-20/+18
| | | | | while here, allow LIBRARY in section 9; by kristaps@
* various improvements regarding errors and warnings Joerg Sonnenberger:schwarze2010-05-151-9/+22
| | | | | | | | | | | | * If the last -column .Bl isn't specified, it is auto-sized. * An invalid .St argument should be a warning, not an error. Just put the argument into the output. * An invalid .At argument should be a warning, not an error. Just print the argument, like new groff does. * Remove warnings concerning manual section (like 1, 6, 8). It was only used for .Ex and not really useful. * Remove warnings concerning page section (like SYNOPSIS). These were only used for .Fd and .Lb and not really useful.
* Integrate kristaps@' end-of-sentence (EOS) frameworkschwarze2010-05-141-2/+1
| | | | | | | | | | | | | which is simpler and more powerful than mine, and remove mine. * man(7) now has EOS handling, too * put EOS detection into its own function in libmandoc * use node and termp flags to communicate the EOS condition * no more EOS pseudo-macro * no more non-printable EOS marker character on the formatter level This slightly breaks EOS detection after trailing punctuation in mdoc(7) macros, but that will be restored soon.
* Merge 1.9.25, keeping local patches;schwarze2010-05-141-2/+2
| | | | | | | | | | | | | | this does not merge kristaps' end-of-sentences handling yet, i will check that separately. This one includes: * handle \*(Ba as a delimiter * introduce ARGS_PEND for .Bl -column .It end-of-line special casing * section ordering: expect EXIT STATUS at the right place * line break fixes in SYNOPSIS * allow literal contexts to have arbitrary line lengths * the input file column number can not be used to identify the beginning of a line because white space is allowed after the initial '.' * proper leading spaces in -man -Tascii mode * do not let Lb break lines in -mdoc -Thtml LIBRARY
* merge 1.9.24, keeping local patches; some changes:schwarze2010-05-141-5/+5
| | | | | | | | | * 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
* Merge the good parts of 1.9.23,schwarze2010-04-071-22/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | avoid the bad parts of 1.9.23, and keep local patches. Input in general: * Basic handling of roff-style font escapes \f, \F. * Quoted punctuation does not count as punctuation. mdoc(7) parser: * Make .Pf callable; noted by Claus Assmann. * Let .Bd and .Bl ignore unknown arguments; noted by deraadt@. * Do not warn when .Er is used outside certain sections. * Replace mdoc_node_free[list] by mdoc_node_delete. * Replace #define by enum for rew*() return values. man(7) parser: * When .TH is missing, use default section and date. Output in general: * Curly braces do not count as punctuation. * No space after .Fl w/o args when a macro follows on the same line. HTML output: * Unify PAIR_*_INIT macros, introduce new PAIR_ID_INIT(). * Print whitespace after, not before .Vt .Fn .Ft .Fo. Checked that all manuals in base still build.
* Make sure we never stay in SEC_NONE when passing by .Sh.schwarze2010-04-041-2/+2
| | | | | Fixing the x11/scrotwm build. Problem reported by naddy@, thanks.
* merge 1.9.22, keeping local patchesschwarze2010-04-021-2/+3
| | | | | | * 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
* Proper inter-sentence spacing for mdoc(7).schwarze2010-03-021-1/+2
| | | | | | | | | 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.
* sync to 1.9.13: minor fixes:schwarze2009-12-231-4/+5
| | | | | | | | | | | | | | | | | | correctness/functionality: - bugfix: properly ignore lines with only a dot in -man - bugfix: .Bl -ohang doesn't allow -width, warn about this - improve date string handling by new function mandoc_a2time - some HTML improvements - significant documentation additions in man.7 and mdoc.7 portability: - replace __dead by __attribute__((noreturn)) - bugfix: correct .Dx rendering - some more library names for NetBSD simplicity: - replace hand-rolled putchar(3)-loops by fwrite(3) - replace single-character printf(3) by putchar(3)
* sync to 1.9.12, mostly portability and refactoring:schwarze2009-12-221-154/+174
| | | | | | | | | | | | | | | | | | | correctness/functionality: - bugfix: do not die when overstep hits the right margin - new option: -fign-escape - and various HTML features portability: - replace bzero(3) by memset(3), which is ANSI C - replace err(3)/warn(3) by perror(3)/exit(3), which is ANSI C - iuse argv[0] instead of __progname - add time.h to various files for FreeBSD compilation simplicity: - do not allocate header/footer data dynamically in *_term.c - provide and use malloc frontends that error out on failure for full changelogs, see http://bsd.lv/cgi-bin/cvsweb.cgi/
* sync to 1.9.11: adapt printing of dates to groff conventions,schwarze2009-10-271-5/+22
| | | | | NetBSD portability fixes and some minor bugfixes and feature enhancements; also checked that my hyphenation code still works on top of this
* sync to 1.9.6: multiple improvements to references (.Rs)schwarze2009-10-191-4/+87
| | | | | | | * validate and order .Rs child nodes * underline book title (.%B) and issuer (.%I) * enclose title of article (.%T) in quotes * avoid calling mdoc_verr directly, use a proper error code instead
* sync to 1.9.6: do not die from .Bd -literal -offset w/o arg (and similar)schwarze2009-10-191-12/+49
| | | | | Actually, our ancient groff behaves slightly differently than this fix, but not to die is already an improvement. Needs a closer look later.
* sync to 1.9.5: lookup hashes are now static tablesschwarze2009-09-211-3/+3
| | | | shortening the code, and, according to kristaps@, speeding it up
* sync to 1.9.1: .Rv and .Ex accept multiple argumentsschwarze2009-08-221-188/+173
|
* sync to 1.8.4: LLVM findings from <uqs at spoerlein dot net>schwarze2009-08-221-3/+8
|
* sync to 1.8.4: do not error out in case of out-of-order prologue macrosschwarze2009-08-221-2/+4
|
* sync to 1.8.3: .Pa without arguments is a synonym for .Pa ~schwarze2009-08-091-6/+6
|
* sync to 1.8.1: support .br and .spschwarze2009-07-261-1/+3
|
* sync to 1.8.0: move mdoc_a2att, mdoc_a2st, and mdoc_a2lib to libmdocschwarze2009-07-181-15/+91
|
* sync to 1.7.23: pass warning code to mdoc_pwarn() instead of warning messageschwarze2009-07-121-39/+5
| | | | | | define additional warning macro mdoc_nwarn() remove obsolete warning functions mdoc_warn(), pwarn(), vwarn(), nwarn() remove various now unused "enum mdoc_warn" and "enum mwarn"
* sync to 1.7.23: pass error code to mdoc_perr() instead of error stringschwarze2009-07-121-29/+1
| | | | | and use the so improved mdoc_nerr() at many places; get rid of now unused static functions perr()
* sync to 1.7.23: pass error code to mdoc_nerr() instead of error stringschwarze2009-07-121-26/+26
| | | | and use the so improved mdoc_nerr() at many places
* sync to 1.7.23: unify the various "enum merr" into libman.h and libmdoc.h,schwarze2009-07-121-8/+1
| | | | | use it as a new argument to mdoc_err(), the same way as for for man_err(), and use string tables instead of switch statements to select error messages
* sync to 1.7.21: convert the last plain mdoc_err() in this file to verr();schwarze2009-07-061-2/+6
| | | | this is still not really good, but can stay like this for now
* sync to 1.7.20: (1) -width Ds is 6 spaces, not 8, see the manual.schwarze2009-06-271-3/+3
| | | | | | | | (2) When determining the offset, add two more spaces to the width. For -width Ds, these two bugs cancelled each other, but for -width [01-9]+n, they did not, leaving the offset to narrow. (3) When determining the width using strlen, we need to add two spaces instead of one, just like in the case (2).
* sync to 1.7.20: like for the -man case, add an nchild counter to the -mdocschwarze2009-06-231-6/+6
| | | | nodes, simplifying the validation code; no functional change
* sync to 1.7.19: simplify code; no functional changeschwarze2009-06-211-4/+3
|
* sync to 1.7.19: .Bl -column now correctly handles tail entries,schwarze2009-06-211-1/+52
| | | | for example: .Bl -column -compact -offset ... args ...
* sync to 1.7.19: more elegant section handlingschwarze2009-06-191-2/+2
|
* sync to 1.7.19: improved comment handlingschwarze2009-06-181-3/+2
|
* sync to 1.7.16: make a couple of macros callable, reserve "|",schwarze2009-06-181-3/+26
| | | | and some tweaks to .Lk
* sync to 1.7.16: comments, whitespace and spelling fixes; no functional changeschwarze2009-06-141-13/+13
|
* Initial check-in of mandoc for formatting manuals. ok deraadt@kristaps2009-04-061-0/+783