From: Guido van Rossum Date: Thu, 22 Aug 1996 23:12:23 +0000 (+0000) Subject: Allow whitespace before '#' in preprocessor directives. X-Git-Tag: v1.4b3~45 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6100d914e8a628d4b7f33dbbbd4f20d88807e4a7;p=thirdparty%2FPython%2Fcpython.git Allow whitespace before '#' in preprocessor directives. --- diff --git a/Tools/scripts/h2py.py b/Tools/scripts/h2py.py index 4cea2353cb75..581f92f288af 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('/\*\([^*]+\|\*+[^/]\)*\(\*+/\)?')