diff options
author | Tavian Barnes <tavianator@gmail.com> | 2010-03-22 13:19:45 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2010-03-22 13:19:45 -0400 |
commit | bb71a70253ae5bf91e99dcd2809471abebea1b69 (patch) | |
tree | 26c145bbdcb6ba71b2f272641439692c30a5254b /dimension/parse.c | |
parent | ac3e97014885af00b5a2eb01df232221482db023 (diff) | |
download | dimension-bb71a70253ae5bf91e99dcd2809471abebea1b69.tar.xz |
Support logical ! operator.
Diffstat (limited to 'dimension/parse.c')
-rw-r--r-- | dimension/parse.c | 9 |
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: |