diff options
| author | Sam Varshavchik | 2021-03-07 17:46:01 -0500 | 
|---|---|---|
| committer | Sam Varshavchik | 2021-03-10 22:52:34 -0500 | 
| commit | 18fc31347b80597f4100f96c86799fe130786781 (patch) | |
| tree | 08b641332ec55232a34d3656d6435559a847fcce /unicode/mkcommon.pm | |
| parent | 92bcce9b28d5d123af67ff0201cd97508af21326 (diff) | |
| download | courier-libs-18fc31347b80597f4100f96c86799fe130786781.tar.bz2 | |
courier-unicode: canonical decomposition and composition implementation.
Move unicode_canonical() into a larger library of functions that handles
full Unicode decomposition and composition.
Diffstat (limited to 'unicode/mkcommon.pm')
| -rw-r--r-- | unicode/mkcommon.pm | 31 | 
1 files changed, 19 insertions, 12 deletions
| diff --git a/unicode/mkcommon.pm b/unicode/mkcommon.pm index 091a219..475721d 100644 --- a/unicode/mkcommon.pm +++ b/unicode/mkcommon.pm @@ -82,6 +82,7 @@ sub new {      $self->{'last_l'}=0;      $self->{"classtype"} //= "uint8_t"; +    $self->{"prefix"} //= "unicode";      return $self;  } @@ -148,7 +149,7 @@ sub range {      my $f=shift;      my $l=shift; -    my $t=shift; +    my $t=shift // 'NONE';      if ($this->{'last_l'} + 1 == $f && $this->{'last'} eq $t)      { @@ -168,7 +169,9 @@ sub output {      $this->_doemit();  # Emit last linebreaking unicode char range class -    print "static const uint8_t unicode_rangetab[][2]={\n"; +    my $prefix = $this->{"prefix"}; + +    print "static const uint8_t ${prefix}_rangetab[][2]={\n";      my $comma="\t"; @@ -183,16 +186,20 @@ sub output {      print "};\n\n"; -    print "static const " . $this->{classtype} . " unicode_classtab[]={\n"; - -    $comma="\t"; -    foreach ( @{$this->{'char_class'}} ) +    unless ($this->{noclass})      { -	print "${comma}$_"; -	$comma=",\n\t"; -    } +	print "static const " . $this->{classtype} +	. " ${prefix}_classtab[]={\n"; -    print "};\n\n"; +	$comma="\t"; +	foreach ( @{$this->{'char_class'}} ) +	{ +	    print "${comma}$_"; +	    $comma=",\n\t"; +	} + +	print "};\n\n"; +    }      my $prev_block=-1; @@ -211,7 +218,7 @@ sub output {  	}      } -    print "static const size_t unicode_starting_indextab[]={\n"; +    print "static const size_t ${prefix}_starting_indextab[]={\n";      $comma="\t"; @@ -221,7 +228,7 @@ sub output {  	$comma=",\n\t";      } -    print "\n};\n\nstatic const char32_t unicode_starting_pagetab[]={\n"; +    print "\n};\n\nstatic const char32_t ${prefix}_starting_pagetab[]={\n";      $comma="\t"; | 
