Skip to content

Commit b037789

Browse files
committed
Update for comments
1 parent 2241b43 commit b037789

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

  • crates/static-analysis-kernel/src/analysis/languages/python

crates/static-analysis-kernel/src/analysis/languages/python/imports.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -318,13 +318,8 @@ fn parse_future_import_statement<'text>(
318318
}
319319

320320
/// Constructs a [`MaybeAliased`] from the provided `node`. This is intended to be used on
321-
/// the `name` and `module_name` field children.
322-
///
323-
/// # Panics
324-
/// Panics if the provided node isn't a:
325-
/// * `dotted_name`
326-
/// * `aliased_import`
327-
/// * `relative_import`
321+
/// the `name` and `module_name` field children. Returns `None` if the node isn't a
322+
/// `relative_import`, `dotted_name`, or an `aliased_import`.
328323
fn parse_field_child_node<'text>(
329324
source_code: &'text str,
330325
node: tree_sitter::Node,
@@ -481,7 +476,7 @@ mod tests {
481476
}
482477

483478
#[test]
484-
fn error_node_does_not_panic() {
479+
fn parse_imports_error_node() {
485480
let code = "import foo, + bar";
486481
let tree = get_tree(code, &Language::Python).unwrap();
487482
assert!(tree.root_node().has_error());
@@ -496,7 +491,7 @@ mod tests {
496491
}
497492

498493
#[test]
499-
fn all_error_nodes_does_not_panic() {
494+
fn parse_imports_all_error_nodes() {
500495
let code = "import +, +";
501496
let tree = get_tree(code, &Language::Python).unwrap();
502497
assert!(tree.root_node().has_error());

0 commit comments

Comments
 (0)