forked from KPGPMC/furlang
@@ -135,6 +135,7 @@ void ir_generator::visit(const ast::var_read_expression_node& node) {
|
||||
static inline furlang::ir::instruction_t unary_op_instruction_t(ast::unaryop_expression_node_t type) {
|
||||
switch (type) {
|
||||
case ast::unaryop_expression_node_t::Pointerof: return furlang::ir::instruction_t::Pointerof;
|
||||
case ast::unaryop_expression_node_t::Sizeof: return furlang::ir::instruction_t::Sizeof;
|
||||
default: throw std::runtime_error("unimplemented");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,6 +105,7 @@ token_r lexer::next_token() {
|
||||
{ "public", keyword_token::Public },
|
||||
{ "private", keyword_token::Private },
|
||||
{ "pointerof", keyword_token::Pointerof },
|
||||
{ "sizeof", keyword_token::Sizeof },
|
||||
{ "int32", keyword_token::Int32 },
|
||||
};
|
||||
|
||||
|
||||
@@ -323,6 +323,7 @@ static inline std::optional<unaryop_info> get_unaryop_info(const token_r& token)
|
||||
};
|
||||
static std::unordered_map<keyword_token, unaryop_info> s_keywords = {
|
||||
{ keyword_token::Pointerof, unaryop_info{ ast::unaryop_expression_node_t::Pointerof, 2 } },
|
||||
{ keyword_token::Sizeof, unaryop_info{ ast::unaryop_expression_node_t::Sizeof, 2 } },
|
||||
};
|
||||
|
||||
if (token->type == token_t::Keyword) {
|
||||
|
||||
Reference in New Issue
Block a user