This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
mktables: Create tables for charname beginning and follow-on
authorKarl Williamson <public@khwilliamson.com>
Thu, 8 Nov 2012 17:59:11 +0000 (10:59 -0700)
committerKarl Williamson <public@khwilliamson.com>
Sun, 11 Nov 2012 17:11:33 +0000 (10:11 -0700)
mktables is changed to add two new tables, one that matches the first
character in a character names, and one that matches continuation
characters.

lib/unicore/mktables

index 6e6d1f5..127e59d 100644 (file)
@@ -13213,7 +13213,7 @@ sub compile_perl() {
                 Initialize => $Blank + $VertSpace,
     );
     $Space->add_alias('XPosixSpace');
-    $perl->add_match_table("PosixSpace",
+    my $posix_space = $perl->add_match_table("PosixSpace",
                             Description => "\\t, \\n, \\cK, \\f, \\r, and ' '.  (\\cK is vertical tab)",
                             Initialize => $Space & $ASCII,
                             );
@@ -13480,6 +13480,23 @@ sub compile_perl() {
 
     $perl_xidc &= $Word;
 
+    my $charname_begin = $perl->add_match_table('_Perl_Charname_Begin',
+                    Perl_Extension => 1,
+                    Fate => $INTERNAL_ONLY,
+                    Initialize => $gc->table('Letter') & $Alpha & $perl_xids,
+                    );
+
+    my $charname_continue = $perl->add_match_table('_Perl_Charname_Continue',
+                        Perl_Extension => 1,
+                        Fate => $INTERNAL_ONLY,
+                        Initialize => $perl_xidc
+                                    + 0x0020        # SPACE
+                                    + 0x0028        # (
+                                    + 0x0029        # )
+                                    + 0x002D        # -
+                                    + 0x00A0        # NBSP
+                        );
+
     # These two tables are for matching \X, which is based on the 'extended'
     # grapheme cluster, which came in 5.1; create empty ones if not already
     # present.  The straight 'grapheme cluster' (non-extended) is used prior