summaryrefslogtreecommitdiffstats
path: root/mdoc_argv.c
Commit message (Collapse)AuthorAgeFilesLines
* The -width and -offset macro arguments consume the next argumentIngo Schwarze2012-04-151-38/+4
| | | | | even if it starts with a dash. ok kristaps@
* Make the `-width' field to `Bl' not puke if it doesn't have an argument.Kristaps Dzonsons2012-03-231-1/+1
| | | | This makes mandoc work much, much nicer with Mac OSX manpages.
* forgotten Copyright bumps; no code changeIngo Schwarze2011-09-181-1/+1
| | | | found while syncing to OpenBSD
* Add back in a check that the leading `-' exists for arguments. ThisKristaps Dzonsons2011-06-181-6/+5
| | | | | mysteriously disappeared in 1.14. No idea why. While here, remove an unnecessary header and order the function prototypes.
* Clean-up: remove a function only called once.Kristaps Dzonsons2011-06-181-37/+16
|
* Fix an assertion failure raised by the following interesting scenario: aKristaps Dzonsons2011-06-181-191/+163
| | | | | | | | | | | | | | auto-opened `It' (i.e., a column list with a free-text first line) with leading spaces in the line triggering assertion when searching for arguments. This led to a fix giving a nice performance speed-ups (a few percent, with some quick trials): the search for flags immediately exits if the macro has no flags, instead of having to first parse the leading word then look it up. I also cleaned up the argv parsing stuff a little bit and added more documentation. This comes from a TODO by joerg@.
* Lint fixes: remove unused function variables and pass in proper enumKristaps Dzonsons2011-05-121-7/+6
| | | | values instead of ints.
* Clean up parsing of delimiters in -mdoc. First, remove the "dowarn"Kristaps Dzonsons2011-04-191-170/+156
| | | | | | | | 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.
* Use mandoc_getarg() for the regular case of processing unquotedKristaps Dzonsons2011-04-171-19/+3
| | | | arguments in -mdoc documents.
* Don't shadow global identifiers.Joerg Sonnenberger2011-04-071-12/+12
|
* As per joerg@'s suggestion, use const arrays when looking up mdoc argvs.Kristaps Dzonsons2011-03-231-37/+68
|
* libmdoc.h and libman.h were including mdoc.h and man.h, respectively.Kristaps Dzonsons2011-03-221-0/+1
| | | | | Don't have them do that (includes in header files = faugh), and have individual files directly include these files.
* mdoc_argn_free is only used local to mdoc_argv.c, so make it static.Kristaps Dzonsons2011-03-221-3/+4
|
* Move mandoc_isdelim() back into libmdoc.h. This fixes an unreportedKristaps Dzonsons2011-03-221-2/+2
| | | | | | | | | error where (1) -man pages were punctuating delimiters (e.g., `.B a ;') and where (2) standalone punctuation in -mdoc or -man (e.g., ";" on its own line) would also be punctuated. This introduces a small amount of complexity of mdoc_{html,term}.c must manage their own spacing with running print_word() or print_text(). The check for delimiting now happens in mdoc_macro.c's dword().
* Clean-up in mdoc_argv.c args_checkpunct().Kristaps Dzonsons2011-03-171-27/+21
|
* Clean-up in mdoc_argv.c: make CPP-defines into an enum, document, makeKristaps Dzonsons2011-03-171-33/+17
| | | | | static arrays const, properly abort() for bogus switch cases, and be obsessive about spacing and (void)-casting.
* Clean up mdoc_pmsg invocations to make them not check the return value.Kristaps Dzonsons2011-03-171-13/+6
|
* Move mdoc_isdelim() into mandoc.h as mandoc_isdelim(). This allows theKristaps Dzonsons2011-03-171-2/+2
| | | | | | removal of manual delimiter checks in html.c and term.c. Finally, add the escaped period as a closing delimiter, removing a TODO to this effect.
* Make args_checkpunct() use mdoc_isdelim() instead of mdoc_iscdelim(),Kristaps Dzonsons2011-03-171-18/+33
| | | | which is wrong. Then remove mdoc_iscdelim() alltogether.
* Move check for closing punctuation into its own function. This willKristaps Dzonsons2011-03-171-24/+41
| | | | | | later be modified to remove the need for iscdelim(), which will be used to unify delimiter checks, which will then allow for the simple removal of a TODO regarding escaped periods.
* Instead of a series of hard-coded strcmps, make argv_a2arg() iterateKristaps Dzonsons2011-03-161-73/+42
| | | | | | over an array of possible argument types, hooking in to mdoc_argnames[]. This knocks off bytes for the duplicated strings and cleans up code readability.
* As per schwarze@'s suggestions, roll back the refcount structure inKristaps Dzonsons2010-12-241-1/+1
| | | | | | | | favour of a simpler shim for normalised data in the node allocation and free routines. This removes the need to bump and copy references within validator handlers, removes a pointer redirect, and also kills the refcount structure itself. Data is assumed to "live" either in a MDOC_BLOCK or MDOC_ELEM and is copied accordingly.
* Implement reference-counted version of original union mdoc_data. ThisKristaps Dzonsons2010-12-221-2/+1
| | | | | | | simplifies clean-up and allows for more types without extra hassle. Also made in-line literal types in -T[x]html use CODE instead of SPAN to match how literal blocks use PRE.
* Prevent .Lp from looping endlessly on punctuation.Ingo Schwarze2010-09-131-1/+1
| | | | Same fix as the previous one.
* Prevent `Pp' from looping endlessly on punctuation. Bug reported byKristaps Dzonsons2010-09-131-1/+1
| | | | Marc Espie.
* Nit-picking assign in decl.Kristaps Dzonsons2010-07-211-1/+3
|
* Finally make mdoc argv CPP-defines into a proper enum.Kristaps Dzonsons2010-07-211-3/+3
|
* correct lots of copyright notices;Ingo Schwarze2010-07-131-1/+1
| | | | ok kristaps@
* Make struct_bl and struct_bd into pointers. This removes the need to doKristaps Dzonsons2010-07-011-1/+2
| | | | | | | | | | | copying on internals after modification. Even more importantly, if an ENDBODY token is provided, it would have been impossible for post-change copying of the data to take place in the BLOCK. This allows it to happen by dint of pointers. Also did some bikeshedding in mdoc_term.c: checking against enum type and explicitly casting to the "post" function to void. This is for my own readability.
* Churn as I finish email address migration kth.se -> bsd.lv.Kristaps Dzonsons2010-06-191-1/+1
|
* `Bl' is now using a struct instead of a single enum mdoc_list for itsKristaps Dzonsons2010-06-121-1/+1
| | | | cached values. You can probably guess where this is going.
* Getting args() function ready to handle no-context (*pos can == 0)Kristaps Dzonsons2010-05-311-11/+11
| | | | processing.
* Remove enum mdocargerr from phrase() (unused).Kristaps Dzonsons2010-05-311-1/+9
| | | | | | | | | | | | | | Add `Ta' macro, which is basically a NULL case everywhere but in mdoc_macro.c, where it closes out an existing `It' body scope and opens a new one, then continues parsing as in phrase() (TODO: merge these two?). Fix where scope-breaking was silently just dying instead of printing an error. Fix where trailing `Ta' or tab weren't creating a new MDOC_BODY context. We now support arbitrarily complex `It' contents for `Bl -column'.
* Have mdoc_args() use enum mdoc_list instead of scanning.Kristaps Dzonsons2010-05-301-16/+3
|
* Enable the unified error/warning enumeration in mandoc.h that'sKristaps Dzonsons2010-05-171-9/+11
| | | | | | | | | | | 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.
* Distinguish OPEN, MIDDLE and CLOSE delimiters (using an enum).Ingo Schwarze2010-05-151-2/+3
| | | | | | | Only OPEN are drawn before the beginning of a macro; this is new, before this, MIDDLE ('|') were drawn in front, too. Only CLOSE are pushed after the end of a macro (as before). ok kristaps@
* More `Bl -column' dancing: It children also inherit in-phrase flags (noted ↵Kristaps Dzonsons2010-05-151-3/+3
| | | | by Ingo Schwarze).
* Proper handling of quoted tab-separated column lists.Kristaps Dzonsons2010-05-141-19/+39
|
* Explicitly account for \*(Ba when checking for delims. Noted by Jason ↵Kristaps Dzonsons2010-05-091-5/+6
| | | | McIntyre via Ingo Schwarze.
* Introduce ARGS_PEND for `It -column' end-of-line special casing.Kristaps Dzonsons2010-05-091-1/+3
| | | | Initial rules for insane `It -column' tabsep handling.
* Lint fixes (type-safety for enums via -cefuh).Kristaps Dzonsons2010-05-081-12/+13
|
* De-chunking of text removed from parsers. This is a significant change (and ↵Kristaps Dzonsons2010-05-071-2/+6
| | | | | | I don't really like it), but it's what groff does. Distinction of ARGS_PHRASE and ARGS_PPHRASE in backend (not yet used).
* Initial ARGS_PPHRASE (partial phrase) framework.Kristaps Dzonsons2010-05-071-1/+3
| | | | Running tally of changes in index.sgml.
* enum-ised mdoc_argv() return (better return-value safety).Kristaps Dzonsons2010-05-071-1/+1
|
* margerr -> margserr (getting ready for margverr).Kristaps Dzonsons2010-05-071-4/+4
|
* Wrangle mdoc_args() and mdoc_zargs() to use enum return type.Kristaps Dzonsons2010-05-071-4/+4
| | | | | Fixed lookup() and lookup_raw() to correctly use enum type. Quashed in_line_argn() bug (not reported, but there) where mixing return values.
* Merged Ingo Schwarze's patch (plus documentation) for removing extraneous ↵Kristaps Dzonsons2010-04-031-14/+19
| | | | list types, which happens fairly often.
* Re-adjusting UGLY tags.Kristaps Dzonsons2010-03-311-1/+0
| | | | | Fixed removed assignment of type. Removed superfluous checks of mdoc_argflags (from days when comments were a macro tag).
* Macro types enum-ated (enum mdoct) (for easier debugging in gdb of "tok" ↵Kristaps Dzonsons2010-03-311-6/+7
| | | | | | | values). Initial check-in of Ingo Schwarze's patch for Xo/Xc handling (in blocks ifdef'd "UGLY"). Put Oc-close-Op parts into UGLY ifdef blocks.
* Integrate Ingo Schwarze's patch for mdoc_iscdelim() (tri-state for opening ↵Kristaps Dzonsons2010-03-291-2/+2
| | | | | | | | | | | and closing macro punctuation). Modify blk_part_exp() to correctly handle leading punctuation before HEAD. Significantly clean up and document blk_part_exp(). Modify blk_part_imp() for to correctly handle leading punctuation before HEAD. Significantly clean up and document blk_part_imp(). Integrate Ingo Schwarze's patch for args() (using new mdoc_iscdelim() format). Documented bad `Ec' handling for later work in mdoc_term.c/mdoc_html.c.