Sfoglia il codice sorgente

Fix bug ID #35086: TParser should reset position (tentative)

git-svn-id: trunk@41331 -
michael 6 anni fa
parent
commit
4143ecf6c0
1 ha cambiato i file con 9 aggiunte e 1 eliminazioni
  1. 9 1
      rtl/objpas/classes/parser.inc

+ 9 - 1
rtl/objpas/classes/parser.inc

@@ -361,8 +361,16 @@ begin
 end;
 
 destructor TParser.Destroy;
+
+Var
+  aCount : Integer;
+
 begin
-  fStream.Position:=SourcePos;
+  if fToken=toWString then
+    aCount:=Length(fLastTokenWStr)*2
+  else
+    aCount:=Length(fLastTokenStr);
+  fStream.Position:=SourcePos-aCount;
   FreeMem(fBuf);
 end;