feat(a1): VM core (operands+pointer semantics, handlers, emit-cap) + RECOVER

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
gamer147
2026-07-06 13:53:03 -04:00
parent 0cb83fcb62
commit 121686fbb1
6 changed files with 235 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
namespace Age.Engine.Hosting;
public sealed class CaptureHost : IHost
{
public List<(int Offset, string Text)> Emitted { get; } = new();
public int CallScriptCount { get; private set; }
public Dictionary<int, int> Stubs { get; } = new();
public void ShowText(int offset, string text) => Emitted.Add((offset, text));
public void CallScript(long id) => CallScriptCount++;
public void OnStub(int opcode) { Stubs.TryGetValue(opcode, out var c); Stubs[opcode] = c + 1; }
}

View File

@@ -0,0 +1,7 @@
namespace Age.Engine.Hosting;
public interface IHost
{
void ShowText(int offset, string text);
void CallScript(long id);
void OnStub(int opcode);
}