polserver/testsuite/escript/oper/plusplus02.src

27 lines
394 B
Text

//some funny valid syntax features
//tokens do not consider spaces inbetween...
var a:=1;
var b:=2;
print(a+++b);
a:=1;
b:=2;
print((a++)+b);
a:=1;
b:=2;
print(a++ +b);
a:=1;
b:=2;
print(a+(++b));
a:=1;
b:=2;
print(a+ ++b);
a:=1;
// postfix operators are now highest precedence: ++a++;
print(a);
a:=1;
// postfix operators are now highest precedence: ++a--;
print(a);
a:=1;
++(++a);
print(a);