codetools: directives parser: adding nodes for all directives

git-svn-id: trunk@11847 -
This commit is contained in:
mattias 2007-08-23 12:47:33 +00:00
parent 576644f062
commit d837b709c7
3 changed files with 18 additions and 2 deletions

View File

@ -83,7 +83,8 @@ const
cdnsLongSwitch = 52+cdnsBase;
cdnsMode = 53+cdnsBase;
cdnsThreading = 54+cdnsBase;
cdnsOther = 55+cdnsBase;
const
H2Pas_Function_Prefix = 'H2PAS_FUNCTION_';
@ -130,6 +131,7 @@ type
function LongSwitchDirective: boolean;
function ModeDirective: boolean;
function ThreadingDirective: boolean;
function OtherDirective: boolean;
procedure InitKeyWordList;
procedure InitParser;
@ -370,6 +372,7 @@ begin
cdnsLongSwitch : Result:='LongSwitch';
cdnsMode : Result:='Mode';
cdnsThreading : Result:='Threading';
cdnsOther : Result:='?';
else Result:='?';
end;
end;
@ -574,6 +577,14 @@ begin
EndChildNode;
end;
function TCompilerDirectivesTree.OtherDirective: boolean;
begin
Result:=true;
CreateChildNode(cdnDefine,cdnsOther);
AtomStart:=SrcPos;
EndChildNode;
end;
procedure TCompilerDirectivesTree.InitKeyWordList;
var
c: Char;
@ -606,6 +617,7 @@ begin
Add('INCLUDEPATH',{$ifdef FPC}@{$endif}IncludePathDirective);
Add('MODE',{$ifdef FPC}@{$endif}ModeDirective);
Add('THREADING',{$ifdef FPC}@{$endif}ThreadingDirective);
DefaultKeyWordFunction:={$ifdef FPC}@{$endif}OtherDirective;
end;
end;
end;

View File

@ -1,6 +1,10 @@
{%MainUnit memcheck.pas}
{$IFDEF MC_Interface}
{$R-}
{$S-}
var
ExceptOnError: boolean = true;

View File

@ -6639,7 +6639,7 @@ var
function GetLineWidthInPixel(LineStart, LineLen: integer): integer;
var
lbearing, rbearing, width, ascent, descent: LongInt;
width: LongInt;
begin
GetTextExtentIgnoringAmpersands(UseFont, @AText[LineStart], LineLen,
nil, nil, @width, nil, nil);