From: Brendan Hansen Date: Mon, 13 Dec 2021 03:06:52 +0000 (-0600) Subject: temporary changes X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=4c3c4314a6e59a70b21fec252a184aa497e57e3d;p=onyx.git temporary changes --- diff --git a/include/astnodes.h b/include/astnodes.h index db33aef1..ac9499a4 100644 --- a/include/astnodes.h +++ b/include/astnodes.h @@ -955,7 +955,7 @@ struct AstDistinctType { // Top level nodes struct AstBinding { AstTyped_base; AstNode* node; }; struct AstAlias { AstTyped_base; AstTyped* alias; }; -struct AstInclude { AstNode_base; char* name; }; +struct AstInclude { AstNode_base; AstNode* name_node; char* name; }; struct AstMemRes { AstTyped_base; u64 addr; diff --git a/src/parser.c b/src/parser.c index 81cfee8f..f4f8b1b6 100644 --- a/src/parser.c +++ b/src/parser.c @@ -2954,13 +2954,16 @@ static void parse_top_level_statement(OnyxParser* parser) { if (parse_possible_directive(parser, "load")) { AstInclude* include = make_node(AstInclude, Ast_Kind_Load_File); include->token = dir_token; + include->name_node = parse_expression(parser, 0); + /* nocheckin OnyxToken* str_token = expect_token(parser, Token_Type_Literal_String); if (str_token != NULL) { token_toggle_end(str_token); include->name = bh_strdup(parser->allocator, str_token->text); token_toggle_end(str_token); } + */ ENTITY_SUBMIT(include); return; @@ -2968,13 +2971,16 @@ static void parse_top_level_statement(OnyxParser* parser) { else if (parse_possible_directive(parser, "load_path")) { AstInclude* include = make_node(AstInclude, Ast_Kind_Load_Path); include->token = dir_token; + include->name_node = parse_expression(parser, 0); + /* nocheckin OnyxToken* str_token = expect_token(parser, Token_Type_Literal_String); if (str_token != NULL) { token_toggle_end(str_token); include->name = bh_strdup(parser->allocator, str_token->text); token_toggle_end(str_token); } + */ ENTITY_SUBMIT(include); return; @@ -2982,13 +2988,16 @@ static void parse_top_level_statement(OnyxParser* parser) { else if (parse_possible_directive(parser, "library_path")) { AstInclude* include = make_node(AstInclude, Ast_Kind_Library_Path); include->token = dir_token; - + include->name_node = parse_expression(parser, 0); + + /* nocheckin OnyxToken* str_token = expect_token(parser, Token_Type_Literal_String); if (str_token != NULL) { token_toggle_end(str_token); include->name = bh_strdup(parser->allocator, str_token->text); token_toggle_end(str_token); } + */ ENTITY_SUBMIT(include); return;