Add typedefs in codegen, globals is working
This commit is contained in:
20
globals.kl
20
globals.kl
@@ -1,10 +1,10 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Function types
|
||||
//-----------------------------------------------------------------------------
|
||||
test_function :: (thing: int): ^int
|
||||
function_type: (thing: int): ^int = test_function
|
||||
test_function :: (thing: int): *int
|
||||
function_type: test_function
|
||||
const_function_alias :: test_function
|
||||
null_function: (t: int): ^int = null
|
||||
null_function: (t: int): *int = null
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Booleans
|
||||
@@ -35,10 +35,10 @@ array_item_imp: int = array2[2]
|
||||
//-----------------------------------------------------------------------------
|
||||
// Pointers
|
||||
//-----------------------------------------------------------------------------
|
||||
pointer_decl : ^int
|
||||
variable_from_deref: int = pointer_decl^
|
||||
pointer_from_var : ^int = ^variable_from_deref
|
||||
boolean_pointer := ^boolean
|
||||
pointer_decl : *int
|
||||
variable_from_deref: int = *pointer_decl
|
||||
pointer_from_var : *int = &variable_from_deref
|
||||
boolean_pointer := &boolean
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Implicit type
|
||||
@@ -49,9 +49,9 @@ implicit_str :: "Hello world"
|
||||
//-----------------------------------------------------------------------------
|
||||
// Pointers
|
||||
//-----------------------------------------------------------------------------
|
||||
pointer1: ^int = null
|
||||
pointer2: ^int = pointer1
|
||||
pointer3: ^^int = null
|
||||
pointer1: *int = null
|
||||
pointer2: *int = pointer1
|
||||
pointer3: **int = null
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// String types
|
||||
|
||||
Reference in New Issue
Block a user