mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-02 11:01:20 +02: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 <id>;
|
||||
external name <id> delayed;
|
||||
external name concat('','');
|
||||
external <id or number> name <id>;
|
||||
external <id or number> index <id>;
|
||||
[alias: <string constant>]
|
||||
@ -2017,10 +2018,12 @@ begin
|
||||
end;
|
||||
if CurPos.Flag in [cafRoundBracketOpen,cafEdgedBracketOpen] then
|
||||
begin
|
||||
// type cast or constant array
|
||||
// type cast or constant array or built-in function
|
||||
BracketType:=CurPos.Flag;
|
||||
if not Extract then ReadNextAtom else ExtractNextAtom(true,Attr);
|
||||
if not ReadConstant(ExceptionOnError,Extract,Attr) then exit;
|
||||
repeat
|
||||
if not Extract then ReadNextAtom else ExtractNextAtom(true,Attr);
|
||||
if not ReadConstant(ExceptionOnError,Extract,Attr) then exit;
|
||||
until CurPos.Flag<>cafComma;
|
||||
if (BracketType=cafRoundBracketOpen)
|
||||
and (CurPos.Flag<>cafRoundBracketClose) then
|
||||
if ExceptionOnError then
|
||||
|
@ -47,6 +47,7 @@ type
|
||||
procedure TestDeprecated;
|
||||
procedure TestMissingGenericKeywordObjFPCFail;
|
||||
procedure TestParseGenericsDelphi;
|
||||
procedure TestParseExternalConcat;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -433,6 +434,16 @@ begin
|
||||
ParseModule;
|
||||
end;
|
||||
|
||||
procedure TTestPascalParser.TestParseExternalConcat;
|
||||
begin
|
||||
Add([
|
||||
'program test1;',
|
||||
'{$mode objfpc}',
|
||||
'procedure foo; cdecl; external name concat(''foo'', ''bar'');',
|
||||
'begin']);
|
||||
ParseModule;
|
||||
end;
|
||||
|
||||
initialization
|
||||
RegisterTest(TTestPascalParser);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user