Skip to main content

function_macro_replacement_span

Function function_macro_replacement_span 

Source
pub fn function_macro_replacement_span(
    node: Node<'_>,
    source: &str,
) -> Option<Range<usize>>
Expand description

The complete logical-line replacement list of a function-like #define.

Comments are tokenized as extras by tree-sitter-cpp and can truncate the preproc_arg value. Start immediately after the parameter list so a replacement that begins with a comment remains source backed even when it has no value node. Follow the preprocessing continuation run to recover the bytes that belong to the replacement. The returned span includes the original backslash/newline bytes so callers can retain source coordinates.