| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
after the first parse. Do this, but note there are more efficient ways
just waiting for a table of macros.
|
|
|
|
|
|
| |
string instead of passing it along to libmdoc/libman (where it'll be
printed verbatim, now). This is what groff seems to do, too (of course
without a warning).
|
|
|
|
|
|
|
|
|
|
|
| |
within roff.c. These are now grokked from a table in the roff
allocation routine and rest in the newly-created predefs.in (for
consistency with chars.in). This is a first implementation and will
likely be optimised along with the ds/de lookup table itself.
This allows mandoc-defined predefined strings to be correctly removed or
whatnot; earlier they couldn't. What will follow is the stripping-away
of all predefined-string crud in the other parts of the system.
|
|
|
|
|
|
| |
ccond(). Fix the text handler to behave like the macro handler
regarding escaped \}. Make \} actually become a zero-width space, too,
and clean up the documentation in this regard.
|
|
|
|
|
|
|
|
|
|
| |
the `\}' not being directly after the `.br'. Now we check for `\}' in
arbitrary parts of the line, and account for if it's escaped in funny
ways.
This behaviour diverges somewhat from groff in that the text at and
following the `\}' is lost, while groff keeps it (sort-of). I'll add a
COMPATIBILITY note to this effect.
|
|
|
|
| |
(which will come).
|
|
|
|
|
| |
The latter got lost due to a regression in rev. 1.130.
ok kristaps@
|
|
|
|
|
|
|
|
| |
variable from mandoc_getarg() so that it prints the warning every time.
Then, remove the warning from args_checkpunct(). This way, warnings
are being posted at the correct time. This makes the flag argument to
mdoc_zargs() superfluous, so make it be zero when it's invoked. Finally,
move the args() flags into mdoc_argv.c and make them enums.
|
|
|
|
| |
function a parameter to suppress warnings.
|
|
|
|
|
|
|
| |
This transforms the stack pop to occur prior to body execution, instead
of afterward. Floated to tech@ without response, but it makes sense
that this is alright and doesn't cause problems during extensive
testing.
|
| |
|
|
|
|
| |
and `SS' bodies.
|
|
|
|
|
| |
Bug reported by Tristan dot LeGuern at gmail dot com in fvwm2(1).
tweaks and ok kristaps@; earlier version looked good to espie@ as well
|
|
|
|
|
|
|
|
|
| |
line. Note that we now properly ignore \.", which earlier would have
been pushed through macro detection. This required attention to all
entries of roff_parse().
This removes a TODO by schwarze@ to the effect that \. can be a control
character, which is now handled in mandoc_getcontrol().
|
|
|
|
| |
libmandoc.h and there's nothing left.
|
|
|
|
|
|
|
|
|
| |
libroff, etc., etc.) route into mandoc_msg() and mandoc_vmsg(), for the
time being in libmandoc.h. This requires struct mparse to be passed
into the allocation routines instead of mandocmsg and a void pointer.
Then, move some of the functionality of the old mmsg() into read.c's
mparse_mmsg() (check against wlevel and setting of file_status) and use
main.c's mmsg() as simply a printing tool.
|
| |
|
|
|
|
| |
the adding itself is implemented; equation data is not yet shown.
|
|
|
|
|
|
|
|
| |
between EQ and EN roff blocks. EQN is different from TBL in that data
after .EQ is unilaterally considered an equation until an .EN. Thus,
there's no need to jump through hoops in having table spans and so on.
This is ONLY the parse code framework in libroff. EQN is not yet passed
into the backends.
|
|
|
|
|
|
| |
for now. All of these just cause a bit too much or too little
whitespace, but no serious formatting problems.
Triggered by reports from brad@.
|
|
|
|
|
| |
make it clear that you cannot use mandoc to format that page (yet).
Triggered by a report from brad@, ok kristaps@.
|
|
|
|
|
|
| |
Using the new roff_getname() function, this is really simple.
Breaks mandoc of the habit of reporting an error in each pod2man(1) preamble.
Reminded by a report from brad@; ok kristaps@.
|
|
|
|
|
|
|
|
|
|
| |
Unify parsing of names given as roff request arguments into a new
function roff_getname(), which is rather different from the parsing
function for normal arguments, mandoc_getarg(), because names cannot
be quoted and cannot contain whitespace or escaped characters.
The new function now throws an ERROR when finding escaped characters
in a name.
"I'm fine with this." kristaps@
|
|
|
|
|
| |
the remaining ones default to the empty string, not to NULL.
Regression reported and fix tested by kristaps@.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
argument parsing (in man_argv.c, man_args()), both having different bugs,
to use one common macro argument parser (in mandoc.c, mandoc_getarg()),
because from the point of view of roff, man macros are just roff macros,
hence their arguments are parsed in exactly the same way.
While doing so, fix these bugs:
* Escaped blanks (i.e. those preceded by an odd number of backslashes)
were mishandled as argument separators in unquoted arguments to
user-defined roff macros.
* Unescaped blanks preceded by an even number of backslashes were not
recognized as argument separators in unquoted arguments to man macros.
* Escaped backslashes (i.e. pairs of backslashes) were not reduced
to single backslashes both in unquoted and quoted arguments both
to user-defined roff macros and to man macros.
* Escaped quotes (i.e. pairs of quotes inside quoted arguments) were
not reduced to single quotes in man macros.
OK kristaps@
Note that mdoc macro argument parsing is yet another beast for no good
reason and is probably afflicted by similar bugs. But i don't attempt
to fix that right now because it is intricately entangled with lots of
unrelated high-level mdoc(7) functionality, like delimiter handling and
column list phrase handling. Disentagling that would waste too much
time now.
|
|
|
|
|
|
|
| |
existing 'struct tbl' as 'struct tbl_node', then move all option stuff
into a 'struct tbl' in mandoc.h.
This conflicted with a structure in chars.c, which was renamed.
|
| |
|
| |
|
|
|
|
|
|
| |
Add bits to remember tbl's invocation point.
Add ERROR class message if no data's in the table.
|
|
|
|
| |
roff.h interface.
|
|
|
|
| |
This completes the parsing phase of the new tbl implementation.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
original parse point to generate a useful error message.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
reference to a current tbl parse and routes ALL text into the tbl parse
after stripping reserved words and making block-level pre-processing
(e.g., `ig'). This is consistent with an analysis of embedded `TS/TE'
in manuals with sprinkled -mdoc, roff, and -man macros.
Fact of a parse is exposed to main.c by a return value (ROFF_TBL), which
will trigger main.c to add a foreign parsed body to the -mdoc or -man
parse stream. This interface isn't in yet, but will follow the
parse-text functions in both libraries. I put this login in main.c
because I don't want libroff calling directly into libmdoc or libman.
As a consequence, a parsed row can be pushed directly into any -mdoc or
-man context (put a `Bd -literal -offset indent' into a `TE/TS' block to
see why this is necessary). It will then absorb formatting cues in the
front-ends.
A note on naming. I decided on libroff.h instead of tbl.h because this
is purely within the roff layer. Separate tbl implementations will
need, then, to interface with libroff. This is "how it should be"
because tbl is tightly linked with roff in terms of `ds' and other
formatting macros, as well as, of course, special characters and other
roffisms.
|
|
|
|
|
|
|
|
|
| |
1) Now that growing buffers in main.c is safe, bring back the bugfix
distinguishing empty and undefined macros that was backed out in
the previous roff.c commit: `de' initializes to "", not to NULL.
2) Roff only interpolates \* strings when the leading backslash is
not escaped; using optimizations suggested by joerg@ and kristaps@.
ok kristaps@
|
|
|
|
|
|
|
|
|
|
| |
returning empty strings in roff_getstrn() instead of NULL. This caused
maddeningly irregular segfaults in the pod2man preamble for `de IX'.
But only on DEC alpha.
Also integrate the kinda-probably-safe assertion relaxation in term.c,
field-tested by schwarze@. This allows ALL [unpreprocessed] base and
xenocara manuals for all BSD systems to run without segfault.
|
|
|
|
|
|
|
|
| |
primarily adds a roff_userdef() function for parsing new defines and
modifies the look-up procedure.
NOTE: there is a bug hidden away in this update that causes an infinite
loop in some pages. The cause is for the moment unknown.
|
|
|
|
| |
schwarze@ and joerg@ for his comments!
|
|
|
|
| |
Made `rm' be an error (again, OpenBSD...).
|
|
|
|
| |
Rename roff_line() -> roff_line_ignore().
|
| |
|
|
|
|
| |
fully accomodates for the pod2man standard preamble!
|
|
|
|
|
|
| |
experimental and hasn't been rigorously tested. It's only implemented in
-mdoc for the time being. This is absolutely required for pod2man. It
does, however, make the pod2man preamble be processed in full.
|
|
|
|
| |
care because pod2man uses this construct.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
syntax of `ds' is such that ALL text following the first
non-space/non-double-quote is part of the value. This also fixes the
warning of *(string++) = NULL report by kristaps@ and joerg@.
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|