Files
app-grosir/check_parens_no_strings.py
2026-07-23 22:12:32 +07:00

30 lines
704 B
Python

with open('D:\\app\\ai\\app-grosir\\lib\\screens\\produk_screen.dart', 'r') as f:
lines = f.readlines()
depth = 0
for i in range(493, 644):
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 == '(':
depth += 1
elif c == ')':
depth -= 1
if depth < 0:
print(f'Negative depth at line {i+1}: {line.rstrip()}')
break
print(f'Final depth: {depth}')