Work on order independent structs + cleanup
This commit is contained in:
13
new_ast.cpp
13
new_ast.cpp
@@ -111,6 +111,7 @@ enum{
|
||||
AST_STMT = 2,
|
||||
AST_BINDING = 4,
|
||||
AST_AGGREGATE = 8,
|
||||
AST_ATOM = 16,
|
||||
};
|
||||
|
||||
struct Ast{
|
||||
@@ -120,12 +121,6 @@ struct Ast{
|
||||
Ast_Kind kind;
|
||||
Ast *parent;
|
||||
Ast_Flag flags;
|
||||
// @todo?
|
||||
// bool is_atom: 1;
|
||||
// bool is_stmt: 1;
|
||||
// bool is_decl: 1;
|
||||
// bool is_expr: 1;
|
||||
// bool is_named: 1;
|
||||
};
|
||||
|
||||
struct Ast_Resolved_Type;
|
||||
@@ -252,21 +247,21 @@ struct Ast_Package:Ast{
|
||||
|
||||
function Ast_Atom *
|
||||
ast_str(Token *pos, Intern_String string, Ast_Flag flags = 0){
|
||||
AST_NEW(Atom, STR, pos,flags);
|
||||
AST_NEW(Atom, STR, pos, AST_ATOM | flags);
|
||||
result->intern_val = string;
|
||||
return result;
|
||||
}
|
||||
|
||||
function Ast_Atom *
|
||||
ast_ident(Token *pos, Intern_String string, Ast_Flag flags = 0){
|
||||
AST_NEW(Atom, IDENT, pos,flags);
|
||||
AST_NEW(Atom, IDENT, pos, AST_ATOM | flags);
|
||||
result->intern_val = string;
|
||||
return result;
|
||||
}
|
||||
|
||||
function Ast_Atom *
|
||||
ast_int(Token *pos, S64 integer, Ast_Flag flags = 0){
|
||||
AST_NEW(Atom, INT, pos,flags);
|
||||
AST_NEW(Atom, INT, pos, AST_ATOM | flags);
|
||||
result->int_val = integer;
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user