Changeset 21 for trunk/Compiler/Analyze/UAnalyzerPascal.pas
- Timestamp:
- Nov 9, 2010, 2:08:55 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Compiler/Analyze/UAnalyzerPascal.pas
r20 r21 79 79 SInvalidAssignmentValue = 'Invalid assignment "%s".'; 80 80 SParamDiffers = 'Declaration of parametr "%s" differs.'; 81 SNotRecordOrClass = '"%s" not record or class'; 81 82 82 83 implementation … … 257 258 if Assigned(UseFunction) then begin 258 259 // Record or class functions 259 ParseExpressionFunctionCall(SourceCode, Expressions, FunctionCall); 260 NewExpression := TExpression.Create; 261 NewExpression.CommonBlock := SourceCode.CommonBlock; 262 NewExpression.NodeType := ntFunction; 263 NewExpression.FunctionCall := FunctionCall; 260 if ParseExpressionFunctionCall(SourceCode, Expressions, FunctionCall) then begin 261 NewExpression := TExpression.Create; 262 NewExpression.CommonBlock := SourceCode.CommonBlock; 263 NewExpression.NodeType := ntFunction; 264 NewExpression.FunctionCall := FunctionCall; 265 end; 264 266 end; 265 267 end; … … 336 338 var 337 339 UseFunction: TFunction; 340 UseType: TType; 338 341 NewExpression: TExpression; 339 342 I: Integer; … … 544 547 if Section = cbsConstant then begin 545 548 ParseConstant(Constants); 546 end else begin 549 end else 550 if NextToken = 'initialization' then Break 551 else if NextToken = 'finalization' then Break 552 else begin 547 553 ErrorMessage(SInvalidConstruction, [NextToken]); 548 554 ReadToken; … … 676 682 UseFunction.Name := UseName; 677 683 UseFunction.FunctionType := FunctionType; 684 UseFunction.Exported := Exported; 678 685 Add(UseFunction); 686 UseFunction.Parent.Order.Add(UseFunction); 679 687 ValidParams := False; 680 688 end; … … 690 698 NewValueType := Parent.Types.Search(TypeName); 691 699 if not Assigned(NewValueType) then 692 ErrorMessage(SUndefinedType, [TypeName], -1) ;693 (*else700 ErrorMessage(SUndefinedType, [TypeName], -1) 701 else 694 702 begin 695 703 ResultType := NewValueType; 696 with TVariable( Parent.Variables.Items[Parent.Variables.Add(704 with TVariable(Variables.Items[Variables.Add( 697 705 TVariable.Create)]) do 698 706 begin … … 700 708 ValueType := NewValueType; 701 709 end; 702 end; *)710 end; 703 711 end; 704 712 Expect(';'); … … 1254 1262 TTypeArray(NewType).IndexType := TypeList.Parent.Types.Search(UseName); 1255 1263 if not Assigned(TTypeArray(NewType).IndexType) then 1256 ErrorMessage(SUndefinedType, [UseName], -1) else 1257 TTypeArray(NewType).IndexType := UseType; 1264 ErrorMessage(SUndefinedType, [UseName], -1); 1258 1265 end else 1259 1266 if NextTokenType = ttConstantNumber then begin
Note:
See TracChangeset
for help on using the changeset viewer.