From d1ce7d44fe15f9e66c1142e243c5dd44a53f63b8 Mon Sep 17 00:00:00 2001 From: Luong Duc Anh Date: Sun, 1 Nov 2026 10:12:48 +0700 Subject: [PATCH] init Signed-off-by: Luong Duc Anh --- rs.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 rs.py 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='"""')) +""" +"""#;