This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
t/loc_tools.pl: Add fcn to return valid locale cats
[perl5.git] / keywords.c
index 1576d4a..9fa30e6 100644 (file)
@@ -950,7 +950,7 @@ Perl_keyword (pTHX_ const char *name, I32 len, bool all_keywords)
           goto unknown;
       }
 
-    case 5: /* 38 tokens of length 5 */
+    case 5: /* 39 tokens of length 5 */
       switch (name[0])
       {
         case 'B':
@@ -1003,15 +1003,31 @@ Perl_keyword (pTHX_ const char *name, I32 len, bool all_keywords)
           }
 
         case 'b':
-          if (name[1] == 'l' &&
-              name[2] == 'e' &&
-              name[3] == 's' &&
-              name[4] == 's')
-          {                                       /* bless            */
-            return -KEY_bless;
-          }
+          switch (name[1])
+          {
+            case 'l':
+              if (name[2] == 'e' &&
+                  name[3] == 's' &&
+                  name[4] == 's')
+              {                                   /* bless            */
+                return -KEY_bless;
+              }
 
-          goto unknown;
+              goto unknown;
+
+            case 'r':
+              if (name[2] == 'e' &&
+                  name[3] == 'a' &&
+                  name[4] == 'k')
+              {                                   /* break            */
+                return (all_keywords || FEATURE_SWITCH_IS_ENABLED ? -KEY_break : 0);
+              }
+
+              goto unknown;
+
+            default:
+              goto unknown;
+          }
 
         case 'c':
           switch (name[1])
@@ -1887,7 +1903,7 @@ Perl_keyword (pTHX_ const char *name, I32 len, bool all_keywords)
           goto unknown;
       }
 
-    case 7: /* 29 tokens of length 7 */
+    case 7: /* 30 tokens of length 7 */
       switch (name[0])
       {
         case 'D':
@@ -1979,13 +1995,33 @@ Perl_keyword (pTHX_ const char *name, I32 len, bool all_keywords)
               goto unknown;
 
             case 'e':
-              if (name[2] == 'f' &&
-                  name[3] == 'i' &&
-                  name[4] == 'n' &&
-                  name[5] == 'e' &&
-                  name[6] == 'd')
-              {                                   /* defined          */
-                return KEY_defined;
+              if (name[2] == 'f')
+              {
+                switch (name[3])
+                {
+                  case 'a':
+                    if (name[4] == 'u' &&
+                        name[5] == 'l' &&
+                        name[6] == 't')
+                    {                             /* default          */
+                      return (all_keywords || FEATURE_SWITCH_IS_ENABLED ? KEY_default : 0);
+                    }
+
+                    goto unknown;
+
+                  case 'i':
+                    if (name[4] == 'n' &&
+                        name[5] == 'e' &&
+                        name[6] == 'd')
+                    {                             /* defined          */
+                      return KEY_defined;
+                    }
+
+                    goto unknown;
+
+                  default:
+                    goto unknown;
+                }
               }
 
               goto unknown;
@@ -3401,5 +3437,5 @@ unknown:
 }
 
 /* Generated from:
- * 50664fad65e719c51bf369702163eb7ade79f997461f928cc20f1e1bcf8369b8 regen/keywords.pl
+ * db0472e0ad4f44bd0816cad799d63b60d1bbd7e11cef40ea15bf0d00f69669f6 regen/keywords.pl
  * ex: set ro: */