Skip to content

Commit

Permalink
#6 Fix missing current-file errors
Browse files Browse the repository at this point in the history
Also doesn't have missing leading whitespace
  • Loading branch information
XenHat authored Oct 21, 2017
1 parent 24fe584 commit 48d7013
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,8 @@ def run(self, cmd, code):
if iter_line.startswith("TOTAL::") is False:
tokens = iter_line.split(',')
# print('Tokens:[{0}]'.format(tokens))
token = tokens[0]
# print("Token:{0}".format(token))
# print("Token1:{0}".format(tokens[1]))
number = int(p.match(token).group(2).strip())
match = p.match(tokens[0])
number = int(match.group(2))
# print("number: '{0}'".format(number))
# laststdin = getLastStdin(preproc_bank, number)
# lastline = getLastLine(preproc_bank, laststdin)
Expand All @@ -304,9 +302,8 @@ def run(self, cmd, code):
new_number = preproc_bank[index + 1].mcpp_in_line + 1
offset = getLastOffset(preproc_bank, new_number)[0]
tokminoff = str(new_number - int(offset))
# the next line is best moved up to avoid calling p.match() twice
token_match = p.match(token)
new_line = '{0}:: ({1:>3}, 1): in file {2}: {3}'.format(token_match.group(1), tokminoff, result[1], new_line)
token_match = match.group(1)
new_line += '\n {0}:: ({1:>3}, 1): in file {2}: {3}'.format(token_match, tokminoff, result[1], new_line)
# print("New Line: {0}".format(new_line))
fixed_output_lines.append(new_line)
continue
Expand Down

0 comments on commit 48d7013

Please sign in to comment.