28 lines
651 B
Python
28 lines
651 B
Python
with open('D:\\app\\ai\\app-grosir\\lib\\screens\\produk_screen.dart', 'r') as f:
|
|
lines = f.readlines()
|
|
|
|
opens = 0
|
|
closes = 0
|
|
for i in range(179, 436):
|
|
line = lines[i]
|
|
in_string = False
|
|
escape = False
|
|
for c in line:
|
|
if escape:
|
|
escape = False
|
|
continue
|
|
if c == '\\':
|
|
escape = True
|
|
continue
|
|
if c in "'\"":
|
|
in_string = not in_string
|
|
continue
|
|
if in_string:
|
|
continue
|
|
if c == '(':
|
|
opens += 1
|
|
elif c == ')':
|
|
closes += 1
|
|
|
|
print(f'Total (: {opens}, ): {closes}, diff: {opens-closes}')
|