37 lines
527 B
Plaintext
37 lines
527 B
Plaintext
module main
|
|
|
|
struct Human {
|
|
name: string
|
|
age: i32
|
|
}
|
|
|
|
enum Message {
|
|
Quit
|
|
Say: string
|
|
}
|
|
|
|
func main(): i32 {
|
|
core::println("Hello, world!")
|
|
core::println("Hello" + "World")
|
|
|
|
let message = getMessage()
|
|
|
|
let newStr = new string("cstring".ptr)
|
|
|
|
core::println(newStr)
|
|
|
|
match message {
|
|
Quit {
|
|
core::println("quit")
|
|
}
|
|
Say msg {
|
|
core::println(msg)
|
|
}
|
|
}
|
|
|
|
return 0
|
|
}
|
|
|
|
func getMessage(): Message {
|
|
return new Message::Say("test")
|
|
} |