chore: initial commit Dutra Store POS app
This commit is contained in:
29
check_parens_no_strings.py
Normal file
29
check_parens_no_strings.py
Normal file
@@ -0,0 +1,29 @@
|
||||
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}')
|
||||
Reference in New Issue
Block a user