update refactoring and add new features

This commit is contained in:
2026-07-24 20:55:58 -07:00
parent 7f12bc7f40
commit 03fbbbcf28
69 changed files with 16332 additions and 17600 deletions
+23
View File
@@ -0,0 +1,23 @@
from pathlib import Path
p = Path('Store/registry.py')
lines = p.read_text(encoding='utf-8').splitlines()
stack = [0]
for i, line in enumerate(lines, start=1):
if not line.strip():
continue
leading = len(line) - len(line.lstrip(' '))
if leading > stack[-1]:
# increased indent -> push
stack.append(leading)
else:
# dedent: must match an existing level
if leading != stack[-1]:
if leading in stack:
# pop until match
while stack and stack[-1] != leading:
stack.pop()
else:
print(f"Line {i}: inconsistent indent {leading}, stack levels {stack}")
print(repr(line))
break
print('Done')