Skip to content

Commit

Permalink
Temp remove comments
Browse files Browse the repository at this point in the history
  • Loading branch information
JoinedSenses authored Jun 8, 2020
1 parent 77bb467 commit de52011
Showing 1 changed file with 22 additions and 20 deletions.
42 changes: 22 additions & 20 deletions SPCompletions.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,20 +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()

# 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
# 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

if brace_level == 0:
m = enum_re.search(buffer)
Expand Down Expand Up @@ -529,7 +531,7 @@ def process_variable(node, buffer):
elif c == ' ' or c == '=' or c == ';':
result = result.strip()
if result != '':
node.funcs.add((result + ' (variable)' + file, result))
node.funcs.add((result + '\t(variable)' + file, result))
result = ''
consumingName = False
consumingBrackets = False
Expand All @@ -542,7 +544,7 @@ def process_variable(node, buffer):

result = result.strip()
if result != '':
node.funcs.add((result + ' (variable)' + file, result))
node.funcs.add((result + '\t(variable)' + file, result))

return ''

Expand Down Expand Up @@ -582,7 +584,7 @@ def process_enum(node, buffer, enum_contents, found_enum):
elif c == ',':
buffer = buffer.strip()
if buffer != '':
node.funcs.add((buffer + ' (enum' + enum_type + ')' + file, buffer))
node.funcs.add((buffer + '\t(enum' + enum_type + ')' + file, buffer))

ignore = False
buffer = ''
Expand All @@ -593,7 +595,7 @@ def process_enum(node, buffer, enum_contents, found_enum):

buffer = buffer.strip()
if buffer != '':
node.funcs.add((buffer + ' (enum' + enum_type + ')' + file, buffer))
node.funcs.add((buffer + '\t(enum' + enum_type + ')' + file, buffer))

buffer = ''

Expand All @@ -614,7 +616,7 @@ def get_preprocessor_define(node, buffer):
buffer = ''
name = define.group(1)
value = define.group(2).strip()
node.funcs.add((name + ' (constant: ' + value + ')' + file, name))
node.funcs.add((name + '\t(constant: ' + value + ')' + file, name))
return buffer


Expand Down Expand Up @@ -707,7 +709,7 @@ def process_function_string(node, func):
i += 1
autocomplete += ')'

node.funcs.add((funcname + ' (function' + return_type + ')' + file, autocomplete))
node.funcs.add((funcname + '\t(function' + return_type + ')' + file, autocomplete))


def skip_brace_line(line_reader, buffer):
Expand Down

0 comments on commit de52011

Please sign in to comment.