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

Skip to content

Commit 047979e

Browse files
committed
Fix regexp recognizing comments to cope with unterminated comments.
1 parent aad5344 commit 047979e

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

Tools/scripts/h2py.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#! /ufs/guido/bin/sgi/python
21
#! /usr/local/python
32

43
# Read #define's from stdin and translate to Python code on stdout.
@@ -18,7 +17,7 @@
1817

1918
p_define = regex.compile('^#[\t ]*define[\t ]+\([a-zA-Z0-9_]+\)[\t ]+')
2019

21-
p_comment = regex.compile('/\*\([^*]+\|\*+[^/]\)*\*+/')
20+
p_comment = regex.compile('/\*\([^*]+\|\*+[^/]\)*\(\*+/\)?')
2221

2322
def main():
2423
process(sys.stdin)

0 commit comments

Comments
 (0)