mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-02 06:39:36 +01:00
codetools: implemented parsing 1e-16, bug #8446
git-svn-id: trunk@15880 -
This commit is contained in:
parent
1bc45f97db
commit
60e3f56061
@ -1698,13 +1698,13 @@ begin
|
||||
inc(Position);
|
||||
while (Position<=Len) and (Source[Position] in ['0'..'9']) do
|
||||
inc(Position);
|
||||
if (Position<=Len) and (Source[Position] in ['e','E']) then begin
|
||||
// read exponent
|
||||
end;
|
||||
if (Position<=Len) and (Source[Position] in ['e','E']) then begin
|
||||
// read exponent
|
||||
inc(Position);
|
||||
if (Position<=Len) and (Source[Position]='-') then inc(Position);
|
||||
while (Position<=Len) and (Source[Position] in ['0'..'9']) do
|
||||
inc(Position);
|
||||
if (Position<=Len) and (Source[Position]='-') then inc(Position);
|
||||
while (Position<=Len) and (Source[Position] in ['0'..'9']) do
|
||||
inc(Position);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
'''','#': // string constant
|
||||
|
||||
@ -1030,16 +1030,16 @@ begin
|
||||
while (CurPos.EndPos<=SrcLen) and (IsNumberChar[Src[CurPos.EndPos]])
|
||||
do
|
||||
inc(CurPos.EndPos);
|
||||
if (CurPos.EndPos<=SrcLen) and (UpperSrc[CurPos.EndPos]='E') then
|
||||
begin
|
||||
// read exponent
|
||||
end;
|
||||
if (CurPos.EndPos<=SrcLen) and (UpperSrc[CurPos.EndPos]='E') then
|
||||
begin
|
||||
// read exponent
|
||||
inc(CurPos.EndPos);
|
||||
if (CurPos.EndPos<=SrcLen) and (Src[CurPos.EndPos] in ['-','+'])
|
||||
then inc(CurPos.EndPos);
|
||||
while (CurPos.EndPos<=SrcLen) and (IsNumberChar[Src[CurPos.EndPos]])
|
||||
do
|
||||
inc(CurPos.EndPos);
|
||||
if (CurPos.EndPos<=SrcLen) and (Src[CurPos.EndPos] in ['-','+'])
|
||||
then inc(CurPos.EndPos);
|
||||
while (CurPos.EndPos<=SrcLen) and (IsNumberChar[Src[CurPos.EndPos]])
|
||||
do
|
||||
inc(CurPos.EndPos);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
'%':
|
||||
|
||||
@ -1277,10 +1277,12 @@ var
|
||||
copying: boolean;
|
||||
IsArrayType: Boolean;
|
||||
IsFileType: Boolean;
|
||||
NeedIdentifier: boolean;
|
||||
begin
|
||||
copying:=[phpWithoutParamList,phpWithoutParamTypes]*Attr=[];
|
||||
Result:=false;
|
||||
if CurPos.Flag in AllCommonAtomWords then begin
|
||||
NeedIdentifier:=true;
|
||||
IsArrayType:=UpAtomIs('ARRAY');
|
||||
if IsArrayType then begin
|
||||
if (phpCreateNodes in Attr) then begin
|
||||
@ -1315,36 +1317,39 @@ begin
|
||||
CurNode.Desc:=ctnFileType;
|
||||
end;
|
||||
if not Extract then ReadNextAtom else ExtractNextAtom(copying,Attr);
|
||||
if not UpAtomIs('OF') then
|
||||
if ExceptionOnError then
|
||||
RaiseStringExpectedButAtomFound('"of"')
|
||||
else exit;
|
||||
if not Extract then ReadNextAtom else ExtractNextAtom(copying,Attr);
|
||||
if UpAtomIs('OF') then begin
|
||||
if not Extract then ReadNextAtom else ExtractNextAtom(copying,Attr);
|
||||
end else begin
|
||||
NeedIdentifier:=false;
|
||||
end;
|
||||
end;
|
||||
if not AtomIsIdentifier(ExceptionOnError) then exit;
|
||||
if (phpCreateNodes in Attr) then begin
|
||||
CreateChildNode;
|
||||
CurNode.Desc:=ctnIdentifier;
|
||||
CurNode.EndPos:=CurPos.EndPos;
|
||||
end;
|
||||
if not Extract then
|
||||
ReadNextAtom
|
||||
else
|
||||
ExtractNextAtom(copying,Attr);
|
||||
if CurPos.Flag=cafPoint then begin
|
||||
// first identifier was unitname -> read '.' + identifier
|
||||
if not Extract then
|
||||
ReadNextAtom
|
||||
else
|
||||
ExtractNextAtom(copying,Attr);
|
||||
if NeedIdentifier then begin
|
||||
if not AtomIsIdentifier(ExceptionOnError) then exit;
|
||||
if (phpCreateNodes in Attr) then begin
|
||||
CreateChildNode;
|
||||
CurNode.Desc:=ctnIdentifier;
|
||||
CurNode.EndPos:=CurPos.EndPos;
|
||||
end;
|
||||
if not Extract then
|
||||
ReadNextAtom
|
||||
else
|
||||
ExtractNextAtom(copying,Attr);
|
||||
if CurPos.Flag=cafPoint then begin
|
||||
// first identifier was unitname -> read '.' + identifier
|
||||
if not Extract then
|
||||
ReadNextAtom
|
||||
else
|
||||
ExtractNextAtom(copying,Attr);
|
||||
if not AtomIsIdentifier(ExceptionOnError) then exit;
|
||||
if not Extract then
|
||||
ReadNextAtom
|
||||
else
|
||||
ExtractNextAtom(copying,Attr);
|
||||
end;
|
||||
if (phpCreateNodes in Attr) then
|
||||
EndChildNode;
|
||||
end;
|
||||
if (phpCreateNodes in Attr) then begin
|
||||
EndChildNode;
|
||||
if IsFileType then
|
||||
EndChildNode;
|
||||
if IsArrayType then
|
||||
|
||||
Loading…
Reference in New Issue
Block a user