summaryrefslogtreecommitdiffstats
path: root/Tools/scripts
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1996-08-22 23:12:23 (GMT)
committerGuido van Rossum <guido@python.org>1996-08-22 23:12:23 (GMT)
commit6100d914e8a628d4b7f33dbbbd4f20d88807e4a7 (patch)
treebac33678d74904f5ace85299cd8a998cbdbb8905 /Tools/scripts
parentac279109d4c4cdcda01afea224464b7d9ebe314e (diff)
downloadcpython-6100d914e8a628d4b7f33dbbbd4f20d88807e4a7.zip
cpython-6100d914e8a628d4b7f33dbbbd4f20d88807e4a7.tar.gz
cpython-6100d914e8a628d4b7f33dbbbd4f20d88807e4a7.tar.bz2
Allow whitespace before '#' in preprocessor directives.
Diffstat (limited to 'Tools/scripts')
-rwxr-xr-xTools/scripts/h2py.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Tools/scripts/h2py.py b/Tools/scripts/h2py.py
index 4cea235..581f92f 100755
--- a/Tools/scripts/h2py.py
+++ b/Tools/scripts/h2py.py
@@ -23,12 +23,13 @@
import sys, regex, regsub, string, getopt, os
-p_define = regex.compile('^#[\t ]*define[\t ]+\([a-zA-Z0-9_]+\)[\t ]+')
+p_define = regex.compile('^[\t ]*#[\t ]*define[\t ]+\([a-zA-Z0-9_]+\)[\t ]+')
p_macro = regex.compile(
- '^#[\t ]*define[\t ]+\([a-zA-Z0-9_]+\)(\([_a-zA-Z][_a-zA-Z0-9]*\))[\t ]+')
+ '^[\t ]*#[\t ]*define[\t ]+'
+ '\([a-zA-Z0-9_]+\)(\([_a-zA-Z][_a-zA-Z0-9]*\))[\t ]+')
-p_include = regex.compile('^#[\t ]*include[\t ]+<\([a-zA-Z0-9_/\.]+\)')
+p_include = regex.compile('^[\t ]*#[\t ]*include[\t ]+<\([a-zA-Z0-9_/\.]+\)')
p_comment = regex.compile('/\*\([^*]+\|\*+[^/]\)*\(\*+/\)?')