comparison src/expr.c @ 23:ec0bf61a5502

Added ^ (bitwise complement)
author lost
date Fri, 02 Jan 2009 01:32:07 +0000
parents 218aabbc3b1a
children 538e15927776
comparison
equal deleted inserted replaced
22:b704f7ffc8ba 23:ec0bf61a5502
200 // parse expression following "-" 200 // parse expression following "-"
201 (*p)++; 201 (*p)++;
202 if (lwasm_expr_parse_expr(s, p, 200) < 0) 202 if (lwasm_expr_parse_expr(s, p, 200) < 0)
203 return -1; 203 return -1;
204 t = lwasm_expr_term_create_oper(LWASM_OPER_NEG); 204 t = lwasm_expr_term_create_oper(LWASM_OPER_NEG);
205 lwasm_expr_stack_push(s, t);
206 lwasm_expr_term_free(t);
207 return 0;
208 }
209
210 if (**p == '^')
211 {
212 // parse expression following "^"
213 (*p)++;
214 if (lwasm_expr_parse_expr(s, p, 200) < 0)
215 return -1;
216 t = lwasm_expr_term_create_oper(LWASM_OPER_COM);
205 lwasm_expr_stack_push(s, t); 217 lwasm_expr_stack_push(s, t);
206 lwasm_expr_term_free(t); 218 lwasm_expr_term_free(t);
207 return 0; 219 return 0;
208 } 220 }
209 221