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:

committed by
Alexander Medvednikov

parent
590566f8c4
commit
eb20dd39b1
@ -25,6 +25,7 @@ fn vcheck(vfile string) {
|
||||
fn main() {
|
||||
vcheck("string")
|
||||
vcheck("linuxsys")
|
||||
vcheck("consts")
|
||||
exit(0)
|
||||
}
|
||||
|
||||
|
15
vlib/builtin/bare/.checks/consts/consts.v
Normal file
15
vlib/builtin/bare/.checks/consts/consts.v
Normal 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")
|
||||
}
|
@ -1,5 +1,9 @@
|
||||
module builtin
|
||||
|
||||
// called by the generated main/init
|
||||
fn init() {
|
||||
}
|
||||
|
||||
pub fn isnil(p voidptr) bool {
|
||||
return p == 0
|
||||
}
|
||||
|
Reference in New Issue
Block a user