feat: introduce pointerof operation

Introduce pointerof operation and do some side-quests along the way.

Refs: #34
Closes: #17
This commit is contained in:
2026-07-05 14:54:16 +02:00
parent 9690ac3617
commit 642d57622a
13 changed files with 290 additions and 141 deletions
+1
View File
@@ -113,6 +113,7 @@ enum class unaryop_expression_node_t {
PostfixIncrement, /**< Postfix increment */
PrefixDecrement, /**< Prefix decrement */
PostfixDecrement, /**< Postfix decrement */
Pointerof, /**< Pointerof */
};
/**
+13 -10
View File
@@ -147,16 +147,17 @@ static inline std::string operator+(const std::string& str, token_t type) {
* @brief Keyword token.
*/
enum class keyword_token {
None, /**< None */
Func, /**< `func` */
Return, /**< `return` */
If, /**< `if` */
Else, /**< `else` */
While, /**< `while` */
Import, /**< `import` */
Native, /**< `native` */
Public, /**< `public` */
Private, /**< `private` */
None, /**< None */
Func, /**< `func` */
Return, /**< `return` */
If, /**< `if` */
Else, /**< `else` */
While, /**< `while` */
Import, /**< `import` */
Native, /**< `native` */
Public, /**< `public` */
Private, /**< `private` */
Pointerof, /**< `pointerof` */
Int32, /**< `int32` */
};
@@ -173,6 +174,7 @@ static inline std::ostream& operator<<(std::ostream& os, keyword_token keyword)
case keyword_token::Native: return os << "native";
case keyword_token::Public: return os << "public";
case keyword_token::Private: return os << "private";
case keyword_token::Pointerof: return os << "pointerof";
case keyword_token::Int32: return os << "int32";
}
return os;
@@ -190,6 +192,7 @@ static inline std::string operator+(const std::string& str, keyword_token keywor
case keyword_token::Native: return str + "native";
case keyword_token::Public: return str + "public";
case keyword_token::Private: return str + "private";
case keyword_token::Pointerof: return str + "pointerof";
case keyword_token::Int32: return str + "int32";
}
return str;