mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-16 17:59:25 +02:00
parent
9787c44c78
commit
aa769348c0
@ -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
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user