]> granicus.if.org Git - python/commitdiff
support C++ comments
authorGuido van Rossum <guido@python.org>
Thu, 14 Aug 1997 20:14:29 +0000 (20:14 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 14 Aug 1997 20:14:29 +0000 (20:14 +0000)
Tools/scripts/h2py.py

index c34073df5fc0d74a91df0f239aee3a767f5c46fe..513fa4bd78aa72ec15c3e3f8c377c4bbbf96b35f 100755 (executable)
@@ -32,8 +32,9 @@ p_macro = regex.compile(
 p_include = regex.compile('^[\t ]*#[\t ]*include[\t ]+<\([a-zA-Z0-9_/\.]+\)')
 
 p_comment = regex.compile('/\*\([^*]+\|\*+[^/]\)*\(\*+/\)?')
+p_cpp_comment = regex.compile('//.*')
 
-ignores = [p_comment]
+ignores = [p_comment, p_cpp_comment]
 
 p_char = regex.compile("'\(\\\\.[^\\\\]*\|[^\\\\]\)'")
 
@@ -48,6 +49,7 @@ except KeyError:
                searchdirs=['/usr/include']
 
 def main():
+       global filedict
        opts, args = getopt.getopt(sys.argv[1:], 'i:')
        for o, a in opts:
                if o == '-i':