Browse Source

* Fix Bug ID #31733

git-svn-id: trunk@36179 -
michael 8 years ago
parent
commit
dbc9b7f8b4
2 changed files with 28 additions and 4 deletions
  1. 4 4
      packages/fcl-passrc/src/pparser.pp
  2. 24 0
      packages/fcl-passrc/tests/tcvarparser.pas

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

@@ -3222,13 +3222,13 @@ begin
     ExpectIdentifier;
     Location:=CurTokenText;
     NextToken;
-    if CurToken=tkDot then
+    While CurToken=tkDot do
       begin
       ExpectIdentifier;
       Location:=Location+'.'+CurTokenText;
-      end
-    else
-      UnGetToken;
+      NextToken;
+      end;
+    UnGetToken;
     end
   else
     UngetToken;

+ 24 - 0
packages/fcl-passrc/tests/tcvarparser.pas

@@ -33,6 +33,9 @@ Type
     Procedure TestSimpleVarInitialized;
     procedure TestSimpleVarInitializedDeprecated;
     procedure TestSimpleVarInitializedPlatform;
+    Procedure TestSimpleVarAbsolute;
+    Procedure TestSimpleVarAbsoluteDot;
+    Procedure TestSimpleVarAbsolute2Dots;
     Procedure TestVarProcedure;
     Procedure TestVarFunctionINitialized;
     Procedure TestVarProcedureDeprecated;
@@ -182,6 +185,27 @@ begin
   AssertExpression('Variable value',TheVar.expr,pekNumber,'123');
 end;
 
+procedure TTestVarParser.TestSimpleVarAbsolute;
+begin
+  ParseVar('q absolute v','');
+  AssertVariableType('q');
+  AssertEquals('correct absolute location','v',TheVar.AbsoluteLocation);
+end;
+
+procedure TTestVarParser.TestSimpleVarAbsoluteDot;
+begin
+  ParseVar('q absolute v.w','');
+  AssertVariableType('q');
+  AssertEquals('correct absolute location','v.w',TheVar.AbsoluteLocation);
+end;
+
+procedure TTestVarParser.TestSimpleVarAbsolute2Dots;
+begin
+  ParseVar('q absolute v.w.x','');
+  AssertVariableType('q');
+  AssertEquals('correct absolute location','v.w.x',TheVar.AbsoluteLocation);
+end;
+
 procedure TTestVarParser.TestVarProcedure;
 begin
   ParseVar('procedure','');