From acc432ed792a2cf6723306174bf0cb781488b0fb Mon Sep 17 00:00:00 2001 From: William Bell Date: Thu, 5 Jun 2025 04:09:31 +0100 Subject: [PATCH] add access --- src/parser/parser.c | 7 +++++++ test.ar | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/parser/parser.c b/src/parser/parser.c index 1d21f44..493689d 100644 --- a/src/parser/parser.c +++ b/src/parser/parser.c @@ -9,6 +9,7 @@ #include "string/string.h" #include "literals/literals.h" #include "assignable/call/call.h" +#include "assignable/access/access.h" #include #include #include @@ -106,6 +107,9 @@ ParsedValue *parse_token(char *file, DArray *tokens, size_t *index, case TOKEN_LPAREN: output = parse_call(file, tokens, index, output); break; + case TOKEN_DOT: + output = parse_access(file, tokens, index, output); + break; default: passed = true; } @@ -141,6 +145,9 @@ void free_parsed(void *ptr) { case AST_CALL: free_parse_call(parsed); break; + case AST_ACCESS: + free_parse_access(parsed); + break; case AST_NUMBER: case AST_NULL: case AST_BOOLEAN: diff --git a/test.ar b/test.ar index f52202e..e4990ee 100644 --- a/test.ar +++ b/test.ar @@ -1,2 +1,3 @@ let a, b = 1, c, d = 42, temp_result, compute_area(radius) = 3.1415, identity(x) = x, f(x), g(y, z), result, z = 0, extremely_long_variable_name_to_test_limits, cache_value = compute_area(5), placeholder_fn_with_no_body(arg1, arg2, arg3), total = identity(100), deeply_nested_args_function(arg1, arg2, arg3, arg4, arg5), sum = a, another, another_function(), just_null_here -x = 10 \ No newline at end of file +x = 10 +x.epic_test_long_variable_name = "hello world" \ No newline at end of file