enum Hello as u64 {
	a
	b
	c = 20 + 10
	d
	e
}

fn enums() Hello {
	mut a := Hello.a
	a = .c
	return a
}

struct AA {
	a u8
	b i64
}

fn of() {
	a := __offsetof(AA, b)
	b := sizeof(AA)
	_, _ := a, b
}

fn constant() int {
	return 100
}

const hello = 'hello\n'

const float = 1.0

const integer = 888

const runtime_init = constant()

struct EE {
	a int
	b int
}

fn ptr_arith() {
	mut a := EE{}
	mut b := &a.b

	unsafe {
		*b = 12
	}
	println(a.b.str())
	unsafe {
		*b = 14
	}
	println(a.b.str())
	unsafe {
		*b = 102
	}
	println((*b).str())
}

fn defer_if(cond bool) {
	if cond {
		defer {
			println('defer_if: defer!')
		}
	}
	println('defer_if: start')
}

fn run_defer() {
	defer {
		println('defer!')
	}
	println('before defer')
	defer_if(true)
	defer_if(false)
}

fn main() {
	println('ptr_arith')
	ptr_arith()
	run_defer()
	println('constants')
	println(runtime_init)
	println(hello)
	// println(float)
	println(integer)
	println('enums')
	println(int(enums()))
	println(sizeof(Hello))
}
