mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-10 05:36:10 +02:00
PascalScript: import updates from original
git-svn-id: trunk@40115 -
This commit is contained in:
parent
812eac65ea
commit
bce1d81e62
@ -9,6 +9,15 @@
|
||||
<SearchPaths>
|
||||
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<Parsing>
|
||||
<SyntaxOptions>
|
||||
<DelphiCompat Value="True"/>
|
||||
<UseAnsiStrings Value="True"/>
|
||||
</SyntaxOptions>
|
||||
</Parsing>
|
||||
<CodeGeneration>
|
||||
<Generate Value="Faster"/>
|
||||
</CodeGeneration>
|
||||
<Other>
|
||||
<Verbosity>
|
||||
<ShowHints Value="False"/>
|
||||
|
@ -7072,7 +7072,8 @@ function TPSPascalCompiler.ProcessSub(BlockInfo: TPSBlockInfo): Boolean;
|
||||
{$IFNDEF PS_NOIDISPATCH}
|
||||
procedure CheckIntf(var P: TPSValue; const VarType: TPSVariableType; VarNo: Cardinal; ImplicitPeriod: Boolean);
|
||||
var
|
||||
Procno, Idx: Cardinal;
|
||||
Procno: Cardinal;
|
||||
Idx: TPSInterfaceMethod;
|
||||
FType: TPSType;
|
||||
s: tbtString;
|
||||
|
||||
@ -12962,6 +12963,11 @@ procedure TPSPascalCompiler.DefineStandardProcedures;
|
||||
var
|
||||
p: TPSRegProc;
|
||||
begin
|
||||
{ The following needs to be in synch in these 3 functions:
|
||||
-UPSCompiler.TPSPascalCompiler.DefineStandardProcedures
|
||||
-UPSRuntime.DefProc
|
||||
-UPSRuntime.TPSExec.RegisterStandardProcs
|
||||
}
|
||||
{$IFNDEF PS_NOINT64}
|
||||
AddFunction('function IntToStr(i: Int64): String;');
|
||||
{$ELSE}
|
||||
@ -13107,6 +13113,7 @@ begin
|
||||
{$IFNDEF PS_NOINT64}
|
||||
AddFunction('function StrToInt64(s: String): int64;');
|
||||
AddFunction('function Int64ToStr(i: Int64): String;');
|
||||
AddFunction('function StrToInt64Def(s: String; def: int64): int64;');
|
||||
{$ENDIF}
|
||||
|
||||
with AddFunction('function SizeOf: Longint;').Decl.AddParam do
|
||||
|
@ -8709,8 +8709,13 @@ var
|
||||
pex: TPSExceptionHandler;
|
||||
Tmp: TObject;
|
||||
begin
|
||||
{ The following needs to be in synch in these 3 functions:
|
||||
-UPSCompiler.TPSPascalCompiler.DefineStandardProcedures
|
||||
-UPSRuntime.DefProc
|
||||
-UPSRuntime.TPSExec.RegisterStandardProcs
|
||||
}
|
||||
case Longint(p.Ext1) of
|
||||
0: Stack.SetAnsiString(-1, IntToStr(Stack.{$IFNDEF PS_NOINT64}GetInt64{$ELSE}GetInt{$ENDIF}(-2))); // inttostr
|
||||
0: Stack.SetAnsiString(-1, tbtstring(SysUtils.IntToStr(Stack.{$IFNDEF PS_NOINT64}GetInt64{$ELSE}GetInt{$ENDIF}(-2)))); // inttostr
|
||||
1: Stack.SetInt(-1, StrToInt(Stack.GetAnsiString(-2))); // strtoint
|
||||
2: Stack.SetInt(-1, StrToIntDef(Stack.GetAnsiString(-2), Stack.GetInt(-3))); // strtointdef
|
||||
3:
|
||||
@ -8934,8 +8939,9 @@ begin
|
||||
{$IFNDEF PS_NOINT64}
|
||||
39: Stack.SetInt64(-1, StrToInt64(string(Stack.GetAnsiString(-2)))); // StrToInt64
|
||||
40: Stack.SetAnsiString(-1, tbtstring(SysUtils.IntToStr(Stack.GetInt64(-2))));// Int64ToStr
|
||||
41: Stack.SetInt64(-1, StrToInt64Def(string(Stack.GetAnsiString(-2)), Stack.GetInt64(-3))); // StrToInt64Def
|
||||
{$ENDIF}
|
||||
41: // sizeof
|
||||
42: // sizeof
|
||||
begin
|
||||
temp := NewTPSVariantIFC(Stack[Stack.Count -2], False);
|
||||
if Temp.aType = nil then
|
||||
@ -8944,7 +8950,7 @@ begin
|
||||
Stack.SetInt(-1, Temp.aType.RealSize)
|
||||
end;
|
||||
{$IFNDEF PS_NOWIDESTRING}
|
||||
42: // WStrGet
|
||||
43: // WStrGet
|
||||
begin
|
||||
temp := NewTPSVariantIFC(Stack[Stack.Count -2], True);
|
||||
if temp.dta = nil then begin
|
||||
@ -8982,7 +8988,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
43: // WStrSet
|
||||
44: // WStrSet
|
||||
begin
|
||||
temp := NewTPSVariantIFC(Stack[Stack.Count -3], True);
|
||||
if (temp.Dta = nil) then
|
||||
@ -9170,6 +9176,9 @@ begin
|
||||
btS16 : Stack.SetInt(-1,Low(SmallInt)); //SmallInt: -32768
|
||||
btU32 : Stack.SetInt(-1,Low(Cardinal)); //Cardinal/LongWord: 0
|
||||
btS32 : Stack.SetInt(-1,Low(Integer)); //Integer/LongInt: -2147483648
|
||||
{$IFNDEF PS_NOINT64}
|
||||
btS64 : Stack.SetInt64(-1,Low(Int64)); //Int64: -9223372036854775808
|
||||
{$ENDIF}
|
||||
else Result:=false;
|
||||
end;
|
||||
end;
|
||||
@ -9190,6 +9199,9 @@ begin
|
||||
btS16 : Stack.SetInt(-1,High(SmallInt)); //SmallInt: 32767
|
||||
btU32 : Stack.SetUInt(-1,High(Cardinal)); //Cardinal/LongWord: 4294967295
|
||||
btS32 : Stack.SetInt(-1,High(Integer)); //Integer/LongInt: 2147483647
|
||||
{$IFNDEF PS_NOINT64}
|
||||
btS64 : Stack.SetInt64(-1,High(Int64)); //Int64: 9223372036854775807
|
||||
{$ENDIF}
|
||||
else Result:=false;
|
||||
end;
|
||||
end;
|
||||
@ -9207,6 +9219,9 @@ begin
|
||||
btS16 : Stack.SetInt(-1,Tbts16(arr.dta^)-1); //SmallInt
|
||||
btU32 : Stack.SetInt(-1,Tbtu32(arr.dta^)-1); //Cardinal/LongWord
|
||||
btS32 : Stack.SetInt(-1,Tbts32(arr.dta^)-1); //Integer/LongInt
|
||||
{$IFNDEF PS_NOINT64}
|
||||
btS64 : Stack.SetInt64(-1,Tbts64(arr.dta^)-1);
|
||||
{$ENDIF}
|
||||
else Result:=false;
|
||||
end;
|
||||
end;
|
||||
@ -9224,6 +9239,9 @@ begin
|
||||
btS16 : Stack.SetInt(-1,Tbts16(arr.dta^)+1); //SmallInt
|
||||
btU32 : Stack.SetInt(-1,Tbtu32(arr.dta^)+1); //Cardinal/LongWord
|
||||
btS32 : Stack.SetInt(-1,Tbts32(arr.dta^)+1); //Integer/LongInt
|
||||
{$IFNDEF PS_NOINT64}
|
||||
btS64 : Stack.SetInt64(-1,Tbts64(arr.dta^)+1);
|
||||
{$ENDIF}
|
||||
else Result:=false;
|
||||
end;
|
||||
end;
|
||||
@ -9241,6 +9259,11 @@ end;
|
||||
|
||||
procedure TPSExec.RegisterStandardProcs;
|
||||
begin
|
||||
{ The following needs to be in synch in these 3 functions:
|
||||
-UPSCompiler.TPSPascalCompiler.DefineStandardProcedures
|
||||
-UPSRuntime.DefProc
|
||||
-UPSRuntime.TPSExec.RegisterStandardProcs
|
||||
}
|
||||
RegisterFunctionName('!NOTIFICATIONVARIANTSET', NVarProc, Pointer(0), nil);
|
||||
RegisterFunctionName('!NOTIFICATIONVARIANTGET', NVarProc, Pointer(1), nil);
|
||||
|
||||
@ -9308,12 +9331,13 @@ begin
|
||||
{$IFNDEF PS_NOINT64}
|
||||
RegisterFunctionName('STRTOINT64', DefProc, Pointer(39), nil);
|
||||
RegisterFunctionName('INT64TOSTR', DefProc, Pointer(40), nil);
|
||||
RegisterFunctionName('STRTOINT64DEF', DefProc, Pointer(41), nil);
|
||||
{$ENDIF}
|
||||
RegisterFunctionName('SIZEOF', DefProc, Pointer(41), nil);
|
||||
RegisterFunctionName('SIZEOF', DefProc, Pointer(42), nil);
|
||||
|
||||
{$IFNDEF PS_NOWIDESTRING}
|
||||
RegisterFunctionName('WSTRGET', DefProc, Pointer(42), nil);
|
||||
RegisterFunctionName('WSTRSET', DefProc, Pointer(43), nil);
|
||||
RegisterFunctionName('WSTRGET', DefProc, Pointer(43), nil);
|
||||
RegisterFunctionName('WSTRSET', DefProc, Pointer(44), nil);
|
||||
|
||||
{$ENDIF}
|
||||
{$IFNDEF DELPHI6UP}
|
||||
|
Loading…
Reference in New Issue
Block a user