202608280129
This commit is contained in:
1 parent
c44a4058d1
commit
5b53bc91be
1 file changed
+10
-10
+10
-10
@@ -77,15 +77,7 @@ r8asm::general_data r8asm::ast::expand_node_to_data(const ast_node &node) {
|
||||
}
|
||||
|
||||
std::string r8asm::ast::expand_node_to_string(const ast_node &node) {
|
||||
std::string to_return = "";
|
||||
switch (node.type) {
|
||||
case ast_node_t::STRING:
|
||||
to_return = node.value;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return to_return;
|
||||
return node.value;
|
||||
}
|
||||
|
||||
#define EMPTY_CODEBLOCK \
|
||||
@@ -440,7 +432,8 @@ bool r8asm::is_integer(const std::string &str) {
|
||||
((present_token->type == token_t::LPAREN || \
|
||||
present_token->type == token_t::STRING || \
|
||||
(present_token->type == token_t::OPERATOR && \
|
||||
(present_token->value == "neg" || present_token->value == "not"))) && \
|
||||
(present_token->value == "op_neg" || \
|
||||
present_token->value == "op_not"))) && \
|
||||
(!((present_token - 1)->type == token_t::OPERATOR || \
|
||||
(present_token - 1)->type == token_t::LPAREN))))
|
||||
r8asm::ast_node r8asm::parse_args(const token_line &line) {
|
||||
@@ -461,6 +454,13 @@ r8asm::ast_node r8asm::parse_args(const token_line &line) {
|
||||
}
|
||||
buffer.push_back(*it);
|
||||
}
|
||||
if (!buffer.empty()) {
|
||||
raw_args.push_back({line.number, {}});
|
||||
while (!buffer.empty()) {
|
||||
raw_args.back().tokens.push_back(buffer.front());
|
||||
buffer.pop_front();
|
||||
}
|
||||
}
|
||||
for (const auto &it : raw_args)
|
||||
to_return.children.push_back(parse_single_arg(it));
|
||||
return to_return;
|
||||
|
||||
Reference in new issue
Block a user