Added logical operators && || and !

This commit is contained in:
2014-05-29 16:57:35 +01:00
parent 147c68ccde
commit 396bf65a84
4 changed files with 68 additions and 5 deletions

3
lval.h
View File

@@ -22,6 +22,9 @@ typedef struct lval_func lval_func;
#include "main.h"
#include "lenv.h"
#define LVAL_IS_TRUE(val) (val->type == LVAL_NUM && fabs(val->data.num) > DBL_EPSILON)
#define LVAL_IS_FALSE(val) (val->type == LVAL_NUM && fabs(val->data.num) <= DBL_EPSILON)
enum VAL_TYPE { LVAL_ERR, LVAL_NUM, LVAL_SYM, LVAL_FUNC, LVAL_S_EXPR, LVAL_Q_EXPR, LVAL_EXIT };
enum VAL_ERROR { LERR_DIV_ZERO, LERR_BAD_OP, LERR_BAD_NUM, LERR_BAD_SYM, LERR_OTHER, LERR_SYNTAX };
typedef enum VAL_TYPE VAL_TYPE;