From 040d79ecfbed9c9b7d3c564add5a06b8e0f0c35a Mon Sep 17 00:00:00 2001 From: "Tristan B. Kildaire" Date: Wed, 21 Apr 2021 23:27:44 +0200 Subject: [PATCH] Added classes for type representation --- source/tlang/compiler/symbols/typing.d | 52 ++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/source/tlang/compiler/symbols/typing.d b/source/tlang/compiler/symbols/typing.d index b68d494..002d18a 100644 --- a/source/tlang/compiler/symbols/typing.d +++ b/source/tlang/compiler/symbols/typing.d @@ -17,6 +17,58 @@ import compiler.symbols.data; public class Type : Entity { + /** + * TODO: See what we need in here, Entity name could be our Type name + * But to make it look nice we could just have `getType` + * Actually yeah, we should, as Number types won't be entities + * Wait lmao they will + */ + this(string name) + { + super(name); + } +} + +public class Number : Type +{ + this(string name) + { + super(name); + } +} + +public class Integer : Number +{ + /* Number of bytes (1,2,4,8) */ + private ubyte width; + + this(string name) + { + super(name); + } +} + +public class Float : Number +{ + this(string name) + { + super(name); + } +} + +public class Double : Number +{ + this(string name) + { + super(name); + } +} + +public class Pointer : Type +{ + /* Datum wdith */ + private ubyte datumWidth; + this(string name) { super(name);