Guido van Rossum | 7627c0d | 2000-03-31 14:58:54 +0000 | [diff] [blame] | 1 | # |
| 2 | # Secret Labs' Regular Expression Engine |
Guido van Rossum | 7627c0d | 2000-03-31 14:58:54 +0000 | [diff] [blame] | 3 | # |
| 4 | # various symbols used by the regular expression engine. |
| 5 | # run this script to update the _sre include files! |
| 6 | # |
Fredrik Lundh | 770617b | 2001-01-14 15:06:11 +0000 | [diff] [blame] | 7 | # Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved. |
Guido van Rossum | 7627c0d | 2000-03-31 14:58:54 +0000 | [diff] [blame] | 8 | # |
Fredrik Lundh | 29c4ba9 | 2000-08-01 18:20:07 +0000 | [diff] [blame] | 9 | # See the sre.py file for information on usage and redistribution. |
Guido van Rossum | 7627c0d | 2000-03-31 14:58:54 +0000 | [diff] [blame] | 10 | # |
| 11 | |
Fred Drake | b8f2274 | 2001-09-04 19:10:20 +0000 | [diff] [blame] | 12 | """Internal support module for sre""" |
| 13 | |
Fredrik Lundh | b35ffc0 | 2001-01-15 12:46:09 +0000 | [diff] [blame] | 14 | # update when constants are added or removed |
| 15 | |
Gustavo Niemeyer | ad3fc44 | 2003-10-17 22:13:16 +0000 | [diff] [blame] | 16 | MAGIC = 20031017 |
Fredrik Lundh | b35ffc0 | 2001-01-15 12:46:09 +0000 | [diff] [blame] | 17 | |
Serhiy Storchaka | c8bf95c | 2013-09-20 21:24:39 +0300 | [diff] [blame^] | 18 | try: |
| 19 | from _sre import MAXREPEAT |
| 20 | except ImportError: |
| 21 | import _sre |
| 22 | MAXREPEAT = _sre.MAXREPEAT = 65535 |
Serhiy Storchaka | 9acb9bc | 2013-02-18 11:14:21 +0200 | [diff] [blame] | 23 | |
Fredrik Lundh | b35ffc0 | 2001-01-15 12:46:09 +0000 | [diff] [blame] | 24 | # SRE standard exception (access as sre.error) |
Fredrik Lundh | 436c3d58 | 2000-06-29 08:58:44 +0000 | [diff] [blame] | 25 | # should this really be here? |
| 26 | |
| 27 | class error(Exception): |
| 28 | pass |
| 29 | |
Guido van Rossum | 7627c0d | 2000-03-31 14:58:54 +0000 | [diff] [blame] | 30 | # operators |
| 31 | |
| 32 | FAILURE = "failure" |
| 33 | SUCCESS = "success" |
| 34 | |
| 35 | ANY = "any" |
Fredrik Lundh | e186983 | 2000-08-01 22:47:49 +0000 | [diff] [blame] | 36 | ANY_ALL = "any_all" |
Guido van Rossum | 7627c0d | 2000-03-31 14:58:54 +0000 | [diff] [blame] | 37 | ASSERT = "assert" |
Fredrik Lundh | 43b3b49 | 2000-06-30 10:41:31 +0000 | [diff] [blame] | 38 | ASSERT_NOT = "assert_not" |
Guido van Rossum | 7627c0d | 2000-03-31 14:58:54 +0000 | [diff] [blame] | 39 | AT = "at" |
Fredrik Lundh | 19af43d | 2001-07-02 16:58:38 +0000 | [diff] [blame] | 40 | BIGCHARSET = "bigcharset" |
Guido van Rossum | 7627c0d | 2000-03-31 14:58:54 +0000 | [diff] [blame] | 41 | BRANCH = "branch" |
| 42 | CALL = "call" |
| 43 | CATEGORY = "category" |
Fredrik Lundh | 3562f11 | 2000-07-02 12:00:07 +0000 | [diff] [blame] | 44 | CHARSET = "charset" |
Fredrik Lundh | 72b82ba | 2000-07-03 21:31:48 +0000 | [diff] [blame] | 45 | GROUPREF = "groupref" |
| 46 | GROUPREF_IGNORE = "groupref_ignore" |
Gustavo Niemeyer | ad3fc44 | 2003-10-17 22:13:16 +0000 | [diff] [blame] | 47 | GROUPREF_EXISTS = "groupref_exists" |
Guido van Rossum | 7627c0d | 2000-03-31 14:58:54 +0000 | [diff] [blame] | 48 | IN = "in" |
| 49 | IN_IGNORE = "in_ignore" |
Fredrik Lundh | 436c3d58 | 2000-06-29 08:58:44 +0000 | [diff] [blame] | 50 | INFO = "info" |
Guido van Rossum | 7627c0d | 2000-03-31 14:58:54 +0000 | [diff] [blame] | 51 | JUMP = "jump" |
| 52 | LITERAL = "literal" |
| 53 | LITERAL_IGNORE = "literal_ignore" |
| 54 | MARK = "mark" |
| 55 | MAX_REPEAT = "max_repeat" |
Fredrik Lundh | 29c4ba9 | 2000-08-01 18:20:07 +0000 | [diff] [blame] | 56 | MAX_UNTIL = "max_until" |
Guido van Rossum | 7627c0d | 2000-03-31 14:58:54 +0000 | [diff] [blame] | 57 | MIN_REPEAT = "min_repeat" |
Fredrik Lundh | 29c4ba9 | 2000-08-01 18:20:07 +0000 | [diff] [blame] | 58 | MIN_UNTIL = "min_until" |
Guido van Rossum | 7627c0d | 2000-03-31 14:58:54 +0000 | [diff] [blame] | 59 | NEGATE = "negate" |
| 60 | NOT_LITERAL = "not_literal" |
| 61 | NOT_LITERAL_IGNORE = "not_literal_ignore" |
| 62 | RANGE = "range" |
| 63 | REPEAT = "repeat" |
Fredrik Lundh | 436c3d58 | 2000-06-29 08:58:44 +0000 | [diff] [blame] | 64 | REPEAT_ONE = "repeat_one" |
Guido van Rossum | 7627c0d | 2000-03-31 14:58:54 +0000 | [diff] [blame] | 65 | SUBPATTERN = "subpattern" |
Guido van Rossum | 41c99e7 | 2003-04-14 17:59:34 +0000 | [diff] [blame] | 66 | MIN_REPEAT_ONE = "min_repeat_one" |
Guido van Rossum | 7627c0d | 2000-03-31 14:58:54 +0000 | [diff] [blame] | 67 | |
| 68 | # positions |
| 69 | AT_BEGINNING = "at_beginning" |
Jeremy Hylton | b1aa195 | 2000-06-01 17:39:12 +0000 | [diff] [blame] | 70 | AT_BEGINNING_LINE = "at_beginning_line" |
Fredrik Lundh | 770617b | 2001-01-14 15:06:11 +0000 | [diff] [blame] | 71 | AT_BEGINNING_STRING = "at_beginning_string" |
Guido van Rossum | 7627c0d | 2000-03-31 14:58:54 +0000 | [diff] [blame] | 72 | AT_BOUNDARY = "at_boundary" |
| 73 | AT_NON_BOUNDARY = "at_non_boundary" |
| 74 | AT_END = "at_end" |
Jeremy Hylton | b1aa195 | 2000-06-01 17:39:12 +0000 | [diff] [blame] | 75 | AT_END_LINE = "at_end_line" |
Fredrik Lundh | 770617b | 2001-01-14 15:06:11 +0000 | [diff] [blame] | 76 | AT_END_STRING = "at_end_string" |
Fredrik Lundh | b25e1ad | 2001-03-22 15:50:10 +0000 | [diff] [blame] | 77 | AT_LOC_BOUNDARY = "at_loc_boundary" |
| 78 | AT_LOC_NON_BOUNDARY = "at_loc_non_boundary" |
| 79 | AT_UNI_BOUNDARY = "at_uni_boundary" |
| 80 | AT_UNI_NON_BOUNDARY = "at_uni_non_boundary" |
Guido van Rossum | 7627c0d | 2000-03-31 14:58:54 +0000 | [diff] [blame] | 81 | |
| 82 | # categories |
Guido van Rossum | 7627c0d | 2000-03-31 14:58:54 +0000 | [diff] [blame] | 83 | CATEGORY_DIGIT = "category_digit" |
| 84 | CATEGORY_NOT_DIGIT = "category_not_digit" |
| 85 | CATEGORY_SPACE = "category_space" |
| 86 | CATEGORY_NOT_SPACE = "category_not_space" |
| 87 | CATEGORY_WORD = "category_word" |
| 88 | CATEGORY_NOT_WORD = "category_not_word" |
Jeremy Hylton | b1aa195 | 2000-06-01 17:39:12 +0000 | [diff] [blame] | 89 | CATEGORY_LINEBREAK = "category_linebreak" |
| 90 | CATEGORY_NOT_LINEBREAK = "category_not_linebreak" |
Jeremy Hylton | b1aa195 | 2000-06-01 17:39:12 +0000 | [diff] [blame] | 91 | CATEGORY_LOC_WORD = "category_loc_word" |
| 92 | CATEGORY_LOC_NOT_WORD = "category_loc_not_word" |
Fredrik Lundh | 436c3d58 | 2000-06-29 08:58:44 +0000 | [diff] [blame] | 93 | CATEGORY_UNI_DIGIT = "category_uni_digit" |
| 94 | CATEGORY_UNI_NOT_DIGIT = "category_uni_not_digit" |
| 95 | CATEGORY_UNI_SPACE = "category_uni_space" |
| 96 | CATEGORY_UNI_NOT_SPACE = "category_uni_not_space" |
| 97 | CATEGORY_UNI_WORD = "category_uni_word" |
| 98 | CATEGORY_UNI_NOT_WORD = "category_uni_not_word" |
| 99 | CATEGORY_UNI_LINEBREAK = "category_uni_linebreak" |
| 100 | CATEGORY_UNI_NOT_LINEBREAK = "category_uni_not_linebreak" |
Guido van Rossum | 7627c0d | 2000-03-31 14:58:54 +0000 | [diff] [blame] | 101 | |
Jeremy Hylton | b1aa195 | 2000-06-01 17:39:12 +0000 | [diff] [blame] | 102 | OPCODES = [ |
Guido van Rossum | 7627c0d | 2000-03-31 14:58:54 +0000 | [diff] [blame] | 103 | |
| 104 | # failure=0 success=1 (just because it looks better that way :-) |
| 105 | FAILURE, SUCCESS, |
| 106 | |
Fredrik Lundh | e186983 | 2000-08-01 22:47:49 +0000 | [diff] [blame] | 107 | ANY, ANY_ALL, |
Fredrik Lundh | 43b3b49 | 2000-06-30 10:41:31 +0000 | [diff] [blame] | 108 | ASSERT, ASSERT_NOT, |
Guido van Rossum | 7627c0d | 2000-03-31 14:58:54 +0000 | [diff] [blame] | 109 | AT, |
| 110 | BRANCH, |
| 111 | CALL, |
| 112 | CATEGORY, |
Fredrik Lundh | 19af43d | 2001-07-02 16:58:38 +0000 | [diff] [blame] | 113 | CHARSET, BIGCHARSET, |
Gustavo Niemeyer | ad3fc44 | 2003-10-17 22:13:16 +0000 | [diff] [blame] | 114 | GROUPREF, GROUPREF_EXISTS, GROUPREF_IGNORE, |
Guido van Rossum | 7627c0d | 2000-03-31 14:58:54 +0000 | [diff] [blame] | 115 | IN, IN_IGNORE, |
Fredrik Lundh | 436c3d58 | 2000-06-29 08:58:44 +0000 | [diff] [blame] | 116 | INFO, |
Guido van Rossum | 7627c0d | 2000-03-31 14:58:54 +0000 | [diff] [blame] | 117 | JUMP, |
| 118 | LITERAL, LITERAL_IGNORE, |
| 119 | MARK, |
Fredrik Lundh | 29c4ba9 | 2000-08-01 18:20:07 +0000 | [diff] [blame] | 120 | MAX_UNTIL, |
| 121 | MIN_UNTIL, |
Guido van Rossum | 7627c0d | 2000-03-31 14:58:54 +0000 | [diff] [blame] | 122 | NOT_LITERAL, NOT_LITERAL_IGNORE, |
| 123 | NEGATE, |
| 124 | RANGE, |
Fredrik Lundh | 29c4ba9 | 2000-08-01 18:20:07 +0000 | [diff] [blame] | 125 | REPEAT, |
| 126 | REPEAT_ONE, |
Guido van Rossum | 41c99e7 | 2003-04-14 17:59:34 +0000 | [diff] [blame] | 127 | SUBPATTERN, |
| 128 | MIN_REPEAT_ONE |
Guido van Rossum | 7627c0d | 2000-03-31 14:58:54 +0000 | [diff] [blame] | 129 | |
| 130 | ] |
| 131 | |
Jeremy Hylton | b1aa195 | 2000-06-01 17:39:12 +0000 | [diff] [blame] | 132 | ATCODES = [ |
Fredrik Lundh | 770617b | 2001-01-14 15:06:11 +0000 | [diff] [blame] | 133 | AT_BEGINNING, AT_BEGINNING_LINE, AT_BEGINNING_STRING, AT_BOUNDARY, |
Fredrik Lundh | b25e1ad | 2001-03-22 15:50:10 +0000 | [diff] [blame] | 134 | AT_NON_BOUNDARY, AT_END, AT_END_LINE, AT_END_STRING, |
| 135 | AT_LOC_BOUNDARY, AT_LOC_NON_BOUNDARY, AT_UNI_BOUNDARY, |
| 136 | AT_UNI_NON_BOUNDARY |
Jeremy Hylton | b1aa195 | 2000-06-01 17:39:12 +0000 | [diff] [blame] | 137 | ] |
| 138 | |
| 139 | CHCODES = [ |
| 140 | CATEGORY_DIGIT, CATEGORY_NOT_DIGIT, CATEGORY_SPACE, |
| 141 | CATEGORY_NOT_SPACE, CATEGORY_WORD, CATEGORY_NOT_WORD, |
Fredrik Lundh | 436c3d58 | 2000-06-29 08:58:44 +0000 | [diff] [blame] | 142 | CATEGORY_LINEBREAK, CATEGORY_NOT_LINEBREAK, CATEGORY_LOC_WORD, |
| 143 | CATEGORY_LOC_NOT_WORD, CATEGORY_UNI_DIGIT, CATEGORY_UNI_NOT_DIGIT, |
| 144 | CATEGORY_UNI_SPACE, CATEGORY_UNI_NOT_SPACE, CATEGORY_UNI_WORD, |
| 145 | CATEGORY_UNI_NOT_WORD, CATEGORY_UNI_LINEBREAK, |
| 146 | CATEGORY_UNI_NOT_LINEBREAK |
Jeremy Hylton | b1aa195 | 2000-06-01 17:39:12 +0000 | [diff] [blame] | 147 | ] |
| 148 | |
| 149 | def makedict(list): |
| 150 | d = {} |
| 151 | i = 0 |
| 152 | for item in list: |
Fredrik Lundh | 43b3b49 | 2000-06-30 10:41:31 +0000 | [diff] [blame] | 153 | d[item] = i |
| 154 | i = i + 1 |
Jeremy Hylton | b1aa195 | 2000-06-01 17:39:12 +0000 | [diff] [blame] | 155 | return d |
| 156 | |
| 157 | OPCODES = makedict(OPCODES) |
| 158 | ATCODES = makedict(ATCODES) |
| 159 | CHCODES = makedict(CHCODES) |
Guido van Rossum | 7627c0d | 2000-03-31 14:58:54 +0000 | [diff] [blame] | 160 | |
| 161 | # replacement operations for "ignore case" mode |
Jeremy Hylton | b1aa195 | 2000-06-01 17:39:12 +0000 | [diff] [blame] | 162 | OP_IGNORE = { |
Fredrik Lundh | 72b82ba | 2000-07-03 21:31:48 +0000 | [diff] [blame] | 163 | GROUPREF: GROUPREF_IGNORE, |
Guido van Rossum | 7627c0d | 2000-03-31 14:58:54 +0000 | [diff] [blame] | 164 | IN: IN_IGNORE, |
| 165 | LITERAL: LITERAL_IGNORE, |
| 166 | NOT_LITERAL: NOT_LITERAL_IGNORE |
| 167 | } |
| 168 | |
Jeremy Hylton | b1aa195 | 2000-06-01 17:39:12 +0000 | [diff] [blame] | 169 | AT_MULTILINE = { |
| 170 | AT_BEGINNING: AT_BEGINNING_LINE, |
| 171 | AT_END: AT_END_LINE |
Guido van Rossum | 7627c0d | 2000-03-31 14:58:54 +0000 | [diff] [blame] | 172 | } |
| 173 | |
Fredrik Lundh | b25e1ad | 2001-03-22 15:50:10 +0000 | [diff] [blame] | 174 | AT_LOCALE = { |
| 175 | AT_BOUNDARY: AT_LOC_BOUNDARY, |
| 176 | AT_NON_BOUNDARY: AT_LOC_NON_BOUNDARY |
| 177 | } |
| 178 | |
| 179 | AT_UNICODE = { |
| 180 | AT_BOUNDARY: AT_UNI_BOUNDARY, |
| 181 | AT_NON_BOUNDARY: AT_UNI_NON_BOUNDARY |
| 182 | } |
| 183 | |
Jeremy Hylton | b1aa195 | 2000-06-01 17:39:12 +0000 | [diff] [blame] | 184 | CH_LOCALE = { |
Fredrik Lundh | 436c3d58 | 2000-06-29 08:58:44 +0000 | [diff] [blame] | 185 | CATEGORY_DIGIT: CATEGORY_DIGIT, |
| 186 | CATEGORY_NOT_DIGIT: CATEGORY_NOT_DIGIT, |
| 187 | CATEGORY_SPACE: CATEGORY_SPACE, |
| 188 | CATEGORY_NOT_SPACE: CATEGORY_NOT_SPACE, |
Jeremy Hylton | b1aa195 | 2000-06-01 17:39:12 +0000 | [diff] [blame] | 189 | CATEGORY_WORD: CATEGORY_LOC_WORD, |
| 190 | CATEGORY_NOT_WORD: CATEGORY_LOC_NOT_WORD, |
Fredrik Lundh | 436c3d58 | 2000-06-29 08:58:44 +0000 | [diff] [blame] | 191 | CATEGORY_LINEBREAK: CATEGORY_LINEBREAK, |
| 192 | CATEGORY_NOT_LINEBREAK: CATEGORY_NOT_LINEBREAK |
| 193 | } |
| 194 | |
| 195 | CH_UNICODE = { |
| 196 | CATEGORY_DIGIT: CATEGORY_UNI_DIGIT, |
| 197 | CATEGORY_NOT_DIGIT: CATEGORY_UNI_NOT_DIGIT, |
| 198 | CATEGORY_SPACE: CATEGORY_UNI_SPACE, |
| 199 | CATEGORY_NOT_SPACE: CATEGORY_UNI_NOT_SPACE, |
| 200 | CATEGORY_WORD: CATEGORY_UNI_WORD, |
| 201 | CATEGORY_NOT_WORD: CATEGORY_UNI_NOT_WORD, |
| 202 | CATEGORY_LINEBREAK: CATEGORY_UNI_LINEBREAK, |
| 203 | CATEGORY_NOT_LINEBREAK: CATEGORY_UNI_NOT_LINEBREAK |
Guido van Rossum | 7627c0d | 2000-03-31 14:58:54 +0000 | [diff] [blame] | 204 | } |
| 205 | |
Jeremy Hylton | b1aa195 | 2000-06-01 17:39:12 +0000 | [diff] [blame] | 206 | # flags |
Fredrik Lundh | 3562f11 | 2000-07-02 12:00:07 +0000 | [diff] [blame] | 207 | SRE_FLAG_TEMPLATE = 1 # template mode (disable backtracking) |
| 208 | SRE_FLAG_IGNORECASE = 2 # case insensitive |
Fredrik Lundh | 8a3ebf8 | 2000-07-23 21:46:17 +0000 | [diff] [blame] | 209 | SRE_FLAG_LOCALE = 4 # honour system locale |
Fredrik Lundh | 3562f11 | 2000-07-02 12:00:07 +0000 | [diff] [blame] | 210 | SRE_FLAG_MULTILINE = 8 # treat target as multiline string |
| 211 | SRE_FLAG_DOTALL = 16 # treat target as a single string |
Antoine Pitrou | fd03645 | 2008-08-19 17:56:33 +0000 | [diff] [blame] | 212 | SRE_FLAG_UNICODE = 32 # use unicode "locale" |
Fredrik Lundh | 3562f11 | 2000-07-02 12:00:07 +0000 | [diff] [blame] | 213 | SRE_FLAG_VERBOSE = 64 # ignore whitespace and comments |
Fredrik Lundh | 770617b | 2001-01-14 15:06:11 +0000 | [diff] [blame] | 214 | SRE_FLAG_DEBUG = 128 # debugging |
Antoine Pitrou | fd03645 | 2008-08-19 17:56:33 +0000 | [diff] [blame] | 215 | SRE_FLAG_ASCII = 256 # use ascii "locale" |
Fredrik Lundh | 3562f11 | 2000-07-02 12:00:07 +0000 | [diff] [blame] | 216 | |
| 217 | # flags for INFO primitive |
| 218 | SRE_INFO_PREFIX = 1 # has prefix |
| 219 | SRE_INFO_LITERAL = 2 # entire pattern is literal (given by prefix) |
| 220 | SRE_INFO_CHARSET = 4 # pattern starts with character from given set |
Jeremy Hylton | b1aa195 | 2000-06-01 17:39:12 +0000 | [diff] [blame] | 221 | |
Guido van Rossum | 7627c0d | 2000-03-31 14:58:54 +0000 | [diff] [blame] | 222 | if __name__ == "__main__": |
Jeremy Hylton | b1aa195 | 2000-06-01 17:39:12 +0000 | [diff] [blame] | 223 | def dump(f, d, prefix): |
Serhiy Storchaka | 385ecd8 | 2013-01-24 13:43:02 +0200 | [diff] [blame] | 224 | items = sorted(d.items(), key=lambda a: a[1]) |
Fredrik Lundh | 43b3b49 | 2000-06-30 10:41:31 +0000 | [diff] [blame] | 225 | for k, v in items: |
Barry Warsaw | 8bee761 | 2004-08-25 02:22:30 +0000 | [diff] [blame] | 226 | f.write("#define %s_%s %s\n" % (prefix, k.upper(), v)) |
Guido van Rossum | 7627c0d | 2000-03-31 14:58:54 +0000 | [diff] [blame] | 227 | f = open("sre_constants.h", "w") |
Fredrik Lundh | 43b3b49 | 2000-06-30 10:41:31 +0000 | [diff] [blame] | 228 | f.write("""\ |
| 229 | /* |
| 230 | * Secret Labs' Regular Expression Engine |
| 231 | * |
| 232 | * regular expression matching engine |
| 233 | * |
| 234 | * NOTE: This file is generated by sre_constants.py. If you need |
| 235 | * to change anything in here, edit sre_constants.py and run it. |
| 236 | * |
Fredrik Lundh | 770617b | 2001-01-14 15:06:11 +0000 | [diff] [blame] | 237 | * Copyright (c) 1997-2001 by Secret Labs AB. All rights reserved. |
Fredrik Lundh | 43b3b49 | 2000-06-30 10:41:31 +0000 | [diff] [blame] | 238 | * |
| 239 | * See the _sre.c file for information on usage and redistribution. |
| 240 | */ |
| 241 | |
| 242 | """) |
| 243 | |
Fredrik Lundh | b35ffc0 | 2001-01-15 12:46:09 +0000 | [diff] [blame] | 244 | f.write("#define SRE_MAGIC %d\n" % MAGIC) |
| 245 | |
Jeremy Hylton | b1aa195 | 2000-06-01 17:39:12 +0000 | [diff] [blame] | 246 | dump(f, OPCODES, "SRE_OP") |
| 247 | dump(f, ATCODES, "SRE") |
| 248 | dump(f, CHCODES, "SRE") |
Fredrik Lundh | 3562f11 | 2000-07-02 12:00:07 +0000 | [diff] [blame] | 249 | |
Fredrik Lundh | 436c3d58 | 2000-06-29 08:58:44 +0000 | [diff] [blame] | 250 | f.write("#define SRE_FLAG_TEMPLATE %d\n" % SRE_FLAG_TEMPLATE) |
| 251 | f.write("#define SRE_FLAG_IGNORECASE %d\n" % SRE_FLAG_IGNORECASE) |
| 252 | f.write("#define SRE_FLAG_LOCALE %d\n" % SRE_FLAG_LOCALE) |
| 253 | f.write("#define SRE_FLAG_MULTILINE %d\n" % SRE_FLAG_MULTILINE) |
| 254 | f.write("#define SRE_FLAG_DOTALL %d\n" % SRE_FLAG_DOTALL) |
| 255 | f.write("#define SRE_FLAG_UNICODE %d\n" % SRE_FLAG_UNICODE) |
| 256 | f.write("#define SRE_FLAG_VERBOSE %d\n" % SRE_FLAG_VERBOSE) |
Fredrik Lundh | 3562f11 | 2000-07-02 12:00:07 +0000 | [diff] [blame] | 257 | |
| 258 | f.write("#define SRE_INFO_PREFIX %d\n" % SRE_INFO_PREFIX) |
| 259 | f.write("#define SRE_INFO_LITERAL %d\n" % SRE_INFO_LITERAL) |
| 260 | f.write("#define SRE_INFO_CHARSET %d\n" % SRE_INFO_CHARSET) |
| 261 | |
Guido van Rossum | 7627c0d | 2000-03-31 14:58:54 +0000 | [diff] [blame] | 262 | f.close() |
Guido van Rossum | be19ed7 | 2007-02-09 05:37:30 +0000 | [diff] [blame] | 263 | print("done") |