]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Allow whitespace before '#' in preprocessor directives.
authorGuido van Rossum <guido@python.org>
Thu, 22 Aug 1996 23:12:23 +0000 (23:12 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 22 Aug 1996 23:12:23 +0000 (23:12 +0000)
Tools/scripts/h2py.py

index 4cea2353cb7595dbb95886b0cbc023bf7f5f448b..581f92f288afd5353d5c93dedf7f533ce0e9913e 100755 (executable)
 
 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('/\*\([^*]+\|\*+[^/]\)*\(\*+/\)?')