Browse Source

fcl-passrc: changed operator precedence level of is to same as and,or,xor

git-svn-id: trunk@40517 -
Mattias Gaertner 6 years ago
parent
commit
7815ed4de1
1 changed files with 4 additions and 2 deletions
  1. 4 2
      packages/fcl-passrc/src/pparser.pp

+ 4 - 2
packages/fcl-passrc/src/pparser.pp

@@ -2385,11 +2385,13 @@ begin
   //    Result:=5;
   //    Result:=5;
     tknot,tkAt,tkAtAt:
     tknot,tkAt,tkAtAt:
       Result:=4;
       Result:=4;
-    tkMul, tkDivision, tkdiv, tkmod, tkand, tkShl,tkShr, tkas, tkPower :
+    tkMul, tkDivision, tkdiv, tkmod, tkand, tkShl,tkShr, tkas, tkPower, tkis:
+      // Note that "is" has same precedence as "and" in Delphi and fpc, even though
+      // some docs say otherwise. e.g. "Obj is TObj and aBool"
       Result:=3;
       Result:=3;
     tkPlus, tkMinus, tkor, tkxor:
     tkPlus, tkMinus, tkor, tkxor:
       Result:=2;
       Result:=2;
-    tkEqual, tkNotEqual, tkLessThan, tkLessEqualThan, tkGreaterThan, tkGreaterEqualThan, tkin, tkis:
+    tkEqual, tkNotEqual, tkLessThan, tkLessEqualThan, tkGreaterThan, tkGreaterEqualThan, tkin:
       Result:=1;
       Result:=1;
   else
   else
     Result:=0;
     Result:=0;