helpers

Structs

InlinedTemplate

Source span and contents for a Pax template embedded in an #[inlined(...)] attribute.

Properties

struct_name

Type: String

start

Type: (usize, usize)

end

Type: (usize, usize)

template

Type: String


InlinedTemplateFinder

AST visitor that extracts #[inlined(...)] templates from #[pax] structs.

Properties

file_contents

Type: String

templates

Type: Vec<InlinedTemplate>

Implementations

new
pub fn new(file_contents: String) -> Self

Prepare a finder for one Rust source file.

Functions

clear_inlined_template

pub fn clear_inlined_template(file_path: &str, pascal_identifier: &str)

Replace a matching #[inlined(...)] template with an empty template body.


get_substring_by_line_column

pub fn get_substring_by_line_column(input: &str, start: (usize, usize), end: (usize, usize)) -> Option<String>

Extract a source substring addressed by one-indexed line/column coordinates.


replace_by_line_column

pub fn replace_by_line_column(input: &str, start: (usize, usize), end: (usize, usize), replacement: String) -> Option<String>

Replace a source span addressed by one-indexed line/column coordinates.