diff --git a/SPCompletions.py b/SPCompletions.py index 5898bb4..0393c6b 100644 --- a/SPCompletions.py +++ b/SPCompletions.py @@ -442,22 +442,22 @@ def process_lines(line_reader, node): break # strip multiline comments if only written on single line - # buffer = comment_re.sub('', buffer) - # buffer = buffer.strip() - # if not buffer or buffer.startswith('//'): - # continue + buffer = comment_re.sub('', buffer) + buffer = buffer.strip() + if not buffer or buffer.startswith('//'): + continue - # # assumes no nested comments. compiler marks those as invalid - # while buffer.startswith('/*'): - # # print('Skipping multi-line comment') - # pos = buffer.find('*/'); - # while pos == -1: - # buffer = read_line(line_reader) - # pos = buffer.find('*/') - # buffer = buffer[pos+2:].strip() - - # if not buffer or buffer.startswith('//'): - # continue + # assumes no nested comments. compiler marks those as invalid + while buffer.startswith('/*'): + # print('Skipping multi-line comment') + pos = buffer.find('*/'); + while pos == -1: + buffer = read_line(line_reader) + pos = buffer.find('*/') + buffer = buffer[pos+2:].strip() + + if not buffer or buffer.startswith('//'): + continue if brace_level == 0: m = enum_re.search(buffer) @@ -776,4 +776,4 @@ def read_string(buffer, found_comment, brace_level): function_re = re.compile(r'^[ \t]*(?:(native|stock|forward)\b[ \t]+)?(?:([\w_]+)(?:[ \t]+|:))?([\w_]+[ \t]*\()') fullfunction_re = re.compile(r'^[ \t]*(?:(native|stock|forward)\b[ \t]+)?(?:([\w_]+)(?: +|:))?([\w_]+ *\(.*?\))') define_re = re.compile(r'#define[ \t]+([^\s]+)[\s]+(.+)') -comment_re = re.compile(r'\/\*(.*?\n?)+\*\/') +comment_re = re.compile(r'\/\*(.*?)\*\/')