refactor(lang): remove IsNoArgFuncCall dead code, fix remaining bare calls
With mandatory () on all zero-argument calls (51ebf23), the
IsNoArgFuncCall/NoArgFuncDecl fields on TIdentExpr and the
synthesised TFuncCallExpr codegen path are dead code. Remove them.
This exposed ~300 bare function calls missed by the original
migration script across compiler, runtime, stdlib, tests, and
embedded Blaise source strings. Fix all of them.
Add IsProcFieldCall support to TMethodCallExpr so that
H.Handler() works for procedure-type fields — the parser creates
TMethodCallExpr for Obj.Name(), and the semantic pass now detects
when 'Name' is a procedural-typed field rather than a method,
routing through the indirect-call codegen path.
Update fixpoint.sh to fall back to an existing blaise_rtl.a when
the release binary is too old to build the runtime.
2627 tests pass, FIXPOINT_OK.
This commit is contained in:
parent
51ebf2350a
commit
57c0660a37
|
|
@ -111,7 +111,7 @@ begin
|
|||
SearchPaths := TStringList.Create();
|
||||
|
||||
I := 1;
|
||||
while I <= ParamCount do
|
||||
while I <= ParamCount() do
|
||||
begin
|
||||
Arg := ParamStr(I);
|
||||
|
||||
|
|
@ -177,7 +177,7 @@ var
|
|||
Arg: string;
|
||||
begin
|
||||
Result := False;
|
||||
for I := 1 to ParamCount do
|
||||
for I := 1 to ParamCount() do
|
||||
begin
|
||||
Arg := ParamStr(I);
|
||||
if (Length(Arg) >= 2) and (StrAt(Arg, 0) = Ord('-')) and (StrAt(Arg, 1) <> Ord('-')) then
|
||||
|
|
@ -215,7 +215,7 @@ begin
|
|||
OPDFEnabled := False;
|
||||
DebugMode := False;
|
||||
UseNative := False;
|
||||
Target := HostTarget;
|
||||
Target := HostTarget();
|
||||
SkipDepCodegen := False;
|
||||
EmitIfaceDir := '';
|
||||
Incremental := False;
|
||||
|
|
@ -223,20 +223,20 @@ begin
|
|||
SearchPaths := TStringList.Create();
|
||||
|
||||
I := 1;
|
||||
while I <= ParamCount do
|
||||
while I <= ParamCount() do
|
||||
begin
|
||||
Arg := ParamStr(I);
|
||||
if (Arg = '--source') and (I < ParamCount) then
|
||||
if (Arg = '--source') and (I < ParamCount()) then
|
||||
begin
|
||||
Inc(I);
|
||||
SourceFile := ParamStr(I);
|
||||
end
|
||||
else if (Arg = '--output') and (I < ParamCount) then
|
||||
else if (Arg = '--output') and (I < ParamCount()) then
|
||||
begin
|
||||
Inc(I);
|
||||
OutputFile := ParamStr(I);
|
||||
end
|
||||
else if (Arg = '--unit-path') and (I < ParamCount) then
|
||||
else if (Arg = '--unit-path') and (I < ParamCount()) then
|
||||
begin
|
||||
Inc(I);
|
||||
SearchPaths.Add(ParamStr(I));
|
||||
|
|
@ -246,7 +246,7 @@ begin
|
|||
unit call becomes an extern reference. Caller is responsible
|
||||
for linking pre-built dep object files at link time. }
|
||||
SkipDepCodegen := True
|
||||
else if (Arg = '--emit-iface') and (I < ParamCount) then
|
||||
else if (Arg = '--emit-iface') and (I < ParamCount()) then
|
||||
begin
|
||||
{ Write each compiled unit's TUnitInterface as <Dir>/<Unit>.bif
|
||||
for later use as a separate-compilation cache. }
|
||||
|
|
@ -261,7 +261,7 @@ begin
|
|||
files instead). Next compile auto-discovers the .o's
|
||||
and skips parsing the .pas entirely. }
|
||||
Incremental := True
|
||||
else if (Arg = '--unit-cache') and (I < ParamCount) then
|
||||
else if (Arg = '--unit-cache') and (I < ParamCount()) then
|
||||
begin
|
||||
Inc(I);
|
||||
UnitCacheDir := ParamStr(I);
|
||||
|
|
@ -276,7 +276,7 @@ begin
|
|||
DebugMode := True
|
||||
else if Arg = '--debug-opdf' then
|
||||
OPDFEnabled := True
|
||||
else if (Arg = '--backend') and (I < ParamCount) then
|
||||
else if (Arg = '--backend') and (I < ParamCount()) then
|
||||
begin
|
||||
Inc(I);
|
||||
if ParamStr(I) = 'qbe' then
|
||||
|
|
@ -290,7 +290,7 @@ begin
|
|||
Exit;
|
||||
end;
|
||||
end
|
||||
else if (Arg = '--target') and (I < ParamCount) then
|
||||
else if (Arg = '--target') and (I < ParamCount()) then
|
||||
begin
|
||||
Inc(I);
|
||||
if not ParseTargetName(ParamStr(I), Target) then
|
||||
|
|
@ -457,7 +457,7 @@ var
|
|||
I: Integer;
|
||||
begin
|
||||
AsmFile := ChangeFileExt(AIRFile, '.s');
|
||||
RTLPath := FindRTL;
|
||||
RTLPath := FindRTL();
|
||||
|
||||
Args := TStringList.Create();
|
||||
try
|
||||
|
|
@ -677,7 +677,7 @@ begin
|
|||
UnitCacheDir := '';
|
||||
TopUnit := nil;
|
||||
IsUnitMode := False;
|
||||
if IsFPCStyleInvocation then
|
||||
if IsFPCStyleInvocation() then
|
||||
begin
|
||||
if not ParseFPCArgs(SourceFile, OutputFile, SearchPaths, OPDFEnabled) then
|
||||
begin
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ implementation
|
|||
|
||||
constructor TNativeBackend.Create(const ATarget: TTargetDesc);
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
FTarget := ATarget;
|
||||
FSymTable := nil;
|
||||
FAsm := TStringBuilder.Create();
|
||||
|
|
@ -75,7 +75,7 @@ end;
|
|||
destructor TNativeBackend.Destroy;
|
||||
begin
|
||||
FAsm.Free();
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
procedure TNativeBackend.SetSymbolTable(ASymTable: TSymbolTable);
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ end;
|
|||
|
||||
constructor TCodeGenNative.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
MakeTarget(osLinux, cpuX86_64, FTarget);
|
||||
FSymTable := nil;
|
||||
FDebugMode := False;
|
||||
|
|
@ -101,7 +101,7 @@ end;
|
|||
destructor TCodeGenNative.Destroy;
|
||||
begin
|
||||
FBackend.Free();
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
procedure TCodeGenNative.SetTarget(const ATarget: TTargetDesc);
|
||||
|
|
|
|||
|
|
@ -403,7 +403,7 @@ begin
|
|||
FStrLits.Free();
|
||||
FThreadVarGlobals.Free();
|
||||
FDataGlobals.Free();
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
function TX86_64Backend.NewLabel(const APrefix: string): string;
|
||||
|
|
@ -717,7 +717,7 @@ begin
|
|||
if AExpr is TIdentExpr then
|
||||
begin
|
||||
IE := TIdentExpr(AExpr);
|
||||
if IE.IsNoArgFuncCall or IE.IsImplicitSelfMethod then
|
||||
if IE.IsImplicitSelfMethod then
|
||||
Exit(True);
|
||||
end;
|
||||
if AExpr is TFieldAccessExpr then
|
||||
|
|
|
|||
|
|
@ -172,6 +172,6 @@ begin
|
|||
end;
|
||||
|
||||
initialization
|
||||
GTarget := HostTarget;
|
||||
GTarget := HostTarget();
|
||||
|
||||
end.
|
||||
|
|
|
|||
|
|
@ -470,7 +470,7 @@ end;
|
|||
|
||||
constructor TTestCase.Create(AName: string);
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
Self.FName := AName;
|
||||
Self.FClassName := '';
|
||||
end;
|
||||
|
|
@ -557,7 +557,7 @@ end;
|
|||
|
||||
constructor TTestResult.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
Self.FNumberOfTests := 0;
|
||||
Self.FNumberOfFailures := 0;
|
||||
Self.FNumberOfErrors := 0;
|
||||
|
|
@ -573,7 +573,7 @@ destructor TTestResult.Destroy;
|
|||
begin
|
||||
Self.FFailureList.Free();
|
||||
Self.FErrorList.Free();
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
procedure TTestResult.StartTest(AClassName, ATestName: string);
|
||||
|
|
@ -642,7 +642,7 @@ end;
|
|||
|
||||
constructor EAssertionFailed.Create(AMessage: string);
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
Self.FMessage := AMessage;
|
||||
end;
|
||||
|
||||
|
|
@ -653,7 +653,7 @@ end;
|
|||
|
||||
constructor EIgnoredTest.Create(AMessage: string);
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
Self.FMessage := AMessage;
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -289,12 +289,12 @@ var
|
|||
begin
|
||||
AVerbose := False;
|
||||
I := 1;
|
||||
while I <= ParamCount do
|
||||
while I <= ParamCount() do
|
||||
begin
|
||||
Arg := ParamStr(I);
|
||||
if Arg = '--verbose' then
|
||||
AVerbose := True
|
||||
else if (Arg = '--suite') and (I < ParamCount) then
|
||||
else if (Arg = '--suite') and (I < ParamCount()) then
|
||||
begin
|
||||
I := I + 1;
|
||||
AppendSuiteFilter(AFilters, ParamStr(I));
|
||||
|
|
@ -404,7 +404,7 @@ begin
|
|||
Result.Verbose := AVerbose;
|
||||
ProcCount := 0;
|
||||
HasFilter := (AFilters <> nil) and (AFilters.Count > 0);
|
||||
for ClsIdx := 0 to GetRegisteredTestCount - 1 do
|
||||
for ClsIdx := 0 to GetRegisteredTestCount() - 1 do
|
||||
begin
|
||||
Cls := GetRegisteredTest(ClsIdx);
|
||||
CName := TestClassName(Cls);
|
||||
|
|
|
|||
|
|
@ -76,8 +76,6 @@ type
|
|||
IsConstant: Boolean; { set by uSemantic — True if this ident is a skConstant symbol }
|
||||
ConstValue: Int64; { valid when IsConstant = True; integer/bool/enum value }
|
||||
ConstString: string; { valid when IsConstant = True and type is tyString }
|
||||
IsNoArgFuncCall: Boolean; { set by uSemantic — bare ident that resolves to a 0-arg function }
|
||||
[Unretained] NoArgFuncDecl: TObject; { TMethodDecl — not owned; valid when IsNoArgFuncCall and user-defined }
|
||||
IsGlobal: Boolean; { set by uSemantic — this ident is a program-level global var }
|
||||
IsThreadVar: Boolean; { set by uSemantic — threadvar (TLS) global }
|
||||
IsImplicitSelf: Boolean; { set by uSemantic — bare field name implicitly referencing Self }
|
||||
|
|
@ -673,6 +671,9 @@ type
|
|||
IsVarParam: Boolean; { set by uSemantic — ObjectName is a var/out parameter }
|
||||
IsBuiltinToString: Boolean; { set by uSemantic — built-in TObject.ToString virtual dispatch }
|
||||
IsBuiltinInheritsFrom: Boolean; { set by uSemantic — SomeClass.InheritsFrom(OtherClass) }
|
||||
IsProcFieldCall: Boolean; { set by uSemantic — Name is a procedural-typed field }
|
||||
[Unretained] ProcFieldInfo: TFieldInfo; { not owned — the procedural field }
|
||||
[Unretained] ResolvedProcType: TObject; { TProceduralTypeDesc — not owned }
|
||||
constructor Create;
|
||||
destructor Destroy; override;
|
||||
end;
|
||||
|
|
@ -942,21 +943,21 @@ end;
|
|||
destructor TIfStmt.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TCompoundStmt }
|
||||
|
||||
constructor TCompoundStmt.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
Stmts := TObjectList.Create(True);
|
||||
end;
|
||||
|
||||
destructor TCompoundStmt.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TWhileStmt }
|
||||
|
|
@ -964,7 +965,7 @@ end;
|
|||
destructor TWhileStmt.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TRepeatStmt }
|
||||
|
|
@ -972,7 +973,7 @@ end;
|
|||
destructor TRepeatStmt.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TForStmt }
|
||||
|
|
@ -980,7 +981,7 @@ end;
|
|||
destructor TForStmt.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TForInStmt }
|
||||
|
|
@ -988,7 +989,7 @@ end;
|
|||
destructor TForInStmt.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TTryFinallyStmt }
|
||||
|
|
@ -996,7 +997,7 @@ end;
|
|||
destructor TTryFinallyStmt.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TExceptHandlerClause }
|
||||
|
|
@ -1004,21 +1005,21 @@ end;
|
|||
destructor TExceptHandlerClause.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TTryExceptStmt }
|
||||
|
||||
constructor TTryExceptStmt.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
Handlers := TObjectList.Create(True);
|
||||
end;
|
||||
|
||||
destructor TTryExceptStmt.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TRaiseStmt }
|
||||
|
|
@ -1026,13 +1027,13 @@ end;
|
|||
destructor TRaiseStmt.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
destructor TExitStmt.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TFieldAccessExpr }
|
||||
|
|
@ -1040,7 +1041,7 @@ end;
|
|||
destructor TFieldAccessExpr.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TIsExpr }
|
||||
|
|
@ -1048,7 +1049,7 @@ end;
|
|||
destructor TIsExpr.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TAsExpr }
|
||||
|
|
@ -1056,7 +1057,7 @@ end;
|
|||
destructor TAsExpr.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TSupportsExpr }
|
||||
|
|
@ -1064,7 +1065,7 @@ end;
|
|||
destructor TSupportsExpr.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TBinaryExpr }
|
||||
|
|
@ -1072,7 +1073,7 @@ end;
|
|||
destructor TBinaryExpr.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TNotExpr }
|
||||
|
|
@ -1080,7 +1081,7 @@ end;
|
|||
destructor TNotExpr.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TAssignment }
|
||||
|
|
@ -1088,7 +1089,7 @@ end;
|
|||
destructor TAssignment.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TFieldAssignment }
|
||||
|
|
@ -1096,7 +1097,7 @@ end;
|
|||
destructor TFieldAssignment.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TStaticSubscriptAssign }
|
||||
|
|
@ -1104,7 +1105,7 @@ end;
|
|||
destructor TStaticSubscriptAssign.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TPointerWriteStmt }
|
||||
|
|
@ -1112,7 +1113,7 @@ end;
|
|||
destructor TPointerWriteStmt.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TDerefExpr }
|
||||
|
|
@ -1120,103 +1121,103 @@ end;
|
|||
destructor TDerefExpr.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
destructor TAddrOfExpr.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
destructor TStringSubscriptExpr.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TArrayLiteralExpr }
|
||||
|
||||
constructor TArrayLiteralExpr.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
Elements := TObjectList.Create(True);
|
||||
end;
|
||||
|
||||
destructor TArrayLiteralExpr.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TProcCall }
|
||||
|
||||
constructor TProcCall.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
Args := TObjectList.Create(True);
|
||||
end;
|
||||
|
||||
destructor TProcCall.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TFuncCallExpr }
|
||||
|
||||
constructor TFuncCallExpr.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
Args := TObjectList.Create(True);
|
||||
end;
|
||||
|
||||
destructor TFuncCallExpr.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TIndirectFuncCallExpr }
|
||||
|
||||
constructor TIndirectFuncCallExpr.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
Args := TObjectList.Create(True);
|
||||
end;
|
||||
|
||||
destructor TIndirectFuncCallExpr.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TMethodCallStmt }
|
||||
|
||||
constructor TMethodCallStmt.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
Args := TObjectList.Create(True);
|
||||
end;
|
||||
|
||||
destructor TMethodCallStmt.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TInheritedCallStmt }
|
||||
|
||||
constructor TInheritedCallStmt.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
Args := TObjectList.Create(True);
|
||||
end;
|
||||
|
||||
destructor TInheritedCallStmt.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TMethodParam }
|
||||
|
|
@ -1224,14 +1225,14 @@ end;
|
|||
destructor TMethodParam.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TVarDecl }
|
||||
|
||||
constructor TVarDecl.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
Names := TStringList.Create();
|
||||
Attributes := TStringList.Create();
|
||||
IsWeak := False;
|
||||
|
|
@ -1240,14 +1241,14 @@ end;
|
|||
destructor TVarDecl.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TFieldDecl }
|
||||
|
||||
constructor TFieldDecl.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
Names := TStringList.Create();
|
||||
Attributes := TStringList.Create();
|
||||
IsWeak := False;
|
||||
|
|
@ -1257,14 +1258,14 @@ end;
|
|||
destructor TFieldDecl.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TRecordTypeDef }
|
||||
|
||||
constructor TRecordTypeDef.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
Fields := TObjectList.Create(True);
|
||||
Methods := TObjectList.Create(True);
|
||||
end;
|
||||
|
|
@ -1272,14 +1273,14 @@ end;
|
|||
destructor TRecordTypeDef.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TProceduralTypeDef }
|
||||
|
||||
constructor TProceduralTypeDef.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
Params := TObjectList.Create(True);
|
||||
IsFunction := False;
|
||||
end;
|
||||
|
|
@ -1287,14 +1288,14 @@ end;
|
|||
destructor TProceduralTypeDef.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TMethodDecl }
|
||||
|
||||
constructor TMethodDecl.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
Params := TObjectList.Create(True);
|
||||
VTableSlot := -1;
|
||||
OwnBody := True;
|
||||
|
|
@ -1308,28 +1309,28 @@ begin
|
|||
OwnerTypeParams.Free();
|
||||
CapturedVars.Free();
|
||||
if OwnBody then Body.Free();
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TMethodCallExpr }
|
||||
|
||||
constructor TMethodCallExpr.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
Args := TObjectList.Create(True);
|
||||
end;
|
||||
|
||||
destructor TMethodCallExpr.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TClassTypeDef }
|
||||
|
||||
constructor TClassTypeDef.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
ImplementsNames := TStringList.Create();
|
||||
ConstDecls := TObjectList.Create(True);
|
||||
Fields := TObjectList.Create(True);
|
||||
|
|
@ -1341,28 +1342,28 @@ end;
|
|||
destructor TClassTypeDef.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TInterfaceTypeDef }
|
||||
|
||||
constructor TInterfaceTypeDef.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
Methods := TObjectList.Create(True);
|
||||
end;
|
||||
|
||||
destructor TInterfaceTypeDef.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TGenericTypeDef }
|
||||
|
||||
constructor TGenericTypeDef.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
ParamNames := TStringList.Create();
|
||||
ParamConstraints := TStringList.Create();
|
||||
ClassDef := TClassTypeDef.Create();
|
||||
|
|
@ -1371,7 +1372,7 @@ end;
|
|||
destructor TGenericTypeDef.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TGenericInstance }
|
||||
|
|
@ -1380,20 +1381,20 @@ end;
|
|||
|
||||
constructor TGenericFuncInstance.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
end;
|
||||
|
||||
destructor TGenericFuncInstance.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TGenericInterfaceDef }
|
||||
|
||||
constructor TGenericInterfaceDef.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
ParamNames := TStringList.Create();
|
||||
ParamConstraints := TStringList.Create();
|
||||
IntfDef := TInterfaceTypeDef.Create();
|
||||
|
|
@ -1401,14 +1402,14 @@ end;
|
|||
|
||||
destructor TGenericInterfaceDef.Destroy;
|
||||
begin
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TGenericRecordDef }
|
||||
|
||||
constructor TGenericRecordDef.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
ParamNames := TStringList.Create();
|
||||
ParamConstraints := TStringList.Create();
|
||||
RecordDef := TRecordTypeDef.Create();
|
||||
|
|
@ -1416,48 +1417,48 @@ end;
|
|||
|
||||
destructor TGenericRecordDef.Destroy;
|
||||
begin
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TGenericRecordInstance }
|
||||
|
||||
constructor TGenericRecordInstance.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
RecordDef := TRecordTypeDef.Create();
|
||||
end;
|
||||
|
||||
destructor TGenericRecordInstance.Destroy;
|
||||
begin
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TGenericInterfaceInstance }
|
||||
|
||||
constructor TGenericInterfaceInstance.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
IntfDef := TInterfaceTypeDef.Create();
|
||||
end;
|
||||
|
||||
destructor TGenericInterfaceInstance.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TGenericInstance }
|
||||
|
||||
constructor TGenericInstance.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
ClassDef := TClassTypeDef.Create();
|
||||
end;
|
||||
|
||||
destructor TGenericInstance.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TTypeDecl }
|
||||
|
|
@ -1465,14 +1466,14 @@ end;
|
|||
destructor TTypeDecl.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TBlock }
|
||||
|
||||
constructor TBlock.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
TypeDecls := TObjectList.Create(True);
|
||||
ConstDecls := TObjectList.Create(True);
|
||||
Decls := TObjectList.Create(True);
|
||||
|
|
@ -1483,21 +1484,21 @@ end;
|
|||
destructor TBlock.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TEnumTypeDef }
|
||||
|
||||
constructor TEnumTypeDef.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
Members := TStringList.Create();
|
||||
end;
|
||||
|
||||
destructor TEnumTypeDef.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
procedure TEnumTypeDef.AddMember(const AName: string; AValue: Integer);
|
||||
|
|
@ -1514,35 +1515,35 @@ end;
|
|||
|
||||
constructor TCaseBranch.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
Values := TObjectList.Create(True);
|
||||
end;
|
||||
|
||||
destructor TCaseBranch.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TCaseStmt }
|
||||
|
||||
constructor TCaseStmt.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
Branches := TObjectList.Create(True);
|
||||
end;
|
||||
|
||||
destructor TCaseStmt.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TProgram }
|
||||
|
||||
constructor TProgram.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
UsedUnits := TStringList.Create();
|
||||
GenericInstances := TObjectList.Create(True);
|
||||
GenericFuncInstances := TObjectList.Create(True);
|
||||
|
|
@ -1553,20 +1554,20 @@ end;
|
|||
destructor TConstDecl.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
destructor TProgram.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ TUnit }
|
||||
|
||||
constructor TUnit.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
UsedUnits := TStringList.Create();
|
||||
ImplUsedUnits := TStringList.Create();
|
||||
IntfBlock := TBlock.Create();
|
||||
|
|
@ -1582,7 +1583,7 @@ end;
|
|||
destructor TUnit.Destroy;
|
||||
begin
|
||||
{ Owned class fields released by ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ ------------------------------------------------------------------ }
|
||||
|
|
|
|||
|
|
@ -410,7 +410,7 @@ end;
|
|||
|
||||
constructor TIRBuffer.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
FCap := IR_INIT_CAP;
|
||||
FLen := 0;
|
||||
FData := GetMem(FCap);
|
||||
|
|
@ -419,7 +419,7 @@ end;
|
|||
destructor TIRBuffer.Destroy;
|
||||
begin
|
||||
FreeMem(FData);
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
procedure TIRBuffer.Grow(ANeed: Integer);
|
||||
|
|
@ -479,7 +479,7 @@ end;
|
|||
|
||||
constructor TCodeGenQBE.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
FOutput := TIRBuffer.Create();
|
||||
FStrLits := TStringList.Create();
|
||||
FStrLits.CaseSensitive := True;
|
||||
|
|
@ -533,7 +533,7 @@ begin
|
|||
FInlineResultQTypes.Free();
|
||||
FOutput.Free();
|
||||
FStrLits.Free();
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
function TCodeGenQBE.ExportPrefix: string;
|
||||
|
|
@ -3417,14 +3417,11 @@ begin
|
|||
if AExpr = nil then Exit;
|
||||
if AExpr.ResolvedType = nil then Exit;
|
||||
if AExpr.ResolvedType.Kind <> tyClass then Exit;
|
||||
{ TIdentExpr with IsNoArgFuncCall: bare zero-arg function call (no parens) }
|
||||
if AExpr is TIdentExpr then
|
||||
begin
|
||||
IE := TIdentExpr(AExpr);
|
||||
if IE.IsNoArgFuncCall or IE.IsImplicitSelfMethod then
|
||||
begin
|
||||
if IE.IsImplicitSelfMethod then
|
||||
Exit(True);
|
||||
end;
|
||||
end;
|
||||
{ Constructor calls via TFieldAccessExpr (TFoo.Create) — do NOT own }
|
||||
if AExpr is TFieldAccessExpr then
|
||||
|
|
@ -4954,6 +4951,43 @@ begin
|
|||
Exit;
|
||||
end;
|
||||
SelfTemp := EmitExpr(ACall.ObjExpr);
|
||||
if ACall.IsProcFieldCall then
|
||||
begin
|
||||
PT := TProceduralTypeDesc(ACall.ResolvedProcType);
|
||||
if ACall.ProcFieldInfo.Offset > 0 then
|
||||
begin
|
||||
SlotAddr := AllocTemp;
|
||||
EmitLine(Format(' %s =l add %s, %d',
|
||||
[SlotAddr, SelfTemp, ACall.ProcFieldInfo.Offset]));
|
||||
end
|
||||
else
|
||||
SlotAddr := SelfTemp;
|
||||
FPtrTemp := AllocTemp;
|
||||
EmitLine(Format(' %s =l loadl %s', [FPtrTemp, SlotAddr]));
|
||||
if PT.IsMethodPtr then
|
||||
begin
|
||||
ArgTemp := AllocTemp;
|
||||
EmitLine(Format(' %s =l add %s, 8', [ArgTemp, SlotAddr]));
|
||||
DataTemp := AllocTemp;
|
||||
EmitLine(Format(' %s =l loadl %s', [DataTemp, ArgTemp]));
|
||||
ArgLine := Format('l %s', [DataTemp]);
|
||||
end
|
||||
else
|
||||
ArgLine := '';
|
||||
for I := 0 to ACall.Args.Count - 1 do
|
||||
begin
|
||||
if ArgLine <> '' then ArgLine := ArgLine + ', ';
|
||||
ArgTemp := EmitExpr(TASTExpr(ACall.Args.Items[I]));
|
||||
QType := QbeTypeOf(TProcParamInfo(PT.Params.Items[I]).TypeDesc);
|
||||
ArgTemp := CoerceArg(ArgTemp, TASTExpr(ACall.Args.Items[I]), QType);
|
||||
ArgLine := ArgLine + Format('%s %s',
|
||||
[QbeParamTypeOf(TProcParamInfo(PT.Params.Items[I]).TypeDesc), ArgTemp]);
|
||||
end;
|
||||
EmitLine(Format(' call %s(%s)', [FPtrTemp, ArgLine]));
|
||||
if ExprOwnsRef(ACall.ObjExpr) then
|
||||
EmitLine(Format(' call $_ClassRelease(l %s)', [SelfTemp]));
|
||||
Exit;
|
||||
end;
|
||||
ArgLine := Format('l %s', [SelfTemp]);
|
||||
ArgTemps := TStringList.Create();
|
||||
for I := 0 to ACall.Args.Count - 1 do
|
||||
|
|
@ -7200,6 +7234,9 @@ var
|
|||
IsIntArg: Boolean;
|
||||
FT: string;
|
||||
ItabName: string;
|
||||
PT: TProceduralTypeDesc;
|
||||
SlotAddr: string;
|
||||
DataTemp: string;
|
||||
begin
|
||||
if AExpr is TFuncCallExpr then
|
||||
begin
|
||||
|
|
@ -8476,6 +8513,61 @@ begin
|
|||
begin
|
||||
MCallExpr := TMethodCallExpr(AExpr);
|
||||
|
||||
{ Procedure-type field call expression: load (Code, Data) pair and
|
||||
dispatch indirectly. Only applies to function-of-object fields that
|
||||
return a value (otherwise they go through TMethodCallStmt). }
|
||||
if MCallExpr.IsProcFieldCall then
|
||||
begin
|
||||
PT := TProceduralTypeDesc(MCallExpr.ResolvedProcType);
|
||||
if MCallExpr.ObjExpr <> nil then
|
||||
SelfTemp := EmitExpr(MCallExpr.ObjExpr)
|
||||
else if MCallExpr.IsVarParam then
|
||||
begin
|
||||
FPtrTemp := AllocTemp;
|
||||
SelfTemp := AllocTemp;
|
||||
EmitLine(Format(' %s =l loadl %%_var_%s', [FPtrTemp, MCallExpr.ObjectName]));
|
||||
EmitLine(Format(' %s =l loadl %s', [SelfTemp, FPtrTemp]));
|
||||
end
|
||||
else
|
||||
begin
|
||||
SelfTemp := AllocTemp;
|
||||
EmitLine(Format(' %s =l loadl %s',
|
||||
[SelfTemp, VarRef(MCallExpr.ObjectName, MCallExpr.IsGlobal)]));
|
||||
end;
|
||||
if MCallExpr.ProcFieldInfo.Offset > 0 then
|
||||
begin
|
||||
SlotAddr := AllocTemp;
|
||||
EmitLine(Format(' %s =l add %s, %d',
|
||||
[SlotAddr, SelfTemp, MCallExpr.ProcFieldInfo.Offset]));
|
||||
end
|
||||
else
|
||||
SlotAddr := SelfTemp;
|
||||
FPtrTemp := AllocTemp;
|
||||
EmitLine(Format(' %s =l loadl %s', [FPtrTemp, SlotAddr]));
|
||||
if PT.IsMethodPtr then
|
||||
begin
|
||||
ArgTemp := AllocTemp;
|
||||
EmitLine(Format(' %s =l add %s, 8', [ArgTemp, SlotAddr]));
|
||||
DataTemp := AllocTemp;
|
||||
EmitLine(Format(' %s =l loadl %s', [DataTemp, ArgTemp]));
|
||||
ArgLine := Format('l %s', [DataTemp]);
|
||||
end
|
||||
else
|
||||
ArgLine := '';
|
||||
for I := 0 to MCallExpr.Args.Count - 1 do
|
||||
begin
|
||||
if ArgLine <> '' then ArgLine := ArgLine + ', ';
|
||||
ArgTemp := EmitExpr(TASTExpr(MCallExpr.Args.Items[I]));
|
||||
QType := QbeTypeOf(TProcParamInfo(PT.Params.Items[I]).TypeDesc);
|
||||
ArgTemp := CoerceArg(ArgTemp, TASTExpr(MCallExpr.Args.Items[I]), QType);
|
||||
ArgLine := ArgLine + Format('%s %s',
|
||||
[QbeParamTypeOf(TProcParamInfo(PT.Params.Items[I]).TypeDesc), ArgTemp]);
|
||||
end;
|
||||
T := AllocTemp;
|
||||
EmitLine(Format(' %s =l call %s(%s)', [T, FPtrTemp, ArgLine]));
|
||||
Exit(T);
|
||||
end;
|
||||
|
||||
{ Interface method call expression: dispatch through itab }
|
||||
if (MCallExpr.ResolvedClassType <> nil) and
|
||||
(MCallExpr.ResolvedClassType.Kind = tyInterface) then
|
||||
|
|
@ -9638,22 +9730,6 @@ begin
|
|||
end;
|
||||
Exit;
|
||||
end
|
||||
else if TIdentExpr(AExpr).IsNoArgFuncCall then
|
||||
begin
|
||||
{ Bare identifier resolving to a zero-arg function (no parens in source).
|
||||
Synthesise a temporary TFuncCallExpr so existing builtin dispatch
|
||||
handles it without duplicating logic. }
|
||||
NoArgCall := TFuncCallExpr.Create();
|
||||
try
|
||||
NoArgCall.Name := TIdentExpr(AExpr).Name;
|
||||
NoArgCall.ResolvedType := AExpr.ResolvedType;
|
||||
NoArgCall.ResolvedDecl := TIdentExpr(AExpr).NoArgFuncDecl;
|
||||
Result := EmitExpr(NoArgCall);
|
||||
finally
|
||||
NoArgCall.Free();
|
||||
end;
|
||||
Exit;
|
||||
end
|
||||
else if TIdentExpr(AExpr).IsMetaclassRef then
|
||||
begin
|
||||
{ Bare class type identifier used as a value: emit the typeinfo address.
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ var
|
|||
Lines: TStringList;
|
||||
BaseDir: string;
|
||||
begin
|
||||
CfgFile := FindConfigFile;
|
||||
CfgFile := FindConfigFile();
|
||||
if CfgFile = '' then
|
||||
Exit;
|
||||
Lines := TStringList.Create();
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ const
|
|||
|
||||
constructor TOPDFEmitter.Create(AProgram: TProgram; const ASourceFile: string);
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
FProgram := AProgram;
|
||||
FSourceFile := ASourceFile;
|
||||
FOutput := TStringList.Create();
|
||||
|
|
@ -142,7 +142,7 @@ begin
|
|||
FEmitted.Free();
|
||||
FTypeNames.Free();
|
||||
FOutput.Free();
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
procedure TOPDFEmitter.L(const AText: string);
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ end;
|
|||
|
||||
constructor TLexer.Create(const ASource: string; const AFilename: string = '');
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
FTok := TFpgPascalTokeniser.Create();
|
||||
FTok.SetSource(ASource);
|
||||
FFilename := AFilename;
|
||||
|
|
@ -162,7 +162,7 @@ end;
|
|||
destructor TLexer.Destroy;
|
||||
begin
|
||||
FTok.Free();
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
function TLexer.MapKeyword(const AUpper: string): TTokenKind;
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ implementation
|
|||
|
||||
constructor TParser.Create(ALexer: TLexer);
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
FLexer := ALexer;
|
||||
FCurrent := FLexer.Next();
|
||||
FLookahead := FLexer.Next();
|
||||
|
|
|
|||
|
|
@ -364,7 +364,7 @@ end;
|
|||
|
||||
constructor TSemanticAnalyser.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
FTable := TSymbolTable.Create();
|
||||
FMethodIndex := TStringList.Create();
|
||||
FMethodIndex.CaseSensitive := False;
|
||||
|
|
@ -390,7 +390,7 @@ begin
|
|||
FProcIndex.Free();
|
||||
FMethodIndex.Free();
|
||||
FTable.Free();
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
procedure TSemanticAnalyser.SemanticError(const AMsg: string; ALine, ACol: Integer);
|
||||
|
|
@ -5250,9 +5250,22 @@ begin
|
|||
MDecl := ResolveMethodOverload(RT.Name, ACall.Name, ACall.Args,
|
||||
ACall.Line, ACall.Col);
|
||||
if MDecl = nil then
|
||||
begin
|
||||
FldInfo := RT.FindField(ACall.Name);
|
||||
if (FldInfo <> nil) and (FldInfo.TypeDesc <> nil) and
|
||||
(FldInfo.TypeDesc.Kind = tyProcedural) then
|
||||
begin
|
||||
ACall.IsProcFieldCall := True;
|
||||
ACall.ProcFieldInfo := FldInfo;
|
||||
ACall.ResolvedProcType := FldInfo.TypeDesc;
|
||||
ACall.ResolvedClassType := RT;
|
||||
ACall.ResolvedMethod := nil;
|
||||
Exit;
|
||||
end;
|
||||
SemanticError(
|
||||
Format('Class ''%s'' has no method ''%s''', [RT.Name, ACall.Name]),
|
||||
ACall.Line, ACall.Col);
|
||||
end;
|
||||
ACall.ResolvedClassType := RT;
|
||||
ACall.ResolvedMethod := MDecl;
|
||||
Exit;
|
||||
|
|
@ -7204,7 +7217,7 @@ begin
|
|||
if SameText(AExpr.Name, 'GetCurrentDir') then
|
||||
begin
|
||||
if AExpr.Args.Count <> 0 then
|
||||
SemanticError('GetCurrentDir takes no arguments', AExpr.Line, AExpr.Col);
|
||||
SemanticError('GetCurrentDir() takes no arguments', AExpr.Line, AExpr.Col);
|
||||
Result := FTable.TypeString;
|
||||
AExpr.ResolvedType := Result;
|
||||
Exit;
|
||||
|
|
@ -7420,6 +7433,7 @@ var
|
|||
IntfDesc: TInterfaceTypeDesc;
|
||||
ObjType: TTypeDesc;
|
||||
ResolvedObjName: string;
|
||||
FldInfo: TFieldInfo;
|
||||
begin
|
||||
{ Call on an arbitrary expression (e.g. TCast(x).Method(y)) }
|
||||
if AExpr.ObjExpr <> nil then
|
||||
|
|
@ -7479,9 +7493,23 @@ begin
|
|||
MDecl := ResolveMethodOverload(RT.Name, AExpr.Name, AExpr.Args,
|
||||
AExpr.Line, AExpr.Col);
|
||||
if MDecl = nil then
|
||||
begin
|
||||
FldInfo := RT.FindField(AExpr.Name);
|
||||
if (FldInfo <> nil) and (FldInfo.TypeDesc <> nil) and
|
||||
(FldInfo.TypeDesc.Kind = tyProcedural) then
|
||||
begin
|
||||
AExpr.IsProcFieldCall := True;
|
||||
AExpr.ProcFieldInfo := FldInfo;
|
||||
AExpr.ResolvedProcType := FldInfo.TypeDesc;
|
||||
AExpr.ResolvedClassType := RT;
|
||||
AExpr.ResolvedMethod := nil;
|
||||
AExpr.ResolvedType := nil;
|
||||
Exit;
|
||||
end;
|
||||
SemanticError(
|
||||
Format('Class ''%s'' has no method ''%s''', [RT.Name, AExpr.Name]),
|
||||
AExpr.Line, AExpr.Col);
|
||||
end;
|
||||
AppendDefaultArgs(AExpr.Args, MDecl, AExpr.Name, AExpr.Line, AExpr.Col);
|
||||
AExpr.ResolvedClassType := RT;
|
||||
AExpr.ResolvedMethod := MDecl;
|
||||
|
|
@ -7561,9 +7589,23 @@ begin
|
|||
MDecl := ResolveMethodOverload(RT.Name, AExpr.Name, AExpr.Args,
|
||||
AExpr.Line, AExpr.Col);
|
||||
if MDecl = nil then
|
||||
begin
|
||||
FldInfo := RT.FindField(AExpr.Name);
|
||||
if (FldInfo <> nil) and (FldInfo.TypeDesc <> nil) and
|
||||
(FldInfo.TypeDesc.Kind = tyProcedural) then
|
||||
begin
|
||||
AExpr.IsProcFieldCall := True;
|
||||
AExpr.ProcFieldInfo := FldInfo;
|
||||
AExpr.ResolvedProcType := FldInfo.TypeDesc;
|
||||
AExpr.ResolvedClassType := RT;
|
||||
AExpr.ResolvedMethod := nil;
|
||||
AExpr.ResolvedType := nil;
|
||||
Exit;
|
||||
end;
|
||||
SemanticError(
|
||||
Format('Class ''%s'' has no method ''%s''', [RT.Name, AExpr.Name]),
|
||||
AExpr.Line, AExpr.Col);
|
||||
end;
|
||||
AppendDefaultArgs(AExpr.Args, MDecl, AExpr.Name, AExpr.Line, AExpr.Col);
|
||||
{ Validate var/out-param arguments (type compatibility scored by
|
||||
overload resolver; only lvalue constraint needs rechecking). }
|
||||
|
|
@ -7708,9 +7750,28 @@ begin
|
|||
Exit;
|
||||
end;
|
||||
if MDecl = nil then
|
||||
begin
|
||||
FldInfo := RT.FindField(AExpr.Name);
|
||||
if (FldInfo <> nil) and (FldInfo.TypeDesc <> nil) and
|
||||
(FldInfo.TypeDesc.Kind = tyProcedural) then
|
||||
begin
|
||||
AExpr.IsProcFieldCall := True;
|
||||
AExpr.ProcFieldInfo := FldInfo;
|
||||
AExpr.ResolvedProcType := FldInfo.TypeDesc;
|
||||
AExpr.ResolvedClassType := RT;
|
||||
AExpr.ResolvedMethod := nil;
|
||||
AExpr.IsGlobal := ObjSym.IsGlobal;
|
||||
AExpr.IsVarParam :=
|
||||
(ObjSym.Kind = skVarParameter) or
|
||||
((ObjSym.Kind = skParameter) and (ObjSym.TypeDesc <> nil) and
|
||||
(ObjSym.TypeDesc.Kind in [tyRecord, tyStaticArray]));
|
||||
AExpr.ResolvedType := nil;
|
||||
Exit;
|
||||
end;
|
||||
SemanticError(
|
||||
Format('Class ''%s'' has no method ''%s''', [RT.Name, AExpr.Name]),
|
||||
AExpr.Line, AExpr.Col);
|
||||
end;
|
||||
if MDecl.ResolvedReturnType = nil then
|
||||
SemanticError(
|
||||
Format('Method ''%s.%s'' is a procedure (no return value)',
|
||||
|
|
@ -7747,7 +7808,6 @@ var
|
|||
Sym: TSymbol;
|
||||
FldInfo: TFieldInfo;
|
||||
PropInfo: TPropertyInfo;
|
||||
NoArgIdx: Integer;
|
||||
begin
|
||||
if AExpr is TNilLiteral then
|
||||
Result := FTable.TypeNil
|
||||
|
|
@ -7867,16 +7927,6 @@ begin
|
|||
AExpr.ResolvedType := Result;
|
||||
Exit;
|
||||
end;
|
||||
{ Bare function reference without parens — mark as no-arg call for codegen.
|
||||
Covers both builtins (not in FProcIndex) and user-defined standalone functions. }
|
||||
if (Sym.Kind = skFunction) and (Sym.TypeDesc <> nil) then
|
||||
begin
|
||||
TIdentExpr(AExpr).IsNoArgFuncCall := True;
|
||||
{ Propagate TMethodDecl for user-defined functions so codegen can emit the call }
|
||||
NoArgIdx := FProcIndex.IndexOf(TIdentExpr(AExpr).Name);
|
||||
if NoArgIdx >= 0 then
|
||||
TIdentExpr(AExpr).NoArgFuncDecl := FProcIndex.Objects[NoArgIdx];
|
||||
end;
|
||||
Result := Sym.TypeDesc;
|
||||
end
|
||||
else if AExpr is TIndirectFuncCallExpr then
|
||||
|
|
|
|||
|
|
@ -614,7 +614,7 @@ begin
|
|||
tyInteger, tyUInt32, tyEnum: Result := 4;
|
||||
tyInt64, tyUInt64, tyString, tyClass, tyPointer, tyNil, tyDouble: Result := 8;
|
||||
tySingle: Result := 4;
|
||||
tyRecord: Result := TRecordTypeDesc(Self).TotalSize;
|
||||
tyRecord: Result := TRecordTypeDesc(Self).TotalSize();
|
||||
tySet: if TSetTypeDesc(Self).BitCount <= 32 then Result := 4 else Result := 8;
|
||||
tyStaticArray:
|
||||
Result := (TStaticArrayTypeDesc(Self).HighBound -
|
||||
|
|
@ -636,7 +636,7 @@ begin
|
|||
tySmallInt, tyWord: Result := 2;
|
||||
tyByte, tyBoolean: Result := 1; { true byte; stack slots are alloc4-padded by codegen }
|
||||
tyString: Result := 8; { pointer size on 64-bit }
|
||||
tyRecord: Result := TRecordTypeDesc(Self).TotalSize;
|
||||
tyRecord: Result := TRecordTypeDesc(Self).TotalSize();
|
||||
tyNil: Result := 8;
|
||||
tyDouble: Result := 8;
|
||||
tySingle: Result := 4;
|
||||
|
|
@ -675,7 +675,7 @@ end;
|
|||
|
||||
constructor TRecordTypeDesc.Create(const AName: string; AKind: TTypeKind);
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
Kind := AKind;
|
||||
Name := AName;
|
||||
FFields := TObjectList.Create(True);
|
||||
|
|
@ -697,7 +697,7 @@ begin
|
|||
FKeys.Free();
|
||||
FFields.Free();
|
||||
FVTable.Free();
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ Returns the alignment required for AType when laid out inside this record.
|
||||
|
|
@ -964,7 +964,7 @@ end;
|
|||
|
||||
constructor TInterfaceTypeDesc.Create(const AName: string);
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
Kind := tyInterface;
|
||||
Name := AName;
|
||||
FMethods := TStringList.Create();
|
||||
|
|
@ -979,7 +979,7 @@ begin
|
|||
FParamIsVar.Free();
|
||||
FReturnTypes.Free();
|
||||
FMethods.Free();
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
procedure TInterfaceTypeDesc.AddMethod(const AName: string;
|
||||
|
|
@ -1055,7 +1055,7 @@ end;
|
|||
|
||||
constructor TSymbol.Create(const AName: string; AKind: TSymbolKind; AType: TTypeDesc);
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
Name := AName;
|
||||
Kind := AKind;
|
||||
TypeDesc := AType;
|
||||
|
|
@ -1067,7 +1067,7 @@ destructor TSymbol.Destroy;
|
|||
begin
|
||||
{ Params and ConstArray are owned class fields — released by ARC field
|
||||
cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ ------------------------------------------------------------------ }
|
||||
|
|
@ -1076,7 +1076,7 @@ end;
|
|||
|
||||
constructor TScope.Create(AParent: TScope);
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
FParent := AParent;
|
||||
FSymbols := TObjectList.Create(True);
|
||||
FKeys := TStringList.Create();
|
||||
|
|
@ -1090,7 +1090,7 @@ begin
|
|||
{ FKeys and FSymbols are owned class fields — ARC field cleanup releases
|
||||
them automatically. Swift-style: destructors handle side-effects only,
|
||||
not the release of owned storage. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
function TScope.Define(ASymbol: TSymbol): Boolean;
|
||||
|
|
@ -1164,7 +1164,7 @@ end;
|
|||
|
||||
constructor TEnumTypeDesc.Create(const AName: string);
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
Kind := tyEnum;
|
||||
Name := AName;
|
||||
Members := TStringList.Create();
|
||||
|
|
@ -1173,7 +1173,7 @@ end;
|
|||
destructor TEnumTypeDesc.Destroy;
|
||||
begin
|
||||
Members.Free();
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
function TEnumTypeDesc.OrdinalOf(const AMember: string): Integer;
|
||||
|
|
@ -1190,7 +1190,7 @@ end;
|
|||
|
||||
constructor TProceduralTypeDesc.Create(const AName: string);
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
Kind := tyProcedural;
|
||||
Name := AName;
|
||||
Params := TObjectList.Create(True);
|
||||
|
|
@ -1200,7 +1200,7 @@ end;
|
|||
destructor TProceduralTypeDesc.Destroy;
|
||||
begin
|
||||
Params.Free();
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
function TProceduralTypeDesc.IsCompatibleWith(AOther: TProceduralTypeDesc): Boolean;
|
||||
|
|
@ -1239,7 +1239,7 @@ end;
|
|||
|
||||
constructor TSymbolTable.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
FScopeStack := TObjectList.Create(True);
|
||||
FAllTypes := TObjectList.Create(True);
|
||||
FGenerics := TStringList.Create();
|
||||
|
|
@ -1261,7 +1261,7 @@ begin
|
|||
FGenericRoutines.Free();
|
||||
{ FGenerics, FGenericTemplates, FScopeStack, FAllTypes are owned class fields — released by
|
||||
ARC field cleanup. }
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
function TSymbolTable.NewType(AKind: TTypeKind; const AName: string): TTypeDesc;
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ begin
|
|||
Exit(Candidate);
|
||||
end;
|
||||
{ Blaise Pos: -1 = not found. `< 0` is the "not present" test. }
|
||||
if IsWindowsHost and (Pos('.exe', LowerCase(ABaseName)) < 0) then
|
||||
if IsWindowsHost() and (Pos('.exe', LowerCase(ABaseName)) < 0) then
|
||||
begin
|
||||
Candidate := IncludeTrailingPathDelimiter(ADir) + ABaseName + '.exe';
|
||||
if FileExists(Candidate) then
|
||||
|
|
@ -127,7 +127,7 @@ begin
|
|||
begin
|
||||
{ Blaise Pos/Copy are 0-based; -1 = not found. Consume one PATH entry
|
||||
per iteration. }
|
||||
SepPos := Pos(PathSep, Path);
|
||||
SepPos := Pos(PathSep(), Path);
|
||||
if SepPos >= 0 then
|
||||
begin
|
||||
Entry := Copy(Path, 0, SepPos);
|
||||
|
|
@ -228,7 +228,7 @@ var
|
|||
begin
|
||||
Result := GetEnvironmentVariable('BLAISE_RTL');
|
||||
if (Result <> '') and FileExists(Result) then Exit;
|
||||
BinDir := CompilerBinDir;
|
||||
BinDir := CompilerBinDir();
|
||||
Result := IncludeTrailingPathDelimiter(BinDir) + 'blaise_rtl.a';
|
||||
if FileExists(Result) then Exit;
|
||||
Result := '';
|
||||
|
|
@ -240,8 +240,8 @@ end;
|
|||
|
||||
function ResolveToolchain(const ATarget: TTargetDesc): TToolchain;
|
||||
begin
|
||||
Result.QBE := ResolveQBE;
|
||||
Result.Assembler := ResolveAssembler;
|
||||
Result.QBE := ResolveQBE();
|
||||
Result.Assembler := ResolveAssembler();
|
||||
Result.Linker := ResolveLinker(ATarget);
|
||||
Result.RTLPath := FindRTLArchive(ATarget);
|
||||
end;
|
||||
|
|
|
|||
|
|
@ -287,7 +287,7 @@ end;
|
|||
|
||||
constructor TRoutineSig.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
Params := TObjectList.Create(True);
|
||||
ReturnType := MakeQualRef('', '');
|
||||
VTableSlot := -1;
|
||||
|
|
@ -296,7 +296,7 @@ end;
|
|||
destructor TRoutineSig.Destroy;
|
||||
begin
|
||||
Params.Free();
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ ----- TConstEntry ----------------------------------------------- }
|
||||
|
|
@ -304,14 +304,14 @@ end;
|
|||
destructor TConstEntry.Destroy;
|
||||
begin
|
||||
Decl.Free();
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ ----- TTypeEntry ------------------------------------------------ }
|
||||
|
||||
constructor TTypeEntry.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
Implements := TStringList.Create();
|
||||
Methods := TObjectList.Create(True);
|
||||
VTableLayout := TObjectList.Create(False); { non-owning }
|
||||
|
|
@ -325,7 +325,7 @@ begin
|
|||
Methods.Free();
|
||||
Implements.Free();
|
||||
Def.Free();
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ ----- TInlineBody ----------------------------------------------- }
|
||||
|
|
@ -333,14 +333,14 @@ end;
|
|||
destructor TInlineBody.Destroy;
|
||||
begin
|
||||
Block.Free();
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ ----- TGenericBody ---------------------------------------------- }
|
||||
|
||||
constructor TGenericBody.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
TypeParams := TStringList.Create();
|
||||
Constraints := TStringList.Create();
|
||||
end;
|
||||
|
|
@ -353,7 +353,7 @@ begin
|
|||
TypeDef.Free();
|
||||
Constraints.Free();
|
||||
TypeParams.Free();
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
{ ----- TUnitInterface -------------------------------------------- }
|
||||
|
|
@ -369,7 +369,7 @@ end;
|
|||
constructor TUnitInterface.Create(const AName: string;
|
||||
ACaseSensitive: Boolean = False);
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
Name := AName;
|
||||
UsedUnits := TStringList.Create();
|
||||
|
||||
|
|
@ -403,7 +403,7 @@ begin
|
|||
Types.Free();
|
||||
|
||||
UsedUnits.Free();
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
procedure TUnitInterface.AddType(AEntry: TTypeEntry);
|
||||
|
|
|
|||
|
|
@ -318,7 +318,7 @@ end;
|
|||
|
||||
constructor TUnitLoader.Create(const ASearchPaths: TStringList);
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
FSearchPaths := ASearchPaths;
|
||||
FLoading := TStringList.Create();
|
||||
FLoading.CaseSensitive := False;
|
||||
|
|
@ -335,7 +335,7 @@ begin
|
|||
FPrebuiltIfaces.Free();
|
||||
FLoadedNames.Free();
|
||||
FLoading.Free();
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
function TUnitLoader.LoadAll(const AUnitNames: TStringList): TObjectList;
|
||||
|
|
|
|||
|
|
@ -124,5 +124,5 @@ uses
|
|||
cp.test.config;
|
||||
|
||||
begin
|
||||
Halt(RunAll);
|
||||
Halt(RunAll());
|
||||
end.
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ begin
|
|||
Result := IncludeTrailingPathDelimiter(Result);
|
||||
Exit;
|
||||
end;
|
||||
Dir := GetCurrentDir;
|
||||
Dir := GetCurrentDir();
|
||||
for Steps := 0 to 6 do
|
||||
begin
|
||||
if FileExists(IncludeTrailingPathDelimiter(Dir) + 'vendor/qbe/qbe') then
|
||||
|
|
@ -127,7 +127,7 @@ begin
|
|||
if (Parent = '') or (Parent = Dir) then Break;
|
||||
Dir := Parent;
|
||||
end;
|
||||
Result := IncludeTrailingPathDelimiter(GetCurrentDir);
|
||||
Result := IncludeTrailingPathDelimiter(GetCurrentDir());
|
||||
end;
|
||||
|
||||
function RunCmdAttr(const AExe: string; const AArgs: array of string): Integer;
|
||||
|
|
@ -161,7 +161,7 @@ var
|
|||
Chunk: string;
|
||||
begin
|
||||
Result := '';
|
||||
Root := ProjectRootAttr;
|
||||
Root := ProjectRootAttr();
|
||||
QBE := Root + 'vendor/qbe/qbe';
|
||||
RTL := Root + 'compiler/target/blaise_rtl.a';
|
||||
if not (FileExists(QBE) and FileExists(RTL)) then
|
||||
|
|
|
|||
|
|
@ -231,7 +231,7 @@ procedure TConfigTests.TestFindConfigFile_NextToBinary;
|
|||
var
|
||||
CfgPath: string;
|
||||
begin
|
||||
CfgPath := FindConfigFile;
|
||||
CfgPath := FindConfigFile();
|
||||
if CfgPath = '' then
|
||||
AssertTrue('no config found (acceptable in test env)', True)
|
||||
else
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ implementation
|
|||
|
||||
procedure TE2EArcTests.SetUp;
|
||||
begin
|
||||
inherited SetUp;
|
||||
inherited SetUp();
|
||||
SetUpScratch('compiler/target/test-e2e-arc');
|
||||
end;
|
||||
|
||||
|
|
@ -356,9 +356,9 @@ const
|
|||
F: IThing;
|
||||
procedure DoSomething(MyIntf: IThing);
|
||||
begin
|
||||
WriteLn(MyIntf.Get);
|
||||
WriteLn(MyIntf.Get());
|
||||
F := nil; { drop the caller's only other reference }
|
||||
WriteLn(MyIntf.Get) { still valid: callee retained it on entry }
|
||||
WriteLn(MyIntf.Get()) { still valid: callee retained it on entry }
|
||||
end;
|
||||
var
|
||||
T: TThing;
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ var
|
|||
begin
|
||||
Result := GetEnvironmentVariable('BLAISE_PROJECT_ROOT');
|
||||
if Result <> '' then begin Result := IncludeTrailingPathDelimiter(Result); Exit end;
|
||||
Dir := GetCurrentDir;
|
||||
Dir := GetCurrentDir();
|
||||
for Steps := 0 to 5 do
|
||||
begin
|
||||
if DirectoryExists(IncludeTrailingPathDelimiter(Dir) + 'vendor/qbe') and
|
||||
|
|
@ -125,7 +125,7 @@ begin
|
|||
if (Parent = '') or (Parent = Dir) then Break;
|
||||
Dir := Parent
|
||||
end;
|
||||
Result := IncludeTrailingPathDelimiter(GetCurrentDir)
|
||||
Result := IncludeTrailingPathDelimiter(GetCurrentDir())
|
||||
end;
|
||||
|
||||
function TE2ETestCase.ToolchainAvailable: Boolean;
|
||||
|
|
@ -142,7 +142,7 @@ end;
|
|||
procedure TE2ETestCase.SetUp;
|
||||
begin
|
||||
{ Subclasses must call SetUpScratch to set FScratch and FCounter }
|
||||
inherited SetUp;
|
||||
inherited SetUp();
|
||||
FCounter := 0;
|
||||
FQBE := GetEnvironmentVariable('BLAISE_QBE');
|
||||
if FQBE = '' then
|
||||
|
|
@ -247,7 +247,7 @@ begin
|
|||
if ABackend = beNative then
|
||||
begin
|
||||
NCG := TCodeGenNative.Create();
|
||||
NCG.SetTarget(HostTarget);
|
||||
NCG.SetTarget(HostTarget());
|
||||
CG := NCG; { ARC-managed; released at scope exit }
|
||||
CG.Generate(Prog);
|
||||
Emitted := CG.GetOutput()
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ implementation
|
|||
|
||||
procedure TE2ECaseEnumTests.SetUp;
|
||||
begin
|
||||
inherited SetUp;
|
||||
inherited SetUp();
|
||||
SetUpScratch('compiler/target/test-e2e-caseenum');
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ implementation
|
|||
|
||||
procedure TE2EClasses2Tests.SetUp;
|
||||
begin
|
||||
inherited SetUp;
|
||||
inherited SetUp();
|
||||
SetUpScratch('compiler/target/test-e2e-classes2');
|
||||
end;
|
||||
|
||||
|
|
@ -332,14 +332,14 @@ const
|
|||
function TChild.Val: Integer;
|
||||
var B: Integer;
|
||||
begin
|
||||
inherited Val;
|
||||
inherited Val();
|
||||
B := Result;
|
||||
Result := B + 5
|
||||
end;
|
||||
var C: TChild;
|
||||
begin
|
||||
C := TChild.Create();
|
||||
WriteLn(C.Val);
|
||||
WriteLn(C.Val());
|
||||
C.Free()
|
||||
end.
|
||||
''';
|
||||
|
|
@ -776,7 +776,7 @@ const
|
|||
var Compute: Integer;
|
||||
begin
|
||||
Compute := 7;
|
||||
Result := Self.Compute
|
||||
Result := Self.Compute()
|
||||
end;
|
||||
var F: TFoo;
|
||||
begin
|
||||
|
|
@ -830,7 +830,7 @@ var
|
|||
Expected: string;
|
||||
begin
|
||||
if not ToolchainAvailable then begin Ignore('toolchain unavailable'); Exit; end;
|
||||
Path := GetCurrentDir;
|
||||
Path := GetCurrentDir();
|
||||
// Walk up to project root looking for tests/phase2_milestone.pas
|
||||
while (Path <> '') and
|
||||
(not FileExists(Path + '/tests/phase2_milestone.pas')) and
|
||||
|
|
@ -871,7 +871,7 @@ var
|
|||
begin
|
||||
if not ToolchainAvailable then begin Ignore('toolchain unavailable'); Exit; end;
|
||||
if not ValgrindAvailable then begin Ignore('valgrind not installed'); Exit; end;
|
||||
Path := GetCurrentDir;
|
||||
Path := GetCurrentDir();
|
||||
while (Path <> '') and
|
||||
(not FileExists(Path + '/tests/phase2_milestone.pas')) and
|
||||
(ExtractFileDir(Path) <> Path) do
|
||||
|
|
@ -896,7 +896,7 @@ var
|
|||
Expected: string;
|
||||
begin
|
||||
if not ToolchainAvailable then begin Ignore('toolchain unavailable'); Exit; end;
|
||||
Path := GetCurrentDir;
|
||||
Path := GetCurrentDir();
|
||||
while (Path <> '') and
|
||||
(not FileExists(Path + '/tests/phase3_milestone.pas')) and
|
||||
(ExtractFileDir(Path) <> Path) do
|
||||
|
|
@ -930,7 +930,7 @@ var
|
|||
begin
|
||||
if not ToolchainAvailable then begin Ignore('toolchain unavailable'); Exit; end;
|
||||
if not ValgrindAvailable then begin Ignore('valgrind not installed'); Exit; end;
|
||||
Path := GetCurrentDir;
|
||||
Path := GetCurrentDir();
|
||||
while (Path <> '') and
|
||||
(not FileExists(Path + '/tests/phase3_milestone.pas')) and
|
||||
(ExtractFileDir(Path) <> Path) do
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ implementation
|
|||
|
||||
procedure TE2ECollections2Tests.SetUp;
|
||||
begin
|
||||
inherited SetUp;
|
||||
inherited SetUp();
|
||||
SetUpScratch('compiler/target/test-e2e-collections2');
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ implementation
|
|||
|
||||
procedure TE2EControlFlowTests.SetUp;
|
||||
begin
|
||||
inherited SetUp;
|
||||
inherited SetUp();
|
||||
SetUpScratch('compiler/target/test-e2e-controlflow');
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ type
|
|||
protected
|
||||
procedure SetUp; override;
|
||||
published
|
||||
procedure TestRun_InstantNow;
|
||||
procedure TestRun_InstantNow();
|
||||
procedure TestRun_MakeDate_ToString;
|
||||
procedure TestRun_MakeTime_ToString;
|
||||
procedure TestRun_MakeTimeNano_ToString;
|
||||
|
|
@ -72,9 +72,9 @@ const
|
|||
uses DateUtils;
|
||||
var I: TInstant;
|
||||
begin
|
||||
I := InstantNow;
|
||||
I := InstantNow();
|
||||
{ Must be after 2020-01-01T00:00:00Z = Unix epoch 1577836800 }
|
||||
WriteLn(I.ToUnixSeconds > 1577836800)
|
||||
WriteLn(I.ToUnixSeconds() > 1577836800)
|
||||
end.
|
||||
''';
|
||||
|
||||
|
|
@ -147,8 +147,8 @@ const
|
|||
begin
|
||||
O := MakeOffset(0, 0);
|
||||
WriteLn(O.TotalSeconds);
|
||||
WriteLn(O.Hours);
|
||||
WriteLn(O.Minutes)
|
||||
WriteLn(O.Hours());
|
||||
WriteLn(O.Minutes())
|
||||
end.
|
||||
''';
|
||||
|
||||
|
|
@ -179,8 +179,8 @@ const
|
|||
begin
|
||||
{ 1970-01-01T00:00:01Z = Unix second 1 }
|
||||
I := MakeInstantUnix(1);
|
||||
WriteLn(I.ToUnixSeconds);
|
||||
WriteLn(I.ToUnixMillis)
|
||||
WriteLn(I.ToUnixSeconds());
|
||||
WriteLn(I.ToUnixMillis())
|
||||
end.
|
||||
''';
|
||||
|
||||
|
|
@ -226,7 +226,7 @@ const
|
|||
A := MakeInstantUnix(1000);
|
||||
B := MakeInstantUnix(1003);
|
||||
Dur := B.Subtract(A);
|
||||
WriteLn(Dur.TotalSeconds)
|
||||
WriteLn(Dur.TotalSeconds())
|
||||
end.
|
||||
''';
|
||||
|
||||
|
|
@ -293,10 +293,10 @@ const
|
|||
begin
|
||||
{ 2 hours + 30 min + 10 sec = 9010 s = 9010000 ms }
|
||||
D := MakeDurationSeconds(9010);
|
||||
WriteLn(D.TotalSeconds);
|
||||
WriteLn(D.TotalMilliseconds);
|
||||
WriteLn(D.TotalMinutes);
|
||||
WriteLn(D.TotalHours)
|
||||
WriteLn(D.TotalSeconds());
|
||||
WriteLn(D.TotalMilliseconds());
|
||||
WriteLn(D.TotalMinutes());
|
||||
WriteLn(D.TotalHours())
|
||||
end.
|
||||
''';
|
||||
|
||||
|
|
@ -319,10 +319,10 @@ const
|
|||
var D, A: TDuration;
|
||||
begin
|
||||
D := MakeDurationSeconds(-120);
|
||||
WriteLn(D.IsNegative);
|
||||
A := D.Abs;
|
||||
WriteLn(A.IsNegative);
|
||||
WriteLn(A.TotalSeconds)
|
||||
WriteLn(D.IsNegative());
|
||||
A := D.Abs();
|
||||
WriteLn(A.IsNegative());
|
||||
WriteLn(A.TotalSeconds())
|
||||
end.
|
||||
''';
|
||||
|
||||
|
|
@ -336,9 +336,9 @@ const
|
|||
B := MakeDurationSeconds(50);
|
||||
C := DurationAdd(A, B);
|
||||
S := DurationSubtract(A, B);
|
||||
WriteLn(C.TotalSeconds);
|
||||
WriteLn(S.TotalSeconds);
|
||||
WriteLn(DurationNegate(A).TotalSeconds)
|
||||
WriteLn(C.TotalSeconds());
|
||||
WriteLn(S.TotalSeconds());
|
||||
WriteLn(DurationNegate(A).TotalSeconds())
|
||||
end.
|
||||
''';
|
||||
|
||||
|
|
@ -425,10 +425,10 @@ const
|
|||
var D: TDuration;
|
||||
begin
|
||||
D := ParseDuration('PT3H25M10S');
|
||||
WriteLn(D.TotalSeconds);
|
||||
WriteLn(D.TotalSeconds());
|
||||
WriteLn(D.ToString());
|
||||
D := ParseDuration('PT0S');
|
||||
WriteLn(D.TotalSeconds)
|
||||
WriteLn(D.TotalSeconds())
|
||||
end.
|
||||
''';
|
||||
|
||||
|
|
@ -480,10 +480,10 @@ const
|
|||
{ 2025-05-15 is a Thursday = 4 (ISO: Mon=1 .. Sun=7) }
|
||||
D := MakeDate(2025, 5, 15);
|
||||
WriteLn(DayOfWeek(D));
|
||||
WriteLn(D.DayOfWeek);
|
||||
WriteLn(D.DayOfWeek());
|
||||
{ 2025-05-19 is a Monday = 1 }
|
||||
D := MakeDate(2025, 5, 19);
|
||||
WriteLn(D.DayOfWeek)
|
||||
WriteLn(D.DayOfWeek())
|
||||
end.
|
||||
''';
|
||||
|
||||
|
|
@ -552,7 +552,7 @@ const
|
|||
uses DateUtils;
|
||||
var O: TTimeZoneOffset;
|
||||
begin
|
||||
O := SystemOffset;
|
||||
O := SystemOffset();
|
||||
{ UTC offset must be within +/-14 hours = +/-50400 seconds }
|
||||
WriteLn(O.TotalSeconds >= -50400);
|
||||
WriteLn(O.TotalSeconds <= 50400)
|
||||
|
|
@ -582,7 +582,7 @@ const
|
|||
|
||||
procedure TE2EDateUtilsTests.SetUp;
|
||||
begin
|
||||
inherited SetUp;
|
||||
inherited SetUp();
|
||||
SetUpScratch('compiler/target/test-e2e-dateutils')
|
||||
end;
|
||||
|
||||
|
|
@ -590,7 +590,7 @@ end;
|
|||
{ Tests }
|
||||
{ ------------------------------------------------------------------ }
|
||||
|
||||
procedure TE2EDateUtilsTests.TestRun_InstantNow;
|
||||
procedure TE2EDateUtilsTests.TestRun_InstantNow();
|
||||
var
|
||||
Output: string;
|
||||
RCode: Integer;
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ implementation
|
|||
|
||||
procedure TE2EExceptionTests.SetUp;
|
||||
begin
|
||||
inherited SetUp;
|
||||
inherited SetUp();
|
||||
SetUpScratch('compiler/target/test-e2e-exceptions');
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -216,7 +216,7 @@ const
|
|||
M.Add(20, 200);
|
||||
WriteLn(M.ContainsKey(10));
|
||||
WriteLn(M.ContainsKey(99));
|
||||
WriteLn(M.GetCount)
|
||||
WriteLn(M.GetCount())
|
||||
end.
|
||||
''';
|
||||
|
||||
|
|
@ -253,7 +253,7 @@ const
|
|||
M := TDict.Create();
|
||||
M.Add(1, 10); M.Add(2, 20); M.Add(3, 30);
|
||||
M.Remove(2);
|
||||
WriteLn(M.GetCount);
|
||||
WriteLn(M.GetCount());
|
||||
WriteLn(M.ContainsKey(2));
|
||||
WriteLn(M.ContainsKey(1))
|
||||
end.
|
||||
|
|
@ -274,7 +274,7 @@ const
|
|||
M.Add(20, 200);
|
||||
WriteLn(M.ContainsKey(10));
|
||||
WriteLn(M.ContainsKey(99));
|
||||
WriteLn(M.GetCount)
|
||||
WriteLn(M.GetCount())
|
||||
end.
|
||||
''';
|
||||
|
||||
|
|
@ -326,7 +326,7 @@ const
|
|||
|
||||
procedure TE2EIMapTests.SetUp;
|
||||
begin
|
||||
inherited SetUp;
|
||||
inherited SetUp();
|
||||
SetUpScratch('compiler/target/test-e2e-imap')
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ implementation
|
|||
|
||||
procedure TE2ELeakCheckTests.SetUp;
|
||||
begin
|
||||
inherited SetUp;
|
||||
inherited SetUp();
|
||||
SetUpScratch('compiler/target/test-e2e-leakcheck');
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ implementation
|
|||
|
||||
procedure TE2EMathTests.SetUp;
|
||||
begin
|
||||
inherited SetUp;
|
||||
inherited SetUp();
|
||||
SetUpScratch('compiler/target/test-e2e-math');
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ implementation
|
|||
|
||||
procedure TE2EMiscTests.SetUp;
|
||||
begin
|
||||
inherited SetUp;
|
||||
inherited SetUp();
|
||||
SetUpScratch('compiler/target/test-e2e-misc');
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ implementation
|
|||
|
||||
procedure TE2ENativeTests.SetUp;
|
||||
begin
|
||||
inherited SetUp;
|
||||
inherited SetUp();
|
||||
SetUpScratch('compiler/target/test-e2e-native');
|
||||
end;
|
||||
|
||||
|
|
@ -892,8 +892,8 @@ const
|
|||
DT.Date.Day := 5;
|
||||
DT.Hour := 14;
|
||||
D := DT.Date;
|
||||
WriteLn(D.Sum);
|
||||
WriteLn(DT.Date.Sum)
|
||||
WriteLn(D.Sum());
|
||||
WriteLn(DT.Date.Sum())
|
||||
end.
|
||||
''';
|
||||
|
||||
|
|
@ -2054,7 +2054,7 @@ const
|
|||
begin
|
||||
B := TBox.Create();
|
||||
S := B;
|
||||
S.Describe
|
||||
S.Describe()
|
||||
end.
|
||||
''';
|
||||
|
||||
|
|
@ -2107,8 +2107,8 @@ const
|
|||
B := TBox.Create();
|
||||
S := B;
|
||||
C := B as IColor;
|
||||
WriteLn(S.Area);
|
||||
WriteLn(C.Code)
|
||||
WriteLn(S.Area());
|
||||
WriteLn(C.Code())
|
||||
end.
|
||||
''';
|
||||
|
||||
|
|
@ -2258,7 +2258,7 @@ const
|
|||
D := TDoc.Create();
|
||||
I := D;
|
||||
H := THolder.Create(I);
|
||||
H.Use
|
||||
H.Use()
|
||||
end.
|
||||
''';
|
||||
|
||||
|
|
@ -2330,13 +2330,13 @@ const
|
|||
begin WriteLn('base') end;
|
||||
procedure TDer.Hello;
|
||||
begin
|
||||
inherited Hello;
|
||||
inherited Hello();
|
||||
WriteLn('derived')
|
||||
end;
|
||||
var D: TDer;
|
||||
begin
|
||||
D := TDer.Create();
|
||||
D.Hello
|
||||
D.Hello()
|
||||
end.
|
||||
''';
|
||||
|
||||
|
|
@ -2660,7 +2660,7 @@ const
|
|||
begin
|
||||
B := TBox<Integer>.Create();
|
||||
B.SetVal(99);
|
||||
WriteLn(B.GetVal)
|
||||
WriteLn(B.GetVal())
|
||||
end.
|
||||
''';
|
||||
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ const
|
|||
|
||||
procedure TE2EOpenArrayTests.SetUp;
|
||||
begin
|
||||
inherited SetUp;
|
||||
inherited SetUp();
|
||||
SetUpScratch('compiler/target/test-e2e-openarray')
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ implementation
|
|||
|
||||
procedure TE2EPointersTests.SetUp;
|
||||
begin
|
||||
inherited SetUp;
|
||||
inherited SetUp();
|
||||
SetUpScratch('compiler/target/test-e2e-pointers');
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ implementation
|
|||
|
||||
procedure TE2ERecordsTests.SetUp;
|
||||
begin
|
||||
inherited SetUp;
|
||||
inherited SetUp();
|
||||
SetUpScratch('compiler/target/test-e2e-records');
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ implementation
|
|||
|
||||
procedure TSepCompileTests.SetUp;
|
||||
begin
|
||||
inherited SetUp;
|
||||
inherited SetUp();
|
||||
SetUpScratch('compiler/target/test-e2e-sepcompile')
|
||||
end;
|
||||
|
||||
|
|
@ -61,7 +61,7 @@ var
|
|||
begin
|
||||
Root := GetEnvironmentVariable('BLAISE_PROJECT_ROOT');
|
||||
if Root = '' then
|
||||
Root := GetCurrentDir;
|
||||
Root := GetCurrentDir();
|
||||
Result := IncludeTrailingPathDelimiter(Root) + 'compiler/target/blaise'
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ const
|
|||
|
||||
procedure TE2EStaticArrayTests.SetUp;
|
||||
begin
|
||||
inherited SetUp;
|
||||
inherited SetUp();
|
||||
SetUpScratch('compiler/target/test-e2e-staticarray')
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ implementation
|
|||
|
||||
procedure TE2EStreamsTests.SetUp;
|
||||
begin
|
||||
inherited SetUp;
|
||||
inherited SetUp();
|
||||
SetUpScratch('compiler/target/test-e2e-streams')
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ implementation
|
|||
|
||||
procedure TE2EStringOpsTests.SetUp;
|
||||
begin
|
||||
inherited SetUp;
|
||||
inherited SetUp();
|
||||
SetUpScratch('compiler/target/test-e2e-stringops');
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ implementation
|
|||
|
||||
procedure TE2EStrUtilsTests.SetUp;
|
||||
begin
|
||||
inherited SetUp;
|
||||
inherited SetUp();
|
||||
SetUpScratch('compiler/target/test-e2e-strutils');
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ implementation
|
|||
|
||||
procedure TE2ESysUtilsTests.SetUp;
|
||||
begin
|
||||
inherited SetUp;
|
||||
inherited SetUp();
|
||||
SetUpScratch('compiler/target/test-e2e-sysutils');
|
||||
end;
|
||||
|
||||
|
|
@ -71,7 +71,7 @@ const
|
|||
'''
|
||||
program P;
|
||||
begin
|
||||
WriteLn(ParamCount)
|
||||
WriteLn(ParamCount())
|
||||
end.
|
||||
''';
|
||||
|
||||
|
|
@ -155,7 +155,7 @@ const
|
|||
'''
|
||||
program P;
|
||||
begin
|
||||
WriteLn(GetProcessID)
|
||||
WriteLn(GetProcessID())
|
||||
end.
|
||||
''';
|
||||
|
||||
|
|
@ -172,7 +172,7 @@ const
|
|||
'''
|
||||
program P;
|
||||
begin
|
||||
WriteLn(GetTempDir)
|
||||
WriteLn(GetTempDir())
|
||||
end.
|
||||
''';
|
||||
|
||||
|
|
@ -204,7 +204,7 @@ const
|
|||
Output: string;
|
||||
Chunk: string;
|
||||
begin
|
||||
H := ProcessCreate;
|
||||
H := ProcessCreate();
|
||||
ProcessSetExe(H, 'echo');
|
||||
ProcessAddArg(H, 'hello from process');
|
||||
ProcessExecute(H);
|
||||
|
|
@ -229,7 +229,7 @@ const
|
|||
Code: Integer;
|
||||
Chunk: string;
|
||||
begin
|
||||
H := ProcessCreate;
|
||||
H := ProcessCreate();
|
||||
ProcessSetExe(H, 'true');
|
||||
ProcessExecute(H);
|
||||
Chunk := ProcessReadOutput(H);
|
||||
|
|
@ -428,8 +428,8 @@ var
|
|||
Dir: string;
|
||||
begin
|
||||
if not ToolchainAvailable then begin Ignore('toolchain unavailable'); Exit; end;
|
||||
Dir := IncludeTrailingPathDelimiter(GetTempDir) +
|
||||
'blaise_test_' + IntToStr(GetProcessID) + '/a/b/c';
|
||||
Dir := IncludeTrailingPathDelimiter(GetTempDir()) +
|
||||
'blaise_test_' + IntToStr(GetProcessID()) + '/a/b/c';
|
||||
try
|
||||
AssertTrue('compile+run',
|
||||
CompileAndRun(SrcForceDirectories, Output, RCode, [Dir]));
|
||||
|
|
@ -509,7 +509,7 @@ const
|
|||
var D: string;
|
||||
begin
|
||||
WriteLn(SetCurrentDir('/tmp'));
|
||||
D := GetCurrentDir;
|
||||
D := GetCurrentDir();
|
||||
WriteLn(Length(D) > 0)
|
||||
end.
|
||||
''';
|
||||
|
|
@ -548,7 +548,7 @@ const
|
|||
'''
|
||||
program P;
|
||||
begin
|
||||
WriteLn(Length(GetCurrentDir) > 0)
|
||||
WriteLn(Length(GetCurrentDir()) > 0)
|
||||
end.
|
||||
''';
|
||||
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ const
|
|||
|
||||
procedure TE2ETComponentTests.SetUp;
|
||||
begin
|
||||
inherited SetUp;
|
||||
inherited SetUp();
|
||||
SetUpScratch('compiler/target/test-e2e-tcomponent')
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ implementation
|
|||
|
||||
procedure TE2ETextBlockTests.SetUp;
|
||||
begin
|
||||
inherited SetUp;
|
||||
inherited SetUp();
|
||||
SetUpScratch('compiler/target/test-e2e-textblock');
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ implementation
|
|||
|
||||
procedure TE2EThreadingTests.SetUp;
|
||||
begin
|
||||
inherited SetUp;
|
||||
inherited SetUp();
|
||||
SetUpScratch('compiler/target/test-e2e-threading');
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ const
|
|||
|
||||
procedure TE2ETListTests.SetUp;
|
||||
begin
|
||||
inherited SetUp;
|
||||
inherited SetUp();
|
||||
SetUpScratch('compiler/target/test-e2e-tlist')
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ const
|
|||
|
||||
procedure TE2EOrdDictTests.SetUp;
|
||||
begin
|
||||
inherited SetUp;
|
||||
inherited SetUp();
|
||||
SetUpScratch('compiler/target/test-e2e-torddict')
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ const
|
|||
|
||||
procedure TE2EQueueTests.SetUp;
|
||||
begin
|
||||
inherited SetUp;
|
||||
inherited SetUp();
|
||||
SetUpScratch('compiler/target/test-e2e-tqueue')
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ const
|
|||
|
||||
procedure TE2ESetTests.SetUp;
|
||||
begin
|
||||
inherited SetUp;
|
||||
inherited SetUp();
|
||||
SetUpScratch('compiler/target/test-e2e-tset')
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ const
|
|||
|
||||
procedure TE2EStackTests.SetUp;
|
||||
begin
|
||||
inherited SetUp;
|
||||
inherited SetUp();
|
||||
SetUpScratch('compiler/target/test-e2e-tstack')
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -474,7 +474,7 @@ const
|
|||
|
||||
procedure TE2ETStringListTests.SetUp;
|
||||
begin
|
||||
inherited SetUp;
|
||||
inherited SetUp();
|
||||
SetUpScratch('compiler/target/test-e2e-tstringlist')
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ implementation
|
|||
|
||||
procedure TE2EUsesChainTests.SetUp;
|
||||
begin
|
||||
inherited SetUp;
|
||||
inherited SetUp();
|
||||
SetUpScratch('compiler/target/test-e2e-useschain');
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -384,8 +384,8 @@ begin
|
|||
function Foo: Byte; external;
|
||||
var b: Byte;
|
||||
begin
|
||||
b := Foo;
|
||||
if Foo <> 0 then
|
||||
b := Foo();
|
||||
if Foo() <> 0 then
|
||||
b := 1;
|
||||
end.
|
||||
'''
|
||||
|
|
@ -403,7 +403,7 @@ begin
|
|||
function Foo: Word; external;
|
||||
var w: Word;
|
||||
begin
|
||||
w := Foo;
|
||||
w := Foo();
|
||||
end.
|
||||
'''
|
||||
);
|
||||
|
|
@ -420,7 +420,7 @@ begin
|
|||
function Foo: SmallInt; external;
|
||||
var s: SmallInt;
|
||||
begin
|
||||
s := Foo;
|
||||
s := Foo();
|
||||
end.
|
||||
'''
|
||||
);
|
||||
|
|
|
|||
|
|
@ -378,7 +378,7 @@ end;
|
|||
|
||||
procedure THighLowE2ETests.SetUp;
|
||||
begin
|
||||
inherited SetUp;
|
||||
inherited SetUp();
|
||||
SetUpScratch('compiler/target/test-e2e-highlow');
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -400,7 +400,7 @@ begin
|
|||
Sym := Prog.SymbolTable.Lookup('TDog');
|
||||
AssertNotNull('TDog symbol', Sym);
|
||||
RT := TRecordTypeDesc(Sym.TypeDesc);
|
||||
AssertEquals('TDog total size = 16', 16, RT.TotalSize);
|
||||
AssertEquals('TDog total size = 16', 16, RT.TotalSize());
|
||||
finally Prog.Free(); end;
|
||||
end;
|
||||
|
||||
|
|
@ -496,7 +496,7 @@ const
|
|||
end;
|
||||
procedure TChild.Init;
|
||||
begin
|
||||
inherited Init;
|
||||
inherited Init();
|
||||
Self.Y := 0
|
||||
end;
|
||||
var C: TChild;
|
||||
|
|
|
|||
|
|
@ -179,7 +179,7 @@ procedure TMathTests.SetUp;
|
|||
var
|
||||
ExeDir: string;
|
||||
begin
|
||||
inherited SetUp;
|
||||
inherited SetUp();
|
||||
ExeDir := ExtractFilePath(ParamStr(0));
|
||||
FRTLUnitPath := ExpandFileName(ExeDir + '../../runtime/src/main/pascal');
|
||||
FStdlibUnitPath := ExpandFileName(ExeDir + '../../stdlib/src/main/pascal');
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ implementation
|
|||
|
||||
procedure TMultifileTests.SetUp;
|
||||
begin
|
||||
FTmpDir := GetTempDir + 'blaise_mf_' + IntToStr(GetProcessID);
|
||||
FTmpDir := GetTempDir() + 'blaise_mf_' + IntToStr(GetProcessID());
|
||||
ForceDirectories(FTmpDir);
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@ begin
|
|||
Prog := AnalyseSrc(Src);
|
||||
try
|
||||
RT := TRecordTypeDesc(TVarDecl(Prog.Block.Decls.Items[0]).ResolvedType);
|
||||
AssertEquals('TotalSize = 1 + 4 = 5 (no tail pad)', 5, RT.TotalSize);
|
||||
AssertEquals('TotalSize = 1 + 4 = 5 (no tail pad)', 5, RT.TotalSize());
|
||||
finally
|
||||
Prog.Free();
|
||||
end;
|
||||
|
|
@ -256,7 +256,7 @@ begin
|
|||
AssertEquals('MaxAlign = 1 for packed', 1, RT.MaxAlign);
|
||||
AssertEquals('B offset = 1 (no 8-byte align)', 1,
|
||||
RT.FindField('B').Offset);
|
||||
AssertEquals('TotalSize = 9 (no tail pad)', 9, RT.TotalSize);
|
||||
AssertEquals('TotalSize = 9 (no tail pad)', 9, RT.TotalSize());
|
||||
finally
|
||||
Prog.Free();
|
||||
end;
|
||||
|
|
@ -373,7 +373,7 @@ end;
|
|||
|
||||
procedure TPackedRecordE2ETests.SetUp;
|
||||
begin
|
||||
inherited SetUp;
|
||||
inherited SetUp();
|
||||
SetUpScratch('compiler/target/test-e2e-packed-record');
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ const
|
|||
program P;
|
||||
var H: Pointer;
|
||||
begin
|
||||
H := ProcessCreate
|
||||
H := ProcessCreate()
|
||||
end.
|
||||
''';
|
||||
|
||||
|
|
@ -81,7 +81,7 @@ const
|
|||
var H: Pointer;
|
||||
B: Boolean;
|
||||
begin
|
||||
H := ProcessCreate;
|
||||
H := ProcessCreate();
|
||||
B := ProcessRunning(H)
|
||||
end.
|
||||
''';
|
||||
|
|
@ -92,7 +92,7 @@ const
|
|||
var H: Pointer;
|
||||
S: string;
|
||||
begin
|
||||
H := ProcessCreate;
|
||||
H := ProcessCreate();
|
||||
S := ProcessReadOutput(H)
|
||||
end.
|
||||
''';
|
||||
|
|
@ -103,7 +103,7 @@ const
|
|||
var H: Pointer;
|
||||
N: Integer;
|
||||
begin
|
||||
H := ProcessCreate;
|
||||
H := ProcessCreate();
|
||||
N := ProcessExitCode(H)
|
||||
end.
|
||||
''';
|
||||
|
|
@ -113,7 +113,7 @@ const
|
|||
program P;
|
||||
var H: Pointer;
|
||||
begin
|
||||
H := ProcessCreate;
|
||||
H := ProcessCreate();
|
||||
ProcessSetExe(H, 'echo')
|
||||
end.
|
||||
''';
|
||||
|
|
@ -123,7 +123,7 @@ const
|
|||
program P;
|
||||
var H: Pointer;
|
||||
begin
|
||||
H := ProcessCreate;
|
||||
H := ProcessCreate();
|
||||
ProcessAddArg(H, 'hello')
|
||||
end.
|
||||
''';
|
||||
|
|
@ -133,7 +133,7 @@ const
|
|||
program P;
|
||||
var H: Pointer;
|
||||
begin
|
||||
H := ProcessCreate;
|
||||
H := ProcessCreate();
|
||||
ProcessSetExe(H, 'echo');
|
||||
ProcessExecute(H)
|
||||
end.
|
||||
|
|
@ -144,7 +144,7 @@ const
|
|||
program P;
|
||||
var H: Pointer;
|
||||
begin
|
||||
H := ProcessCreate;
|
||||
H := ProcessCreate();
|
||||
ProcessSetExe(H, 'echo');
|
||||
ProcessExecute(H);
|
||||
ProcessWaitOnExit(H)
|
||||
|
|
@ -156,7 +156,7 @@ const
|
|||
program P;
|
||||
var H: Pointer;
|
||||
begin
|
||||
H := ProcessCreate;
|
||||
H := ProcessCreate();
|
||||
ProcessFree(H)
|
||||
end.
|
||||
''';
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ begin
|
|||
Result := IncludeTrailingPathDelimiter(Result);
|
||||
Exit;
|
||||
end;
|
||||
Dir := GetCurrentDir;
|
||||
Dir := GetCurrentDir();
|
||||
for Steps := 0 to 5 do
|
||||
begin
|
||||
if DirectoryExists(IncludeTrailingPathDelimiter(Dir) + 'vendor/qbe') and
|
||||
|
|
@ -130,7 +130,7 @@ begin
|
|||
if (Parent = '') or (Parent = Dir) then Break;
|
||||
Dir := Parent;
|
||||
end;
|
||||
Result := IncludeTrailingPathDelimiter(GetCurrentDir);
|
||||
Result := IncludeTrailingPathDelimiter(GetCurrentDir());
|
||||
end;
|
||||
|
||||
function RunCmdOFO(const AExe: string; const AArgs: array of string): Integer;
|
||||
|
|
@ -164,7 +164,7 @@ var
|
|||
Chunk: string;
|
||||
begin
|
||||
Result := '';
|
||||
Root := ProjectRootOFO;
|
||||
Root := ProjectRootOFO();
|
||||
QBE := Root + 'vendor/qbe/qbe';
|
||||
RTL := Root + 'compiler/target/blaise_rtl.a';
|
||||
if not (FileExists(QBE) and FileExists(RTL)) then
|
||||
|
|
@ -613,7 +613,7 @@ begin
|
|||
try
|
||||
RT := TRecordTypeDesc(TVarDecl(Prog.Block.Decls.Items[0]).ResolvedType);
|
||||
AssertEquals('record holding a method-ptr field totals 16 bytes',
|
||||
16, RT.TotalSize);
|
||||
16, RT.TotalSize());
|
||||
finally
|
||||
Prog.Free();
|
||||
end;
|
||||
|
|
@ -649,7 +649,7 @@ const
|
|||
{ Read the field into a local and invoke — exercises the field-read
|
||||
path (which must return the field address, not a single loadl). }
|
||||
G := H.Handler;
|
||||
G;
|
||||
G();
|
||||
H.Free();
|
||||
F.Free()
|
||||
end.
|
||||
|
|
@ -672,7 +672,7 @@ const
|
|||
var H: THolder;
|
||||
begin
|
||||
H := THolder.Create();
|
||||
H.Handler;
|
||||
H.Handler();
|
||||
H.Free()
|
||||
end.
|
||||
''';
|
||||
|
|
@ -708,7 +708,7 @@ const
|
|||
M.Code := MethodAddress(F, 'SayHi');
|
||||
M.Data := F;
|
||||
F.Handler := TGreet(M);
|
||||
F.Handler;
|
||||
F.Handler();
|
||||
F.Handler();
|
||||
F.Free()
|
||||
end.
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ begin
|
|||
Result := IncludeTrailingPathDelimiter(Result);
|
||||
Exit;
|
||||
end;
|
||||
Dir := GetCurrentDir;
|
||||
Dir := GetCurrentDir();
|
||||
for Steps := 0 to 5 do
|
||||
begin
|
||||
if DirectoryExists(IncludeTrailingPathDelimiter(Dir) + 'vendor/qbe') and
|
||||
|
|
@ -121,7 +121,7 @@ begin
|
|||
if (Parent = '') or (Parent = Dir) then Break;
|
||||
Dir := Parent;
|
||||
end;
|
||||
Result := IncludeTrailingPathDelimiter(GetCurrentDir);
|
||||
Result := IncludeTrailingPathDelimiter(GetCurrentDir());
|
||||
end;
|
||||
|
||||
{ Compile, assemble with QBE, link with the RTL static library, run, and
|
||||
|
|
@ -159,7 +159,7 @@ var
|
|||
Chunk: string;
|
||||
begin
|
||||
Result := '';
|
||||
Root := ProjectRootRTTI;
|
||||
Root := ProjectRootRTTI();
|
||||
QBE := Root + 'vendor/qbe/qbe';
|
||||
RTL := Root + 'compiler/target/blaise_rtl.a';
|
||||
if not (FileExists(QBE) and FileExists(RTL)) then
|
||||
|
|
|
|||
|
|
@ -709,7 +709,7 @@ begin
|
|||
try
|
||||
RT := TRecordTypeDesc(TVarDecl(Prog.Block.Decls.Items[0]).ResolvedType);
|
||||
AssertEquals('record of four Byte fields totals 4 bytes',
|
||||
4, RT.TotalSize);
|
||||
4, RT.TotalSize());
|
||||
finally
|
||||
Prog.Free();
|
||||
end;
|
||||
|
|
@ -738,7 +738,7 @@ begin
|
|||
RT := TRecordTypeDesc(TVarDecl(Prog.Block.Decls.Items[0]).ResolvedType);
|
||||
F := RT.FindField('B');
|
||||
AssertEquals('Integer after Byte aligns to offset 4', 4, F.Offset);
|
||||
AssertEquals('record total size is 8 (1 byte + 3 pad + 4)', 8, RT.TotalSize);
|
||||
AssertEquals('record total size is 8 (1 byte + 3 pad + 4)', 8, RT.TotalSize());
|
||||
finally
|
||||
Prog.Free();
|
||||
end;
|
||||
|
|
@ -837,7 +837,7 @@ begin
|
|||
try
|
||||
RT := TRecordTypeDesc(TVarDecl(Prog.Block.Decls.Items[0]).ResolvedType);
|
||||
AssertEquals('record of three Single fields totals 12 bytes (4-byte align)',
|
||||
12, RT.TotalSize);
|
||||
12, RT.TotalSize());
|
||||
finally
|
||||
Prog.Free();
|
||||
end;
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ end;
|
|||
|
||||
procedure TSarE2ETests.SetUp;
|
||||
begin
|
||||
inherited SetUp;
|
||||
inherited SetUp();
|
||||
SetUpScratch('compiler/target/test-e2e-sar');
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ const
|
|||
program P;
|
||||
var N: Integer;
|
||||
begin
|
||||
N := ParamCount
|
||||
N := ParamCount()
|
||||
end.
|
||||
''';
|
||||
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ end;
|
|||
|
||||
procedure TSizeOfE2ETests.SetUp;
|
||||
begin
|
||||
inherited SetUp;
|
||||
inherited SetUp();
|
||||
SetUpScratch('compiler/target/test-e2e-sizeof');
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -236,7 +236,7 @@ begin
|
|||
AssertEquals('B at 2', 2, RT.FindField('B').Offset);
|
||||
AssertEquals('C at 4', 4, RT.FindField('C').Offset);
|
||||
AssertEquals('D at 6', 6, RT.FindField('D').Offset);
|
||||
AssertEquals('total 8', 8, RT.TotalSize);
|
||||
AssertEquals('total 8', 8, RT.TotalSize());
|
||||
finally
|
||||
Prog.Free();
|
||||
end;
|
||||
|
|
@ -266,7 +266,7 @@ begin
|
|||
AssertEquals('Tag at 0', 0, RT.FindField('Tag').Offset);
|
||||
AssertEquals('ID at 2 (after 1-byte pad)', 2, RT.FindField('ID').Offset);
|
||||
AssertEquals('Val at 4', 4, RT.FindField('Val').Offset);
|
||||
AssertEquals('total 8', 8, RT.TotalSize);
|
||||
AssertEquals('total 8', 8, RT.TotalSize());
|
||||
finally
|
||||
Prog.Free();
|
||||
end;
|
||||
|
|
@ -320,7 +320,7 @@ end;
|
|||
|
||||
procedure TSmallIntWordE2ETests.SetUp;
|
||||
begin
|
||||
inherited SetUp;
|
||||
inherited SetUp();
|
||||
SetUpScratch('compiler/target/test-e2e-smallint-word');
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ procedure TStrUtilsTests.SetUp;
|
|||
var
|
||||
ExeDir: string;
|
||||
begin
|
||||
inherited SetUp;
|
||||
inherited SetUp();
|
||||
ExeDir := ExtractFilePath(ParamStr(0));
|
||||
FRTLUnitPath := ExpandFileName(ExeDir + '../../runtime/src/main/pascal');
|
||||
FStdlibUnitPath := ExpandFileName(ExeDir + '../../stdlib/src/main/pascal');
|
||||
|
|
|
|||
|
|
@ -370,7 +370,7 @@ end;
|
|||
|
||||
procedure TUInt64E2ETests.SetUp;
|
||||
begin
|
||||
inherited SetUp;
|
||||
inherited SetUp();
|
||||
SetUpScratch('compiler/target/test-e2e-uint64');
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -1850,7 +1850,7 @@ begin
|
|||
U.AddConst(MakeConstEntry('Pi'));
|
||||
U.AddRoutine(MakeRoutineSig('DoIt'));
|
||||
U.AddGenericBody(MakeGenericBody('TList'));
|
||||
U.AddInlineBody(MakeInlineBody);
|
||||
U.AddInlineBody(MakeInlineBody());
|
||||
|
||||
AssertEquals('type missing', True, U.FindType('TBar') = nil);
|
||||
AssertEquals('const missing', True, U.FindConst('E') = nil);
|
||||
|
|
@ -1942,7 +1942,7 @@ var
|
|||
Sym: TSymbol;
|
||||
begin
|
||||
Iface := ParseAnalyseAndExport(SRC);
|
||||
Tab := FreshTableWithBuiltins;
|
||||
Tab := FreshTableWithBuiltins();
|
||||
try
|
||||
ImportUnitInterface(Iface, Tab);
|
||||
Sym := Tab.Lookup('Answer');
|
||||
|
|
@ -1969,7 +1969,7 @@ var
|
|||
Sym: TSymbol;
|
||||
begin
|
||||
Iface := ParseAnalyseAndExport(SRC);
|
||||
Tab := FreshTableWithBuiltins;
|
||||
Tab := FreshTableWithBuiltins();
|
||||
try
|
||||
ImportUnitInterface(Iface, Tab);
|
||||
Sym := Tab.Lookup('Greeting');
|
||||
|
|
@ -1997,7 +1997,7 @@ var
|
|||
Sym: TSymbol;
|
||||
begin
|
||||
Iface := ParseAnalyseAndExport(SRC);
|
||||
Tab := FreshTableWithBuiltins;
|
||||
Tab := FreshTableWithBuiltins();
|
||||
try
|
||||
ImportUnitInterface(Iface, Tab);
|
||||
TyDesc := Tab.FindType('TColor');
|
||||
|
|
@ -2030,7 +2030,7 @@ var
|
|||
TyDesc: TTypeDesc;
|
||||
begin
|
||||
Iface := ParseAnalyseAndExport(SRC);
|
||||
Tab := FreshTableWithBuiltins;
|
||||
Tab := FreshTableWithBuiltins();
|
||||
try
|
||||
ImportUnitInterface(Iface, Tab);
|
||||
TyDesc := Tab.FindType('TColors');
|
||||
|
|
@ -2060,7 +2060,7 @@ var
|
|||
TyDesc: TTypeDesc;
|
||||
begin
|
||||
Iface := ParseAnalyseAndExport(SRC);
|
||||
Tab := FreshTableWithBuiltins;
|
||||
Tab := FreshTableWithBuiltins();
|
||||
try
|
||||
ImportUnitInterface(Iface, Tab);
|
||||
TyDesc := Tab.FindType('TMyInt');
|
||||
|
|
@ -2087,7 +2087,7 @@ var
|
|||
Sym: TSymbol;
|
||||
begin
|
||||
Iface := ParseAnalyseAndExport(SRC);
|
||||
Tab := FreshTableWithBuiltins;
|
||||
Tab := FreshTableWithBuiltins();
|
||||
try
|
||||
ImportUnitInterface(Iface, Tab);
|
||||
Sym := Tab.Lookup('DoIt');
|
||||
|
|
@ -2117,7 +2117,7 @@ var
|
|||
Sym: TSymbol;
|
||||
begin
|
||||
Iface := ParseAnalyseAndExport(SRC);
|
||||
Tab := FreshTableWithBuiltins;
|
||||
Tab := FreshTableWithBuiltins();
|
||||
try
|
||||
ImportUnitInterface(Iface, Tab);
|
||||
Sym := Tab.Lookup('Sum');
|
||||
|
|
@ -2147,7 +2147,7 @@ var
|
|||
Fx, Fy: TFieldInfo;
|
||||
begin
|
||||
Iface := ParseAnalyseAndExport(SRC);
|
||||
Tab := FreshTableWithBuiltins;
|
||||
Tab := FreshTableWithBuiltins();
|
||||
try
|
||||
ImportUnitInterface(Iface, Tab);
|
||||
TyDesc := Tab.FindType('TPoint');
|
||||
|
|
@ -2183,7 +2183,7 @@ var
|
|||
Rec: TRecordTypeDesc;
|
||||
begin
|
||||
Iface := ParseAnalyseAndExport(SRC);
|
||||
Tab := FreshTableWithBuiltins;
|
||||
Tab := FreshTableWithBuiltins();
|
||||
try
|
||||
ImportUnitInterface(Iface, Tab);
|
||||
TyDesc := Tab.FindType('TFoo');
|
||||
|
|
@ -2214,7 +2214,7 @@ var
|
|||
Fi: TFieldInfo;
|
||||
begin
|
||||
Iface := ParseAnalyseAndExport(SRC);
|
||||
Tab := FreshTableWithBuiltins;
|
||||
Tab := FreshTableWithBuiltins();
|
||||
try
|
||||
ImportUnitInterface(Iface, Tab);
|
||||
Rec := TRecordTypeDesc(Tab.FindType('TFoo'));
|
||||
|
|
@ -2247,7 +2247,7 @@ var
|
|||
Fa, Fb: TFieldInfo;
|
||||
begin
|
||||
Iface := ParseAnalyseAndExport(SRC);
|
||||
Tab := FreshTableWithBuiltins;
|
||||
Tab := FreshTableWithBuiltins();
|
||||
try
|
||||
ImportUnitInterface(Iface, Tab);
|
||||
Derived := TRecordTypeDesc(Tab.FindType('TDerived'));
|
||||
|
|
@ -2288,7 +2288,7 @@ var
|
|||
Ent: TVTableEntry;
|
||||
begin
|
||||
Iface := ParseAnalyseAndExport(SRC);
|
||||
Tab := FreshTableWithBuiltins;
|
||||
Tab := FreshTableWithBuiltins();
|
||||
try
|
||||
ImportUnitInterface(Iface, Tab);
|
||||
RT := TRecordTypeDesc(Tab.FindType('TFoo'));
|
||||
|
|
@ -2322,7 +2322,7 @@ var
|
|||
BaseSlot, DerSlot: Integer;
|
||||
begin
|
||||
Iface := ParseAnalyseAndExport(SRC);
|
||||
Tab := FreshTableWithBuiltins;
|
||||
Tab := FreshTableWithBuiltins();
|
||||
try
|
||||
ImportUnitInterface(Iface, Tab);
|
||||
Base := TRecordTypeDesc(Tab.FindType('TBase'));
|
||||
|
|
@ -2362,7 +2362,7 @@ var
|
|||
ITD: TInterfaceTypeDesc;
|
||||
begin
|
||||
Iface := ParseAnalyseAndExport(SRC);
|
||||
Tab := FreshTableWithBuiltins;
|
||||
Tab := FreshTableWithBuiltins();
|
||||
try
|
||||
ImportUnitInterface(Iface, Tab);
|
||||
ITD := TInterfaceTypeDesc(Tab.FindType('IGreeter'));
|
||||
|
|
@ -2393,7 +2393,7 @@ var
|
|||
RT: TRecordTypeDesc;
|
||||
begin
|
||||
Iface := ParseAnalyseAndExport(SRC);
|
||||
Tab := FreshTableWithBuiltins;
|
||||
Tab := FreshTableWithBuiltins();
|
||||
try
|
||||
ImportUnitInterface(Iface, Tab);
|
||||
RT := TRecordTypeDesc(Tab.FindType('TFoo'));
|
||||
|
|
@ -2426,7 +2426,7 @@ var
|
|||
RT: TRecordTypeDesc;
|
||||
begin
|
||||
Iface := ParseAnalyseAndExport(SRC);
|
||||
Tab := FreshTableWithBuiltins;
|
||||
Tab := FreshTableWithBuiltins();
|
||||
try
|
||||
ImportUnitInterface(Iface, Tab);
|
||||
RT := TRecordTypeDesc(Tab.FindType('TFoo'));
|
||||
|
|
@ -2453,7 +2453,7 @@ var
|
|||
Templ: TObject;
|
||||
begin
|
||||
Iface := ParseAnalyseAndExport(SRC);
|
||||
Tab := FreshTableWithBuiltins;
|
||||
Tab := FreshTableWithBuiltins();
|
||||
try
|
||||
ImportUnitInterface(Iface, Tab);
|
||||
Templ := Tab.FindGeneric('TBox');
|
||||
|
|
@ -2485,7 +2485,7 @@ var
|
|||
Templ: TObject;
|
||||
begin
|
||||
Iface := ParseAnalyseAndExport(SRC);
|
||||
Tab := FreshTableWithBuiltins;
|
||||
Tab := FreshTableWithBuiltins();
|
||||
try
|
||||
ImportUnitInterface(Iface, Tab);
|
||||
Templ := Tab.FindGeneric('IBox');
|
||||
|
|
@ -2517,7 +2517,7 @@ var
|
|||
MD: TMethodDecl;
|
||||
begin
|
||||
Iface := ParseAnalyseAndExport(SRC);
|
||||
Tab := FreshTableWithBuiltins;
|
||||
Tab := FreshTableWithBuiltins();
|
||||
try
|
||||
ImportUnitInterface(Iface, Tab);
|
||||
Templ := Tab.FindGenericRoutine('Identity');
|
||||
|
|
@ -2548,7 +2548,7 @@ begin
|
|||
try
|
||||
Parser := TParser.Create(Lex);
|
||||
try
|
||||
Result := Parser.ParseProgram;
|
||||
Result := Parser.ParseProgram();
|
||||
finally
|
||||
Parser.Free();
|
||||
end;
|
||||
|
|
@ -2643,7 +2643,7 @@ var
|
|||
Sym: TSymbol;
|
||||
begin
|
||||
Iface := ParseAnalyseAndExport(SRC);
|
||||
Tab := FreshTableWithBuiltins;
|
||||
Tab := FreshTableWithBuiltins();
|
||||
try
|
||||
ImportUnitInterface(Iface, Tab);
|
||||
Sym := Tab.Lookup('Counter');
|
||||
|
|
@ -2713,7 +2713,7 @@ var
|
|||
C: TConstEntry;
|
||||
Buf: string;
|
||||
begin
|
||||
Src := BuildIfaceWithIntConst;
|
||||
Src := BuildIfaceWithIntConst();
|
||||
try
|
||||
Buf := WriteUnitInterface(Src);
|
||||
Dst := ReadUnitInterface(Buf);
|
||||
|
|
@ -3138,7 +3138,7 @@ begin
|
|||
Src.Free();
|
||||
end;
|
||||
AIface := ReadUnitInterface(Buf);
|
||||
ATab := FreshTableWithBuiltins;
|
||||
ATab := FreshTableWithBuiltins();
|
||||
ImportUnitInterface(AIface, ATab);
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -48,5 +48,5 @@ end;
|
|||
|
||||
begin
|
||||
RegisterTest(TSampleTests);
|
||||
Halt(RunAll);
|
||||
Halt(RunAll());
|
||||
end.
|
||||
|
|
|
|||
|
|
@ -138,12 +138,12 @@ begin
|
|||
Exc := g_current_exception;
|
||||
if Exc = nil then
|
||||
begin
|
||||
Exit(ExcStrEmpty);
|
||||
Exit(ExcStrEmpty());
|
||||
end;
|
||||
MsgSlot := Exc + 8;
|
||||
Msg := MsgSlot^;
|
||||
if Msg = nil then
|
||||
Result := ExcStrEmpty
|
||||
Result := ExcStrEmpty()
|
||||
else
|
||||
Result := Msg;
|
||||
end;
|
||||
|
|
|
|||
|
|
@ -211,7 +211,7 @@ begin
|
|||
Exit(Pointer(PtrUInt(Hdr) + HEADER_SIZE));
|
||||
end;
|
||||
|
||||
A := AllocArena;
|
||||
A := AllocArena();
|
||||
if A = nil then
|
||||
begin
|
||||
Exit(nil);
|
||||
|
|
|
|||
|
|
@ -671,7 +671,7 @@ end;
|
|||
|
||||
function TRtlPlatformPosix.GetProcessID: Integer;
|
||||
begin
|
||||
Result := libc_getpid;
|
||||
Result := libc_getpid();
|
||||
end;
|
||||
|
||||
function TRtlPlatformPosix.GetEnvVar(const AName: string): string;
|
||||
|
|
@ -1047,7 +1047,7 @@ begin
|
|||
ArgvSet(Argv, I + 1, ArgvGet(P^.Argv, I));
|
||||
ArgvSet(Argv, Total - 1, nil);
|
||||
|
||||
Pid := libc_fork;
|
||||
Pid := libc_fork();
|
||||
if Pid < 0 then
|
||||
begin
|
||||
_BlaiseFreeMem(Argv);
|
||||
|
|
@ -1177,7 +1177,7 @@ end;
|
|||
|
||||
function _ParamCount: Integer;
|
||||
begin
|
||||
Result := GRtlPlatform.ParamCount;
|
||||
Result := GRtlPlatform.ParamCount();
|
||||
end;
|
||||
|
||||
function _ParamStr(Index: Integer): Pointer;
|
||||
|
|
@ -1237,7 +1237,7 @@ end;
|
|||
|
||||
function _GetCurrentDir: Pointer;
|
||||
begin
|
||||
Result := Pointer(GRtlPlatform.GetCurrentDir);
|
||||
Result := Pointer(GRtlPlatform.GetCurrentDir());
|
||||
end;
|
||||
|
||||
function _SetCurrentDir(Path: Pointer): Integer;
|
||||
|
|
@ -1247,7 +1247,7 @@ end;
|
|||
|
||||
function _GetTempDir: Pointer;
|
||||
begin
|
||||
Result := Pointer(GRtlPlatform.GetTempDir);
|
||||
Result := Pointer(GRtlPlatform.GetTempDir());
|
||||
end;
|
||||
|
||||
function _GetTempFileName(Dir, Prefix: Pointer): Pointer;
|
||||
|
|
@ -1257,7 +1257,7 @@ end;
|
|||
|
||||
function _GetProcessID: Integer;
|
||||
begin
|
||||
Result := GRtlPlatform.GetProcessID;
|
||||
Result := GRtlPlatform.GetProcessID();
|
||||
end;
|
||||
|
||||
function _GetEnvVar(Name: Pointer): Pointer;
|
||||
|
|
@ -1362,12 +1362,12 @@ end;
|
|||
|
||||
function _TimeNow: Int64;
|
||||
begin
|
||||
Result := GRtlPlatform.TimeNow;
|
||||
Result := GRtlPlatform.TimeNow();
|
||||
end;
|
||||
|
||||
function _TimeLocalOffsetSecs: Integer;
|
||||
begin
|
||||
Result := GRtlPlatform.TimeLocalOffsetSecs;
|
||||
Result := GRtlPlatform.TimeLocalOffsetSecs();
|
||||
end;
|
||||
|
||||
procedure _TimeSplit(Nanos: Int64;
|
||||
|
|
@ -1393,7 +1393,7 @@ end;
|
|||
|
||||
function _ProcessCreate: Pointer;
|
||||
begin
|
||||
Result := GRtlPlatform.ProcessCreate;
|
||||
Result := GRtlPlatform.ProcessCreate();
|
||||
end;
|
||||
|
||||
procedure _ProcessSetExe(Proc: Pointer; ExeStr: Pointer);
|
||||
|
|
|
|||
|
|
@ -40,14 +40,14 @@ var
|
|||
|
||||
procedure BenchStart;
|
||||
begin
|
||||
T0 := _TimeNow;
|
||||
T0 := _TimeNow();
|
||||
end;
|
||||
|
||||
function BenchElapsedMs: Integer;
|
||||
var
|
||||
Diff: Int64;
|
||||
begin
|
||||
Diff := _TimeNow - T0;
|
||||
Diff := _TimeNow() - T0;
|
||||
Result := Integer(Diff div 1_000_000);
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -19,14 +19,14 @@ var
|
|||
|
||||
procedure BenchStart;
|
||||
begin
|
||||
T0 := _TimeNow;
|
||||
T0 := _TimeNow();
|
||||
end;
|
||||
|
||||
function BenchElapsedMs: Integer;
|
||||
var
|
||||
Diff: Int64;
|
||||
begin
|
||||
Diff := _TimeNow - T0;
|
||||
Diff := _TimeNow() - T0;
|
||||
Result := Integer(Diff div 1000000);
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -24,14 +24,14 @@ var
|
|||
|
||||
procedure BenchStart;
|
||||
begin
|
||||
T0 := _TimeNow;
|
||||
T0 := _TimeNow();
|
||||
end;
|
||||
|
||||
function BenchElapsedMs: Integer;
|
||||
var
|
||||
Diff: Int64;
|
||||
begin
|
||||
Diff := _TimeNow - T0;
|
||||
Diff := _TimeNow() - T0;
|
||||
Result := Integer(Diff div 1000000);
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -1524,7 +1524,7 @@ begin
|
|||
on E : TObject do
|
||||
begin
|
||||
CurrentResult := @CurrentRun.Results;
|
||||
SetTestResult(trHandlerError, E.ToString, True);
|
||||
SetTestResult(trHandlerError, E.ToString(), True);
|
||||
Result := SetTestError(teRunStartHandler);
|
||||
end;
|
||||
end;
|
||||
|
|
@ -1540,7 +1540,7 @@ begin
|
|||
on E : TObject do
|
||||
begin
|
||||
CurrentResult := @CurrentRun.Results;
|
||||
SetTestResult(trHandlerError, E.ToString, False);
|
||||
SetTestResult(trHandlerError, E.ToString(), False);
|
||||
Result := SetTestError(teRunCompleteHandler);
|
||||
end;
|
||||
end;
|
||||
|
|
@ -1554,11 +1554,11 @@ begin
|
|||
GlobalSuiteStartHandler(ASuite);
|
||||
except
|
||||
on E : EIgnore do
|
||||
SetTestResult(trTestIgnore, E.ToString);
|
||||
SetTestResult(trTestIgnore, E.ToString());
|
||||
on E : EFail do
|
||||
SetTestResult(trAssertFailed, E.ToString);
|
||||
SetTestResult(trAssertFailed, E.ToString());
|
||||
on E : TObject do
|
||||
SetTestResult(trHandlerError, E.ToString);
|
||||
SetTestResult(trHandlerError, E.ToString());
|
||||
end;
|
||||
end;
|
||||
|
||||
|
|
@ -1576,11 +1576,11 @@ begin
|
|||
GlobalSuiteCompleteHandler(ASuite, SuiteResult);
|
||||
except
|
||||
on E : EIgnore do
|
||||
SetTestResult(trTestIgnore, E.ToString);
|
||||
SetTestResult(trTestIgnore, E.ToString());
|
||||
on E : EFail do
|
||||
SetTestResultRec(SuiteResult^, trAssertFailed, E.ToString);
|
||||
SetTestResultRec(SuiteResult^, trAssertFailed, E.ToString());
|
||||
on E : TObject do
|
||||
SetTestResultRec(SuiteResult^, trHandlerError, E.ToString);
|
||||
SetTestResultRec(SuiteResult^, trHandlerError, E.ToString());
|
||||
end;
|
||||
CurrentResult := C;
|
||||
end;
|
||||
|
|
@ -1600,7 +1600,7 @@ begin
|
|||
S := SetupFn();
|
||||
except
|
||||
on E : TObject do
|
||||
S := E.ToString;
|
||||
S := E.ToString();
|
||||
end;
|
||||
if S <> '' then
|
||||
begin
|
||||
|
|
@ -1629,7 +1629,7 @@ begin
|
|||
S := TearDownFn();
|
||||
except
|
||||
on E : TObject do
|
||||
S := E.ToString;
|
||||
S := E.ToString();
|
||||
end;
|
||||
if S <> '' then
|
||||
begin
|
||||
|
|
@ -1677,7 +1677,7 @@ begin
|
|||
ExcRaised := True;
|
||||
ExcClass := E.ClassType;
|
||||
ExcClassName := E.ClassName;
|
||||
EM := E.ToString;
|
||||
EM := E.ToString();
|
||||
end;
|
||||
end;
|
||||
if CurrentResult^.ExpectException <> nil then
|
||||
|
|
@ -1834,7 +1834,7 @@ begin
|
|||
begin
|
||||
S := TestStagePrefix(Stage);
|
||||
if S <> '' then S := '[' + S + '] ';
|
||||
S := S + E.ToString;
|
||||
S := S + E.ToString();
|
||||
SetTestResultRec(CurrentResult^, TestStageError(Stage), S, True);
|
||||
end;
|
||||
end;
|
||||
|
|
@ -1929,7 +1929,7 @@ begin
|
|||
begin
|
||||
S := SuiteStagePrefix(Stage);
|
||||
if S <> '' then S := '[' + S + '] ';
|
||||
S := S + E.ToString;
|
||||
S := S + E.ToString();
|
||||
SetTestResultRec(SuiteResult^, SuiteStageError(Stage), S, True);
|
||||
end;
|
||||
end;
|
||||
|
|
@ -2453,7 +2453,7 @@ var
|
|||
begin
|
||||
SysRunMode := rmTest;
|
||||
I := 1;
|
||||
while I <= ParamCount do
|
||||
while I <= ParamCount() do
|
||||
begin
|
||||
S := ParamStr(I);
|
||||
if (S = '-v') or (S = '--verbose') then
|
||||
|
|
|
|||
|
|
@ -223,8 +223,8 @@ begin
|
|||
try
|
||||
AssertSame('Must fail: Instances differ', A, B);
|
||||
finally
|
||||
A.Free;
|
||||
B.Free;
|
||||
A.Free();
|
||||
B.Free();
|
||||
end;
|
||||
end;
|
||||
|
||||
|
|
@ -236,7 +236,7 @@ begin
|
|||
try
|
||||
AssertSame('Must fail: Instances differ (actual nil)', A, nil);
|
||||
finally
|
||||
A.Free;
|
||||
A.Free();
|
||||
end;
|
||||
end;
|
||||
|
||||
|
|
@ -248,7 +248,7 @@ begin
|
|||
try
|
||||
AssertSame('Must fail: Instances differ (expected nil)', nil, A);
|
||||
finally
|
||||
A.Free;
|
||||
A.Free();
|
||||
end;
|
||||
end;
|
||||
|
||||
|
|
@ -261,7 +261,7 @@ begin
|
|||
B := A;
|
||||
AssertSame('Instances equal', B, A);
|
||||
finally
|
||||
A.Free;
|
||||
A.Free();
|
||||
end;
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,11 @@ ABS_STAGE1=$(readlink -f "$STAGE1_BIN")
|
|||
echo "[1/5] rebuild + install runtime (BLAISE=$ABS_STAGE1)"
|
||||
( cd runtime && make BLAISE="$ABS_STAGE1" > /tmp/fp_rtl.log 2>&1 \
|
||||
&& make BLAISE="$ABS_STAGE1" install >> /tmp/fp_rtl.log 2>&1 ) || {
|
||||
echo "RUNTIME_FAIL"; tail -5 /tmp/fp_rtl.log; exit 11;
|
||||
if [ -f compiler/target/blaise_rtl.a ]; then
|
||||
echo " stage-1 too old for runtime; using existing blaise_rtl.a"
|
||||
else
|
||||
echo "RUNTIME_FAIL"; tail -5 /tmp/fp_rtl.log; exit 11;
|
||||
fi
|
||||
}
|
||||
|
||||
# Resolve the RTL archive for the link steps below. `make install` copies it
|
||||
|
|
|
|||
|
|
@ -228,7 +228,7 @@ var
|
|||
Slot: ^Pointer;
|
||||
begin
|
||||
if Self.FChildCnt = Self.FChildCap then
|
||||
Self.GrowChildren;
|
||||
Self.GrowChildren();
|
||||
Slot := Self.FChildren + Self.FChildCnt * SizeOf(Pointer);
|
||||
Slot^ := Pointer(AComp);
|
||||
Self.FChildCnt := Self.FChildCnt + 1;
|
||||
|
|
|
|||
|
|
@ -119,9 +119,9 @@ type
|
|||
{ C shim bindings (must be in interface section) }
|
||||
{ ------------------------------------------------------------------ }
|
||||
|
||||
function _TimeNow: Int64;
|
||||
function _TimeNow(): Int64;
|
||||
external name '_TimeNow';
|
||||
function _TimeLocalOffsetSecs: Integer;
|
||||
function _TimeLocalOffsetSecs(): Integer;
|
||||
external name '_TimeLocalOffsetSecs';
|
||||
procedure _TimeSplit(Nanos: Int64;
|
||||
out Year, Month, Day,
|
||||
|
|
@ -373,8 +373,8 @@ begin
|
|||
Sign := '-'
|
||||
else
|
||||
Sign := '+';
|
||||
H := Self.Hours;
|
||||
M := Self.Minutes;
|
||||
H := Self.Hours();
|
||||
M := Self.Minutes();
|
||||
Result := Sign + Pad2(H) + ':' + Pad2(M)
|
||||
end;
|
||||
|
||||
|
|
@ -672,20 +672,20 @@ end;
|
|||
|
||||
function InstantNow: TInstant;
|
||||
begin
|
||||
Result.Nanoseconds := _TimeNow
|
||||
Result.Nanoseconds := _TimeNow()
|
||||
end;
|
||||
|
||||
function LocalNow(Offset: TTimeZoneOffset): TDateTime;
|
||||
var
|
||||
Now: TInstant;
|
||||
begin
|
||||
Now := InstantNow;
|
||||
Now := InstantNow();
|
||||
Result := Now.ToLocalDateTime(Offset)
|
||||
end;
|
||||
|
||||
function SystemOffset: TTimeZoneOffset;
|
||||
begin
|
||||
Result.TotalSeconds := _TimeLocalOffsetSecs
|
||||
Result.TotalSeconds := _TimeLocalOffsetSecs()
|
||||
end;
|
||||
|
||||
{ ================================================================== }
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ implementation
|
|||
|
||||
constructor TProcess.Create(AOwner: TObject);
|
||||
begin
|
||||
Self.FHandle := ProcessCreate;
|
||||
Self.FHandle := ProcessCreate();
|
||||
Self.FParameters := TStringList.Create()
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -1258,7 +1258,7 @@ begin
|
|||
{ Append to tail if there is room; otherwise allocate a new segment. }
|
||||
if (Self.FTail = nil) or (Self.FTail.FLimit >= kSegmentSize) then
|
||||
begin
|
||||
Seg := AcquireSegment;
|
||||
Seg := AcquireSegment();
|
||||
if Self.FTail = nil then
|
||||
Self.FHead := Seg
|
||||
else
|
||||
|
|
@ -1388,7 +1388,7 @@ begin
|
|||
if Int64(Take) > HeadAvail then Take := Integer(HeadAvail);
|
||||
if (Dst.FTail = nil) or (Dst.FTail.FLimit >= kSegmentSize) then
|
||||
begin
|
||||
Seg := AcquireSegment;
|
||||
Seg := AcquireSegment();
|
||||
if Dst.FTail = nil then
|
||||
Dst.FHead := Seg
|
||||
else
|
||||
|
|
|
|||
|
|
@ -617,7 +617,7 @@ end;
|
|||
|
||||
constructor TStringBuilder.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
Self.FCap := 256;
|
||||
Self.FLen := 0;
|
||||
Self.FData := GetMem(Self.FCap);
|
||||
|
|
@ -626,7 +626,7 @@ end;
|
|||
destructor TStringBuilder.Destroy;
|
||||
begin
|
||||
FreeMem(Self.FData);
|
||||
inherited Destroy;
|
||||
inherited Destroy();
|
||||
end;
|
||||
|
||||
procedure TStringBuilder.Grow(ANeed: Integer);
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ function BoolToStr(B: Boolean; AUseBoolStrs: Boolean = False): string;
|
|||
{ ExpandFileName — resolve a relative path to an absolute path.
|
||||
If APath is already absolute (starts with '/') it is returned unchanged
|
||||
after normalising redundant separators and '.' components.
|
||||
Otherwise it is resolved relative to GetCurrentDir.
|
||||
Otherwise it is resolved relative to GetCurrentDir().
|
||||
Note: '..' segments are removed by simple text processing; symlinks are
|
||||
not resolved (unlike POSIX realpath). This matches Delphi/FPC behaviour
|
||||
on paths that do not traverse symlinks. }
|
||||
|
|
@ -78,14 +78,14 @@ var
|
|||
begin
|
||||
if APath = '' then
|
||||
begin
|
||||
Exit(GetCurrentDir);
|
||||
Exit(GetCurrentDir());
|
||||
end;
|
||||
|
||||
{ Determine base: absolute or relative }
|
||||
if APath[0] = 47 then { '/' }
|
||||
Base := APath
|
||||
else
|
||||
Base := GetCurrentDir + '/' + APath;
|
||||
Base := GetCurrentDir() + '/' + APath;
|
||||
|
||||
Len := Length(Base);
|
||||
SP := PChar(Base);
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ implementation
|
|||
|
||||
constructor TBoard.Create(const AFilePath: string);
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
FFilePath := AFilePath;
|
||||
FTasks := TObjectList.Create(True);
|
||||
FDeletedIds := TObjectList.Create(True);
|
||||
|
|
@ -231,7 +231,7 @@ var
|
|||
I: Integer;
|
||||
Task: TTask;
|
||||
begin
|
||||
if Self.HasExternalChanges then
|
||||
if Self.HasExternalChanges() then
|
||||
Self.MergeFromDisk();
|
||||
Lines := TStringList.Create();
|
||||
try
|
||||
|
|
@ -281,7 +281,7 @@ var
|
|||
Now: TInstant;
|
||||
UtcDT: TDateTime;
|
||||
begin
|
||||
Now := InstantNow;
|
||||
Now := InstantNow();
|
||||
UtcDT := Now.ToUtcDateTime();
|
||||
Result := TTask.Create();
|
||||
Result.FId := FNextId;
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ implementation
|
|||
|
||||
constructor TKanbanUI.Create(ATerm: TTerminal; ABoard: TBoard);
|
||||
begin
|
||||
inherited Create;
|
||||
inherited Create();
|
||||
FTerm := ATerm;
|
||||
FBoard := ABoard;
|
||||
FActiveCol := 0;
|
||||
|
|
@ -134,7 +134,7 @@ begin
|
|||
I := I + 1
|
||||
end;
|
||||
|
||||
Self.DrawStatusBar;
|
||||
Self.DrawStatusBar();
|
||||
FTerm.BufFlush()
|
||||
end;
|
||||
|
||||
|
|
@ -563,7 +563,7 @@ begin
|
|||
|
||||
if Key = KEY_ESCAPE then
|
||||
begin
|
||||
Self.CancelInput;
|
||||
Self.CancelInput();
|
||||
Exit
|
||||
end;
|
||||
|
||||
|
|
@ -575,7 +575,7 @@ begin
|
|||
FBoard.Save();
|
||||
FStatusMsg := 'Added: ' + FInputBuf
|
||||
end;
|
||||
Self.FinishInput;
|
||||
Self.FinishInput();
|
||||
Exit
|
||||
end;
|
||||
|
||||
|
|
@ -608,11 +608,11 @@ begin
|
|||
if FViewMode = vmBoard then
|
||||
Self.DrawBoard()
|
||||
else if FViewMode = vmDetail then
|
||||
Self.DrawDetailView;
|
||||
Self.DrawDetailView();
|
||||
FNeedsRedraw := False
|
||||
end;
|
||||
|
||||
Key := FTerm.ReadKey;
|
||||
Key := FTerm.ReadKey();
|
||||
|
||||
if Key = KEY_NONE then
|
||||
begin
|
||||
|
|
@ -620,7 +620,7 @@ begin
|
|||
if FPollCounter >= 20 then
|
||||
begin
|
||||
FPollCounter := 0;
|
||||
if FBoard.HasExternalChanges then
|
||||
if FBoard.HasExternalChanges() then
|
||||
begin
|
||||
Merged := FBoard.MergeFromDisk();
|
||||
if Merged > 0 then
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ begin
|
|||
CliMode := False;
|
||||
|
||||
I := 1;
|
||||
while I <= ParamCount do
|
||||
while I <= ParamCount() do
|
||||
begin
|
||||
Arg := ParamStr(I);
|
||||
|
||||
|
|
@ -72,7 +72,7 @@ begin
|
|||
else if Arg = '--add' then
|
||||
begin
|
||||
CliMode := True;
|
||||
if I + 1 <= ParamCount then
|
||||
if I + 1 <= ParamCount() then
|
||||
begin
|
||||
I := I + 1;
|
||||
AddTitle := ParamStr(I)
|
||||
|
|
@ -81,7 +81,7 @@ begin
|
|||
|
||||
else if Arg = '--detail' then
|
||||
begin
|
||||
if I + 1 <= ParamCount then
|
||||
if I + 1 <= ParamCount() then
|
||||
begin
|
||||
I := I + 1;
|
||||
DetailText := ParamStr(I)
|
||||
|
|
@ -90,7 +90,7 @@ begin
|
|||
|
||||
else if Arg = '--detail-file' then
|
||||
begin
|
||||
if I + 1 <= ParamCount then
|
||||
if I + 1 <= ParamCount() then
|
||||
begin
|
||||
I := I + 1;
|
||||
DetailFile := ParamStr(I)
|
||||
|
|
@ -99,7 +99,7 @@ begin
|
|||
|
||||
else if Arg = '--priority' then
|
||||
begin
|
||||
if I + 1 <= ParamCount then
|
||||
if I + 1 <= ParamCount() then
|
||||
begin
|
||||
I := I + 1;
|
||||
PriorityVal := ParamStr(I)
|
||||
|
|
@ -108,7 +108,7 @@ begin
|
|||
|
||||
else if Arg = '--status' then
|
||||
begin
|
||||
if I + 1 <= ParamCount then
|
||||
if I + 1 <= ParamCount() then
|
||||
begin
|
||||
I := I + 1;
|
||||
Arg := ParamStr(I);
|
||||
|
|
|
|||
Loading…
Reference in a new issue