From 4ec0e96e32a271ff59099aa6bb4233b107195ccd Mon Sep 17 00:00:00 2001 From: A404M Date: Mon, 7 Apr 2025 10:31:58 +0330 Subject: add struct + struct values + access by dot --- src/compiler/ast-tree.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/compiler/ast-tree.h') diff --git a/src/compiler/ast-tree.h b/src/compiler/ast-tree.h index fdc797e..d8e9f9a 100644 --- a/src/compiler/ast-tree.h +++ b/src/compiler/ast-tree.h @@ -43,6 +43,7 @@ typedef enum AstTreeToken { AST_TREE_TOKEN_VALUE_INT, AST_TREE_TOKEN_VALUE_FLOAT, AST_TREE_TOKEN_VALUE_BOOL, + AST_TREE_TOKEN_VALUE_OBJECT, AST_TREE_TOKEN_OPERATOR_ASSIGN, AST_TREE_TOKEN_OPERATOR_PLUS, @@ -156,6 +157,10 @@ typedef f128 AstTreeFloat; typedef bool AstTreeBool; +typedef struct AstTreeObject { + AstTreeVariables variables; +} AstTreeObject; + typedef AstTree AstTreeSingleChild; typedef struct AstTreeInfix { @@ -291,6 +296,7 @@ bool setTypesValueInt(AstTree *tree, AstTreeSetTypesHelper helper); bool setTypesValueFloat(AstTree *tree, AstTreeSetTypesHelper helper); bool setTypesValueNull(AstTree *tree, AstTreeSetTypesHelper helper); bool setTypesValueUndefined(AstTree *tree, AstTreeSetTypesHelper helper); +bool setTypesValueObject(AstTree *tree, AstTreeSetTypesHelper helper); bool setTypesFunction(AstTree *tree, AstTreeSetTypesHelper helper); bool setTypesPrintU64(AstTree *tree, AstTreeSetTypesHelper helper); bool setTypesReturn(AstTree *tree, AstTreeSetTypesHelper helper, @@ -320,5 +326,3 @@ bool setTypesOperatorAccess(AstTree *tree, AstTreeSetTypesHelper helper); bool setTypesAstVariable(AstTreeVariable *variable, AstTreeSetTypesHelper helper); bool setTypesAstInfix(AstTreeInfix *infix, AstTreeSetTypesHelper helper); - -size_t sizeOfType(AstTree *type); -- cgit v1.2.3