lisp but crispier
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
339B

  1. //
  2. // Created by red on 05/12/19.
  3. //
  4. #include "mpc.h"
  5. #ifndef CRISP_EVAL_H
  6. #define CRISP_EVAL_H
  7. typedef struct {
  8. int type;
  9. long num;
  10. int err;
  11. } cval;
  12. enum { CVAL_NUM, CVAL_ERR };
  13. enum { CERR_DIV_ZERO, CERR_BAD_OP, CERR_BAD_NUM };
  14. cval eval(mpc_ast_t* t);
  15. void cval_print(cval v);
  16. void cval_println(cval v);
  17. #endif //CRISP_EVAL_H