chore: Checkpoint commit of unstaged changes, including new tests and debug scripts

This commit is contained in:
2026-02-26 21:39:03 -05:00
parent 94a1c320a5
commit 51918d9bc3
18 changed files with 226 additions and 28 deletions

18
debug_ast.py Normal file
View File

@@ -0,0 +1,18 @@
import tree_sitter
import tree_sitter_python
code = """def hot_func():
# [HOT]
print(1)"""
PY_LANGUAGE = tree_sitter.Language(tree_sitter_python.language())
parser = tree_sitter.Parser(PY_LANGUAGE)
tree = parser.parse(bytes(code, "utf8"))
def walk(node, indent=0):
content = code[node.start_byte:node.end_byte].strip()
print(f"{' ' * indent}{node.type} ({node.start_byte}-{node.end_byte}): {content[:20]}")
for child in node.children:
walk(child, indent + 1)
walk(tree.root_node)