Add Core compiler interface
This commit is contained in:
@@ -1,11 +1,5 @@
|
||||
|
||||
struct Operator_Info{
|
||||
Intern_String op;
|
||||
String name;
|
||||
Token_Kind op_kind;
|
||||
bool valid_binary_expr;
|
||||
bool valid_unary_expr;
|
||||
};
|
||||
|
||||
|
||||
/*#import meta
|
||||
|
||||
@@ -40,7 +34,7 @@ print(" return 0;\n}")
|
||||
|
||||
|
||||
*/
|
||||
Operator_Info op_info_table[] = {
|
||||
Ast_Operator_Info op_info_table[] = {
|
||||
{{}, "MUL"_s, TK_Mul, 1, 0},
|
||||
{{}, "DIV"_s, TK_Div, 1, 0},
|
||||
{{}, "MOD"_s, TK_Mod, 1, 0},
|
||||
@@ -62,7 +56,7 @@ Operator_Info op_info_table[] = {
|
||||
{{}, "NEG"_s, TK_Neg, 0, 1},
|
||||
{{}, "NOT"_s, TK_Not, 0, 1},
|
||||
};
|
||||
CORE_Static Operator_Info *
|
||||
CORE_Static Ast_Operator_Info *
|
||||
get_operator_info(Token_Kind op){
|
||||
switch(op){
|
||||
case TK_Mul: return op_info_table + 0;
|
||||
@@ -89,7 +83,7 @@ get_operator_info(Token_Kind op){
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
CORE_Static Operator_Info *
|
||||
CORE_Static Ast_Operator_Info *
|
||||
get_operator_info(Intern_String op){
|
||||
if(0){}
|
||||
else if(op_info_table[0].op.str == op.str) return op_info_table + 0;
|
||||
|
||||
Reference in New Issue
Block a user