add access

This commit is contained in:
2025-06-05 04:09:31 +01:00
parent 71c192f1d1
commit acc432ed79
2 changed files with 9 additions and 1 deletions

View File

@@ -9,6 +9,7 @@
#include "string/string.h"
#include "literals/literals.h"
#include "assignable/call/call.h"
#include "assignable/access/access.h"
#include <stdbool.h>
#include <stddef.h>
#include <stdio.h>
@@ -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:

View File

@@ -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
x.epic_test_long_variable_name = "hello world"