1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2024-08-22 13:29:01 +00:00

Fix compliment(~ and #) and logical not (!) operator

This commit is contained in:
David Schmenk 2016-07-24 12:13:21 -07:00
parent 7c30332427
commit 9ab2daf808
2 changed files with 10 additions and 5 deletions

Binary file not shown.

View File

@ -90,7 +90,7 @@ word = $0450,$04D0,$0550,$05D0,$0650,$06D0,$0750,$07D0
// Editor variables
//
byte nullstr = ""
byte version = "PLASMA ][ SANDBOX VERSION 00.93"
byte version = "PLASMA ][ SANDBOX VERSION 00.94"
byte errorstr = "ERROR: $"
byte okstr = "OK"
byte outofmem = "OUT OF MEMORY!"
@ -150,7 +150,8 @@ const DOT_TKN = $AE // .
const COLON_TKN = $BA // :
const NEG_TKN = $AD // -
const COMP_TKN = $A3 // #
const LOGIC_NOT_TKN = $FE // ~
const ALT_COMP_TKN = $FE // ~
const LOGIC_NOT_TKN = $A1 // !
const BPTR_TKN = $DE // ^
const WPTR_TKN = $AA // *
const PTRB_TKN = $D8 // X
@ -2232,6 +2233,7 @@ def emit_unaryop(op)
when op
is NEG_TKN
emit_op($10); break
is ALT_COMP_TKN
is COMP_TKN
emit_op($12); break
is LOGIC_NOT_TKN
@ -2962,6 +2964,7 @@ def parse_constval
when token
is SUB_TKN
mod = mod | 1; break
is ALT_COMP_TKN
is COMP_TKN
mod = mod | 2; break
is LOGIC_NOT_TKN
@ -3143,6 +3146,7 @@ def parse_value(rvalue)
deref = deref - 1
break
is SUB_TKN
is ALT_COMP_TKN
is COMP_TKN
is LOGIC_NOT_TKN
push_op(token, 0)
@ -3192,15 +3196,16 @@ def parse_value(rvalue)
is NEG_TKN
pop_op
value = -value
break
break
is ALT_COMP_TKN
is COMP_TKN
pop_op
value = ~value
break
break
is LOGIC_NOT_TKN
pop_op
value = !value
break
break
otherwise
cparams = FALSE
wend