Browse Source

* Fix bug ID #31825: because of helpers, almost any expression can have a .

git-svn-id: trunk@36682 -
michael 8 năm trước cách đây
mục cha
commit
d6552989d6

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

@@ -2074,7 +2074,7 @@ begin
   func:=Last;
   
   if Last.Kind<>pekSet then NextToken;
-  if not (Last.Kind in [pekIdent,pekSelf,pekNil]) then
+  if not (Last.Kind in [pekNumber,pekString,pekSet,pekIdent,pekSelf,pekNil]) then
     exit;
 
   ok:=false;

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

@@ -141,6 +141,7 @@ type
     Procedure TestNilCaret;
     Procedure TestExpCaret;
     Procedure TestArrayAccess;
+    Procedure TestHelperOnLiteral;
   end;
 
 implementation
@@ -664,6 +665,14 @@ begin
   ParseModule;
 end;
 
+procedure TTestExpressions.TestHelperOnLiteral;
+begin
+  Source.Add('begin');
+  Source.Add('writeln(''10''.toint);');
+  Source.Add('end.');
+  ParseModule;
+end;
+
 
 procedure TTestExpressions.TestUnaryMinus;
 begin