Mercurial > hg-old > index.cgi
comparison lwlib/lw_expr.c @ 347:1649bc7bda5a
Some data oriented pseudo ops added
author | lost@starbug |
---|---|
date | Sat, 27 Mar 2010 20:16:24 -0600 |
parents | a82c55070624 |
children | 34dfc9747f23 |
comparison
equal
deleted
inserted
replaced
346:a82c55070624 | 347:1649bc7bda5a |
---|---|
32 #include "lw_string.h" | 32 #include "lw_string.h" |
33 | 33 |
34 static lw_expr_fn_t *evaluate_special = NULL; | 34 static lw_expr_fn_t *evaluate_special = NULL; |
35 static lw_expr_fn2_t *evaluate_var = NULL; | 35 static lw_expr_fn2_t *evaluate_var = NULL; |
36 static lw_expr_fn3_t *parse_term = NULL; | 36 static lw_expr_fn3_t *parse_term = NULL; |
37 | |
38 int lw_expr_istype(lw_expr_t e, int t) | |
39 { | |
40 if (e -> type == t) | |
41 return 1; | |
42 return 0; | |
43 } | |
44 | |
45 int lw_expr_intval(lw_expr_t e) | |
46 { | |
47 if (e -> type == lw_expr_type_int) | |
48 return e -> value; | |
49 return -1; | |
50 } | |
37 | 51 |
38 void lw_expr_set_term_parser(lw_expr_fn3_t *fn) | 52 void lw_expr_set_term_parser(lw_expr_fn3_t *fn) |
39 { | 53 { |
40 parse_term = fn; | 54 parse_term = fn; |
41 } | 55 } |