mktables: Convert to use new function
authorKarl Williamson <public@khwilliamson.com>
Fri, 15 Nov 2013 02:32:44 +0000 (19:32 -0700)
committerKarl Williamson <public@khwilliamson.com>
Tue, 31 Dec 2013 15:27:19 +0000 (08:27 -0700)
The previous commit added a new function used in newly added code; this
changes some existing code to use that function

lib/unicore/mktables

index c6b180a..bad1799 100644 (file)
@@ -5766,31 +5766,22 @@ END
                                              $start,       $end;
                         if ($value ne "") {
                             if ($convert_map_to_from_hex) {
-                                $OUT[-1] .= sprintf "\t$hex_format", $value;
+                                $OUT[-1] .= sprintf "\t$hex_format\n", $value;
                             }
                             else {
-                                $OUT[-1] .= "\t$value";
+                                $OUT[-1] .= "\t$value\n";
                             }
                         }
 
                         # Add a comment with the size of the range, if
-                        # requested.  Expand Tabs to make sure they all start
-                        # in the same column, and then unexpand to use mostly
-                        # tabs.
-                        if (! $output_range_counts{$addr}) {
-                            $OUT[-1] .= "\n";
-                        }
-                        else {
-                            $OUT[-1] = Text::Tabs::expand($OUT[-1]);
-                            my $count = main::clarify_number($end - $start + 1);
-                            use integer;
-
-                            my $width = $tab_stops * 8 - 1;
-                            $OUT[-1] = sprintf("%-*s # [%s]\n",
-                                                $width,
-                                                $OUT[-1],
-                                                $count);
-                            $OUT[-1] = Text::Tabs::unexpand($OUT[-1]);
+                        # requested.
+                        if ($output_range_counts{$addr}) {
+                            $OUT[-1] = merge_single_annotation_line(
+                                    $OUT[-1],
+                                    "# ["
+                                      . main::clarify_number($end - $start + 1)
+                                      . "]\n",
+                                    $comment_indent);
                         }
                     }
                     else { # Here to output a single code point per line.