summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2022-10-27 07:18:16 +0200
committerGeorg Brandl <georg@python.org>2022-10-27 12:15:22 +0200
commit629c448bdcbd7ca9f5d530c0ef10fa3bcd7ccbff (patch)
tree0d16b78a78b188e1f3ef28746b87ada37bdd804e /scripts
parentcffc5df62c258ca39fc7474f7197f2df33ab014f (diff)
downloadpygments-git-regex.tar.gz
all: convert "re" to "regex"regex
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/check_sources.py3
-rw-r--r--scripts/gen_mapfiles.py3
-rw-r--r--scripts/get_vimkw.py2
-rwxr-xr-xscripts/vim2pygments.py3
4 files changed, 7 insertions, 4 deletions
diff --git a/scripts/check_sources.py b/scripts/check_sources.py
index 1feb1a33..26284f17 100755
--- a/scripts/check_sources.py
+++ b/scripts/check_sources.py
@@ -12,11 +12,12 @@
import io
import os
-import re
import sys
import getopt
from os.path import join, splitext, abspath
+import regex as re
+
checkers = {}
diff --git a/scripts/gen_mapfiles.py b/scripts/gen_mapfiles.py
index a5aed0ca..7da79c65 100644
--- a/scripts/gen_mapfiles.py
+++ b/scripts/gen_mapfiles.py
@@ -10,9 +10,10 @@
from importlib import import_module
from pathlib import Path
-import re
import sys
+import regex as re
+
top_src_dir = Path(__file__).parent.parent
pygments_package = top_src_dir / 'pygments'
sys.path.insert(0, str(pygments_package.parent.resolve()))
diff --git a/scripts/get_vimkw.py b/scripts/get_vimkw.py
index 0b2d82ec..e5d70edb 100644
--- a/scripts/get_vimkw.py
+++ b/scripts/get_vimkw.py
@@ -1,4 +1,4 @@
-import re
+import regex as re
from pygments.util import format_lines
diff --git a/scripts/vim2pygments.py b/scripts/vim2pygments.py
index ec9b63b7..42d7d52d 100755
--- a/scripts/vim2pygments.py
+++ b/scripts/vim2pygments.py
@@ -11,10 +11,11 @@
"""
import sys
-import re
from os import path
from io import StringIO
+import regex as re
+
split_re = re.compile(r'(?<!\\)\s+')
SCRIPT_NAME = 'Vim Colorscheme Converter'