New cast '->'
This commit is contained in:
17
ast.cpp
17
ast.cpp
@@ -111,13 +111,6 @@ struct Ast_Load: Ast{
|
||||
String string;
|
||||
};
|
||||
|
||||
struct Ast_Cast: Ast_Expr{
|
||||
Ast_Expr *expr;
|
||||
Ast_Expr *typespec;
|
||||
Ast_Type *before_type;
|
||||
Ast_Type *after_type;
|
||||
};
|
||||
|
||||
struct Ast_Index: Ast_Expr{
|
||||
Ast_Expr *expr;
|
||||
Ast_Expr *index;
|
||||
@@ -130,6 +123,7 @@ struct Ast_Binary: Ast_Expr{
|
||||
Ast_Expr *right;
|
||||
|
||||
Ast_Type *type;
|
||||
Ast_Type *before_type;
|
||||
};
|
||||
|
||||
// Problem: We are parsing out of order, in the middle of parsing a function
|
||||
@@ -314,15 +308,6 @@ ast_call_item(Token *pos, Ast_Atom *name, Ast_Expr *index, Ast_Expr *item){
|
||||
return result;
|
||||
}
|
||||
|
||||
function Ast_Expr *
|
||||
ast_expr_cast(Token *pos, Ast_Expr *expr, Ast_Expr *typespec){
|
||||
AST_NEW(Cast, CAST, pos, AST_EXPR);
|
||||
result->flags = AST_EXPR;
|
||||
result->expr = expr;
|
||||
result->typespec = typespec;
|
||||
return result;
|
||||
}
|
||||
|
||||
function Ast_Expr *
|
||||
ast_expr_unary(Token *pos, Token_Kind op, Ast_Expr *expr){
|
||||
AST_NEW(Unary, UNARY, pos, AST_EXPR);
|
||||
|
||||
Reference in New Issue
Block a user