mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-01 17:19:36 +01:00
codetools: parse built-in function concat in constant, issue #33201
git-svn-id: trunk@57339 -
This commit is contained in:
parent
65d5df23da
commit
38166e7a0a
@ -1737,6 +1737,7 @@ function TPascalParserTool.ReadTilProcedureHeadEnd(
|
|||||||
external;
|
external;
|
||||||
external <id>;
|
external <id>;
|
||||||
external name <id> delayed;
|
external name <id> delayed;
|
||||||
|
external name concat('','');
|
||||||
external <id or number> name <id>;
|
external <id or number> name <id>;
|
||||||
external <id or number> index <id>;
|
external <id or number> index <id>;
|
||||||
[alias: <string constant>]
|
[alias: <string constant>]
|
||||||
@ -2017,10 +2018,12 @@ begin
|
|||||||
end;
|
end;
|
||||||
if CurPos.Flag in [cafRoundBracketOpen,cafEdgedBracketOpen] then
|
if CurPos.Flag in [cafRoundBracketOpen,cafEdgedBracketOpen] then
|
||||||
begin
|
begin
|
||||||
// type cast or constant array
|
// type cast or constant array or built-in function
|
||||||
BracketType:=CurPos.Flag;
|
BracketType:=CurPos.Flag;
|
||||||
|
repeat
|
||||||
if not Extract then ReadNextAtom else ExtractNextAtom(true,Attr);
|
if not Extract then ReadNextAtom else ExtractNextAtom(true,Attr);
|
||||||
if not ReadConstant(ExceptionOnError,Extract,Attr) then exit;
|
if not ReadConstant(ExceptionOnError,Extract,Attr) then exit;
|
||||||
|
until CurPos.Flag<>cafComma;
|
||||||
if (BracketType=cafRoundBracketOpen)
|
if (BracketType=cafRoundBracketOpen)
|
||||||
and (CurPos.Flag<>cafRoundBracketClose) then
|
and (CurPos.Flag<>cafRoundBracketClose) then
|
||||||
if ExceptionOnError then
|
if ExceptionOnError then
|
||||||
|
|||||||
@ -47,6 +47,7 @@ type
|
|||||||
procedure TestDeprecated;
|
procedure TestDeprecated;
|
||||||
procedure TestMissingGenericKeywordObjFPCFail;
|
procedure TestMissingGenericKeywordObjFPCFail;
|
||||||
procedure TestParseGenericsDelphi;
|
procedure TestParseGenericsDelphi;
|
||||||
|
procedure TestParseExternalConcat;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -433,6 +434,16 @@ begin
|
|||||||
ParseModule;
|
ParseModule;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TTestPascalParser.TestParseExternalConcat;
|
||||||
|
begin
|
||||||
|
Add([
|
||||||
|
'program test1;',
|
||||||
|
'{$mode objfpc}',
|
||||||
|
'procedure foo; cdecl; external name concat(''foo'', ''bar'');',
|
||||||
|
'begin']);
|
||||||
|
ParseModule;
|
||||||
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
RegisterTest(TTestPascalParser);
|
RegisterTest(TTestPascalParser);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user