polserver/testsuite/escript/oper/plusplus02.src

28 lines
394 B
Text
Raw Permalink Normal View History

2019-09-22 11:50:29 +02:00
//some funny valid syntax features
2019-09-22 09:37:51 +02:00
//tokens do not consider spaces inbetween...
2019-09-21 16:35:54 +02:00
var a:=1;
2019-09-22 09:37:51 +02:00
var b:=2;
2019-09-21 16:35:54 +02:00
print(a+++b);
2019-09-22 09:37:51 +02:00
a:=1;
b:=2;
print((a++)+b);
a:=1;
b:=2;
print(a++ +b);
a:=1;
b:=2;
2019-09-22 09:37:51 +02:00
print(a+(++b));
a:=1;
b:=2;
print(a+ ++b);
2019-09-22 11:50:29 +02:00
a:=1;
// postfix operators are now highest precedence: ++a++;
2019-09-22 11:50:29 +02:00
print(a);
a:=1;
// postfix operators are now highest precedence: ++a--;
2019-09-22 11:50:29 +02:00
print(a);
2019-09-22 15:25:40 +02:00
a:=1;
++(++a);
print(a);