diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-01-01 18:18:43 +0000 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-01-01 18:18:43 +0000 |
| commit | 3f1195cd03ac009eee508b7d0e086807507a0ef4 (patch) | |
| tree | 28d6b4c7af854adfe336b06cea7167b8a7e8abab /code | |
| parent | 311b5cb6e211aa49d8dc0e081173204d7271964f (diff) | |
More declaration differentiation in semantic stage e.g. make only variables and constants
Diffstat (limited to 'code')
| -rw-r--r-- | code/demo.odin | 22 |
1 files changed, 3 insertions, 19 deletions
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); } |