Skip to content

Commit

Permalink
Update count.py
Browse files Browse the repository at this point in the history
  • Loading branch information
sbryngelson authored Dec 29, 2023
1 parent 37ddb15 commit 47aad98
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion toolchain/mfc/count.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ def handle_dir(dirpath: str) -> typing.Tuple[typing.List[typing.Tuple[str, int]]

for filepath in glob.glob(os.path.join(dirpath, '*.*f*')):
with open(filepath) as f:
count = sum(1 if not l.isspace() else 0 for l in f.read().split('\n'))
count = 0
for l in f.read().split('\n'):
if not (l.isspace() or len(l) == 0):
if not l.lstrip()[0] == '!':
count = count + 1
if l.lstrip()[0:5] == "!$acc":
count = count + 1
files.append((filepath, count))
total += count

Expand Down

0 comments on commit 47aad98

Please sign in to comment.