Implement new transition.

This commit is contained in:
2023-04-20 00:18:49 +08:00
parent d2b71e41c9
commit 8670482c04
8 changed files with 175 additions and 28 deletions

View File

@@ -0,0 +1,19 @@
using Cryville.Common.Pdt;
using Newtonsoft.Json;
using System;
namespace Cryville.Crtr {
public class JsonPdtExpConverter : JsonConverter<PdtExpression> {
static readonly PdtFragmentInterpreter _itor = new PdtFragmentInterpreter();
public override PdtExpression ReadJson(JsonReader reader, Type objectType, PdtExpression existingValue, bool hasExistingValue, JsonSerializer serializer) {
_itor.SetSource((string)reader.Value);
return _itor.GetExp();
}
public override void WriteJson(JsonWriter writer, PdtExpression value, JsonSerializer serializer) {
throw new NotSupportedException();
}
public override bool CanWrite { get { return false; } }
}
}