From: Michael D. Lowis Date: Fri, 20 Sep 2019 03:32:04 +0000 (-0400) Subject: taking inspiration from ada... X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=2954f00d04636cfb069898005cbbfd41148021f2;p=proto%2Fsclpl-rb.git taking inspiration from ada... --- 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)