Begin raymarcher example and math module, fixing parsing bugs

This commit is contained in:
Krzosa Karol
2022-09-27 22:42:46 +02:00
parent 7ab1b24bbe
commit f388e3f915
7 changed files with 244 additions and 9 deletions

View File

@@ -180,7 +180,9 @@ parse_expr_call(Ast_Expr *left, Token_Kind close_kind){
Ast_Call_Item *item_comp = ast_new(Ast_Call_Item, AST_CALL_ITEM, token_get(), AST_EXPR);
item_comp->item = parse_expr();
if(token_match(TK_Assign)){
assert(is_flag_set(item_comp->item->flags, AST_ATOM));
if(!is_flag_set(item_comp->item->flags, AST_ATOM)){
compiler_error(item_comp->pos, "Invalid value specifier, it's required to be a simple identifier/index");
}
if(item_comp->item->kind != AST_IDENT){
item_comp->index = item_comp->item;