Revision 12754
Added by Aaron Marcuse-Kubitza almost 11 years ago
trunk/bin/repl | ||
---|---|---|
61 | 61 |
# don't try to match word w/ suffix, because there are cases |
62 | 62 |
# where a mapping adds a suffix which would cause the same |
63 | 63 |
# replacement to be performed repeatedly |
64 |
in_word_re = (excluded_prefix_re+r'\b'+in_str_re+r'\b' |
|
64 |
in_word_re = r'\b'+in_str_re+r'\b' |
|
65 |
|
|
66 |
# only use excluded_prefix_re/excluded_suffix_re in text |
|
67 |
# mode (used in renaming columns in SQL scripts), to prevent |
|
68 |
# the special coding for column renames from also affecting |
|
69 |
# regular regexp/word replacements |
|
70 |
if text: in_word_re = (excluded_prefix_re+in_word_re |
|
65 | 71 |
+excluded_suffix_re) |
72 |
|
|
66 | 73 |
in_ = '(?:'+in_+'|'+in_word_re+')' |
67 | 74 |
repls.append((r'(?m)'+in_, out)) |
68 | 75 |
stream.close() |
Also available in: Unified diff
bugfix: bin/repl: only use excluded_prefix_re/excluded_suffix_re in text mode (used in renaming columns in SQL scripts), to prevent the special coding for column renames from also affecting regular regexp/word replacements