diff 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
line wrap: on
line diff
--- a/lwlib/lw_expr.c	Sat Mar 27 19:04:03 2010 -0600
+++ b/lwlib/lw_expr.c	Sat Mar 27 20:16:24 2010 -0600
@@ -35,6 +35,20 @@
 static lw_expr_fn2_t *evaluate_var = NULL;
 static lw_expr_fn3_t *parse_term = NULL;
 
+int lw_expr_istype(lw_expr_t e, int t)
+{
+	if (e -> type == t)
+		return 1;
+	return 0;
+}
+
+int lw_expr_intval(lw_expr_t e)
+{
+	if (e -> type == lw_expr_type_int)
+		return e -> value;
+	return -1;
+}
+
 void lw_expr_set_term_parser(lw_expr_fn3_t *fn)
 {
 	parse_term = fn;