Skip to main content

is_exception_function

Function is_exception_function 

Source
pub fn is_exception_function(name: &str) -> bool
Expand description

Check if a function name is in the Perl exception family.

Returns true for: die, warn, croak, carp, confess, cluck.

This is a classification helper for future diagnostic and code-action use. It is not currently called from any LSP code path — callers may use it to decide whether to invoke get_exception_context.

§Examples

use perl_semantic_analyzer::analysis::semantic::is_exception_function;

assert!(is_exception_function("die"));
assert!(is_exception_function("croak"));
assert!(!is_exception_function("print"));