Compiling entire folder, working on examples
This commit is contained in:
@@ -45,59 +45,25 @@ main :: (): int
|
||||
|
||||
assert(value_to_be_wrapped == 20)
|
||||
|
||||
letter := get_first_letter_of_type(value_to_be_wrapped)
|
||||
assert(letter == 'I) // '
|
||||
|
||||
get_first_letter_of_type :: (a: Any): U8
|
||||
type_info := get_type_info(a.type)
|
||||
if !type_info
|
||||
return '- // '
|
||||
|
||||
result: U8
|
||||
switch type_info.kind
|
||||
Type_Info_Kind.S64, Type_Info_Kind.S32, Type_Info_Kind.S16, Type_Info_Kind.S8, Type_Info_Kind.INT
|
||||
result = 'I // '
|
||||
Type_Info_Kind.U64, Type_Info_Kind.U32, Type_Info_Kind.U16, Type_Info_Kind.U8
|
||||
result = 'U // '
|
||||
Type_Info_Kind.F64
|
||||
result = 'F // '
|
||||
Type_Info_Kind.POINTER
|
||||
result = '* // '
|
||||
default;; result = '- // '
|
||||
|
||||
// print :: (a: Any)
|
||||
// type_info := get_type_info(a.type)
|
||||
// if !type_info
|
||||
// return
|
||||
|
||||
// print_type(a.type)
|
||||
// OutputDebugStringA(" - ")
|
||||
// // @todo check for types here
|
||||
// switch type_info.kind
|
||||
// Type_Info_Kind.S64, Type_Info_Kind.S32, Type_Info_Kind.S16, Type_Info_Kind.S8, Type_Info_Kind.INT
|
||||
// OutputDebugStringA("Integer")
|
||||
// Type_Info_Kind.U64, Type_Info_Kind.U32, Type_Info_Kind.U16, Type_Info_Kind.U8
|
||||
// OutputDebugStringA("Unsigned")
|
||||
// Type_Info_Kind.F64
|
||||
// data := a.data->*F64
|
||||
// print_float(*data)
|
||||
// Type_Info_Kind.POINTER
|
||||
// OutputDebugStringA("Pointer")
|
||||
// default;; OutputDebugStringA("Unknown")
|
||||
|
||||
|
||||
// little_untyped_test :: ()
|
||||
// if true == false;; pass
|
||||
// if true;; pass
|
||||
// cast_value1 := 32->S64
|
||||
// cast_value2 := true->Bool
|
||||
// value3 := !true
|
||||
// value4 := !325252
|
||||
// value5 := !42.42
|
||||
// some_constant :: 10
|
||||
// value6 := !some_constant
|
||||
// var_not_const := 0
|
||||
// value7 := some_constant + - -some_constant + +-32 + -var_not_const
|
||||
|
||||
|
||||
// value3 = value3 + value4 + value5 + cast_value2 + value6
|
||||
// cast_value1 += 1 + value7
|
||||
|
||||
|
||||
// switch 4
|
||||
// 4;; OutputDebugStringA("4")
|
||||
// 3;; OutputDebugStringA("3")
|
||||
|
||||
// some_type: Type = Vec2
|
||||
// char_info := get_type_info(char)
|
||||
// val := 4232.23
|
||||
// thing: Any = val
|
||||
// print(val)
|
||||
// print(some_type)
|
||||
// // print_array({125.23, 32})
|
||||
|
||||
// assert(char_info.kind == Type_Info_Kind.CHAR)
|
||||
return result
|
||||
|
||||
|
||||
Reference in New Issue
Block a user