aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/ast.h8
-rw-r--r--include/tokenizer.h3
2 files changed, 6 insertions, 5 deletions
diff --git a/include/ast.h b/include/ast.h
index e49ad08..7b16796 100644
--- a/include/ast.h
+++ b/include/ast.h
@@ -65,12 +65,12 @@ typedef struct {
AstValue value;
AstType type;
AstResolveStatus resolve_status;
- StructDecl *resolved_type;
+ LhsExpr *resolved_type;
} Ast;
struct Scope {
Buffer ast_objects;
- HashMap/*(key=BufferView, value=Ast)*/ named_objects;
+ HashMap/*(key=BufferView, value=Ast<LhsExpr>)*/ named_objects;
Scope *parent;
};
@@ -81,7 +81,6 @@ struct FileScopeReference {
struct Variable {
BufferView name;
- Ast resolved_variable;
};
struct FunctionDecl {
@@ -104,6 +103,7 @@ struct StructField {
};
struct LhsExpr {
+ bool is_pub;
bool is_const;
BufferView var_name;
Variable type;
@@ -149,7 +149,7 @@ CHECK_RESULT int funcdecl_init(FunctionDecl *self, Scope *parent, ScopedAllocato
CHECK_RESULT int funccall_init(FunctionCall *self, BufferView name, ScopedAllocator *allocator);
CHECK_RESULT int structdecl_init(StructDecl *self, Scope *parent, ScopedAllocator *allocator);
void structfield_init(StructField *self, BufferView name, BufferView type_name);
-void lhsexpr_init(LhsExpr *self, bool is_const, BufferView var_name);
+void lhsexpr_init(LhsExpr *self, bool is_pub, bool is_const, BufferView var_name);
void import_init(Import *self, BufferView path);
CHECK_RESULT int string_init(String *self, BufferView str);
void number_init(Number *self, i64 value, bool is_integer);
diff --git a/include/tokenizer.h b/include/tokenizer.h
index c4c3725..3944ed1 100644
--- a/include/tokenizer.h
+++ b/include/tokenizer.h
@@ -30,7 +30,8 @@ typedef enum {
TOK_NUMBER,
TOK_SEMICOLON,
TOK_COLON,
- TOK_BINOP
+ TOK_BINOP,
+ TOK_PUB
} Token;
typedef struct {