feat: introduce sizeof instruction

Closes: #34
This commit is contained in:
2026-07-05 22:33:15 +02:00
parent 642d57622a
commit ee9eadeea8
11 changed files with 32 additions and 2 deletions
+1
View File
@@ -114,6 +114,7 @@ enum class unaryop_expression_node_t {
PrefixDecrement, /**< Prefix decrement */
PostfixDecrement, /**< Postfix decrement */
Pointerof, /**< Pointerof */
Sizeof, /**< Sizeof */
};
/**
+3
View File
@@ -158,6 +158,7 @@ enum class keyword_token {
Public, /**< `public` */
Private, /**< `private` */
Pointerof, /**< `pointerof` */
Sizeof, /**< `sizeof` */
Int32, /**< `int32` */
};
@@ -175,6 +176,7 @@ static inline std::ostream& operator<<(std::ostream& os, keyword_token keyword)
case keyword_token::Public: return os << "public";
case keyword_token::Private: return os << "private";
case keyword_token::Pointerof: return os << "pointerof";
case keyword_token::Sizeof: return os << "sizeof";
case keyword_token::Int32: return os << "int32";
}
return os;
@@ -193,6 +195,7 @@ static inline std::string operator+(const std::string& str, keyword_token keywor
case keyword_token::Public: return str + "public";
case keyword_token::Private: return str + "private";
case keyword_token::Pointerof: return str + "pointerof";
case keyword_token::Sizeof: return str + "sizeof";
case keyword_token::Int32: return str + "int32";
}
return str;