更新异步step
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Convention.RScript.Parser;
|
||||
using System.Collections;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Convention.RScript.Runner
|
||||
@@ -27,5 +28,23 @@ namespace Convention.RScript.Runner
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
[return: MaybeNull]
|
||||
public override IEnumerator RunAsync(ExpressionParser parser, RScriptSentence sentence, RScriptContext context)
|
||||
{
|
||||
// 检查并跳转到上次跳转的位置
|
||||
if (parser.Evaluate<bool>(sentence.content))
|
||||
{
|
||||
if (context.GotoPointerStack.Count == 0)
|
||||
{
|
||||
throw new RScriptRuntimeException($"No position to back.", context.CurrentRuntimePointer);
|
||||
}
|
||||
else
|
||||
{
|
||||
DoJumpRuntimePointer(parser, context.GotoPointerStack.Pop(), context);
|
||||
}
|
||||
}
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user