Ignore:
Timestamp:
Nov 9, 2010, 2:08:55 PM (13 years ago)
Author:
george
Message:
  • Modified: Project saving.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Compiler/Analyze/UAnalyzerPascal.pas

    r20 r21  
    7979  SInvalidAssignmentValue = 'Invalid assignment "%s".';
    8080  SParamDiffers = 'Declaration of parametr "%s" differs.';
     81  SNotRecordOrClass = '"%s" not record or class';
    8182
    8283implementation
     
    257258            if Assigned(UseFunction) then begin
    258259              // 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;
    264266            end;
    265267          end;
     
    336338var
    337339  UseFunction: TFunction;
     340  UseType: TType;
    338341  NewExpression: TExpression;
    339342  I: Integer;
     
    544547      if Section = cbsConstant then begin
    545548        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
    547553        ErrorMessage(SInvalidConstruction, [NextToken]);
    548554        ReadToken;
     
    676682      UseFunction.Name := UseName;
    677683      UseFunction.FunctionType := FunctionType;
     684      UseFunction.Exported := Exported;
    678685      Add(UseFunction);
     686      UseFunction.Parent.Order.Add(UseFunction);
    679687      ValidParams := False;
    680688    end;
     
    690698        NewValueType := Parent.Types.Search(TypeName);
    691699        if not Assigned(NewValueType) then
    692           ErrorMessage(SUndefinedType, [TypeName], -1);
    693 (*        else
     700          ErrorMessage(SUndefinedType, [TypeName], -1)
     701        else
    694702          begin
    695703            ResultType := NewValueType;
    696             with TVariable(Parent.Variables.Items[Parent.Variables.Add(
     704            with TVariable(Variables.Items[Variables.Add(
    697705                TVariable.Create)]) do
    698706            begin
     
    700708              ValueType := NewValueType;
    701709            end;
    702           end;  *)
     710          end;
    703711      end;
    704712      Expect(';');
     
    12541262        TTypeArray(NewType).IndexType := TypeList.Parent.Types.Search(UseName);
    12551263        if not Assigned(TTypeArray(NewType).IndexType) then
    1256           ErrorMessage(SUndefinedType, [UseName], -1) else
    1257           TTypeArray(NewType).IndexType := UseType;
     1264          ErrorMessage(SUndefinedType, [UseName], -1);
    12581265      end else
    12591266      if NextTokenType = ttConstantNumber then begin
Note: See TracChangeset for help on using the changeset viewer.