Files
polyquine/rs.py
T
lda d1ce7d44fe init
Signed-off-by: Luong Duc Anh <[email protected]>
2026-11-01 10:12:48 +07:00

18 lines
571 B
Python

#![doc = r#"
rust = r"""
"#]
fn main() {
let (head, body) = ("#![doc = r#\"\nrust = r\"\"\"\n\"#]\nfn main() {\n let (head, body) = ", " println!(\"{head}({head:?}, {body:?});\\n{body}{REAL}\\\"#;\");\n}\nconst REAL: &'static str = r#\"");
println!("{head}({head:?}, {body:?});\n{body}{REAL}\"#;");
}
const REAL: &'static str = r#"""
p = """{d}
rust = r{triple}{rust}{triple}
p = {triple}{p}{triple}
print(p.format(p=p, d={d!r}, rust=rust, triple={triple!r}))
{triple}
{triple}#;"""
print(p.format(p=p, d='#![doc = r#"', rust=rust, triple='"""'))
"""
"""#;