From 2954f00d04636cfb069898005cbbfd41148021f2 Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Thu, 19 Sep 2019 23:32:04 -0400 Subject: [PATCH] taking inspiration from ada... --- compile.rb | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/compile.rb b/compile.rb index 4f65af2..d9fae36 100755 --- a/compile.rb +++ b/compile.rb @@ -5,9 +5,17 @@ require 'pp' module Type Void = "void" - Int = "int" - Char = "char" - Bool = "bool" + Float = "float" + + Range = Struct.new(:start, :stop) + Int = Range.new(-2147483647, 2147483647) + UInt = Range.new(0, 0xFFFFFFFF) + Byte = Range.new(0, 0xFF) + Char = Range.new(0, 0x10FFFF) + + Enum = Struct.new(:entries) + Bool = Enum.new([:true, :false]) + Func = Struct.new(:args, :return) Ptr = Struct.new(:type) Array = Struct.new(:type, :count) -- 2.54.0