This fixes issue #49 in the simplest way. Before, if the
dereferenced variable was a byte type, the result of the word
pointer dereference operator, *, would be a byte type. This
caused *@a to return a byte if a was a byte type. Now the
pointer type is used instead, causing *@a to return a word.
Prefix operator parsing allows some nonsensical constructions,
like @*x, but these were already possible before.
Before the output from:
include "inc/cmdsys.plh"
byte a
byte b
word x
a = 5
b = 6
x = $55FF
puti(*@a) // 5
putln()
puti(*(@a)) // 1541
putln()
puti(@*a) // 5
putln()
puti(^@x) // 255
putln()
puti(^(@x)) // 255
putln()
puti(@^x) // 255
putln()
done
This fixes issue #49 in the simplest way. Before, if the dereferenced variable was a byte type, the result of the word pointer dereference operator,
*
, would be a byte type. This caused*@a
to return a byte ifa
was a byte type. Now the pointer type is used instead, causing*@a
to return a word.Prefix operator parsing allows some nonsensical constructions, like
@*x
, but these were already possible before.Before the output from:
was:
now it is: