From 424f381755ebd7e65bd8c0ee034a8ab2c36d66c4 Mon Sep 17 00:00:00 2001 From: 0x4261756D <38735823+0x4261756D@users.noreply.github.com> Date: Wed, 21 Feb 2024 15:06:51 +0100 Subject: [PATCH] Make INumeral json serializable --- Tokenizer.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Tokenizer.cs b/Tokenizer.cs index 2c79abd..867aa46 100644 --- a/Tokenizer.cs +++ b/Tokenizer.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Text.Json.Serialization; namespace luaaaaah; class Tokenizer @@ -3734,6 +3735,8 @@ public enum TokenType StringLiteral, } +[JsonDerivedType(typeof(Integer), typeDiscriminator: "int")] +[JsonDerivedType(typeof(Float), typeDiscriminator: "float")] public interface INumeral { public class Integer(int value) : INumeral