mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-10 08:28:14 +02:00
MG: Delphi6 syntax and defines
git-svn-id: trunk@1638 -
This commit is contained in:
parent
3352e04aa7
commit
13a8d7484d
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Don't edit, this file is generated by FPCMake Version 1.1 [2002/03/28]
|
||||
# Don't edit, this file is generated by FPCMake Version 1.1 [2002/04/22]
|
||||
#
|
||||
default: all
|
||||
MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx netware
|
||||
@ -199,6 +199,7 @@ override PACKAGE_NAME=codetools
|
||||
override PACKAGE_VERSION=0.8a
|
||||
override TARGET_UNITS+=allcodetoolunits
|
||||
override TARGET_IMPLICITUNITS+=codetoolsstrconsts avl_tree basiccodetools codecache sourcelog customcodetool pascalparsertool finddeclarationtool stdcodetools methodjumptool eventcodetool codecompletiontool codeatom codetree definetemplates expreval keywordfunclists linkscanner sourcechanger fileprocs
|
||||
override CLEAN_FILES+=$(wildcard *$(OEXT)) $(wildcard *$(PPUEXT)) $(wildcard *$(RSTEXT))
|
||||
override COMPILER_OPTIONS+=-gl
|
||||
override COMPILER_UNITDIR+=.
|
||||
override COMPILER_UNITTARGETDIR+=../units
|
||||
@ -515,6 +516,18 @@ EXEEXT=
|
||||
FPCMADE=fpcmade.qnx
|
||||
ZIPSUFFIX=qnx
|
||||
endif
|
||||
ifeq ($(OS_TARGET),netware)
|
||||
STATICLIBPREFIX=
|
||||
PPUEXT=.ppn
|
||||
OEXT=.on
|
||||
ASMEXT=.s
|
||||
SMARTEXT=.sl
|
||||
STATICLIBEXT=.a
|
||||
SHAREDLIBEXT=.nlm
|
||||
FPCMADE=fpcmade.nw
|
||||
ZIPSUFFIX=nw
|
||||
EXEEXT=.nlm
|
||||
endif
|
||||
ifndef ECHO
|
||||
ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
|
||||
ifeq ($(ECHO),)
|
||||
|
@ -20,6 +20,9 @@ implicitunits=codetoolsstrconsts avl_tree basiccodetools codecache sourcelog \
|
||||
definetemplates expreval keywordfunclists linkscanner sourcechanger \
|
||||
fileprocs
|
||||
|
||||
[clean]
|
||||
files=$(wildcard *$(OEXT)) $(wildcard *$(PPUEXT)) $(wildcard *$(RSTEXT))
|
||||
|
||||
[require]
|
||||
packages=fcl
|
||||
|
||||
|
@ -123,7 +123,7 @@ type
|
||||
function CreateFile(const AFilename: string): TCodeBuffer;
|
||||
function SaveBufferAs(OldBuffer: TCodeBuffer;const ExpandedFilename: string;
|
||||
var NewBuffer: TCodeBuffer): boolean;
|
||||
function FilenameHasSourceExt(const ExpandedFilename: string): boolean;
|
||||
function FilenameHasSourceExt(const AFilename: string): boolean;
|
||||
|
||||
// exception handling
|
||||
property CatchExceptions: boolean
|
||||
@ -414,18 +414,18 @@ begin
|
||||
end;
|
||||
|
||||
function TCodeToolManager.FilenameHasSourceExt(
|
||||
const ExpandedFilename: string): boolean;
|
||||
const AFilename: string): boolean;
|
||||
var i, CurExtStart, CurExtEnd, ExtStart, ExtLen: integer;
|
||||
begin
|
||||
ExtStart:=length(ExpandedFilename);
|
||||
while (ExtStart>0) and (ExpandedFilename[ExtStart]<>'.')
|
||||
and (ExpandedFilename[ExtStart]<>PathDelim) do
|
||||
ExtStart:=length(AFilename);
|
||||
while (ExtStart>0) and (AFilename[ExtStart]<>'.')
|
||||
and (AFilename[ExtStart]<>PathDelim) do
|
||||
dec(ExtStart);
|
||||
if (ExtStart<1) or (ExpandedFilename[ExtStart]<>'.') then begin
|
||||
if (ExtStart<1) or (AFilename[ExtStart]<>'.') then begin
|
||||
Result:=false;
|
||||
exit;
|
||||
end;
|
||||
ExtLen:=length(ExpandedFilename)-ExtStart+1;
|
||||
ExtLen:=length(AFilename)-ExtStart+1;
|
||||
CurExtStart:=1;
|
||||
CurExtEnd:=CurExtStart;
|
||||
while CurExtEnd<=length(FSourceExtensions)+1 do begin
|
||||
@ -435,7 +435,7 @@ begin
|
||||
if ExtLen=CurExtEnd-CurExtStart then begin
|
||||
i:=0;
|
||||
while (i<ExtLen)
|
||||
and (UpChars[ExpandedFilename[i+ExtStart]]
|
||||
and (UpChars[AFilename[i+ExtStart]]
|
||||
=UpChars[FSourceExtensions[CurExtStart+i]]) do
|
||||
inc(i);
|
||||
if i=ExtLen then begin
|
||||
@ -505,9 +505,9 @@ begin
|
||||
end;
|
||||
FCurCodeTool:=TCodeTool(GetCodeToolForSource(MainCode,true));
|
||||
FCurCodeTool.ErrorPosition.Code:=nil;
|
||||
{$IFDEF CTDEBUG}
|
||||
writeln('[TCodeToolManager.InitCurCodeTool] ',Code.Filename,' ',Code.SourceLength);
|
||||
{$ENDIF}
|
||||
{$IFDEF CTDEBUG}
|
||||
writeln('[TCodeToolManager.InitCurCodeTool] ',Code.Filename,' ',Code.SourceLength);
|
||||
{$ENDIF}
|
||||
Result:=(FCurCodeTool.Scanner<>nil);
|
||||
if not Result then begin
|
||||
fErrorCode:=MainCode;
|
||||
|
@ -276,11 +276,15 @@ type
|
||||
const LazarusSrcDir, WidgetType: string): TDefineTemplate;
|
||||
function CreateLCLProjectTemplate(const LazarusSrcDir, WidgetType,
|
||||
ProjectDir: string): TDefineTemplate;
|
||||
function CreateDelphi5CompilerDefinesTemplate: TDefineTemplate;
|
||||
function CreateDelphi5DirectoryTemplate(
|
||||
const DelphiDirectory: string): TDefineTemplate;
|
||||
function CreateDelphi5ProjectTemplate(
|
||||
const ProjectDir, DelphiDirectory: string): TDefineTemplate;
|
||||
function CreateDelphiSrcPath(DelphiVersion: integer;
|
||||
const PathPrefix: string): string;
|
||||
function CreateDelphiCompilerDefinesTemplate(
|
||||
DelphiVersion: integer): TDefineTemplate;
|
||||
function CreateDelphiDirectoryTemplate(const DelphiDirectory: string;
|
||||
DelphiVersion: integer): TDefineTemplate;
|
||||
function CreateDelphiProjectTemplate(
|
||||
const ProjectDir, DelphiDirectory: string;
|
||||
DelphiVersion: integer): TDefineTemplate;
|
||||
procedure Clear;
|
||||
constructor Create;
|
||||
destructor Destroy; override;
|
||||
@ -1252,7 +1256,7 @@ end;
|
||||
|
||||
procedure TDefineTree.ClearCache;
|
||||
begin
|
||||
if (FCache.Count=0) or (FVirtualDirCache=nil) then exit;
|
||||
if (FCache.Count=0) and (FVirtualDirCache=nil) then exit;
|
||||
FCache.FreeAndClear;
|
||||
FVirtualDirCache.Free;
|
||||
FVirtualDirCache:=nil;
|
||||
@ -2375,6 +2379,24 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function TDefinePool.CreateDelphiSrcPath(DelphiVersion: integer;
|
||||
const PathPrefix: string): string;
|
||||
begin
|
||||
case DelphiVersion of
|
||||
6:
|
||||
Result:=PathPrefix+'Source/Rtl/Win;'
|
||||
+PathPrefix+'Source/Rtl/Sys;'
|
||||
+PathPrefix+'Source/Rtl/Common;'
|
||||
+PathPrefix+'Source/Rtl/Corba40;'
|
||||
+PathPrefix+'Source/Vcl;';
|
||||
else
|
||||
Result:=PathPrefix+'Source/Rtl/Win;'
|
||||
+PathPrefix+'Source/Rtl/Sys;'
|
||||
+PathPrefix+'Source/Rtl/Corba;'
|
||||
+PathPrefix+'Source/Vcl;';
|
||||
end;
|
||||
end;
|
||||
|
||||
function TDefinePool.CreateLazarusSrcTemplate(
|
||||
const LazarusSrcDir, WidgetType: string): TDefineTemplate;
|
||||
const
|
||||
@ -2539,11 +2561,14 @@ begin
|
||||
Result.AddChild(DirTempl);
|
||||
end;
|
||||
|
||||
function TDefinePool.CreateDelphi5CompilerDefinesTemplate: TDefineTemplate;
|
||||
function TDefinePool.CreateDelphiCompilerDefinesTemplate(
|
||||
DelphiVersion: integer): TDefineTemplate;
|
||||
var DefTempl: TDefineTemplate;
|
||||
begin
|
||||
DefTempl:=TDefineTemplate.Create('Delphi5 Compiler Defines',
|
||||
Format(ctsOtherCompilerDefines,['Delphi5']),'','',da_Block);
|
||||
DefTempl:=TDefineTemplate.Create('Delphi'+IntToStr(DelphiVersion)
|
||||
+' Compiler Defines',
|
||||
Format(ctsOtherCompilerDefines,['Delphi'+IntToStr(DelphiVersion)]),
|
||||
'','',da_Block);
|
||||
DefTempl.AddChild(TDefineTemplate.Create('Reset',
|
||||
ctsResetAllDefines,
|
||||
'','',da_UndefineAll));
|
||||
@ -2553,9 +2578,31 @@ begin
|
||||
DefTempl.AddChild(TDefineTemplate.Create('Define makro FPC_DELPHI',
|
||||
Format(ctsDefineMakroName,['FPC_DELPHI']),
|
||||
'FPC_DELPHI','',da_DefineRecurse));
|
||||
DefTempl.AddChild(TDefineTemplate.Create('Define makro VER_130',
|
||||
Format(ctsDefineMakroName,['VER_130']),
|
||||
'VER_130','',da_DefineRecurse));
|
||||
DefTempl.AddChild(TDefineTemplate.Create('Define makro MSWINDOWS',
|
||||
Format(ctsDefineMakroName,['MSWINDOWS']),
|
||||
'MSWINDOWS','',da_DefineRecurse));
|
||||
|
||||
// version
|
||||
case DelphiVersion of
|
||||
3:
|
||||
DefTempl.AddChild(TDefineTemplate.Create('Define makro VER_110',
|
||||
Format(ctsDefineMakroName,['VER_110']),
|
||||
'VER_130','',da_DefineRecurse));
|
||||
4:
|
||||
DefTempl.AddChild(TDefineTemplate.Create('Define makro VER_125',
|
||||
Format(ctsDefineMakroName,['VER_125']),
|
||||
'VER_130','',da_DefineRecurse));
|
||||
5:
|
||||
DefTempl.AddChild(TDefineTemplate.Create('Define makro VER_130',
|
||||
Format(ctsDefineMakroName,['VER_130']),
|
||||
'VER_130','',da_DefineRecurse));
|
||||
else
|
||||
// else define Delphi 6
|
||||
DefTempl.AddChild(TDefineTemplate.Create('Define makro VER_140',
|
||||
Format(ctsDefineMakroName,['VER_140']),
|
||||
'VER_140','',da_DefineRecurse));
|
||||
end;
|
||||
|
||||
DefTempl.AddChild(TDefineTemplate.Create(
|
||||
Format(ctsDefineMakroName,[ExternalMacroStart+'Compiler']),
|
||||
'Define '+ExternalMacroStart+'Compiler variable',
|
||||
@ -2564,36 +2611,34 @@ begin
|
||||
Result:=DefTempl;
|
||||
end;
|
||||
|
||||
function TDefinePool.CreateDelphi5DirectoryTemplate(
|
||||
const DelphiDirectory: string): TDefineTemplate;
|
||||
function TDefinePool.CreateDelphiDirectoryTemplate(
|
||||
const DelphiDirectory: string; DelphiVersion: integer): TDefineTemplate;
|
||||
var MainDirTempl: TDefineTemplate;
|
||||
begin
|
||||
MainDirTempl:=TDefineTemplate.Create('Delphi5 Directory',
|
||||
Format(ctsNamedDirectory,['Delphi5']),
|
||||
MainDirTempl:=TDefineTemplate.Create('Delphi'+IntToStr(DelphiVersion)
|
||||
+' Directory',
|
||||
Format(ctsNamedDirectory,['Delphi'+IntToStr(DelphiVersion)]),
|
||||
'',DelphiDirectory,da_Directory);
|
||||
MainDirTempl.AddChild(CreateDelphi5CompilerDefinesTemplate);
|
||||
MainDirTempl.AddChild(CreateDelphiCompilerDefinesTemplate(DelphiVersion));
|
||||
MainDirTempl.AddChild(TDefineTemplate.Create('SrcPath',
|
||||
Format(ctsSetsSrcPathTo,['RTL, VCL']),
|
||||
ExternalMacroStart+'SrcPath',
|
||||
SetDirSeparators(
|
||||
'$(#DefinePath)/Source/Rtl/Win;'
|
||||
+'$(#DefinePath)/Source/Rtl/Sys;'
|
||||
+'$(#DefinePath)/Source/Rtl/Corba;'
|
||||
+'$(#DefinePath)/Source/Vcl;'
|
||||
+'$(#SrcPath)'),
|
||||
SetDirSeparators(CreateDelphiSrcPath(DelphiVersion,'$(#DefinePath)/')
|
||||
+'$(#SrcPath)'),
|
||||
da_DefineRecurse));
|
||||
|
||||
Result:=MainDirTempl;
|
||||
end;
|
||||
|
||||
function TDefinePool.CreateDelphi5ProjectTemplate(
|
||||
const ProjectDir, DelphiDirectory: string): TDefineTemplate;
|
||||
function TDefinePool.CreateDelphiProjectTemplate(
|
||||
const ProjectDir, DelphiDirectory: string;
|
||||
DelphiVersion: integer): TDefineTemplate;
|
||||
var MainDirTempl: TDefineTemplate;
|
||||
begin
|
||||
MainDirTempl:=TDefineTemplate.Create('Delphi5 Project',
|
||||
Format(ctsNamedProject,['Delphi5']),
|
||||
MainDirTempl:=TDefineTemplate.Create('Delphi'+IntToStr(DelphiVersion)+' Project',
|
||||
Format(ctsNamedProject,['Delphi'+IntToStr(DelphiVersion)]),
|
||||
'',ProjectDir,da_Directory);
|
||||
MainDirTempl.AddChild(CreateDelphi5CompilerDefinesTemplate);
|
||||
MainDirTempl.AddChild(CreateDelphiCompilerDefinesTemplate(DelphiVersion));
|
||||
MainDirTempl.AddChild(TDefineTemplate.Create(
|
||||
'Define '+ExternalMacroStart+'DelphiDir',
|
||||
Format(ctsDefineMakroName,[ExternalMacroStart+'DelphiDir']),
|
||||
@ -2601,12 +2646,8 @@ begin
|
||||
MainDirTempl.AddChild(TDefineTemplate.Create('SrcPath',
|
||||
Format(ctsAddsDirToSourcePath,['Delphi RTL+VCL']),
|
||||
ExternalMacroStart+'SrcPath',
|
||||
SetDirSeparators(
|
||||
'$(#DelphiDir)/Source/Rtl/Win;'
|
||||
+'$(#DelphiDir)/Source/Rtl/Sys;'
|
||||
+'$(#DelphiDir)/Source/Rtl/Corba;'
|
||||
+'$(#DelphiDir)/Source/Vcl;'
|
||||
+'$(#SrcPath)'),
|
||||
SetDirSeparators(CreateDelphiSrcPath(DelphiVersion,'$(#DelphiDir)/')
|
||||
+'$(#SrcPath)'),
|
||||
da_DefineRecurse));
|
||||
|
||||
Result:=MainDirTempl;
|
||||
|
@ -44,6 +44,7 @@ const
|
||||
// ToDo: find the constant in the fpc units.
|
||||
EndOfLine:shortstring={$IFDEF win32}#13+{$ENDIF}#10;
|
||||
|
||||
|
||||
// files
|
||||
function CompareFilenames(const Filename1, Filename2: string): integer;
|
||||
function DirectoryExists(DirectoryName: string): boolean;
|
||||
@ -56,6 +57,9 @@ function FileIsReadable(const AFilename: string): boolean;
|
||||
function FileIsWritable(const AFilename: string): boolean;
|
||||
function FileIsText(const AFilename: string): boolean;
|
||||
function TrimFilename(const AFilename: string): string;
|
||||
function AppendPathDelim(const Path: string): string;
|
||||
function SearchFileInPath(const Filename, BasePath, SearchPath,
|
||||
Delimiter: string; SearchLoUpCase: boolean): string;
|
||||
|
||||
implementation
|
||||
|
||||
@ -336,6 +340,69 @@ begin
|
||||
SetLength(Result,DestPos-1);
|
||||
end;
|
||||
|
||||
function AppendPathDelim(const Path: string): string;
|
||||
begin
|
||||
if (Path<>'') and (Path[length(Path)]<>PathDelim) then
|
||||
Result:=Path+PathDelim
|
||||
else
|
||||
Result:=Path;
|
||||
end;
|
||||
|
||||
function SearchFileInPath(const Filename, BasePath, SearchPath,
|
||||
Delimiter: string; SearchLoUpCase: boolean): string;
|
||||
|
||||
function FileDoesExists(const AFilename: string): boolean;
|
||||
begin
|
||||
Result:=FileExists(AFilename);
|
||||
if Result then begin
|
||||
SearchFileInPath:=ExpandFilename(AFilename);
|
||||
exit;
|
||||
end;
|
||||
{$IFNDEF Win32}
|
||||
if SearchLoUpCase then begin
|
||||
|
||||
end;
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
var
|
||||
p, StartPos, l: integer;
|
||||
CurPath, Base: string;
|
||||
begin
|
||||
//writeln('[SearchFileInPath] Filename="',Filename,'" BasePath="',BasePath,'" SearchPath="',SearchPath,'" Delimiter="',Delimiter,'"');
|
||||
if (Filename='') then begin
|
||||
Result:=Filename;
|
||||
exit;
|
||||
end;
|
||||
// check if filename absolute
|
||||
if FilenameIsAbsolute(Filename) then begin
|
||||
if FileDoesExists(Filename) then exit;
|
||||
Result:='';
|
||||
exit;
|
||||
end;
|
||||
Base:=ExpandFilename(AppendPathDelim(BasePath));
|
||||
// search in current directory
|
||||
if FileDoesExists(Base+Filename) then exit;
|
||||
// search in search path
|
||||
StartPos:=1;
|
||||
l:=length(SearchPath);
|
||||
while StartPos<=l do begin
|
||||
p:=StartPos;
|
||||
while (p<=l) and (pos(SearchPath[p],Delimiter)<1) do inc(p);
|
||||
CurPath:=Trim(copy(SearchPath,StartPos,p-StartPos));
|
||||
if CurPath<>'' then begin
|
||||
if not FilenameIsAbsolute(CurPath) then
|
||||
CurPath:=Base+CurPath;
|
||||
Result:=ExpandFilename(AppendPathDelim(CurPath)+Filename);
|
||||
if FileDoesExists(Result) then exit;
|
||||
end;
|
||||
StartPos:=p+1;
|
||||
end;
|
||||
Result:='';
|
||||
end;
|
||||
|
||||
|
||||
|
||||
end.
|
||||
|
||||
|
||||
|
@ -530,35 +530,41 @@ begin
|
||||
Add('CDECL' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('INLINE' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('MESSAGE' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('DEPRECATED' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('PLATFORM' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
end;
|
||||
IsKeyWordProcedureSpecifier:=TKeyWordFunctionList.Create;
|
||||
KeyWordLists.Add(IsKeyWordProcedureSpecifier);
|
||||
with IsKeyWordProcedureSpecifier do begin
|
||||
Add('STDCALL' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('REGISTER',{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('POPSTACK',{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('OVERLOAD',{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('CDECL' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('INLINE' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('EXTERNAL',{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('FORWARD' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('PASCAL' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('ASSEMBLER',{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('STDCALL' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('REGISTER' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('POPSTACK' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('OVERLOAD' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('CDECL' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('INLINE' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('EXTERNAL' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('FORWARD' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('PASCAL' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('ASSEMBLER' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('SAVEREGISTERS',{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('FAR' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('NEAR' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('[' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('FAR' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('NEAR' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('DEPRECATED' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('PLATFORM' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('[' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
end;
|
||||
IsKeyWordProcedureTypeSpecifier:=TKeyWordFunctionList.Create;
|
||||
KeyWordLists.Add(IsKeyWordProcedureTypeSpecifier);
|
||||
with IsKeyWordProcedureTypeSpecifier do begin
|
||||
Add('STDCALL' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('REGISTER',{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('POPSTACK',{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('CDECL' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('PASCAL' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('FAR' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('NEAR' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('STDCALL' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('REGISTER' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('POPSTACK' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('CDECL' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('PASCAL' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('FAR' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('NEAR' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('DEPRECATED' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('PLATFORM' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
end;
|
||||
IsKeyWordProcedureBracketSpecifier:=TKeyWordFunctionList.Create;
|
||||
KeyWordLists.Add(IsKeyWordProcedureBracketSpecifier);
|
||||
@ -639,7 +645,6 @@ begin
|
||||
Add('OBJECT',{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('OF',{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('ON',{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('OPERATOR',{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('OR',{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('PACKED',{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('PROCEDURE',{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
|
@ -946,23 +946,26 @@ begin
|
||||
ReadNextAtom;
|
||||
if (not UpAtomIs('PROCEDURE')) and (not UpAtomIs('FUNCTION')) then begin
|
||||
SaveRaiseExceptionFmt(ctsStrExpectedButAtomFound,
|
||||
[ctsProcedureOrFunction,GetAtom]);
|
||||
[ctsProcedureOrFunction,GetAtom]);
|
||||
end;
|
||||
end;
|
||||
IsFunction:=UpAtomIs('FUNCTION');
|
||||
// read procedure head
|
||||
// read name
|
||||
ReadNextAtom;
|
||||
if (CurPos.StartPos>SrcLen)
|
||||
or (not (IsIdentStartChar[Src[CurPos.StartPos]]))
|
||||
then
|
||||
SaveRaiseExceptionFmt(ctsStrExpectedButAtomFound,[ctsMethodName,GetAtom]);
|
||||
AtomIsIdentifier(true);
|
||||
// create node for procedure head
|
||||
CreateChildNode;
|
||||
CurNode.Desc:=ctnProcedureHead;
|
||||
CurNode.SubDesc:=ctnsNeedJITParsing;
|
||||
// read rest
|
||||
ReadNextAtom;
|
||||
if (CurPos.Flag=cafPoint) then begin
|
||||
// first identifier was interface name
|
||||
ReadNextAtom;
|
||||
AtomIsIdentifier(true);
|
||||
ReadNextAtom;
|
||||
end;
|
||||
// read rest
|
||||
ParseAttr:=[pphIsMethod];
|
||||
if IsFunction then Include(ParseAttr,pphIsFunction);
|
||||
ReadTilProcedureHeadEnd(ParseAttr,HasForwardModifier);
|
||||
@ -1220,7 +1223,16 @@ begin
|
||||
ReadNextAtom;
|
||||
end else begin
|
||||
if (Scanner.CompilerMode<>cmDelphi) then
|
||||
SaveRaiseExceptionFmt(ctsStrExpectedButAtomFound,[':',GetAtom]);
|
||||
SaveRaiseExceptionFmt(ctsStrExpectedButAtomFound,[':',GetAtom])
|
||||
else begin
|
||||
// Delphi Mode
|
||||
if CurPos.Flag=cafEqual then begin
|
||||
// read interface alias
|
||||
ReadNextAtom;
|
||||
AtomIsIdentifier(true);
|
||||
ReadNextAtom;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
if UpAtomIs('OF') then begin
|
||||
@ -1406,14 +1418,15 @@ begin
|
||||
'[':
|
||||
begin
|
||||
// open bracket + ? + close bracket
|
||||
if not Extract then ReadNextAtom else ExtractNextAtom(true,Attr);
|
||||
repeat
|
||||
if not Extract then ReadNextAtom else ExtractNextAtom(true,Attr);
|
||||
if (CurPos.Flag=cafEdgedBracketClose) then break;
|
||||
// read
|
||||
if not ReadConstant(ExceptionOnError,Extract,Attr) then exit;
|
||||
if (CurPos.Flag=cafComma) or AtomIs('..') then begin
|
||||
// continue
|
||||
end else if (CurPos.Flag=cafEdgedBracketClose) then begin
|
||||
break;
|
||||
end else begin
|
||||
if not Extract then ReadNextAtom else ExtractNextAtom(true,Attr);
|
||||
end else if (CurPos.Flag<>cafEdgedBracketClose) then begin
|
||||
if ExceptionOnError then
|
||||
SaveRaiseExceptionFmt(ctsStrExpectedButAtomFound,[']',GetAtom])
|
||||
else exit;
|
||||
@ -2517,7 +2530,7 @@ begin
|
||||
end;
|
||||
if CurPos.Flag=cafEND then begin
|
||||
ReadNextAtom;
|
||||
if UpAtomIs('DEPRECATED') then ReadNextAtom;
|
||||
if UpAtomIs('DEPRECATED') or UpAtomIs('PLATFORM') then ReadNextAtom;
|
||||
end;
|
||||
Result:=true;
|
||||
end;
|
||||
@ -2772,6 +2785,7 @@ begin
|
||||
SaveRaiseException(ctsInvalidSubrange);
|
||||
CurNode.EndPos:=CurPos.StartPos;
|
||||
end;
|
||||
if UpAtomIs('PLATFORM') or UpAtomIs('DEPRECATED') then ReadNextAtom;
|
||||
end else begin
|
||||
// enum or subrange
|
||||
ReadTillTypeEnd;
|
||||
@ -2876,6 +2890,7 @@ begin
|
||||
CurNode.EndPos:=CurPos.EndPos;
|
||||
EndChildNode; // close record
|
||||
ReadNextAtom;
|
||||
if UpAtomIs('PLATFORM') then ReadNextAtom;
|
||||
Result:=true;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user