diff options
author | H. Peter Anvin (Intel) <hpa@zytor.com> | 2020-06-27 22:30:50 -0700 |
---|---|---|
committer | H. Peter Anvin (Intel) <hpa@zytor.com> | 2020-06-27 22:30:50 -0700 |
commit | de8817ddbcb3e3ecc0e81c1d5fdd973064d41563 (patch) | |
tree | 569983d373cbef742eb94f9de70dc3944e1e8999 | |
parent | 444905e48bc2e4e428064b3ad5ec6d6c5d23d2f1 (diff) | |
download | nasm-de8817ddbcb3e3ecc0e81c1d5fdd973064d41563.tar.gz |
doc: clean up warnings formatting
When a warning documentation message contains more than one paragraph,
we have to indent the subsequent paragraphs using \> unless they are a
code paragraph (\c).
Improve a few warnings doc messages.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
-rw-r--r-- | asm/preproc.c | 2 | ||||
-rw-r--r-- | asm/stdscan.c | 2 | ||||
-rwxr-xr-x | asm/warnings.pl | 13 |
3 files changed, 14 insertions, 3 deletions
diff --git a/asm/preproc.c b/asm/preproc.c index 69c87087..a2c57883 100644 --- a/asm/preproc.c +++ b/asm/preproc.c @@ -5946,7 +5946,7 @@ static MMacro *is_mmacro(Token * tline, int *nparamp, Token ***paramsp) *! The legacy behavior is quite strange and highly context-dependent, *! and can be disabled with: *!- - *! \c %pragma preproc sane_empty_expansion true + *! \c %pragma preproc sane_empty_expansion true *!- *! It is highly recommended to use this option in new code. */ diff --git a/asm/stdscan.c b/asm/stdscan.c index c1c38f42..cbc0fc77 100644 --- a/asm/stdscan.c +++ b/asm/stdscan.c @@ -164,7 +164,7 @@ int stdscan(void *private_data, struct tokenval *tv) *!ptr [on] non-NASM keyword used in other assemblers *! warns about keywords used in other assemblers that might *! indicate a mistake in the source code. Currently only the MASM - *! \c{PTR} keyword is recognized. + *! \c{PTR} keyword is recognized. See also \k{pkg_masm}. */ nasm_warn(WARN_PTR, "`%s' is not a NASM keyword", tv->t_charptr); diff --git a/asm/warnings.pl b/asm/warnings.pl index a609e132..8a79568a 100755 --- a/asm/warnings.pl +++ b/asm/warnings.pl @@ -253,7 +253,18 @@ if ($what eq 'c') { } else { my $docdef = $whatdef{$warn->{def}}; - @doc = @{$warn->{doc}}; + my $newpara = 0; + foreach my $l (@{$warn->{doc}}) { + if ($l =~ /^\s*$/) { + $newpara = 1; + } else { + if ($newpara && $l !~ /^\\c\s+/) { + $l = '\> ' . $l; + } + $newpara = 0; + } + push(@doc, $l); + } if (defined($docdef)) { push(@doc, "\n", "\\> $docdef by default.\n"); } |