Jesus Reyes A. for freepascal support.

git-svn-id: http://code.remobjects.com/svn/pascalscript@19 5c9d2617-0215-0410-a2ee-e80e04d1c6d8
This commit is contained in:
carlokok 2006-10-31 07:47:33 +00:00
parent a104f73336
commit 19a4ca3bdf
8 changed files with 243 additions and 226 deletions

View File

@ -7,11 +7,11 @@
{ (c)opyright RemObjects Software. all rights reserved. }
{ }
{----------------------------------------------------------------------------}
{$INCLUDE eDefines.inc}
{$IFDEF FPC}{$H+}{$MODE DELPHI}{$ENDIF}
{$IFDEF FPC}{$MODE DELPHI}{$ENDIF}
{$IFDEF VER125}{C4}{$B-}{$X+}{$T-}{$H+}{$ENDIF}
{$IFDEF VER110}{C3}{$B-}{$X+}{$T-}{$H+}{$ENDIF}
@ -64,4 +64,3 @@ Defines:
{$DEFINE DELPHI3UP}
{$DEFINE DELPHI6UP}
{$ENDIF}
{$DEFINE PS_USESSUPPORT}

View File

@ -1,36 +1,34 @@
<?xml version="1.0"?>
<CONFIG>
<Package Version="2">
<PathDelim Value="\"/>
<Name Value="PascalScript"/>
<Author Value="Carlo Kok"/>
<CompilerOptions>
<Version Value="5"/>
<PathDelim Value="\"/>
<SearchPaths>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(Target_OS)\"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<DelphiCompat Value="True"/>
<UseAnsiStrings Value="True"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<Generate Value="Faster"/>
</CodeGeneration>
<Other>
<Verbosity>
<ShowHints Value="False"/>
</Verbosity>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions>
<?xml version="1.0"?>
<CONFIG>
<Package Version="2">
<Name Value="PascalScript"/>
<Author Value="Carlo Kok"/>
<CompilerOptions>
<Version Value="5"/>
<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"/>
</Verbosity>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions>
<Description Value="RemObjects Pascal Script
Created by Carlo Kok
RemObjects Software
Fixed for Lazarus by Bogus³aw Brandys
"/>
"/>
<License Value="*********************************************************************
RemObjects Pascal Script
Created By Carlo Kok ck@carlo-kok.com
@ -59,188 +57,188 @@ If you have any questions concerning this license write me (Carlo Kok):
Carlo Kok
RemObjects Software
"/>
<Version Build="1"/>
<Files Count="41">
<Item1>
<Filename Value="uPSRuntime.pas"/>
<UnitName Value="uPSRuntime"/>
</Item1>
<Item2>
<Filename Value="eDefines.inc"/>
<Type Value="Include"/>
</Item2>
<Item3>
<Filename Value="PascalScript.inc"/>
<Type Value="Include"/>
</Item3>
<Item4>
<Filename Value="license.txt"/>
<Type Value="Text"/>
</Item4>
<Item5>
<Filename Value="PascalScript_Core_Reg.pas"/>
<HasRegisterProc Value="True"/>
<UnitName Value="PascalScript_Core_Reg"/>
</Item5>
<Item6>
<Filename Value="uPSC_buttons.pas"/>
<UnitName Value="uPSC_buttons"/>
</Item6>
<Item7>
<Filename Value="uPSC_classes.pas"/>
<UnitName Value="uPSC_classes"/>
</Item7>
<Item8>
<Filename Value="uPSC_controls.pas"/>
<UnitName Value="uPSC_controls"/>
</Item8>
<Item9>
<Filename Value="uPSC_dateutils.pas"/>
<UnitName Value="uPSC_dateutils"/>
</Item9>
<Item10>
<Filename Value="uPSC_DB.pas"/>
<UnitName Value="uPSC_DB"/>
</Item10>
<Item11>
<Filename Value="uPSC_dll.pas"/>
<UnitName Value="uPSC_dll"/>
</Item11>
<Item12>
<Filename Value="uPSC_extctrls.pas"/>
<UnitName Value="uPSC_extctrls"/>
</Item12>
<Item13>
<Filename Value="uPSC_forms.pas"/>
<UnitName Value="uPSC_forms"/>
</Item13>
<Item14>
<Filename Value="uPSC_graphics.pas"/>
<UnitName Value="uPSC_graphics"/>
</Item14>
<Item15>
<Filename Value="uPSC_menus.pas"/>
<UnitName Value="uPSC_menus"/>
</Item15>
<Item16>
<Filename Value="uPSC_std.pas"/>
<UnitName Value="uPSC_std"/>
</Item16>
<Item17>
<Filename Value="uPSC_stdctrls.pas"/>
<UnitName Value="uPSC_stdctrls"/>
</Item17>
<Item18>
<Filename Value="uPSCompiler.pas"/>
<UnitName Value="uPSCompiler"/>
</Item18>
<Item19>
<Filename Value="uPSComponent.pas"/>
<UnitName Value="uPSComponent"/>
</Item19>
<Item20>
<Filename Value="uPSComponent_Controls.pas"/>
<UnitName Value="uPSComponent_Controls"/>
</Item20>
<Item21>
<Filename Value="uPSComponent_DB.pas"/>
<UnitName Value="uPSComponent_DB"/>
</Item21>
<Item22>
<Filename Value="uPSComponent_Default.pas"/>
<UnitName Value="uPSComponent_Default"/>
</Item22>
<Item23>
<Filename Value="uPSComponent_Forms.pas"/>
<UnitName Value="uPSComponent_Forms"/>
</Item23>
<Item24>
<Filename Value="uPSComponent_StdCtrls.pas"/>
<UnitName Value="uPSComponent_StdCtrls"/>
</Item24>
<Item25>
<Filename Value="uPSComponentExt.pas"/>
<UnitName Value="uPSComponentExt"/>
</Item25>
<Item26>
<Filename Value="uPSDebugger.pas"/>
<UnitName Value="uPSDebugger"/>
</Item26>
<Item27>
<Filename Value="uPSDisassembly.pas"/>
<UnitName Value="uPSDisassembly"/>
</Item27>
<Item28>
<Filename Value="uPSPreProcessor.pas"/>
<UnitName Value="uPSPreProcessor"/>
</Item28>
<Item29>
<Filename Value="uPSR_buttons.pas"/>
<UnitName Value="uPSR_buttons"/>
</Item29>
<Item30>
<Filename Value="uPSR_classes.pas"/>
<UnitName Value="uPSR_classes"/>
</Item30>
<Item31>
<Filename Value="uPSR_controls.pas"/>
<UnitName Value="uPSR_controls"/>
</Item31>
<Item32>
<Filename Value="uPSR_dateutils.pas"/>
<UnitName Value="uPSR_dateutils"/>
</Item32>
<Item33>
<Filename Value="uPSR_DB.pas"/>
<UnitName Value="uPSR_DB"/>
</Item33>
<Item34>
<Filename Value="uPSR_dll.pas"/>
<UnitName Value="uPSR_dll"/>
</Item34>
<Item35>
<Filename Value="uPSR_extctrls.pas"/>
<UnitName Value="uPSR_extctrls"/>
</Item35>
<Item36>
<Filename Value="uPSR_forms.pas"/>
<UnitName Value="UPSR_forms"/>
</Item36>
<Item37>
<Filename Value="uPSR_graphics.pas"/>
<UnitName Value="UPSR_graphics"/>
</Item37>
<Item38>
<Filename Value="uPSR_menus.pas"/>
<UnitName Value="uPSR_menus"/>
</Item38>
<Item39>
<Filename Value="uPSR_std.pas"/>
<UnitName Value="uPSR_std"/>
</Item39>
<Item40>
<Filename Value="uPSR_stdctrls.pas"/>
<UnitName Value="uPSR_stdctrls"/>
</Item40>
<Item41>
<Filename Value="uPSUtils.pas"/>
<UnitName Value="uPSUtils"/>
</Item41>
</Files>
<Type Value="RunAndDesignTime"/>
<RequiredPkgs Count="1">
<Item1>
<PackageName Value="LCL"/>
<MinVersion Major="1" Valid="True"/>
</Item1>
</RequiredPkgs>
<UsageOptions>
<UnitPath Value="$(PkgOutDir)\"/>
</UsageOptions>
<PublishOptions>
<Version Value="2"/>
<IgnoreBinaries Value="False"/>
</PublishOptions>
</Package>
</CONFIG>
"/>
<Version Build="1"/>
<Files Count="41">
<Item1>
<Filename Value="uPSRuntime.pas"/>
<UnitName Value="uPSRuntime"/>
</Item1>
<Item2>
<Filename Value="eDefines.inc"/>
<Type Value="Include"/>
</Item2>
<Item3>
<Filename Value="PascalScript.inc"/>
<Type Value="Include"/>
</Item3>
<Item4>
<Filename Value="license.txt"/>
<Type Value="Text"/>
</Item4>
<Item5>
<Filename Value="PascalScript_Core_Reg.pas"/>
<HasRegisterProc Value="True"/>
<UnitName Value="PascalScript_Core_Reg"/>
</Item5>
<Item6>
<Filename Value="uPSC_buttons.pas"/>
<UnitName Value="uPSC_buttons"/>
</Item6>
<Item7>
<Filename Value="uPSC_classes.pas"/>
<UnitName Value="uPSC_classes"/>
</Item7>
<Item8>
<Filename Value="uPSC_controls.pas"/>
<UnitName Value="uPSC_controls"/>
</Item8>
<Item9>
<Filename Value="uPSC_dateutils.pas"/>
<UnitName Value="uPSC_dateutils"/>
</Item9>
<Item10>
<Filename Value="uPSC_DB.pas"/>
<UnitName Value="uPSC_DB"/>
</Item10>
<Item11>
<Filename Value="uPSC_dll.pas"/>
<UnitName Value="uPSC_dll"/>
</Item11>
<Item12>
<Filename Value="uPSC_extctrls.pas"/>
<UnitName Value="uPSC_extctrls"/>
</Item12>
<Item13>
<Filename Value="uPSC_forms.pas"/>
<UnitName Value="uPSC_forms"/>
</Item13>
<Item14>
<Filename Value="uPSC_graphics.pas"/>
<UnitName Value="uPSC_graphics"/>
</Item14>
<Item15>
<Filename Value="uPSC_menus.pas"/>
<UnitName Value="uPSC_menus"/>
</Item15>
<Item16>
<Filename Value="uPSC_std.pas"/>
<UnitName Value="uPSC_std"/>
</Item16>
<Item17>
<Filename Value="uPSC_stdctrls.pas"/>
<UnitName Value="uPSC_stdctrls"/>
</Item17>
<Item18>
<Filename Value="uPSCompiler.pas"/>
<UnitName Value="uPSCompiler"/>
</Item18>
<Item19>
<Filename Value="uPSComponent.pas"/>
<UnitName Value="uPSComponent"/>
</Item19>
<Item20>
<Filename Value="uPSComponent_Controls.pas"/>
<UnitName Value="uPSComponent_Controls"/>
</Item20>
<Item21>
<Filename Value="uPSComponent_DB.pas"/>
<UnitName Value="uPSComponent_DB"/>
</Item21>
<Item22>
<Filename Value="uPSComponent_Default.pas"/>
<UnitName Value="uPSComponent_Default"/>
</Item22>
<Item23>
<Filename Value="uPSComponent_Forms.pas"/>
<UnitName Value="uPSComponent_Forms"/>
</Item23>
<Item24>
<Filename Value="uPSComponent_StdCtrls.pas"/>
<UnitName Value="uPSComponent_StdCtrls"/>
</Item24>
<Item25>
<Filename Value="uPSComponentExt.pas"/>
<UnitName Value="uPSComponentExt"/>
</Item25>
<Item26>
<Filename Value="uPSDebugger.pas"/>
<UnitName Value="uPSDebugger"/>
</Item26>
<Item27>
<Filename Value="uPSDisassembly.pas"/>
<UnitName Value="uPSDisassembly"/>
</Item27>
<Item28>
<Filename Value="uPSPreProcessor.pas"/>
<UnitName Value="uPSPreProcessor"/>
</Item28>
<Item29>
<Filename Value="uPSR_buttons.pas"/>
<UnitName Value="uPSR_buttons"/>
</Item29>
<Item30>
<Filename Value="uPSR_classes.pas"/>
<UnitName Value="uPSR_classes"/>
</Item30>
<Item31>
<Filename Value="uPSR_controls.pas"/>
<UnitName Value="uPSR_controls"/>
</Item31>
<Item32>
<Filename Value="uPSR_dateutils.pas"/>
<UnitName Value="uPSR_dateutils"/>
</Item32>
<Item33>
<Filename Value="uPSR_DB.pas"/>
<UnitName Value="uPSR_DB"/>
</Item33>
<Item34>
<Filename Value="uPSR_dll.pas"/>
<UnitName Value="uPSR_dll"/>
</Item34>
<Item35>
<Filename Value="uPSR_extctrls.pas"/>
<UnitName Value="uPSR_extctrls"/>
</Item35>
<Item36>
<Filename Value="uPSR_forms.pas"/>
<UnitName Value="UPSR_forms"/>
</Item36>
<Item37>
<Filename Value="uPSR_graphics.pas"/>
<UnitName Value="UPSR_graphics"/>
</Item37>
<Item38>
<Filename Value="uPSR_menus.pas"/>
<UnitName Value="uPSR_menus"/>
</Item38>
<Item39>
<Filename Value="uPSR_std.pas"/>
<UnitName Value="uPSR_std"/>
</Item39>
<Item40>
<Filename Value="uPSR_stdctrls.pas"/>
<UnitName Value="uPSR_stdctrls"/>
</Item40>
<Item41>
<Filename Value="uPSUtils.pas"/>
<UnitName Value="uPSUtils"/>
</Item41>
</Files>
<Type Value="RunAndDesignTime"/>
<RequiredPkgs Count="1">
<Item1>
<PackageName Value="LCL"/>
<MinVersion Major="1" Valid="True"/>
</Item1>
</RequiredPkgs>
<UsageOptions>
<UnitPath Value="$(PkgOutDir)\"/>
</UsageOptions>
<PublishOptions>
<Version Value="2"/>
<IgnoreBinaries Value="False"/>
</PublishOptions>
</Package>
</CONFIG>

