Added is_body to AST and Code types

This commit is contained in:
2024-12-01 12:48:58 -05:00
parent 31691b1466
commit 8ef982003a
9 changed files with 109 additions and 75 deletions

View File

@ -11,8 +11,10 @@ struct StrC
ssize Len;
char const* Ptr;
#if ! GEN_COMPILER_C
operator char const* () const { return Ptr; }
char const& operator[]( ssize index ) const { return Ptr[index]; }
#endif
};
#define cast_to_strc( str ) * rcast( StrC*, (str) - sizeof(ssize) )
@ -29,12 +31,7 @@ StrC to_str( char const* str ) {
// I kept it for simplicty of porting but its not necessary to keep it that way.
#pragma region String
struct StringHeader;
#if GEN_COMPILER_C
typedef char* String;
#else
struct String;
#endif
String string_make(AllocatorInfo allocator, char const* str);
String string_make(AllocatorInfo allocator, StrC str);