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