diff options
author | Chuck Crayne <ccrayne@users.sourceforge.net> | 2007-05-02 04:21:26 +0000 |
---|---|---|
committer | Chuck Crayne <ccrayne@users.sourceforge.net> | 2007-05-02 04:21:26 +0000 |
commit | cb9bc21374d962e584ddb4fe3f0f3e3d1883b047 (patch) | |
tree | d48028bb60db6a9ac3d578d43096c41055f369dd /eval.c | |
parent | 60ae75d3ab2be0981d86e53275e06110f019a641 (diff) | |
download | nasm-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.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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); |