summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authorChuck Crayne <ccrayne@users.sourceforge.net>2007-05-02 04:21:26 +0000
committerChuck Crayne <ccrayne@users.sourceforge.net>2007-05-02 04:21:26 +0000
commitcb9bc21374d962e584ddb4fe3f0f3e3d1883b047 (patch)
treed48028bb60db6a9ac3d578d43096c41055f369dd /eval.c
parent60ae75d3ab2be0981d86e53275e06110f019a641 (diff)
downloadnasm-cb9bc21374d962e584ddb4fe3f0f3e3d1883b047.tar.gz
nasm-cb9bc21374d962e584ddb4fe3f0f3e3d1883b047.tar.bz2
nasm-cb9bc21374d962e584ddb4fe3f0f3e3d1883b047.zip
Allow '!' to be used in expressions with same meaning as in C.
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/eval.c b/eval.c
index 35baf27..3469555 100644
--- a/eval.c
+++ b/eval.c
@@ -631,6 +631,19 @@ static expr *expr6(int critical)
return NULL;
}
return scalarvect(~reloc_value(e));
+ } else if (i == '!') {
+ i = scan(scpriv, tokval);
+ e = expr6(critical);
+ if (!e)
+ return NULL;
+ if (is_just_unknown(e))
+ return unknown_expr();
+ else if (!is_simple(e)) {
+ error(ERR_NONFATAL, "`!' operator may only be applied to"
+ " scalar values");
+ return NULL;
+ }
+ return scalarvect(!reloc_value(e));
} else if (i == TOKEN_SEG) {
i = scan(scpriv, tokval);
e = expr6(critical);