View File

@ -13,8 +13,8 @@ uses
uPSComponent, uPSComponent_Controls, uPSComponent_DB, uPSComponent_Default,
uPSComponent_Forms, uPSComponent_StdCtrls, uPSComponentExt, uPSDebugger,
uPSDisassembly, uPSPreProcessor, uPSR_buttons, uPSR_classes, uPSR_controls,
uPSR_dateutils, uPSR_DB, uPSR_dll, uPSR_extctrls, UPSR_forms,
UPSR_graphics, uPSR_menus, uPSR_std, uPSR_stdctrls, uPSUtils,
uPSR_dateutils, uPSR_DB, uPSR_dll, uPSR_extctrls, uPSR_forms,
uPSR_graphics, uPSR_menus, uPSR_std, uPSR_stdctrls, uPSUtils,
LazarusPackageIntf;
implementation

View File

@ -4353,7 +4353,16 @@ begin
{$ENDIF}
if @FOnTranslateLineInfo <> nil then
FOnTranslateLineInfo(Self, Pos, Row, Col, S);
{$IFDEF FPC}
WriteDebugData(#4 + s + #1);
WriteDebugData(Ps_mi2s(ProcNo));
WriteDebugData(Ps_mi2s(Length(Proc.Data)));
WriteDebugData(Ps_mi2s(Pos));
WriteDebugData(Ps_mi2s(Row));
WriteDebugData(Ps_mi2s(Col));
{$ELSE}
WriteDebugData(#4 + s + #1 + PS_mi2s(ProcNo) + PS_mi2s(Length(Proc.Data)) + PS_mi2s(Pos) + PS_mi2s(Row)+ PS_mi2s(Col));
{$ENDIF}
end;
procedure TPSPascalCompiler.Debug_WriteParams(ProcNo: Cardinal; Proc: TPSInternalProcedure);

View File

@ -258,7 +258,7 @@ type
function ExecuteFunction(const Params: array of Variant; const ProcName: string): Variant;
published
property About: string read GetAbout;
property About: string read GetAbout stored false;
property Script: TStrings read FScript write SetScript;

View File

@ -268,8 +268,12 @@ var
case b of
CM_A:
begin
{$IFDEF FPC}
Output := Output + ' ['+inttostr(dp)+'] ASSIGN '+ ReadWriteVariable;
Output := Output + ', ' + ReadWriteVariable + #13#10;
{$ELSE}
Writeln(' ['+inttostr(dp)+'] ASSIGN '+ReadWriteVariable+ ', ' + ReadWriteVariable);
{$ENDIF}
end;
CM_CA:
begin

View File

@ -211,10 +211,14 @@ begin
RegisterMethod(@TAPPLICATION.CONTROLDESTROYED, 'CONTROLDESTROYED');
RegisterMethod(@TAPPLICATION.CANCELHINT, 'CANCELHINT');
{$IFNDEF CLX}
{$IFNDEF FPC}
RegisterMethod(@TAPPLICATION.HELPCOMMAND, 'HELPCOMMAND');
{$ENDIF}
RegisterMethod(@TAPPLICATION.HELPCONTEXT, 'HELPCONTEXT');
{$IFNDEF FPC}
RegisterMethod(@TAPPLICATION.HELPJUMP, 'HELPJUMP');
{$ENDIF}
{$ENDIF}
// RegisterMethod(@TAPPLICATION.HANDLEEXCEPTION, 'HANDLEEXCEPTION');
// RegisterMethod(@TAPPLICATION.HOOKMAINWINDOW, 'HOOKMAINWINDOW');
// RegisterMethod(@TAPPLICATION.UNHOOKMAINWINDOW, 'UNHOOKMAINWINDOW');

View File

@ -9244,12 +9244,7 @@ begin
btchar,btU8, btS8: tbtu8(res.dta^) := RealCall_Register(Address, EAX, EDX, ECX, @Stack[Length(Stack)-3], Length(Stack) div 4, 1, nil);
{$IFNDEF PS_NOWIDESTRING}btWideChar, {$ENDIF}btu16, bts16: tbtu16(res.dta^) := RealCall_Register(Address, EAX, EDX, ECX, @Stack[Length(Stack)-3], Length(Stack) div 4, 2, nil);
btClass :
{$IFNDEF FPC}
tbtu32(res.dta^) := RealCall_Register(Address, EAX, EDX, ECX, @Stack[Length(Stack)-3], Length(Stack) div 4, 4, nil);
{$ELSE}
//EAX switched with EDX
tbtu32(res.dta^) := RealCall_Register(Address, EDX, EAX, ECX, @Stack[Length(Stack)-3], Length(Stack) div 4, 4, nil);
{$ENDIF}
btu32,bts32: tbtu32(res.dta^) := RealCall_Register(Address, EAX, EDX, ECX, @Stack[Length(Stack)-3], Length(Stack) div 4, 4, nil);
btPChar: pchar(res.dta^) := Pchar(RealCall_Register(Address, EAX, EDX, ECX, @Stack[Length(Stack)-3], Length(Stack) div 4, 4, nil));
{$IFNDEF PS_NOINT64}bts64:
@ -9826,7 +9821,15 @@ begin
Result := False;
exit;
end;
{$IFDEF FPC}
// under FPC a constructor it's called with self=0 (EAX) and
// the VMT class pointer in EDX so they are effectively swaped
// using register calling convention
PPSVariantU32(IntVal).Data := Cardinal(FSelf);
FSelf := pointer(1);
{$ELSE}
PPSVariantU32(IntVal).Data := 1;
{$ENDIF}
MyList := TPSList.Create;
MyList.Add(NewPPSVariantIFC(intval, false));
for i := 2 to length(s) do