temporary changes
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Mon, 13 Dec 2021 03:06:52 +0000 (21:06 -0600)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Mon, 13 Dec 2021 03:06:52 +0000 (21:06 -0600)
include/astnodes.h
src/parser.c

index db33aef18d87f8bc91893da3b1839cff91604e8f..ac9499a42d4212283faeaa8499f8be439f0ac000 100644 (file)
@@ -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;
index 81cfee8fb1f5e712c6006020289db28c84af428d..f4f8b1b6a392bc122d9e3ddba50572937a0cb2d0 100644 (file)
@@ -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;