From 807c53511da6c5bedabf039640a0b1c08021190c Mon Sep 17 00:00:00 2001 From: lifegpc Date: Sun, 31 May 2026 10:05:29 +0800 Subject: [PATCH] Add workround fix --- src/scripts/yuris/txt.rs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/scripts/yuris/txt.rs b/src/scripts/yuris/txt.rs index 24c7523..206e637 100644 --- a/src/scripts/yuris/txt.rs +++ b/src/scripts/yuris/txt.rs @@ -112,7 +112,10 @@ impl INode for CommandNode { } else { s.push_str(", "); } - if arg.contains(" ") || arg.contains(",") || arg.contains("=") { + if (arg.contains(" ") && !arg.chars().all(|s| s.is_ascii_digit() || s == ' ')) + || arg.contains(",") + || arg.contains("=") + { s.push_str(&format!("\"{}\"", arg)); } else { s.push_str(arg); @@ -835,4 +838,16 @@ mod tests { })])], ); } + #[test] + fn test_ser1() { + assert_eq!( + (CommandNode { + name: "EV.CMXYZ".into(), + args: vec!["0 474".into(), "54".into(), "-58".into()], + has_args: true, + }) + .serialize(), + r"\EV.CMXYZ(0 474, 54, -58)" + ); + } }