changeset 709:8c6cf02718be

Add XOR operator (^, caret) to the parser .. was implemented already otherwise.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 16 Apr 2013 22:39:43 +0300
parents 35ffb03ffd01
children a2d567d8a82d
files dmeval.c tools/auval.c
diffstat 2 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/dmeval.c	Tue Apr 16 22:33:26 2013 +0300
+++ b/dmeval.c	Tue Apr 16 22:39:43 2013 +0300
@@ -535,6 +535,7 @@
                     case '/': op = OP_DIV; c++; break;
                     case '%': op = OP_MOD; c++; break;
                     case '&': op = OP_AND; c++; break;
+                    case '^': op = OP_XOR; c++; break;
                     case '|': op = OP_OR; c++; break;
                     case '>':
                         if (c[1] == '>')
--- a/tools/auval.c	Tue Apr 16 22:33:26 2013 +0300
+++ b/tools/auval.c	Tue Apr 16 22:39:43 2013 +0300
@@ -1012,6 +1012,9 @@
             if (audata.err == 0)
                 audata.err = dm_eval_reorder(audata.engine, tmp, &audata.expr);
 
+            dm_print_optree(stdout, audata.engine, tmp);
+            dm_print_optree(stdout, audata.engine, audata.expr);
+            printf("--\n");
             dm_eval_free(tmp);
 
             audata.pos = 0;