* Fix bug ID #30759

git-svn-id: trunk@35522 -
This commit is contained in:
michael 2017-03-04 17:38:04 +00:00
parent 9787c44c78
commit aa769348c0
2 changed files with 27 additions and 0 deletions

View File

@ -3737,6 +3737,17 @@ function TPasParser.ParseProperty(Parent: TPasElement; const AName: String;
ExpectToken(tkSquaredBraceClose);
Result := Result + ']';
end;
repeat
NextToken;
if CurToken <> tkDot then
begin
UngetToken;
break;
end;
ExpectIdentifier;
Result := Result + '.' + CurTokenString;
AddToBinaryExprChain(Expr,Last,CreatePrimitiveExpr(aParent,pekIdent,CurTokenString),eopSubIdent);
until false;
end;
var

View File

@ -139,6 +139,7 @@ type
Procedure TestPropertyImplements;
Procedure TestPropertyImplementsFullyQualifiedName;
Procedure TestPropertyReadFromRecordField;
procedure TestPropertyReadFromArrayField;
procedure TestPropertyReadWriteFromRecordField;
Procedure TestLocalSimpleType;
Procedure TestLocalSimpleTypes;
@ -1463,6 +1464,21 @@ begin
Assertequals('Default value','',Property1.DefaultValue);
end;
procedure TTestClassType.TestPropertyReadFromArrayField;
begin
StartVisibility(visPublished);
AddMember('Property Something : Integer Read FPoint.W[x].y.Z');
ParseClass;
AssertProperty(Property1,visPublished,'Something','FPoint.W[x].y.Z','','','',0,False,False);
AssertNotNull('Have type',Property1.VarType);
AssertEquals('Property type class type',TPasUnresolvedTypeRef,Property1.vartype.ClassType);
AssertEquals('Property type name','Integer',Property1.vartype.name);
Assertequals('No index','',Property1.IndexValue);
AssertNull('No Index expression',Property1.IndexExpr);
AssertNull('No default expression',Property1.DefaultExpr);
Assertequals('Default value','',Property1.DefaultValue);
end;
procedure TTestClassType.TestPropertyReadWriteFromRecordField;
begin
StartVisibility(visPublished);