From 2efc34846c84a7d8f6817a917ad640744029aa0d Mon Sep 17 00:00:00 2001 From: zengwenjie <1663900244@qq.com> Date: Thu, 16 Oct 2025 14:44:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=B2=E7=BB=8F=E5=AE=8C=E6=88=90While?= =?UTF-8?q?=E3=80=81Continue=E3=80=81Break=E6=8C=87=E4=BB=A4=E7=9A=84?= =?UTF-8?q?=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DeedyDesigner/Deedy.Testing/App.xaml.cs | 24 ++++++++++++++++++------ DeedyDesigner/Deedy.Testing/Dodo.cs | 15 +++++++++------ 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/DeedyDesigner/Deedy.Testing/App.xaml.cs b/DeedyDesigner/Deedy.Testing/App.xaml.cs index 72bfa28..926c43a 100644 --- a/DeedyDesigner/Deedy.Testing/App.xaml.cs +++ b/DeedyDesigner/Deedy.Testing/App.xaml.cs @@ -16,19 +16,31 @@ namespace Deedy @" VarP var1 111 VarP var2 222 -Func Add var1x var2x - LetP AddResult -1 - math AddResult @var1x 777 + @var2 - @var2x - - retu AddResult +Func Add var1x var2x + LetP AddResult -1 + math AddResult @var1x 777 + @var2 - @var2x - + retu AddResult EndF //调用自定义方法 Call Add @var1 99 PopV result ifth true 4 3 < - letp result 248 + letp result 248 else - letp result 80 + letp result 80 endi +letp var1 1 +letp var2 1 +whil false @var1 10 < + math var1 @var1 ++ + ifth false @var2 4 != + math var2 @var2 ++ + cont + var var3 xxx + else + brea + endi +endw "; Todo todo = new Todo(); todo.Init(script); diff --git a/DeedyDesigner/Deedy.Testing/Dodo.cs b/DeedyDesigner/Deedy.Testing/Dodo.cs index 4655341..fb36b21 100644 --- a/DeedyDesigner/Deedy.Testing/Dodo.cs +++ b/DeedyDesigner/Deedy.Testing/Dodo.cs @@ -291,7 +291,7 @@ namespace Deedy.Testing string cmd = Pre_Hand(this.Script[index]); if (cmd == "endw") { - this.Control_CurrentLine = index; + this.Control_CurrentLine = index + 1; return; } } @@ -308,7 +308,7 @@ namespace Deedy.Testing string cmd = Pre_Hand(this.Script[index]); if (cmd == "whil") { - this.Control_CurrentLine = index + 1; + this.Control_CurrentLine = index; return; } } @@ -378,8 +378,11 @@ namespace Deedy.Testing { string cmdArgs = this.Script[index][cmd.Length..].Trim(); if (this.CmdP_Cond(cmdArgs)) + { this.Control_CurrentLine = index + 1; - return; + return; + } + else break; } else if (cmd == "letp") { @@ -807,7 +810,7 @@ namespace Deedy.Testing if (Pre_Math(numStack, 1)) { double lParam = numStack.Pop(); - numStack.Push(lParam++); + numStack.Push(++lParam); } } /// @@ -818,7 +821,7 @@ namespace Deedy.Testing if (Pre_Math(numStack, 1)) { double lParam = numStack.Pop(); - numStack.Push(lParam--); + numStack.Push(--lParam); } } /// @@ -909,7 +912,7 @@ namespace Deedy.Testing int index = 1; while (index < conParts.Length) - { + { switch (conParts[index]) { case "!": this.Cond_Nega(stack); break;