aboutsummaryrefslogtreecommitdiff
path: root/include/ast.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/ast.h')
-rw-r--r--include/ast.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/ast.h b/include/ast.h
index 1198a98..bdab6c3 100644
--- a/include/ast.h
+++ b/include/ast.h
@@ -20,7 +20,6 @@
typedef struct Ast Ast;
typedef struct FunctionParameter FunctionParameter;
-typedef struct FunctionSignature FunctionSignature;
typedef struct FunctionCall FunctionCall;
typedef struct StructDecl StructDecl;
typedef struct StructField StructField;
@@ -87,6 +86,7 @@ typedef enum {
typedef struct {
union {
+ void *data;
LhsExpr *lhs_expr;
FunctionSignature *func_sig;
} value;
@@ -107,6 +107,7 @@ typedef enum {
typedef struct {
union {
+ void *data;
LhsExpr *lhs_expr;
FunctionParameter *func_param;
} value;
@@ -218,6 +219,7 @@ struct LhsExpr {
BufferView var_name;
VariableType type;
nullable Ast *rhs_expr;
+ u16 extern_index; /* Index to extern func, extern variable, etc; if applicable */
};
#define LHS_EXPR_IS_EXTERN(expr) ((expr)->decl_flags & DECL_FLAG_EXTERN)
@@ -297,6 +299,8 @@ CHECK_RESULT int function_signature_init(FunctionSignature *self, ArenaAllocator
CHECK_RESULT int function_signature_add_parameter(FunctionSignature *self, const FunctionParameter *param);
/* Adds a copy of @return_type to the function signature return type list */
CHECK_RESULT int function_signature_add_return_type(FunctionSignature *self, const VariableType *return_type);
+CHECK_RESULT bool function_signature_equals(FunctionSignature *self, FunctionSignature *other);
+
void function_parameter_init(FunctionParameter *self);
CHECK_RESULT int funcdecl_init(FunctionDecl *self, FunctionSignature *signature, Scope *parent, ArenaAllocator *allocator);
CHECK_RESULT int funccall_init(FunctionCall *self, BufferView name, ArenaAllocator *allocator);