summaryrefslogtreecommitdiffstats
path: root/dimension/parse.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2010-03-22 13:19:45 -0400
committerTavian Barnes <tavianator@gmail.com>2010-03-22 13:19:45 -0400
commitbb71a70253ae5bf91e99dcd2809471abebea1b69 (patch)
tree26c145bbdcb6ba71b2f272641439692c30a5254b /dimension/parse.c
parentac3e97014885af00b5a2eb01df232221482db023 (diff)
downloaddimension-bb71a70253ae5bf91e99dcd2809471abebea1b69.tar.xz
Support logical ! operator.
Diffstat (limited to 'dimension/parse.c')
-rw-r--r--dimension/parse.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/dimension/parse.c b/dimension/parse.c
index 177a96c..6de30c9 100644
--- a/dimension/parse.c
+++ b/dimension/parse.c
@@ -660,6 +660,10 @@ dmnsn_eval_unary(dmnsn_astnode astnode, dmnsn_symbol_table *symtable)
dmnsn_make_ast_integer(&ret, -n);
break;
+ case DMNSN_AST_NOT:
+ dmnsn_make_ast_integer(&ret, !n);
+ break;
+
case DMNSN_AST_ABS:
dmnsn_make_ast_integer(&ret, labs(n));
break;
@@ -755,6 +759,10 @@ dmnsn_eval_unary(dmnsn_astnode astnode, dmnsn_symbol_table *symtable)
dmnsn_make_ast_float(&ret, -n);
break;
+ case DMNSN_AST_NOT:
+ dmnsn_make_ast_integer(&ret, !n);
+ break;
+
case DMNSN_AST_ABS:
dmnsn_make_ast_float(&ret, fabs(n));
break;
@@ -1389,6 +1397,7 @@ dmnsn_eval(dmnsn_astnode astnode, dmnsn_symbol_table *symtable)
case DMNSN_AST_DOT_T:
case DMNSN_AST_DOT_TRANSMIT:
case DMNSN_AST_NEGATE:
+ case DMNSN_AST_NOT:
case DMNSN_AST_ABS:
case DMNSN_AST_ACOS:
case DMNSN_AST_ACOSH: