From 3a7588e5c5b7718012917b608e2346dc066cecc2 Mon Sep 17 00:00:00 2001 From: Mustafa Quraish Date: Thu, 3 Feb 2022 03:42:41 -0500 Subject: Remove `putc` intrinsic and replace with `write(fd, buf, size)` `putc`, `puts`, and `putnum` in `std/common.cup` are now implemented in terms of the `write()` syscall. --- src/types.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/types.c') diff --git a/src/types.c b/src/types.c index 31edc4b..b2709f8 100644 --- a/src/types.c +++ b/src/types.c @@ -59,6 +59,14 @@ Type *type_new(DataType type) return self; } +Type *type_new_ptr(DataType type) +{ + Type *self = type_new(TYPE_PTR); + self->ptr = type_new(type); + return self; +} + + bool is_string_type(Type *type) { return type -- cgit v1.2.3