...
This commit is contained in:
@@ -1,55 +1,42 @@
|
||||
module math
|
||||
|
||||
struct vec2 {
|
||||
export struct vec2 {
|
||||
x: i32
|
||||
y: i32
|
||||
}
|
||||
|
||||
struct vec3 {
|
||||
export struct vec3 {
|
||||
x: i32
|
||||
y: i32
|
||||
z: i32
|
||||
}
|
||||
|
||||
struct color {
|
||||
export struct color {
|
||||
r: i32
|
||||
g: i32
|
||||
b: i32
|
||||
a: i32
|
||||
}
|
||||
|
||||
struct example {
|
||||
a: {
|
||||
a: i32
|
||||
}
|
||||
b: {
|
||||
b: {
|
||||
c: i32
|
||||
}
|
||||
c: {
|
||||
d: i32
|
||||
}
|
||||
}
|
||||
export struct example {
|
||||
b: color
|
||||
}
|
||||
|
||||
|
||||
export enum message {
|
||||
quit
|
||||
move {
|
||||
x: i32
|
||||
y: i32
|
||||
}
|
||||
quit: {}
|
||||
move: color
|
||||
}
|
||||
|
||||
export func add(a: i32 b: i32): i32
|
||||
{
|
||||
let message: message = enum math::message::move { x = 1 y = 1 }
|
||||
let message: message = enum math::message::move struct color { r = 23 g = 46 b = 56 }
|
||||
|
||||
match message {
|
||||
quit q {}
|
||||
move m {
|
||||
m.x = 23
|
||||
m.y = 23
|
||||
m.r = 23
|
||||
m.g = 23
|
||||
m.b = 23
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user