Răsfoiți Sursa

* Fix bug ID #31718

git-svn-id: trunk@35966 -
michael 8 ani în urmă
părinte
comite
fe2df71ef5

+ 1 - 1
packages/fcl-passrc/src/pparser.pp

@@ -1804,7 +1804,7 @@ begin
 
 
   ok:=false;
   ok:=false;
   try
   try
-    if Last.Kind in [pekIdent,pekSelf] then
+    if Last.Kind in [pekIdent,pekSelf,pekNil] then
       begin
       begin
       while CurToken in [tkDot] do
       while CurToken in [tkDot] do
         begin
         begin

+ 20 - 0
packages/fcl-passrc/tests/tcexprparser.pas

@@ -136,6 +136,8 @@ type
     procedure TestTypeCast2;
     procedure TestTypeCast2;
     Procedure TestCreate;
     Procedure TestCreate;
     procedure TestChainedPointers;
     procedure TestChainedPointers;
+    Procedure TestNilCaret;
+    Procedure TestExpCaret;
   end;
   end;
 
 
 implementation
 implementation
@@ -605,6 +607,24 @@ begin
   ParseModule;
   ParseModule;
 end;
 end;
 
 
+procedure TTestExpressions.TestNilCaret;
+begin
+  Source.Add('{$mode objfpc}');
+  Source.Add('begin');
+  Source.Add('FillChar(nil^,10,10);');
+  Source.Add('end.');
+  ParseModule;
+end;
+
+procedure TTestExpressions.TestExpCaret;
+begin
+  Source.Add('{$mode objfpc}');
+  Source.Add('begin');
+  Source.Add('A:=B^;');
+  Source.Add('end.');
+  ParseModule;
+end;
+
 
 
 procedure TTestExpressions.TestUnaryMinus;
 procedure TTestExpressions.TestUnaryMinus;
 begin
 begin