From: Dale Weiler Date: Thu, 29 Aug 2013 11:19:19 +0000 (-0400) Subject: Remove &~= operator from gmqccs operator table, only fteqcc supports it. X-Git-Tag: 0.3.5~117 X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=commitdiff_plain;h=f8af7adcd7afa208bd9d0e104e140d88efb2666f Remove &~= operator from gmqccs operator table, only fteqcc supports it. --- diff --git a/lexer.h b/lexer.h index 2d67f39..48ab4b6 100644 --- a/lexer.h +++ b/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}, diff --git a/tests/bitnot.qc b/tests/bitnot.qc index 17ba6cd..54b6ecb 100644 --- a/tests/bitnot.qc +++ b/tests/bitnot.qc @@ -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: ", diff --git a/tests/bitnot.tmpl b/tests/bitnot.tmpl index b6a1eaa..45838e3 100644 --- a/tests/bitnot.tmpl +++ b/tests/bitnot.tmpl @@ -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 diff --git a/tests/bitnotgmqcc.tmpl b/tests/bitnotgmqcc.tmpl new file mode 100644 index 0000000..5614312 --- /dev/null +++ b/tests/bitnotgmqcc.tmpl @@ -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'