New syntax that's easier to parse, parsing doesn't need variable lookup
This commit is contained in:
16
expr.h
16
expr.h
@@ -1,5 +1,11 @@
|
||||
#pragma once
|
||||
typedef struct Expr Expr;
|
||||
typedef struct Typespec Typespec;
|
||||
|
||||
typedef enum Expr_Sizeof_Kind{
|
||||
SIZEOF_Expr,
|
||||
SIZEOF_Type,
|
||||
}Expr_Sizeof_Kind;
|
||||
|
||||
typedef enum Expr_Kind{
|
||||
EK_None,
|
||||
@@ -11,6 +17,7 @@ typedef enum Expr_Kind{
|
||||
EK_List,
|
||||
EK_Call,
|
||||
EK_Index,
|
||||
EK_Sizeof,
|
||||
} Expr_Kind;
|
||||
|
||||
struct Expr {
|
||||
@@ -19,7 +26,7 @@ struct Expr {
|
||||
Expr *next;
|
||||
union {
|
||||
struct {
|
||||
//Typespec *type;
|
||||
Typespec *type;
|
||||
Expr* expr;
|
||||
} cast;
|
||||
struct {
|
||||
@@ -46,5 +53,12 @@ struct Expr {
|
||||
Expr* on_true;
|
||||
Expr* on_false;
|
||||
} ternary;
|
||||
struct{
|
||||
Expr_Sizeof_Kind kind;
|
||||
union{
|
||||
Typespec *type;
|
||||
Expr *expr;
|
||||
};
|
||||
} size_of;
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user