From 0b9d5e907c1c55453c85d921c145a19a01f745a9 Mon Sep 17 00:00:00 2001 From: Dongkyun Son Date: Mon, 11 Mar 2019 15:00:02 +0900 Subject: Fix regular expression at doc/rdsrc.pl fix build error """ [ 105s] perl ./rdsrc.pl html < nasmdoc.src [ 105s] Unescaped left brace in regex is illegal here in regex; marked by <-- HERE in m/\\{ <-- HERE / at ./rdsrc.pl line 252. [ 105s] Makefile:47: recipe for target 'html/nasmdoc0.html' failed """ Change-Id: Ic9dd399c02a8795deb301f42d68868d93c9bb5fd Signed-off-by: Dongkyun Son --- doc/rdsrc.pl | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/doc/rdsrc.pl b/doc/rdsrc.pl index de3a862..64b3c62 100644 --- a/doc/rdsrc.pl +++ b/doc/rdsrc.pl @@ -249,8 +249,8 @@ sub got_para { while (/^\\c (([^\\]|\\[^c])*)(.*)$/) { $l = $1; $_ = $3; - $l =~ s/\\{/{/g; - $l =~ s/\\}/}/g; + $l =~ s/\\\{/{/g; + $l =~ s/\\\}/}/g; $l =~ s/\\\\/\\/g; push @$pname, $l; } @@ -263,7 +263,7 @@ sub got_para { $snum = 0; $xref = "chapter-$cnum"; $pflags = "chap $cnum :$xref"; - die "badly formatted chapter heading: $_\n" if !/^\\C{([^}]*)}\s*(.*)$/; + die "badly formatted chapter heading: $_\n" if !/^\\C\{([^}]*)\}\s*(.*)$/; $refs{$1} = "chapter $cnum"; $node = "Chapter $cnum"; &add_item($node, 1); @@ -280,7 +280,7 @@ sub got_para { $snum = 0; $xref = "appendix-$cnum"; $pflags = "appn $cnum :$xref"; - die "badly formatted appendix heading: $_\n" if !/^\\A{([^}]*)}\s*(.*)$/; + die "badly formatted appendix heading: $_\n" if !/^\\A\{([^}]*)\}\s*(.*)$/; $refs{$1} = "appendix $cnum"; $node = "Appendix $cnum"; &add_item($node, 1); @@ -294,7 +294,7 @@ sub got_para { $snum = 0; $xref = "section-$cnum.$hnum"; $pflags = "head $cnum.$hnum :$xref"; - die "badly formatted heading: $_\n" if !/^\\[HP]{([^}]*)}\s*(.*)$/; + die "badly formatted heading: $_\n" if !/^\\[HP]\{([^\}]*)\}\s*(.*)$/; $refs{$1} = "section $cnum.$hnum"; $node = "Section $cnum.$hnum"; &add_item($node, 2); @@ -307,7 +307,7 @@ sub got_para { $snum++; $xref = "section-$cnum.$hnum.$snum"; $pflags = "subh $cnum.$hnum.$snum :$xref"; - die "badly formatted subheading: $_\n" if !/^\\S{([^}]*)}\s*(.*)$/; + die "badly formatted subheading: $_\n" if !/^\\S\{([^}]*)\}\s*(.*)$/; $refs{$1} = "section $cnum.$hnum.$snum"; $node = "Section $cnum.$hnum.$snum"; &add_item($node, 3); @@ -317,18 +317,18 @@ sub got_para { # the standard word-by-word code will happen next } elsif (/^\\IR/) { # An index-rewrite. - die "badly formatted index rewrite: $_\n" if !/^\\IR{([^}]*)}\s*(.*)$/; + die "badly formatted index rewrite: $_\n" if !/^\\IR\{([^\}]*)\}\s*(.*)$/; $irewrite = $1; $_ = $2; # the standard word-by-word code will happen next } elsif (/^\\IA/) { # An index-alias. - die "badly formatted index alias: $_\n" if !/^\\IA{([^}]*)}{([^}]*)}\s*$/; + die "badly formatted index alias: $_\n" if !/^\\IA\{([^}]*)\}\{([^\}]*)\}\s*$/; $idxalias{$1} = $2; return; # avoid word-by-word code } elsif (/^\\M/) { # Metadata - die "badly formed metadata: $_\n" if !/^\\M{([^}]*)}{([^}]*)}\s*$/; + die "badly formed metadata: $_\n" if !/^\\M\{([^\}]*)\}\{([^\}]*)\}\s*$/; $metadata{$1} = $2; return; # avoid word-by-word code } elsif (/^\\b/) { @@ -377,8 +377,8 @@ sub got_para { die "badly formatted \\c: \\c$_\n" if !/{(([^\\}]|\\.)*)}(.*)$/; $w = $1; $_ = $3; - $w =~ s/\\{/{/g; - $w =~ s/\\}/}/g; + $w =~ s/\\\{/{/g; + $w =~ s/\\\}/}/g; $w =~ s/\\-/-/g; $w =~ s/\\\\/\\/g; (push @$pname,"i"),$lastp = $#$pname if $indexing; @@ -394,8 +394,8 @@ sub got_para { die "badly formatted $type: $type$_\n" if !/{(([^\\}]|\\.)*)}(.*)$/; $w = $1; $_ = $3; - $w =~ s/\\{/{/g; - $w =~ s/\\}/}/g; + $w =~ s/\\\{/{/g; + $w =~ s/\\\}/}/g; $w =~ s/\\-/-/g; $w =~ s/\\\\/\\/g; $t = $emph ? "es" : "n "; @@ -431,8 +431,8 @@ sub got_para { $t = "w "; $t = "wc" if $3 eq "\\c"; $indexing = 1 if $2; - $w =~ s/\\{/{/g; - $w =~ s/\\}/}/g; + $w =~ s/\\\{/{/g; + $w =~ s/\\\}/}/g; $w =~ s/\\-/-/g; $w =~ s/\\\\/\\/g; (push @$pname,"i"),$lastp = $#$pname if $indexing; @@ -443,8 +443,8 @@ sub got_para { die "painful death! $_\n" if !length $1; $w = $1; $_ = $3; - $w =~ s/\\{/{/g; - $w =~ s/\\}/}/g; + $w =~ s/\\\{/{/g; + $w =~ s/\\\}/}/g; $w =~ s/\\-/-/g; $w =~ s/\\\\/\\/g; if ($w eq "-") { -- cgit v1.2.3