Fix strings

Signed-off-by: Slendi <slendi@socopon.com>
This commit is contained in:
Slendi 2024-02-28 15:07:06 +02:00
parent 7fe927a683
commit d2068be1b8
2 changed files with 1 additions and 8 deletions

View File

@ -3,7 +3,6 @@ package main
TypeKind :: enum { TypeKind :: enum {
Integer, Integer,
Float, Float,
String,
} }
Type :: struct { Type :: struct {
@ -56,9 +55,3 @@ type_create_float :: proc(bit_size: u8) -> (ret: ^Type) {
ret.is_signed = true ret.is_signed = true
return return
} }
type_create_string :: proc() -> (ret: ^Type) {
ret = new(Type)
ret.kind = .String
return
}

View File

@ -15,7 +15,7 @@ infer_type :: proc(parent: ^Node, child: ^Node) {
#partial switch child.kind { #partial switch child.kind {
case .Integer: child.return_type = type_create_integer(32, true) case .Integer: child.return_type = type_create_integer(32, true)
case .Float: child.return_type = type_create_float(32) case .Float: child.return_type = type_create_float(32)
case .String: child.return_type = type_create_string() case .String: panic("FIXME: Add support for arrays")
case .Character: child.return_type = type_create_integer(32, false) case .Character: child.return_type = type_create_integer(32, false)
} }
} else { } else {