Browse Source

* Proper fix for initialized variable (including procedures)

git-svn-id: trunk@11052 -
michael 17 years ago
parent
commit
4d4554a303
1 changed files with 10 additions and 4 deletions
  1. 10 4
      packages/fcl-passrc/src/pparser.pp

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

@@ -1219,10 +1219,11 @@ var
   Value, S: String;
   Value, S: String;
   M: string;
   M: string;
   H : TPasMemberHints;
   H : TPasMemberHints;
-  
+  LastVar : String;
 begin
 begin
   while True do
   while True do
   begin
   begin
+    LastVar:=CurTokenString;
     List.Add(CreateElement(TPasVariable, CurTokenString, Parent));
     List.Add(CreateElement(TPasVariable, CurTokenString, Parent));
     NextToken;
     NextToken;
     if CurToken = tkColon then
     if CurToken = tkColon then
@@ -1238,15 +1239,20 @@ begin
     if i > 0 then
     if i > 0 then
       VarType.AddRef;
       VarType.AddRef;
   end;
   end;
-  NextToken;
+//  Writeln(LastVar,': Parsed complex type: ',CurtokenText);
+  // NextToken;
+  // Writeln(LastVar,': Parsed complex type, next: ',CurtokenText);
   If CurToken=tkEqual then
   If CurToken=tkEqual then
     begin
     begin
+    NextToken;
     Value := ParseExpression;
     Value := ParseExpression;
+  //  Writeln(LastVar,' Value :',Value);
     for i := 0 to List.Count - 1 do
     for i := 0 to List.Count - 1 do
       TPasVariable(List[i]).Value := Value;
       TPasVariable(List[i]).Value := Value;
+//    Writeln(LastVar,': Parsed expression:',CurTokenText);
     end
     end
-  else
-    UngetToken;
+{  else
+    UngetToken};
 
 
   NextToken;
   NextToken;
   if CurToken = tkAbsolute then
   if CurToken = tkAbsolute then