Browse Source

* Fix bug ID #31680

git-svn-id: trunk@35897 -
michael 8 years ago
parent
commit
ffb89bee59
2 changed files with 12 additions and 1 deletions
  1. 4 1
      packages/fcl-passrc/src/pparser.pp
  2. 8 0
      packages/fcl-passrc/tests/tcstatements.pas

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

@@ -4638,8 +4638,11 @@ begin
       end;
       end;
     tkEOF:
     tkEOF:
       CheckToken(tkend);
       CheckToken(tkend);
-    tkBraceOpen,tkIdentifier,tkNumber,tkSquaredBraceOpen,tkMinus,tkPlus,tkinherited:
+    tkAt,tkBraceOpen,tkIdentifier,tkNumber,tkSquaredBraceOpen,tkMinus,tkPlus,tkinherited:
       begin
       begin
+// This should in fact not be checked here.
+//      if (CurToken=tkAt) and not (msDelphi in CurrentModeswitches) then
+//        ParseExc;
       left:=DoParseExpression(CurBlock);
       left:=DoParseExpression(CurBlock);
       case CurToken of
       case CurToken of
         tkAssign,
         tkAssign,

+ 8 - 0
packages/fcl-passrc/tests/tcstatements.pas

@@ -114,6 +114,7 @@ Type
     Procedure TestAsm;
     Procedure TestAsm;
     Procedure TestAsmBlock;
     Procedure TestAsmBlock;
     Procedure TestGotoInIfThen;
     Procedure TestGotoInIfThen;
+    procedure AssignToAddress;
   end;
   end;
 
 
 implementation
 implementation
@@ -1659,6 +1660,13 @@ begin
   ParseModule;
   ParseModule;
 end;
 end;
 
 
+Procedure TTestStatementParser.AssignToAddress;
+
+begin
+  AddStatements(['@Proc:=Nil']);
+  ParseModule;
+end;
+
 Procedure TTestStatementParser.TestGotoInIfThen;
 Procedure TTestStatementParser.TestGotoInIfThen;
 
 
 begin
 begin