chars: rename $html parameter from glyph_info method
authorMischa POSLAWSKY <perl@shiar.org>
Wed, 29 Mar 2017 11:08:57 +0000 (13:08 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 10 Apr 2017 13:28:45 +0000 (15:28 +0200)
Overridden in font.plp, but too generic and ambiguous anyway.

Shiar_Sheet/FormatChar.pm
apl.plp
chars.plp
font.plp

index 78e4a21fdbad97788b08565b5a5540352047b88e..80546556aae9f5153d73166c8e95b07ad33c8863 100644 (file)
@@ -31,7 +31,7 @@ sub glyph_html {
        my ($self, $char) = @_;
        my $codepoint = ord $char;
        my $info = $self->glyph_info($codepoint);
        my ($self, $char) = @_;
        my $codepoint = ord $char;
        my $info = $self->glyph_info($codepoint);
-       my ($class, $name, $mnem, $html, $string) = @$info;
+       my ($class, $name, $mnem, $entity, $string) = @$info;
 
        my $cell = EscapeHTML($string || $char);
        my $title = sprintf 'U+%04X%s', $codepoint, $name && " ($name)";
 
        my $cell = EscapeHTML($string || $char);
        my $title = sprintf 'U+%04X%s', $codepoint, $name && " ($name)";
@@ -39,7 +39,7 @@ sub glyph_html {
        $cell = "<span>$cell</span>" if $class =~ /\bZs\b/;
        $cell = '&nbsp;' if $cell eq '';
 
        $cell = "<span>$cell</span>" if $class =~ /\bZs\b/;
        $cell = '&nbsp;' if $cell eq '';
 
-       return ($cell, EscapeHTML($title), "X $class", $mnem, $html);
+       return ($cell, EscapeHTML($title), "X $class", $mnem, $entity);
 }
 
 sub glyphs_html {
 }
 
 sub glyphs_html {
diff --git a/apl.plp b/apl.plp
index 6fdf3ca62da5ba73a0eaccc2578234a5e10c6f41..546be3beb9a219df5668500019e7dd45bd918593 100644 (file)
--- a/apl.plp
+++ b/apl.plp
@@ -60,14 +60,14 @@ for my $op (@ops) {
        my $codepoint = ord $chr;
        my $ascii = $codepoint <= 127;
        my $info = $glyphs->glyph_info($codepoint);
        my $codepoint = ord $chr;
        my $ascii = $codepoint <= 127;
        my $info = $glyphs->glyph_info($codepoint);
-       my ($class, $name, $mnem, $html, $string) = @{$info};
+       my ($class, $name, $mnem, $entity, $string) = @{$info};
 
        printf '<tr><th title="%2$s">%s', $chr, EscapeHTML($name || '?'), $class;
        printf '<td class="%s">%s', @{$_} for (
                [$ascii ? 'l5' : defined $altkey ? 'l4' : 'l3', $altkey],
                [defined $mnem ? $class =~ /\bu-di\b/ ? 'l4' : 'l3' : $ascii ? 'l5' : 'l1',
                        EscapeHTML($mnem) // sprintf('%s%0*X', $codepoint < 256 ? (x => 2) : (u => 4), $codepoint)],
 
        printf '<tr><th title="%2$s">%s', $chr, EscapeHTML($name || '?'), $class;
        printf '<td class="%s">%s', @{$_} for (
                [$ascii ? 'l5' : defined $altkey ? 'l4' : 'l3', $altkey],
                [defined $mnem ? $class =~ /\bu-di\b/ ? 'l4' : 'l3' : $ascii ? 'l5' : 'l1',
                        EscapeHTML($mnem) // sprintf('%s%0*X', $codepoint < 256 ? (x => 2) : (u => 4), $codepoint)],
-               [defined $html ? 'l4' : $ascii ? 'l5' : 'l1', $html // "#$codepoint"],
+               [defined $entity ? 'l4' : $ascii ? 'l5' : 'l1', $entity // "#$codepoint"],
        );
        printf(
                defined $_ ? '<td%s>%s' : '<td class=Xi>',
        );
        printf(
                defined $_ ? '<td%s>%s' : '<td class=Xi>',
index a637eae8528f89b119a46fccd4c93ae1d6c3e944..96d74b4293285d0f2d345168bd7beb4d5ae11fce 100644 (file)
--- a/chars.plp
+++ b/chars.plp
@@ -115,12 +115,12 @@ for my $chr (@chars) {
 
        print "<tr><th>$chr\n";
        my $info = $glyphs->glyph_info($codepoint);
 
        print "<tr><th>$chr\n";
        my $info = $glyphs->glyph_info($codepoint);
-       my ($class, $name, $mnem, $html, $string) = @$info;
+       my ($class, $name, $mnem, $entity, $string) = @$info;
        print "<td>$_" for sprintf('%X', $codepoint), EscapeHTML($name || '?');
        printf '<td class="%s">%s', @$_ for (
                [$ascii ? 'l0' : defined $mnem ? $class =~ /\bu-di\b/ ? 'l4' : 'l3' : 'l1',
                        EscapeHTML($mnem) // ''],
        print "<td>$_" for sprintf('%X', $codepoint), EscapeHTML($name || '?');
        printf '<td class="%s">%s', @$_ for (
                [$ascii ? 'l0' : defined $mnem ? $class =~ /\bu-di\b/ ? 'l4' : 'l3' : 'l1',
                        EscapeHTML($mnem) // ''],
-               [$ascii ? 'l0' : defined $html ? 'l4' : 'l1', $html // ''],
+               [$ascii ? 'l0' : defined $entity ? 'l4' : 'l1', $entity // ''],
                (map {
                        !defined $font{$_}->{-name} ? [l0 => '?'] :
                        $font{$_}->{$chr} ? [l4 => '✔'] : [l1 => '✘']
                (map {
                        !defined $font{$_}->{-name} ? [l0 => '?'] :
                        $font{$_}->{$chr} ? [l4 => '✔'] : [l1 => '✘']
index fd5501707e91f53d8f77f6981581161c780b448b..82aa0c39dd0411c700c49bc95b059bc64d4c297c 100644 (file)
--- a/font.plp
+++ b/font.plp
@@ -107,7 +107,7 @@ EOT
                say sprintf '<tr><th>%X', $cp if $colpos++ % $pagecols == 0;
 
                my $info = $glyphs->glyph_info($cp);
                say sprintf '<tr><th>%X', $cp if $colpos++ % $pagecols == 0;
 
                my $info = $glyphs->glyph_info($cp);
-               my ($class, $name, $mnem, $html, $string) = @{$info};
+               my ($class, $name, $mnem, $entity, $string) = @{$info};
                my $np = $class =~ /\bC\S\b/;  # noprint if control or invalid
                # display literal character, with placeholder circle if non-spacing/enclosing
                my $html = ($class =~ /\bM[ne]\b/ && chr 9676) . EscapeHTML(chr $cp);
                my $np = $class =~ /\bC\S\b/;  # noprint if control or invalid
                # display literal character, with placeholder circle if non-spacing/enclosing
                my $html = ($class =~ /\bM[ne]\b/ && chr 9676) . EscapeHTML(chr $cp);