mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-28 15:40:41 +02:00
added Delphi7 source template and language features
git-svn-id: trunk@4657 -
This commit is contained in:
parent
429de108cf
commit
55c9353c30
@ -113,7 +113,8 @@ var
|
|||||||
WordIsNumberOperator,
|
WordIsNumberOperator,
|
||||||
WordIsPredefinedFPCIdentifier,
|
WordIsPredefinedFPCIdentifier,
|
||||||
WordIsPredefinedDelphiIdentifier,
|
WordIsPredefinedDelphiIdentifier,
|
||||||
UnexpectedKeyWordInBeginBlock: TKeyWordFunctionList;
|
UnexpectedKeyWordInBeginBlock,
|
||||||
|
UnexpectedKeyWordInAsmBlock: TKeyWordFunctionList;
|
||||||
UpChars: array[char] of char;
|
UpChars: array[char] of char;
|
||||||
|
|
||||||
function UpperCaseStr(const s: string): string;
|
function UpperCaseStr(const s: string): string;
|
||||||
@ -963,6 +964,29 @@ begin
|
|||||||
Add('VAR',{$ifdef FPC}@{$endif}AllwaysTrue);
|
Add('VAR',{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
UnexpectedKeyWordInAsmBlock:=TKeyWordFunctionList.Create;
|
||||||
|
KeyWordLists.Add(UnexpectedKeyWordInAsmBlock);
|
||||||
|
with UnexpectedKeyWordInAsmBlock do begin
|
||||||
|
Add('CLASS',{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||||
|
Add('CONST',{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||||
|
Add('CONSTRUCTOR',{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||||
|
Add('DESTRUCTOR',{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||||
|
Add('FINALIZATION',{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||||
|
Add('FUNCTION',{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||||
|
Add('IMPLEMENTATION',{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||||
|
Add('INITIALIZATION',{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||||
|
Add('INTERFACE',{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||||
|
Add('LIBRARY',{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||||
|
Add('PROCEDURE',{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||||
|
Add('PROGRAM',{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||||
|
Add('RECORD',{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||||
|
Add('RESOURCESTRING',{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||||
|
Add('SET',{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||||
|
Add('THREADVAR',{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||||
|
Add('UNIT',{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||||
|
Add('VAR',{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||||
|
end;
|
||||||
|
|
||||||
WordIsLogicalBlockStart:=TKeyWordFunctionList.Create;
|
WordIsLogicalBlockStart:=TKeyWordFunctionList.Create;
|
||||||
KeyWordLists.Add(WordIsLogicalBlockStart);
|
KeyWordLists.Add(WordIsLogicalBlockStart);
|
||||||
with WordIsLogicalBlockStart do begin
|
with WordIsLogicalBlockStart do begin
|
||||||
|
@ -1337,14 +1337,13 @@ begin
|
|||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
if CurPos.Flag<>cafSemicolon then begin
|
// check semicolon
|
||||||
|
if CurPos.Flag=cafSemicolon then begin
|
||||||
|
ReadNextAtom;
|
||||||
|
end else begin
|
||||||
|
// Delphi allows procs without ending semicolon
|
||||||
if (Scanner.CompilerMode<>cmDelphi) then
|
if (Scanner.CompilerMode<>cmDelphi) then
|
||||||
RaiseCharExpectedButAtomFound(';');
|
RaiseCharExpectedButAtomFound(';');
|
||||||
// Delphi allows procs without ending semicolon
|
|
||||||
UndoReadNextAtom; // unread unknown atom
|
|
||||||
if CurPos.Flag=cafSemicolon then
|
|
||||||
UndoReadNextAtom; // unread semicolon
|
|
||||||
break;
|
|
||||||
end;
|
end;
|
||||||
end else begin
|
end else begin
|
||||||
// current atom does not belong to procedure/method declaration
|
// current atom does not belong to procedure/method declaration
|
||||||
@ -1353,7 +1352,6 @@ begin
|
|||||||
UndoReadNextAtom; // unread semicolon
|
UndoReadNextAtom; // unread semicolon
|
||||||
break;
|
break;
|
||||||
end;
|
end;
|
||||||
ReadNextAtom;
|
|
||||||
until false;
|
until false;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1903,12 +1901,18 @@ begin
|
|||||||
// check for unexpected keywords
|
// check for unexpected keywords
|
||||||
case BlockType of
|
case BlockType of
|
||||||
|
|
||||||
ebtBegin,ebtAsm,ebtTry,ebtCase,ebtRepeat:
|
ebtBegin,ebtTry,ebtCase,ebtRepeat:
|
||||||
if UnexpectedKeyWordInBeginBlock.DoItUppercase(UpperSrc,
|
if UnexpectedKeyWordInBeginBlock.DoItUppercase(UpperSrc,
|
||||||
CurPos.StartPos,CurPos.EndPos-CurPos.StartPos)
|
CurPos.StartPos,CurPos.EndPos-CurPos.StartPos)
|
||||||
then
|
then
|
||||||
RaiseUnexpectedKeyWordInBeginEndBlock;
|
RaiseUnexpectedKeyWordInBeginEndBlock;
|
||||||
|
|
||||||
|
ebtAsm:
|
||||||
|
if UnexpectedKeyWordInAsmBlock.DoItUppercase(UpperSrc,
|
||||||
|
CurPos.StartPos,CurPos.EndPos-CurPos.StartPos)
|
||||||
|
then
|
||||||
|
RaiseUnexpectedKeyWordInBeginEndBlock;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
until false;
|
until false;
|
||||||
@ -3014,7 +3018,7 @@ begin
|
|||||||
CurNode.EndPos:=CurPos.EndPos;
|
CurNode.EndPos:=CurPos.EndPos;
|
||||||
EndChildNode; // close record
|
EndChildNode; // close record
|
||||||
ReadNextAtom;
|
ReadNextAtom;
|
||||||
if UpAtomIs('PLATFORM') then ReadNextAtom;
|
if UpAtomIs('PLATFORM') or UpAtomIs('DEPRECATED') then ReadNextAtom;
|
||||||
Result:=true;
|
Result:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user