Add typedefs in codegen, globals is working

This commit is contained in:
Krzosa Karol
2022-05-27 15:00:45 +02:00
parent 46abf8c1a6
commit 8875b61970
6 changed files with 92 additions and 122 deletions

View File

@@ -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