From 58f3d1067cfdd19f8c4c7f3934ce7102b3685397 Mon Sep 17 00:00:00 2001 From: ninemine <1371605831@qq.com> Date: Sat, 18 Oct 2025 17:26:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86=E6=B3=A8=E9=87=8A?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E7=9A=84=E5=88=86=E6=AE=B5=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- RScriptEngine.cs | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/RScriptEngine.cs b/RScriptEngine.cs index dfb20c3..58472d8 100644 --- a/RScriptEngine.cs +++ b/RScriptEngine.cs @@ -56,16 +56,8 @@ namespace Convention.RScript // Skip single-line comment if (line[i + 1] == '/') { - while (i < line.Length && line[i] != '\n') - i++; - } - // Skip multi-line comment - else if (line[i + 1] == '*') - { - i += 2; - while (i + 1 < line.Length && !(line[i] == '*' && line[i + 1] == '/')) - i++; - i++; + PushBuilder(); + break; } else { @@ -74,9 +66,8 @@ namespace Convention.RScript } else if (c == '#') { - // Skip single-line comment - while (i < line.Length && line[i] != '\n') - i++; + PushBuilder(); + break; } else if (c == '\"') { @@ -126,10 +117,7 @@ namespace Convention.RScript } } } - if (builder.Length > 0) - { - PushBuilder(); - } + PushBuilder(); return statements.Where(s => !string.IsNullOrWhiteSpace(s)); }