Skip to main content

normalize_var

Function normalize_var 

Source
pub fn normalize_var(name: &str) -> (Option<char>, &str)
Expand description

Normalize a Perl variable name for Index/Analyze workflows.

Extracts an optional sigil and bare name for consistent symbol indexing.

§Arguments

  • name - Variable name from Perl source, with or without sigil.

§Returns

(sigil, name) tuple with the optional sigil and normalized identifier.

§Examples

use perl_parser::workspace_index::normalize_var;

assert_eq!(normalize_var("$count"), (Some('$'), "count"));
assert_eq!(normalize_var("process_emails"), (None, "process_emails"));