Restructure
This commit is contained in:
@@ -11,6 +11,7 @@ Intern_String keyword_return;
|
||||
Intern_String keyword_if;
|
||||
Intern_String keyword_else;
|
||||
Intern_String keyword_for;
|
||||
Intern_String keyword_pass;
|
||||
Intern_String keyword_cast;
|
||||
Intern_String keyword_enum;
|
||||
|
||||
@@ -59,6 +60,7 @@ struct Parse_Ctx:Lexer{
|
||||
keyword_cast = intern("cast"_s);
|
||||
keyword_return = intern("return"_s);
|
||||
keyword_if = intern("if"_s);
|
||||
keyword_pass = intern("pass"_s);
|
||||
keyword_else = intern("else"_s);
|
||||
keyword_for = intern("for"_s);
|
||||
keyword_enum = intern_string(&interns, "enum"_s);
|
||||
@@ -98,6 +100,7 @@ enum Ast_Kind: U32{
|
||||
AST_IF_NODE,
|
||||
AST_RETURN,
|
||||
AST_BLOCK,
|
||||
AST_PASS,
|
||||
AST_LAMBDA,
|
||||
AST_LAMBDA_ARG,
|
||||
AST_ENUM,
|
||||
@@ -410,6 +413,12 @@ ast_for(Token *pos, Ast_Expr *init, Ast_Expr *cond, Ast_Expr *iter, Ast_Block *b
|
||||
return result;
|
||||
}
|
||||
|
||||
function Ast_Pass *
|
||||
ast_pass(Token *pos){
|
||||
AST_NEW(Pass, PASS, pos, AST_STMT);
|
||||
return result;
|
||||
}
|
||||
|
||||
function Ast_Return *
|
||||
ast_return(Token *pos, Ast_Expr *expr){
|
||||
AST_NEW(Return, RETURN, pos, AST_STMT);
|
||||
|
||||
Reference in New Issue
Block a user