From 3f1195cd03ac009eee508b7d0e086807507a0ef4 Mon Sep 17 00:00:00 2001 From: Ginger Bill Date: Sun, 1 Jan 2017 18:18:43 +0000 Subject: More declaration differentiation in semantic stage e.g. make only variables and constants --- code/demo.odin | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) (limited to 'code') diff --git a/code/demo.odin b/code/demo.odin index 1106b1295..376ed30ac 100644 --- a/code/demo.odin +++ b/code/demo.odin @@ -11,8 +11,7 @@ import { win32 "sys/windows.odin"; } - -type Thing enum f64 { +const Thing = enum f64 { _, // Ignore first value A = 1<<(10*iota), B, @@ -20,21 +19,6 @@ type Thing enum f64 { D, }; -proc main() { - var ti = type_info(Thing); - match type info : type_info_base(ti) { - case Type_Info.Enum: - for var i = 0; i < info.names.count; i++ { - if i > 0 { - fmt.print(", "); - } - fmt.print(info.names[i]); - } - fmt.println(); - } - - var x Thing = Thing.A; - - fmt.println(x, Thing.B, Thing.C, Thing.D); - +const main = proc() { + fmt.println(Thing.A, Thing.B, Thing.C, Thing.D); } -- cgit v1.2.3