mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-03-22 02:31:28 +00:00
Remove &~= operator from gmqccs operator table, only fteqcc supports it.
This commit is contained in:
parent
dd289ed0e1
commit
f8af7adcd7
4 changed files with 30 additions and 3 deletions
1
lexer.h
1
lexer.h
|
@ -235,7 +235,6 @@ static const oper_info c_operators[] = {
|
|||
{ "&=", 2, opid2('&','='), ASSOC_RIGHT, 2, 0, false},
|
||||
{ "^=", 2, opid2('^','='), ASSOC_RIGHT, 2, 0, false},
|
||||
{ "|=", 2, opid2('|','='), ASSOC_RIGHT, 2, 0, false},
|
||||
{ "&~=", 2, opid3('&','~','='), ASSOC_RIGHT, 2, 0, false},
|
||||
|
||||
{ ":", 0, opid2(':','?'), ASSOC_RIGHT, 1, 0, false},
|
||||
|
||||
|
|
|
@ -6,11 +6,28 @@ void main() {
|
|||
vector e; e = '1 1 1';
|
||||
vector f; f = '1 1 1';
|
||||
|
||||
#ifdef __STD_FTEQCC__
|
||||
a &~= 1; // 0
|
||||
#else
|
||||
a &= ~1; // 0
|
||||
#endif
|
||||
#ifdef __STD_GMQCC__
|
||||
b &= ~1; // 0
|
||||
c &= ~d; // 0
|
||||
#else
|
||||
b &~= 1; // 0
|
||||
c &~= 1; // 0
|
||||
#endif
|
||||
#ifdef __STD_FTEQCC__
|
||||
f &~= e; // '0 0 0'
|
||||
#else
|
||||
f &= ~e; // '0 0 0'
|
||||
#endif
|
||||
#ifdef __STD_GMQCC__
|
||||
e &= ~e; // '0 0 0'
|
||||
#else
|
||||
e &~= e; // '0 0 0'
|
||||
#endif
|
||||
|
||||
print("a: ", ftos(a), "\nb: ",
|
||||
ftos(b), "\nc: ",
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
# used to test the builtins
|
||||
I: bitnot.qc
|
||||
D: test bitwise not operators
|
||||
D: test bitwise not operators (fteqcc operators)
|
||||
T: -execute
|
||||
C: -std=gmqcc
|
||||
C: -std=fteqcc
|
||||
E: $null
|
||||
M: a: 0
|
||||
M: b: 0
|
||||
|
|
11
tests/bitnotgmqcc.tmpl
Normal file
11
tests/bitnotgmqcc.tmpl
Normal file
|
@ -0,0 +1,11 @@
|
|||
# used to test the builtins
|
||||
I: bitnot.qc
|
||||
D: test bitwise not operators (gmqcc operators)
|
||||
T: -execute
|
||||
C: -std=gmqcc -fftepp
|
||||
E: $null
|
||||
M: a: 0
|
||||
M: b: 0
|
||||
M: c: 0
|
||||
M: e: '0 0 0'
|
||||
M: f: '0 0 0'
|
Loading…
Reference in a new issue