]> granicus.if.org Git - python/commitdiff
Add syntax for hex,octal
authorGuido van Rossum <guido@python.org>
Wed, 13 Aug 1997 03:21:14 +0000 (03:21 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 13 Aug 1997 03:21:14 +0000 (03:21 +0000)
Modules/regexpr.c
Modules/regexpr.h

index 2d30171f421a511a473eb5e8c78ad85d3f7c7656..663e1de00a02ebcb3948581d227cc352afb2f5b9 100644 (file)
@@ -486,7 +486,13 @@ void re_compile_initialize(void)
                for (a = 'A'; a <= 'Z'; a++)
                        re_syntax_table[a] = Sword;
                for (a = '0'; a <= '9'; a++)
-                       re_syntax_table[a] = Sword | Sdigit;
+                       re_syntax_table[a] = Sword | Sdigit | Shexdigit;
+               for (a = '0'; a <= '7'; a++)
+                       re_syntax_table[a] |= Soctaldigit;
+               for (a = 'A'; a <= 'F'; a++)
+                       re_syntax_table[a] |= Shexdigit;
+               for (a = 'a'; a <= 'f'; a++)
+                       re_syntax_table[a] |= Shexdigit;
                re_syntax_table['_'] = Sword;
                for (a = 9; a <= 13; a++)
                        re_syntax_table[a] = Swhitespace;
index 91f00b9504ca039e19f909d3a69ff8c214ecb57d..9ac2ab96c0f7eadb0575fd771664760fa5efbe28 100644 (file)
@@ -70,6 +70,8 @@ typedef struct re_registers
 #define Sword       1
 #define Swhitespace 2
 #define Sdigit      4
+#define Soctaldigit 8
+#define Shexdigit   16
 
 /* Rename all exported symbols to avoid conflicts with similarly named
    symbols in some systems' standard C libraries... */