commit d1ce7d44fe15f9e66c1142e243c5dd44a53f63b8 Author: Luong Duc Anh Date: Sun Nov 1 10:12:48 2026 +0700 init Signed-off-by: Luong Duc Anh diff --git a/rs.py b/rs.py new file mode 100644 index 0000000..fd5c272 --- /dev/null +++ b/rs.py @@ -0,0 +1,17 @@ +#![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='"""')) +""" +"""#;