Browse Source

* Patch from Mattias Gaertner: fixed creating binary element for "as" operator

git-svn-id: trunk@35469 -
michael 8 years ago
parent
commit
8def379f49
1 changed files with 9 additions and 3 deletions
  1. 9 3
      packages/fcl-passrc/src/pparser.pp

+ 9 - 3
packages/fcl-passrc/src/pparser.pp

@@ -1672,14 +1672,20 @@ begin
           end;
       until false;
       // Needed for TSDOBaseDataObjectClass(Self.ClassType).Create
-      if CurToken in [tkdot,tkas] then
+      if CurToken in [tkDot,tkas] then
         begin
         optk:=CurToken;
         NextToken;
         Expr:=ParseExpIdent(AParent);
         if Expr=nil then
-          Exit; // error
-        AddToBinaryExprChain(Result,Last,Expr,TokenToExprOp(optk));
+          ParseExcExpectedIdentifier;
+        if optk=tkDot then
+          AddToBinaryExprChain(Result,Last,Expr,TokenToExprOp(optk))
+        else
+          begin
+          // a as b
+          Result:=CreateBinaryExpr(AParent,Result,Expr,TokenToExprOp(tkas));
+          end;
       end;
     end;
     ok:=true;