spl

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit ce2c2dc17a5a8cfabddc7d5be344078e03de1b32
parent 0f68d093eb604b33de4258366083d4f9272d2420
Author: Brian Swetland <swetland@frotz.net>
Date:   Tue, 17 Oct 2023 22:25:53 -0700

compiler0: support bool

Diffstat:
Mbootstrap/compiler0.c | 2++
Mbootstrap/inc/builtin.type.h | 2++
2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/bootstrap/compiler0.c b/bootstrap/compiler0.c @@ -147,6 +147,7 @@ struct Ctx { String *idn_continue; Type *type_void; // base types + Type *type_bool; Type *type_str; Type *type_u32; Type *type_i32; @@ -319,6 +320,7 @@ void ctx_init() { ctx.idn_continue = string_make("continue", 8); ctx.type_void = type_make(string_make("void", 4), TYPE_VOID, nil, nil, 0); + ctx.type_bool = type_make(string_make("bool", 4), TYPE_BOOL, nil, nil, 0); ctx.type_str = type_make(string_make("str", 3), TYPE_STR, nil, nil, 0); ctx.type_u32 = type_make(string_make("u32", 3), TYPE_U32, nil, nil, 0); ctx.type_i32 = type_make(string_make("i32", 3), TYPE_U32, nil, nil, 0); diff --git a/bootstrap/inc/builtin.type.h b/bootstrap/inc/builtin.type.h @@ -1,7 +1,9 @@ #include <stdint.h> +#include <stdbool.h> typedef void t$void; +typedef bool t$bool; typedef uint32_t t$u32; typedef int32_t t$i32;