fixed compilation with fpc 2.3.1, which does not allow passing literal chars to formal const parameters (bug )

git-svn-id: trunk@14452 -
This commit is contained in:
vincents 2008-03-07 10:17:39 +00:00
parent bd4b61b421
commit 035ee959b3
3 changed files with 8 additions and 3 deletions

View File

@ -3819,6 +3819,8 @@ procedure TPascalParserTool.ExtractNextAtom(AddAtom: boolean;
var
LastAtomEndPos: integer;
LastStreamPos: TFPCStreamSeekType;
const
space: char = ' ';
begin
LastStreamPos:=ExtractMemStream.Position;
if LastAtoms.Count>0 then begin
@ -3840,7 +3842,7 @@ begin
or ((CurPos.StartPos<=SrcLen) and (IsIdentStartChar[Src[CurPos.StartPos]])
and ExtractStreamEndIsIdentChar))
then begin
ExtractMemStream.Write(' ',1);
ExtractMemStream.Write(space,1);
LastStreamPos:=ExtractMemStream.Position;
end;
end;

View File

@ -345,6 +345,8 @@ var
IsProcedure: Boolean;
IsFunction: Boolean;
IsOperator: Boolean;
const
SemiColon : char = ';';
begin
Result:='';
ExtractProcHeadPos:=phepNone;
@ -451,7 +453,7 @@ begin
ExtractNextAtom([phpWithCallingSpecs,phpWithProcModifiers]*Attr<>[],
Attr);
if not (phpWithProcModifiers in Attr) then
ExtractMemStream.Write(';',1);
ExtractMemStream.Write(SemiColon,1);
end
else if (CurPos.Flag=cafEdgedBracketOpen) then begin
ReadTilBracketClose(false);

View File

@ -425,7 +425,8 @@ begin
fs:=TFileStream.Create(AFilename,fmOpenReadWrite);
try
fs.Position:=fs.Size;
fs.Write(' ',1);
c := ' ';
fs.Write(c,1);
finally
fs.Free;
end;