Spaces:
Sleeping
Sleeping
Update parser.py
Browse files
parser.py
CHANGED
|
@@ -45,6 +45,11 @@ def get_value(node):
|
|
| 45 |
elif isinstance(node, ast.Call):
|
| 46 |
return '<function_call>'
|
| 47 |
return '<complex>'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
|
| 49 |
def collect_variable_usage(tree):
|
| 50 |
"""Collect definitions and uses of variables, respecting scope."""
|
|
|
|
| 45 |
elif isinstance(node, ast.Call):
|
| 46 |
return '<function_call>'
|
| 47 |
return '<complex>'
|
| 48 |
+
def is_blank_or_comment(line):
|
| 49 |
+
"""Check if a line is blank or a comment."""
|
| 50 |
+
stripped = line.strip()
|
| 51 |
+
return not stripped or stripped.startswith('#')
|
| 52 |
+
|
| 53 |
|
| 54 |
def collect_variable_usage(tree):
|
| 55 |
"""Collect definitions and uses of variables, respecting scope."""
|