Просмотр исходного кода

* Fix second case of bug ID #31800 (binary expression with platform identifier)

git-svn-id: trunk@36226 -
michael 8 лет назад
Родитель
Сommit
de8c780fa7
2 измененных файлов с 8 добавлено и 1 удалено
  1. 1 1
      packages/fcl-passrc/src/pparser.pp
  2. 7 0
      packages/fcl-passrc/tests/tcstatements.pas

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

@@ -2317,7 +2317,7 @@ begin
         NextToken;
         end;
        //Writeln('Bin ',NotBinary ,' or EOE ',isEndOfExp, ' Ex ',Assigned(x),' stack ',ExpStack.Count);
-    until NotBinary or isEndOfExp(AllowEqual);
+    until NotBinary or isEndOfExp(AllowEqual, NotBinary);
 
     if not NotBinary then ParseExcExpectedIdentifier;
 

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

@@ -120,6 +120,7 @@ Type
     procedure FinalizationNoSemicolon;
     procedure MacroComment;
     Procedure PLatformIdentifier;
+    Procedure PLatformIdentifier2;
     Procedure Onidentifier;
   end;
 
@@ -1738,6 +1739,12 @@ begin
   ParseModule;
 end;
 
+procedure TTestStatementParser.PLatformIdentifier2;
+begin
+  AddStatements(['write(libs+platform);']);
+  ParseModule;
+end;
+
 procedure TTestStatementParser.Onidentifier;
 begin
   Source.Add('function TryOn(const on: boolean): boolean;');