diff options
author | H. Peter Anvin <hpa@zytor.com> | 2022-12-21 18:40:08 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2022-12-21 18:40:08 -0800 |
commit | e847465bb5bc01b2b203133b58f1dd7c93d97310 (patch) | |
tree | c6136a72ab71517aec7670943b799fba5a65672c | |
parent | feac856c543ba6e89cfe3e01377edbf942003da0 (diff) | |
parent | 80eebbcb5c20a57a99960b12a09292d1aab2fca6 (diff) | |
download | nasm-master.tar.gz nasm-master.tar.xz nasm-master.zip |
Resolved Conflicts:
doc/changes.src
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r-- | .gitignore | 12 | ||||
-rw-r--r-- | autoconf/m4/pa_have_func.m4 | 4 | ||||
-rw-r--r-- | doc/changes.src | 10 | ||||
-rw-r--r-- | doc/rdsrc.pl | 98 |
4 files changed, 70 insertions, 54 deletions
@@ -75,22 +75,14 @@ TAGS /doc/Fontmap /include/warnings.h /macros/macros.c +/misc/nasmtok.el /misc/omfdump /nasm /ndisasm /nasm.spec /nsis/arch.nsh /nsis/version.nsh -/rdoff/Makefile -/rdoff/ldrdf -/rdoff/rdf2bin -/rdoff/rdf2com -/rdoff/rdf2ihx -/rdoff/rdf2ith -/rdoff/rdf2srec -/rdoff/rdfdump -/rdoff/rdflib -/rdoff/rdx +/rdoff /test/golden /test/perf/*.asm /test/testresults diff --git a/autoconf/m4/pa_have_func.m4 b/autoconf/m4/pa_have_func.m4 index b00145a0..867320e0 100644 --- a/autoconf/m4/pa_have_func.m4 +++ b/autoconf/m4/pa_have_func.m4 @@ -1,8 +1,8 @@ dnl -------------------------------------------------------------------------- -dnl PA_HAVE_FUNC(func_name) +dnl PA_HAVE_FUNC(func_name, arguments) dnl dnl Look for a function with the specified arguments which could be -dnl a builtin/intrinsic function. +dnl a macro/builtin/intrinsic function. dnl -------------------------------------------------------------------------- AC_DEFUN([PA_HAVE_FUNC], [AC_MSG_CHECKING([for $1]) diff --git a/doc/changes.src b/doc/changes.src index 751e2aaa..4851d604 100644 --- a/doc/changes.src +++ b/doc/changes.src @@ -7,11 +7,21 @@ The NASM 2 series supports x86-64, and is the production version of NASM since 2007. + \S{cl-2.17} Version 2.17 \b ... here goes release notes not intended to be included in the 2.16.xx stable series ... + +\S{cl-2.16.01} Version 2.16.01 + +\e{This is a documentation update release only.} + +\b Fix the creation of the table of contents in the HTML version of +the documentation. + + \S{cl-2.16} Version 2.16 \b Support for the \c{rdf} format has been discontinued and all the diff --git a/doc/rdsrc.pl b/doc/rdsrc.pl index bde9a1a0..1fc99f61 100644 --- a/doc/rdsrc.pl +++ b/doc/rdsrc.pl @@ -268,7 +268,7 @@ sub include { sub got_para { local ($_) = @_; my $pflags = "", $i, $w, $l, $t; - my @para = (); + my $para = []; return if !/\S/; @@ -294,7 +294,7 @@ sub got_para { $l =~ s/\\\{/\{/g; $l =~ s/\\\}/}/g; $l =~ s/\\\\/\\/g; - push @para, $l; + push @$para, $l; } $_ = ''; # suppress word-by-word code } elsif (/^\\C/) { @@ -308,7 +308,7 @@ sub got_para { die "badly formatted chapter heading: $_\n" if !/^\\C\{([^\}]*)\}\s*(.*)$/; $refs{$1} = "chapter $cnum"; $node = "Chapter $cnum"; - &add_item($node, 1); + &add_item($node, 1, $para); $xrefnodes{$node} = $xref; $nodexrefs{$xref} = $node; $xrefs{$1} = $xref; $_ = $2; @@ -325,7 +325,7 @@ sub got_para { die "badly formatted appendix heading: $_\n" if !/^\\A\{([^\}]*)}\s*(.*)$/; $refs{$1} = "appendix $cnum"; $node = "Appendix $cnum"; - &add_item($node, 1); + &add_item($node, 1, $para); $xrefnodes{$node} = $xref; $nodexrefs{$xref} = $node; $xrefs{$1} = $xref; $_ = $2; @@ -339,7 +339,7 @@ sub got_para { die "badly formatted heading: $_\n" if !/^\\[HP]\{([^\}]*)\}\s*(.*)$/; $refs{$1} = "section $cnum.$hnum"; $node = "Section $cnum.$hnum"; - &add_item($node, 2); + &add_item($node, 2, $para); $xrefnodes{$node} = $xref; $nodexrefs{$xref} = $node; $xrefs{$1} = $xref; $_ = $2; @@ -352,7 +352,7 @@ sub got_para { die "badly formatted subheading: $_\n" if !/^\\S\{([^\}]*)\}\s*(.*)$/; $refs{$1} = "section $cnum.$hnum.$snum"; $node = "Section $cnum.$hnum.$snum"; - &add_item($node, 3); + &add_item($node, 3, $para); $xrefnodes{$node} = $xref; $nodexrefs{$xref} = $node; $xrefs{$1} = $xref; $_ = $2; @@ -389,11 +389,11 @@ sub got_para { $pflags = "norm"; } - # The word-by-word code: unless @para is already defined (which it + # The word-by-word code: unless @$para is already defined (which it # will be in the case of a code paragraph), split the paragraph up - # into words and push each on @para. + # into words and push each on @$para. # - # Each thing pushed on @para should have a two-character type + # Each thing pushed on @$para should have a two-character type # code followed by the text. # # Type codes are: @@ -416,7 +416,7 @@ sub got_para { # index-items arrays # "sp" for space while (/\S/) { - s/^\s*//, push @para, "sp" if /^\s/; + s/^\s*//, push @$para, "sp" if /^\s/; $indexing = $qindex = 0; if (/^(\\[iI])?\\c/) { $qindex = 1 if $1 eq "\\I"; @@ -429,8 +429,8 @@ sub got_para { $w =~ s/\\\}/\}/g; $w =~ s/\\-/-/g; $w =~ s/\\\\/\\/g; - push(@para, addidx($node, $w, "c $w")) if ($indexing); - push(@para, "c $w") if (!$qindex); + push(@$para, addidx($node, $w, "c $w")) if ($indexing); + push(@$para, "c $w") if (!$qindex); } elsif (/^\\[iIe]/) { /^(\\[iI])?(\\e)?/; $emph = 0; @@ -456,7 +456,7 @@ sub got_para { if ($indexing) { $w =~ tr/A-Z/a-z/; pop @ientry; # remove final space - push(@para, addidx($node, $w, @ientry)); + push(@$para, addidx($node, $w, @ientry)); } if (!$qindex) { pop @pentry; # remove final space @@ -465,7 +465,7 @@ sub got_para { } elsif ($emph) { substr($pentry[-1],0,2) = 'ee'; } - push(@para, @pentry); + push(@$para, @pentry); } } elsif (/^\\[kK]/) { $t = "k "; @@ -473,7 +473,7 @@ sub got_para { s/^\\[kK]//; die "badly formatted \\k: \\k$_\n" if !/\{([^\}]*)\}(.*)$/; $_ = $2; - push @para,"$t$1"; + push @$para,"$t$1"; } elsif (/^\\W/) { s/^\\W//; die "badly formatted \\W: \\W$_\n" @@ -488,8 +488,8 @@ sub got_para { $w =~ s/\\\}/\}/g; $w =~ s/\\-/-/g; $w =~ s/\\\\/\\/g; - push(@para, addidx($node, $w, "c $w")) if $indexing; - push(@para, "$t<$l>$w"); + push(@$para, addidx($node, $w, "c $w")) if $indexing; + push(@$para, "$t<$l>$w"); } else { die "what the hell? $_\n" if !/^(([^\s\\\-]|\\[\\{}\-])*-?)(.*)$/; die "painful death! $_\n" if !length $1; @@ -500,18 +500,18 @@ sub got_para { $w =~ s/\\-/-/g; $w =~ s/\\\\/\\/g; if ($w eq '--') { - push @para, 'dm'; + push @$para, 'dm'; } elsif ($w eq '-') { - push @para, 'da'; + push @$para, 'da'; } else { - push @para,"n $w"; + push @$para,"n $w"; } } } if ($irewrite ne undef) { - addidx(undef, $irewrite, @para); + addidx(undef, $irewrite, @$para); } else { - push @pnames, [@para]; + push @pnames, $para; push @pflags, $pflags; } } @@ -769,6 +769,15 @@ sub word_txt { } } +sub html_filename($) { + my($node) = @_; + + (my $number = lc($xrefnodes{$node})) =~ s/.*-//; + my $fname="nasmdocx.html"; + substr($fname,8 - length $number, length $number) = $number; + return $fname; +} + sub write_html { # This is called from the top level, so I won't bother using # my or local. @@ -778,6 +787,8 @@ sub write_html { print "writing contents file..."; open TEXT, '>', File::Spec->catfile($out_path, 'nasmdoc0.html'); select TEXT; + undef $html_nav_last; + $html_nav_next = $tstruct_next{'Top'}; &html_preamble(0); print "<p>This manual documents NASM, the Netwide Assembler: an assembler\n"; print "targeting the Intel x86 series of processors, with portable source.\n</p>"; @@ -797,22 +808,13 @@ sub write_html { } $level = $tstruct_level{$node}; if ($level == 1) { - # Invent a file name. - ($number = lc($xrefnodes{$node})) =~ s/.*-//; - $fname="nasmdocx.html"; - substr($fname,8 - length $number, length $number) = $number; - $html_fnames{$node} = $fname; - $link = $fname; + $link = $fname = html_filename($node); } else { # Use the preceding filename plus a marker point. $link = $fname . "#$xrefnodes{$node}"; } - $title = ''; $pname = $tstruct_pname{$node}; - foreach $i (@$pname) { - $ww = &word_html($i); - $title .= $ww unless $ww eq "\001"; - } + $title = plist_to_html(@$pname); print "<li class=\"toc${level}\">\n"; print "<span class=\"node\">$node: </span><a href=\"$link\">$title</a>\n"; } @@ -857,7 +859,7 @@ sub write_html { $html_nav_last = $chapternode; $chapternode = $nodexrefs{$xref}; $html_nav_next = $tstruct_mnext{$chapternode}; - open(TEXT, '>', File::Spec->catfile($out_path, $html_fnames{$chapternode})); + open(TEXT, '>', File::Spec->catfile($out_path, html_filename($chapternode))); select TEXT; &html_preamble(1); foreach $i (@$pname) { @@ -875,7 +877,7 @@ sub write_html { $html_nav_last = $chapternode; $chapternode = $nodexrefs{$xref}; $html_nav_next = $tstruct_mnext{$chapternode}; - open(TEXT, '>', File::Spec->catfile($out_path, $html_fnames{$chapternode})); + open(TEXT, '>', File::Spec->catfile($out_path, html_filename($chapternode))); select TEXT; &html_preamble(1); foreach $i (@$pname) { @@ -992,11 +994,11 @@ sub html_preamble { # Navigation bar print "<ul class=\"navbar\">\n"; if (defined($html_nav_last)) { - my $lastf = $html_fnames{$html_nav_last}; + my $lastf = html_filename($html_nav_last); print "<li class=\"first\"><a class=\"prev\" href=\"$lastf\">$html_nav_last</a></li>\n"; } if (defined($html_nav_next)) { - my $nextf = $html_fnames{$html_nav_next}; + my $nextf = html_filename($html_nav_next); print "<li><a class=\"next\" href=\"$nextf\">$html_nav_next</a></li>\n"; } print "<li><a class=\"toc\" href=\"nasmdoc0.html\">Contents</a></li>\n"; @@ -1066,7 +1068,19 @@ sub html_index { print "</ul>\n"; } -sub word_html { +sub plist_to_html(@) { + my $ws = ''; + + foreach my $w (@_) { + my $ww = word_html($w); + next if ($ww eq "\001"); + $ws .= $ww; + } + + return $ws; +} + +sub word_html($) { my ($w) = @_; my $wtype, $wmajt, $pfx, $sfx; @@ -1106,7 +1120,7 @@ sub word_html { my $level = $tstruct_level{$node}; # and its level my $up = $node, $uplev = $level-1; $up = $tstruct_up{$up} while $uplev--; # get top node of containing file - my $file = ($up ne $chapternode) ? $html_fnames{$up} : ""; + my $file = ($up ne $chapternode) ? html_filename($up) : ""; my $marker = ($level == 1 and $file) ? "" : "#$w"; return "<a href=\"$file$marker\">"; } elsif ($wtype eq "xe") { @@ -1119,11 +1133,11 @@ sub word_html { } # Make tree structures. $tstruct_* is top-level and global. -sub add_item { - my ($item, $level) = @_; +sub add_item($$$) { + my ($item, $level, $para) = @_; my $i; - $tstruct_pname{$item} = $pname; + $tstruct_pname{$item} = $para; $tstruct_next{$tstruct_previtem} = $item; $tstruct_prev{$item} = $tstruct_previtem; $tstruct_level{$item} = $level; |