Skip to content

Commit aa37734

Browse files
committed
Major Bug fix in AST Analysis, minor documentation and rules enhancements
1 parent 366166b commit aa37734

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

src/pyspector/_rust_core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "_rust_core"
3-
version = "0.1.1"
3+
version = "0.1.2"
44
edition = "2021"
55

66
[lib]

src/pyspector/_rust_core/src/analysis/ast_analysis.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,17 @@ fn node_has_property(node: &AstNode, path: &[&str], expected_value: &str) -> boo
8686
}
8787

8888
if let Some(child_list) = node.children.get(current_part) {
89-
if remaining_path[0] == "*" {
89+
if !remaining_path.is_empty() && remaining_path[0] == "*" {
9090
let path_after_wildcard = &remaining_path[1..];
9191
for child in child_list {
9292
if node_has_property(child, path_after_wildcard, expected_value) {
9393
return true;
9494
}
9595
}
96-
} else if let Some(child) = child_list.get(0) {
97-
return node_has_property(child, remaining_path, expected_value);
96+
} else if !remaining_path.is_empty() {
97+
if let Some(child) = child_list.first() {
98+
return node_has_property(child, remaining_path, expected_value);
99+
}
98100
}
99101
}
100102

src/pyspector/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def cli():
9999
__/> / \
100100
"""
101101
click.echo(click.style(banner))
102-
click.echo("Version: 0.1.1-beta\n")
102+
click.echo("Version: 0.1.2-beta\n")
103103
click.echo("Made with <3 by github.com/ParzivalHack\n")
104104

105105
cli = cast(click.Group, cli)

0 commit comments

Comments
 (0)