1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

freestanding: init consts

This commit is contained in:
Delyan Angelov
2019-12-04 00:40:26 +02:00
committed by Alexander Medvednikov
parent 590566f8c4
commit eb20dd39b1
5 changed files with 37 additions and 4 deletions

View File

@ -25,6 +25,7 @@ fn vcheck(vfile string) {
fn main() {
vcheck("string")
vcheck("linuxsys")
vcheck("consts")
exit(0)
}

View File

@ -0,0 +1,15 @@
module main
const (
integer1 = 111
integer2 = 222
integer3 = 333
integer9 = integer3 * 3
abc = "123"
)
fn main(){
assert abc == "123"
assert integer9 == 999
println("constants are properly initialized")
}

View File

@ -1,5 +1,9 @@
module builtin
// called by the generated main/init
fn init() {
}
pub fn isnil(p voidptr) bool {
return p == 0
}