Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9189bda

Browse files
committed
support C++ comments
1 parent 5526e39 commit 9189bda

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Tools/scripts/h2py.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@
3232
p_include = regex.compile('^[\t ]*#[\t ]*include[\t ]+<\([a-zA-Z0-9_/\.]+\)')
3333

3434
p_comment = regex.compile('/\*\([^*]+\|\*+[^/]\)*\(\*+/\)?')
35+
p_cpp_comment = regex.compile('//.*')
3536

36-
ignores = [p_comment]
37+
ignores = [p_comment, p_cpp_comment]
3738

3839
p_char = regex.compile("'\(\\\\.[^\\\\]*\|[^\\\\]\)'")
3940

@@ -48,6 +49,7 @@
4849
searchdirs=['/usr/include']
4950

5051
def main():
52+
global filedict
5153
opts, args = getopt.getopt(sys.argv[1:], 'i:')
5254
for o, a in opts:
5355
if o == '-i':

0 commit comments

Comments
 (0)