mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-30 11:20:08 +00:00
Allow comparisons of cstring; Add resize
This commit is contained in:
@@ -3767,6 +3767,11 @@ irValue *ir_emit_comp(irProcedure *proc, TokenKind op_kind, irValue *left, irVal
|
||||
}
|
||||
|
||||
if (is_type_string(a)) {
|
||||
if (is_type_cstring(a)) {
|
||||
left = ir_emit_conv(proc, left, t_string);
|
||||
right = ir_emit_conv(proc, right, t_string);
|
||||
}
|
||||
|
||||
char *runtime_proc = nullptr;
|
||||
switch (op_kind) {
|
||||
case Token_CmpEq: runtime_proc = "string_eq"; break;
|
||||
|
||||
+3
-1
@@ -1238,8 +1238,10 @@ bool is_type_comparable(Type *t) {
|
||||
return false;
|
||||
case Basic_rune:
|
||||
return true;
|
||||
case Basic_string:
|
||||
return true;
|
||||
case Basic_cstring:
|
||||
return false;
|
||||
return true;
|
||||
case Basic_typeid:
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user