From: Guido van Rossum Date: Fri, 5 Jun 1992 15:13:53 +0000 (+0000) Subject: Fix regexp recognizing comments to cope with unterminated comments. X-Git-Tag: v0.9.8~285 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=047979e3d5d30feee560f98c9c8d65029a4cbe37;p=thirdparty%2FPython%2Fcpython.git Fix regexp recognizing comments to cope with unterminated comments. --- diff --git a/Tools/scripts/h2py.py b/Tools/scripts/h2py.py index ff2afc24d068..2fc26d81f86f 100755 --- a/Tools/scripts/h2py.py +++ b/Tools/scripts/h2py.py @@ -1,4 +1,3 @@ -#! /ufs/guido/bin/sgi/python #! /usr/local/python # Read #define's from stdin and translate to Python code on stdout. @@ -18,7 +17,7 @@ import sys, regex, string p_define = regex.compile('^#[\t ]*define[\t ]+\([a-zA-Z0-9_]+\)[\t ]+') -p_comment = regex.compile('/\*\([^*]+\|\*+[^/]\)*\*+/') +p_comment = regex.compile('/\*\([^*]+\|\*+[^/]\)*\(\*+/\)?') def main(): process(sys.stdin)