harec

[hare] Hare compiler, written in C11 for POSIX OSs
Log | Files | Refs | README | LICENSE

eval.h (394B)


      1 #ifndef HAREC_EVAL_H
      2 #define HAREC_EVAL_H
      3 #include <stdbool.h>
      4 
      5 struct expression;
      6 struct context;
      7 
      8 enum eval_result {
      9 	// Evaluation succeeded.
     10 	EVAL_OK,
     11 
     12 	// This expression cannot be evaluated at compile time (user error).
     13 	EVAL_INVALID,
     14 };
     15 
     16 // Evaluates an expression at compile time.
     17 enum eval_result eval_expr(struct context *ctx,
     18 	struct expression *in, struct expression *out);
     19 
     20 #endif