Skip to main content

extract_prefix

Function extract_prefix 

Source
pub fn extract_prefix(
    node: &Node,
    source: &str,
    redirect_span: Option<(usize, usize)>,
) -> PrefixResult
Expand description

Extract a command prefix from a simple command node.

source is the original command string; node should be a command or declaration_command AST node. redirect_span is the byte range of any enclosing redirected_statement so redirects are not included in the prefix.