FPC compilation issues
git-svn-id: http://code.remobjects.com/svn/pascalscript@32 5c9d2617-0215-0410-a2ee-e80e04d1c6d8
This commit is contained in:
parent
8691cd91cc
commit
006e13f9fe
File diff suppressed because it is too large
Load Diff
@ -1,17 +1,18 @@
|
|||||||
unit uPSComponent_DB;
|
unit uPSComponent_DB;
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
{$I PascalScript.inc}
|
||||||
uses
|
uses
|
||||||
SysUtils, Classes, uPSComponent, uPSRuntime, uPSCompiler;
|
SysUtils, Classes, uPSComponent, uPSRuntime, uPSCompiler;
|
||||||
type
|
type
|
||||||
|
|
||||||
TPSImport_DB = class(TPSPlugin)
|
TPSImport_DB = class(TPSPlugin)
|
||||||
protected
|
protected
|
||||||
procedure CompileImport1(CompExec: TPSScript); override;
|
procedure CompileImport1(CompExec: TPSScript); override;
|
||||||
procedure ExecImport1(CompExec: TPSScript; const ri: TPSRuntimeClassImporter); override;
|
procedure ExecImport1(CompExec: TPSScript; const ri: TPSRuntimeClassImporter); override;
|
||||||
public
|
public
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TIFPS3CE_DB = class(TPSImport_DB);
|
TIFPS3CE_DB = class(TPSImport_DB);
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
unit uPSR_dateutils;
|
unit uPSR_dateutils;
|
||||||
|
{$I PascalScript.inc}
|
||||||
interface
|
interface
|
||||||
uses
|
uses
|
||||||
SysUtils, uPSRuntime;
|
SysUtils, uPSRuntime;
|
||||||
|
@ -310,82 +310,82 @@ type
|
|||||||
|
|
||||||
tbtwidechar = widechar;
|
tbtwidechar = widechar;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
IPointer = Cardinal;
|
IPointer = Cardinal;
|
||||||
TPSCallingConvention = (cdRegister, cdPascal, cdCdecl, cdStdCall, cdSafeCall);
|
TPSCallingConvention = (cdRegister, cdPascal, cdCdecl, cdStdCall, cdSafeCall);
|
||||||
|
|
||||||
|
|
||||||
const
|
const
|
||||||
|
|
||||||
MaxListSize = Maxint div 16;
|
MaxListSize = Maxint div 16;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
PPointerList = ^TPointerList;
|
PPointerList = ^TPointerList;
|
||||||
|
|
||||||
TPointerList = array[0..MaxListSize - 1] of Pointer;
|
TPointerList = array[0..MaxListSize - 1] of Pointer;
|
||||||
|
|
||||||
|
|
||||||
TPSList = class(TObject)
|
TPSList = class(TObject)
|
||||||
protected
|
protected
|
||||||
|
|
||||||
FData: PPointerList;
|
FData: PPointerList;
|
||||||
|
|
||||||
FCapacity: Cardinal;
|
FCapacity: Cardinal;
|
||||||
|
|
||||||
FCount: Cardinal;
|
FCount: Cardinal;
|
||||||
|
|
||||||
FCheckCount: Cardinal;
|
FCheckCount: Cardinal;
|
||||||
private
|
private
|
||||||
function GetItem(Nr: Cardinal): Pointer;
|
function GetItem(Nr: Cardinal): Pointer;
|
||||||
procedure SetItem(Nr: Cardinal; P: Pointer);
|
procedure SetItem(Nr: Cardinal; P: Pointer);
|
||||||
public
|
public
|
||||||
{$IFNDEF PS_NOSMARTLIST}
|
{$IFNDEF PS_NOSMARTLIST}
|
||||||
|
|
||||||
procedure Recreate;
|
procedure Recreate;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
property Data: PPointerList read FData;
|
property Data: PPointerList read FData;
|
||||||
|
|
||||||
constructor Create;
|
constructor Create;
|
||||||
|
|
||||||
function IndexOf(P: Pointer): Longint;
|
function IndexOf(P: Pointer): Longint;
|
||||||
|
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
|
|
||||||
property Count: Cardinal read FCount;
|
property Count: Cardinal read FCount;
|
||||||
|
|
||||||
property Items[nr: Cardinal]: Pointer read GetItem write SetItem; default;
|
property Items[nr: Cardinal]: Pointer read GetItem write SetItem; default;
|
||||||
|
|
||||||
function Add(P: Pointer): Longint;
|
function Add(P: Pointer): Longint;
|
||||||
|
|
||||||
procedure AddBlock(List: PPointerList; Count: Longint);
|
procedure AddBlock(List: PPointerList; Count: Longint);
|
||||||
|
|
||||||
procedure Remove(P: Pointer);
|
procedure Remove(P: Pointer);
|
||||||
|
|
||||||
procedure Delete(Nr: Cardinal);
|
procedure Delete(Nr: Cardinal);
|
||||||
|
|
||||||
procedure DeleteLast;
|
procedure DeleteLast;
|
||||||
|
|
||||||
procedure Clear; virtual;
|
procedure Clear; virtual;
|
||||||
end;
|
end;
|
||||||
TIFList = TPSList;
|
TIFList = TPSList;
|
||||||
|
|
||||||
TPSStringList = class(TObject)
|
TPSStringList = class(TObject)
|
||||||
private
|
private
|
||||||
List: TPSList;
|
List: TPSList;
|
||||||
function GetItem(Nr: LongInt): string;
|
function GetItem(Nr: LongInt): string;
|
||||||
procedure SetItem(Nr: LongInt; const s: string);
|
procedure SetItem(Nr: LongInt; const s: string);
|
||||||
public
|
public
|
||||||
|
|
||||||
function Count: LongInt;
|
function Count: LongInt;
|
||||||
|
|
||||||
property Items[Nr: Longint]: string read GetItem write SetItem; default;
|
property Items[Nr: Longint]: string read GetItem write SetItem; default;
|
||||||
|
|
||||||
|
|
||||||
procedure Add(const P: string);
|
procedure Add(const P: string);
|
||||||
|
|
||||||
procedure Delete(NR: LongInt);
|
procedure Delete(NR: LongInt);
|
||||||
|
|
||||||
procedure Clear;
|
procedure Clear;
|
||||||
|
|
||||||
constructor Create;
|
constructor Create;
|
||||||
@ -396,7 +396,7 @@ type
|
|||||||
|
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
TPSPasToken = (
|
TPSPasToken = (
|
||||||
CSTI_EOF,
|
CSTI_EOF,
|
||||||
|
|
||||||
@ -523,27 +523,27 @@ type
|
|||||||
function GetCol: Cardinal;
|
function GetCol: Cardinal;
|
||||||
// only applicable when Token in [CSTI_Identifier, CSTI_Integer, CSTI_Real, CSTI_String, CSTI_Char, CSTI_HexInt]
|
// only applicable when Token in [CSTI_Identifier, CSTI_Integer, CSTI_Real, CSTI_String, CSTI_Char, CSTI_HexInt]
|
||||||
public
|
public
|
||||||
|
|
||||||
property EnableComments: Boolean read FEnableComments write FEnableComments;
|
property EnableComments: Boolean read FEnableComments write FEnableComments;
|
||||||
|
|
||||||
property EnableWhitespaces: Boolean read FEnableWhitespaces write FEnableWhitespaces;
|
property EnableWhitespaces: Boolean read FEnableWhitespaces write FEnableWhitespaces;
|
||||||
|
|
||||||
procedure Next; virtual;
|
procedure Next; virtual;
|
||||||
|
|
||||||
property GetToken: string read FToken;
|
property GetToken: string read FToken;
|
||||||
|
|
||||||
property OriginalToken: string read FOriginalToken;
|
property OriginalToken: string read FOriginalToken;
|
||||||
|
|
||||||
property CurrTokenPos: Cardinal read FRealPosition;
|
property CurrTokenPos: Cardinal read FRealPosition;
|
||||||
|
|
||||||
property CurrTokenID: TPSPasToken read FTokenId;
|
property CurrTokenID: TPSPasToken read FTokenId;
|
||||||
|
|
||||||
property Row: Cardinal read FRow;
|
property Row: Cardinal read FRow;
|
||||||
|
|
||||||
property Col: Cardinal read GetCol;
|
property Col: Cardinal read GetCol;
|
||||||
|
|
||||||
procedure SetText(const Data: string); virtual;
|
procedure SetText(const Data: string); virtual;
|
||||||
|
|
||||||
property OnParserError: TPSParserErrorEvent read FParserError write FParserError;
|
property OnParserError: TPSParserErrorEvent read FParserError write FParserError;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -566,7 +566,7 @@ function GRFW(var s: string): string;
|
|||||||
function GRLW(var s: string): string;
|
function GRLW(var s: string): string;
|
||||||
|
|
||||||
const
|
const
|
||||||
|
|
||||||
FCapacityInc = 32;
|
FCapacityInc = 32;
|
||||||
{$IFNDEF PS_NOSMARTLIST}
|
{$IFNDEF PS_NOSMARTLIST}
|
||||||
|
|
||||||
@ -1092,13 +1092,13 @@ var
|
|||||||
end;
|
end;
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
|
|
||||||
function GetToken(CurrTokenPos, CurrTokenLen: Cardinal): string;
|
function _GetToken(CurrTokenPos, CurrTokenLen: Cardinal): string;
|
||||||
var
|
var
|
||||||
s: string;
|
s: string;
|
||||||
begin
|
begin
|
||||||
SetLength(s, CurrTokenLen);
|
SetLength(s, CurrTokenLen);
|
||||||
Move(FText[CurrTokenPos], S[1], CurrtokenLen);
|
Move(FText[CurrTokenPos], S[1], CurrtokenLen);
|
||||||
GetToken := s;
|
Result := s;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function ParseToken(var CurrTokenPos, CurrTokenLen: Cardinal; var CurrTokenId: TPSPasToken): TPSParserErrorKind;
|
function ParseToken(var CurrTokenPos, CurrTokenLen: Cardinal; var CurrTokenId: TPSPasToken): TPSParserErrorKind;
|
||||||
@ -1124,7 +1124,7 @@ var
|
|||||||
end;
|
end;
|
||||||
CurrTokenLen := ci - ct;
|
CurrTokenLen := ci - ct;
|
||||||
|
|
||||||
FLastUpToken := GetToken(CurrTokenPos, CurrtokenLen);
|
FLastUpToken := _GetToken(CurrTokenPos, CurrtokenLen);
|
||||||
p := pchar(FLastUpToken);
|
p := pchar(FLastUpToken);
|
||||||
while p^<>#0 do
|
while p^<>#0 do
|
||||||
begin
|
begin
|
||||||
@ -1162,8 +1162,8 @@ var
|
|||||||
Inc(ci);
|
Inc(ci);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
if (FText[ci] in ['E','e']) and ((FText[ci+1] in ['0'..'9'])
|
if (FText[ci] in ['E','e']) and ((FText[ci+1] in ['0'..'9'])
|
||||||
or ((FText[ci+1] in ['+','-']) and (FText[ci+2] in ['0'..'9']))) then
|
or ((FText[ci+1] in ['+','-']) and (FText[ci+2] in ['0'..'9']))) then
|
||||||
begin
|
begin
|
||||||
hs := True;
|
hs := True;
|
||||||
Inc(ci);
|
Inc(ci);
|
||||||
@ -1221,7 +1221,7 @@ var
|
|||||||
begin
|
begin
|
||||||
while (FText[ci] in ['0'..'9']) do begin
|
while (FText[ci] in ['0'..'9']) do begin
|
||||||
Inc(ci);
|
Inc(ci);
|
||||||
end;
|
end;
|
||||||
if FText[ci] in ['A'..'Z', 'a'..'z', '_'] then
|
if FText[ci] in ['A'..'Z', 'a'..'z', '_'] then
|
||||||
begin
|
begin
|
||||||
ParseToken := iCharError;
|
ParseToken := iCharError;
|
||||||
|
Loading…
Reference in New Issue
Block a user