pub fn extract_rust_macro(rust_source: String) -> Option<String>
Expand description
Given a Rust source file contents, return a string containing the contents of the first slint!
macro
All the other bytes which are not newlines are replaced by space. This allow offsets in the resulting string to preserve line and column number.
The last byte before the Slint area will be \u{2} (ASCII Start-of-Text), the first byte after the slint code will be \u{3} (ASCII End-of-Text), so that programs can find the area of slint code within the program.
Note that the slint compiler considers Start-of-Text and End-of-Text as whitespace and will treat them accordingly.