aboutsummaryrefslogtreecommitdiff
path: root/src/ast.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ast.c')
-rw-r--r--src/ast.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/ast.c b/src/ast.c
index 56eb34f..75c8afc 100644
--- a/src/ast.c
+++ b/src/ast.c
@@ -17,8 +17,9 @@ int funcdecl_add_to_body(FunctionDecl *self, Ast ast) {
return BUFFER_OK;
}
-void funccall_init(FunctionCall *self, BufferView name) {
+int funccall_init(FunctionCall *self, BufferView name, ScopedAllocator *allocator) {
self->name = name;
+ return buffer_init(&self->args, allocator);
}
void lhsexpr_init(LhsExpr *self, int isConst, BufferView var_name) {
@@ -30,3 +31,14 @@ void lhsexpr_init(LhsExpr *self, int isConst, BufferView var_name) {
void import_init(Import *self, BufferView path) {
self->path = path;
}
+
+int string_init(String *self, BufferView str) {
+ /* TODO: Convert special characters. For example \n should be converted to binary newline etc */
+ self->str = str;
+ return 0;
+}
+
+void number_init(Number *self, i64 value, bool is_integer) {
+ self->value.integer = value;
+ self->is_integer = is_integer;
+} \ No newline at end of file