| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
completely with the BSD.lv code due to performance issues and flat-out
errors.
Performance issues: functions called per character. Ugly.
Flat-out errors: disallowing "reserved" tokens as arguments to those
options accepting arguments.
Also added are two mandoc.h error codes for general tbl syntax errors
and for bad options.
|
|
|
|
|
|
|
| |
although technically-speaking a lost macro is an error (e.g.,
MANDOCERR_MACRO), casting out some extra whitespace (note, IGNPAR only
happens in conditions where whitespace already exists!) is hardly an
error matter.
|
|
|
|
|
|
|
| |
Always grow at least to the minimum requested size.
Before this, a buffer of 1 byte was grown to 2 bytes,
which was too small and sometimes caused segfaults.
ok kristaps@
|
|
|
|
|
|
|
| |
Remove `Pp' or `Lp' if it is the FIRST or LAST child of an `Sh' or `Sh' body.
Make "skipping paragraph" be an error, not a warning, as information (an
invoked macro) is ignored.
|
|
|
|
|
|
| |
For now, use the simplest conceivable approach, like groff does:
Just a fixed, ugly input stack limit.
"check it in" kristaps@
|
|
|
|
| |
except for the tbl one which will be the focus of later study.
|
|
|
|
|
| |
schwarze@, but without the -T[x]html handling, which structurally does
not work. Also add man.7 documentation (not in original patch).
|
|
|
|
| |
ending of scopes and drop stray scope-endings.
|
|
|
|
| |
NOARGV warnings. From patch by schwarze@.
|
| |
|
|
|
|
|
|
|
| |
making sure output doesn't add a superfluous newline with the nested displays.
Also add a COMPATIBILITY note.
Rename a macro (DATESIZ) to be in line with OpenBSD (DATESIZE).
|
|
|
|
|
|
|
|
| |
we can for example skip rendering on FATAL parsing errors,
and globally (exit_status), such that we know what to return.
Without this, following files produced no rendered output
once a single file suffered from a FATAL error.
Bug reported by kristaps@, fix by me.
|
| |
|
|
|
|
| |
schwarze@ and joerg@ for his comments!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
being inherited during the parse sequence, making pset() meaningless.
Make sure that the mdoc/man curp pointer is set for each parse from a
persistent object.
This flushes out an obscure error where `man' pages called with `mdoc'
will parse and segfault due to a missing title. Never happened earlier
because `mdoc' pages were guaranteed to have a prologue. Fix this
later.
Also document the new main.c functions. Please make sure these sort of
things are documented! Throw in some whitespace to make things a bit
more readable.
|
|
|
|
|
|
|
|
| |
carefully by joerg@. Merge roff.h header for compilation's sake (this is not
yet implemented in roff.c.).
THIS IS A BUGGY CHECK-IN. The manual type is erroneously kept between runs
of the compiler. This is a known bug.
|
|
|
|
| |
Made `rm' be an error (again, OpenBSD...).
|
|
|
|
|
|
|
|
|
| |
Remove MANDOCERR_BADLIB (not used).
Moved `St' handling from mdoc_action.c into mdoc_validate.c.
Moved relevant MDOC_LITERAL macros (`Dl', `Bd' subtypes) from
mdoc_action.c into mdoc_validate.c.
|
|
|
|
| |
Making IGNARGV be an ERROR, not a WARNING, as information is lost.
|
|
|
|
| |
specified).
|
|
|
|
|
|
|
|
|
|
| |
report an ERROR: We can still render the page by just closing
the open scope, but it is likely that information will be missing
or document structure mangled.
Before, man(7) only reported a WARNING (which is dangerous because
we cannot be sure rendering is correct) and mdoc(7) ran into FATAL
(which is too drastic, there is no reason not to show what we have).
"looks good" kristaps@
|
| |
|
|
|
|
|
| |
skip output functions, but not *_endparse;
problem reported by kristaps@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We now have sufficient practical experience to know what we want,
so this is intended to be final:
- provide -Wlevel (warning, error or fatal) to select what you care about
- provide -Wstop to stop after parsing a file with warnings you care about
- provide consistent exit status codes for those warnings you care about
- fully document what warnings, errors and fatal errors mean
- remove all other cruft from the user interface, less is more:
- remove all -f knobs along with the whole -f option
- remove the old -Werror because calling warnings "fatal" is silly
- always finish parsing each file, unless fatal errors prevent that
This commit also includes a couple of related simplifications behind
the scenes regarding error handling.
Feedback and OK kristaps@; Joerg Sonnenberger (NetBSD) and
Sascha Wildner (DragonFly BSD) agree with the general direction.
|
|
|
|
|
|
| |
For example, on OpenBSD without locale settings,
isgraph(3) returns true for some eight-bit characters.
ok kristaps@
|
| |
|
|
|
|
|
|
|
|
|
|
| |
It's currently missing the xref table, so you'll get a warning in most
PDF viewers). It also produces lots of redundant output, which will go
away once I get a better handle on the PDF spec. The code doesn't
really touch any existing functionality; it's a bunch of conditionals
atop the -Tps (term_ps.c) implementation. I'm checking it in now to
have it exist and be auditable. It needs clean-up, polish, and general
care (and xref!).
|
|
|
|
|
|
|
|
|
| |
specifically say that this is not allowed, and were it allowed, output
would be inconsistent across output media (-Tps will puke,
non-your-charset terminals will puke, etc.).
With this done, simplify check_text() to only check escapes and for
tabs. Add in a new tab warning, too.
|
|
|
|
|
|
|
|
|
| |
roff_getstr() family of functions into roff.c with the "first_string"
directly in struct roff. Second, pre-process each line for reserved
words in libroff, splicing and re-running a line if it has one (this
allows defined symbols to be macros). Remove term.c's invocation of the
roff_getstrn() function. Removed function documentation in roff.3 and
added roff.7 `ds' documentation.
|
|
|
|
|
| |
on those parts of the code and text that i have written as Kristaps is.
"fine with me" kristaps@
|
| |
|
|
|
|
|
|
|
| |
kristaps@ will do the missing HTML part soon.
"looks nicer" jmc@
"seems perfect to me" sobrado@
"slap it in" kristaps@
|
|
|
|
|
|
|
|
|
| |
* avoid error exit code after mere warnings
* add ERROR: and FATAL: to messages when appropriate
* sort the code in mmsg() to make it easier on the eye
* make the mandocerrs[] list easier to maintain
* update a few comments in mandoc.h
ok kristaps@
|
|
|
|
|
|
| |
functional changes beyond the getsubopt() parse in term_ps.c. If you
want to test this (it only does -Opaper=a4 and -Opaper=letter; adding
more is trivial), make sure you specify (e.g.) -sPAPERSIZE=a4 to gs(1).
|
|
|
|
|
|
|
|
|
| |
functionality and UGLY works quite well thanks to schwarze@'s careful
attention.
This also backs out function-prototype changes for struct regset,
instead stuffing a pointer to the regset directly into struct
mdoc/man/roff.
|
|
|
|
| |
const struct regset pointer. No functionality.
|
|
|
|
|
|
| |
patch by schwarze@. This commit adds support to libroff parsing `nr'
into register set defined in regs.h. This will propogate into libmdoc
and libman in later commits.
|
| |
|
|
|
|
|
|
|
| |
sure where this came about. Added regression tests to convince myself
that this is so. Also consolidated COMPATIBILITY notes regarding `Bd'.
Added COMPATIBILITY note to the effect that old groff pukes on `Bd
-compact -ragged' (regression test will fail on old groff).
|
|
|
|
|
|
|
|
|
|
|
| |
only calculated once in mdoc_validate.c.
Noted that `Bd -file xxx' is not supported: it now raises a fatal
warning. This is noted in mdoc.7.
Empty `Bd' now defaults to LIST_ragged, which is not quite what groff
does, but close enough (gross just throws away the `Bd' and gets upset
when it encounters an `Ed').
|
|
|
|
|
| |
terminal_free() in favour of ps_free() and ascii_free(). Moved ps_*()
functions into term_ps.c so that they don't clutter up term.c.
|
|
|
|
|
|
| |
within term.c, but does add a small shim over putchar() that switches on
the output engine. Prints, for this initial version, only monospace and
without font decorations. It's a start.
|
|
|
|
| |
thousand years ago. Note that this is normalised to >=60.
|
|
|
|
| |
otherwise.
|
|
|
|
|
|
|
|
|
|
| |
relieves having to repeat running over the argument list in
mdoc_action.c and mdoc_validate.c.
Default to LIST_item for type-less lists (groff technically doesn't do
this: it just ignores the `It' lines altogether).
Make MANDOC_LISTTYPE be a recoverable error.
|
| |
|
|
|
|
|
|
|
|
| |
list).
Reverted MANDOC_COLUMNS to be a bad-bad syntax error: we don't, and
apparently never have, allowed mixing of -column syntaxes. This would
have segfaulted if encountered.
|
|
|
|
|
|
|
|
|
|
|
| |
stringified in main.c.
Allow `An' to handle an argument and child (with a warning).
Allow `Rv' and `Ex' to work without a prior `Nm' as groff does (with a
warning).
Allow inconsistent column syntax to only raise a warning.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
.ig ig
asdf
.ig
fdsa
..
or
.ig if
asdf
.if n \
foo
for a laugh. It all works. Lots of regression tests supporting this
and documentation for the same.
|