]> git.mdlowis.com Git - proto/sclpl-rb.git/commitdiff
taking inspiration from ada...
authorMichael D. Lowis <mike@mdlowis.com>
Fri, 20 Sep 2019 03:32:04 +0000 (23:32 -0400)
committerMichael D. Lowis <mike@mdlowis.com>
Fri, 20 Sep 2019 03:32:04 +0000 (23:32 -0400)
compile.rb

index 4f65af2311dd18ffe1a4e99e41f5c8eb2eed3d8e..d9fae36ee4afee8f4871a559adb774e22aab507a 100755 (executable)
@@ -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)