add boolean logic

This commit is contained in:
r4
2021-12-23 21:06:49 +01:00
parent d185396a1c
commit 84785dc3cf
10 changed files with 155 additions and 29 deletions

8
tok.h
View File

@@ -11,6 +11,7 @@ typedef struct Type {
TypeVoid = 0,
TypeFloat,
TypeInt,
TypeBool,
} kind;
/*union {
@@ -23,6 +24,7 @@ typedef struct Value {
union {
double Float;
ssize_t Int;
bool Bool;
};
} Value;
@@ -36,7 +38,13 @@ enum Operator {
OpSub = '-',
OpMul = '*',
OpDiv = '/',
OpNot = '!',
OpBeginNonchars = 256,
OpEq,
OpLt,
OpGt,
OpLe,
OpGe,
OpNewLn,
OpEOF,
OperatorEnumSize,