From ff473e83425c74bae2cee4c9d68435c7b346533e Mon Sep 17 00:00:00 2001 From: Ginger Bill Date: Sun, 8 Jan 2017 20:24:12 +0000 Subject: "Old style" enums name and value information `count`, `min_value`, `max_value` constants --- code/demo.odin | 42 ++++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 16 deletions(-) (limited to 'code') diff --git a/code/demo.odin b/code/demo.odin index 1fe4c564d..285abe14d 100644 --- a/code/demo.odin +++ b/code/demo.odin @@ -1,21 +1,31 @@ #import "fmt.odin"; main :: proc() { - fmt.printf("%f", 123); -} - -/* -Standard Library Development: -* Formatted printf -* The Variable -* math - - Trig - - Random - - atoi -* Memory allocation -* File IO -* Timing - - Regular and OS + using Type_Info; + is_type_integer :: proc(info: ^Type_Info) -> bool { + if info == nil { + return false; + } + match type i : type_info_base(info) { + case Integer: + return true; + } + return false; + } -*/ + ti := type_info_base(type_info(Allocator_Mode)); + match type e : ti { + case Enum: + is_int := is_type_integer(e.base); + for i : 0..