- my $alias = (state $seen = {})->{$chr}++; # assume first is preferred
- $table{$mnem} = [
- ord $chr,
- $uninfo->{$chr}->[1] // '', # name
- 0, # comparison
- $alias ? 'l0 ex' :
- ($uninfo->{$chr}->[0] // '') =~ s/ u-di| u-prop| ex//gr, # class
- $uninfo->{$chr}->[4] // (), # string
- ];
+
+ my $alias = \(state $seen = {})->{$chr}; # assume first is preferred
+ my $cp = ord $chr;
+ my ($class, $name, undef, undef, $string) = @{
+ Shiar_Sheet::FormatChar->glyph_info($cp)
+ };
+ my $comparison = (
+ !$vidi->{key}->{$mnem} ? 'l3' : # free
+ $vidi->{key}->{$mnem}->[0] != $cp ? 'l1' : # conflict
+ $vidi->{key}->{$mnem}->[2] eq 'l5' ? 'l5' : # rfc
+ 'l4' # any
+ );
+
+ if (${$alias}) {
+ # aliases an earlier occurrence
+ if ($matchvim and ${$alias}->[2] lt $comparison) {
+ # replace lower compatibility level
+ ${$alias}->[3] = 'l0';
+ ${$alias}->[2] .= ' u-' . ${$alias}->[2];
+ ${$alias} = undef;
+ }
+ else {
+ $class = 'l0';
+ my $menm = substr($mnem, 1, 1).substr($mnem, 0, 1);
+ if ($table{$menm} && $table{$menm}[0] == $cp) {
+ # unannotated if identical to reversed input
+ $cp = 0;
+ }
+ else {
+ $class .= ' ex';
+ }
+ }
+ }
+
+ $table{$mnem} = [ $cp, $name, $comparison, $class, $string // () ];
+ ${$alias} //= $table{$mnem};