mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-28 17:00:57 +02:00
codetools: parse built-in function concat in constant, issue #33201
git-svn-id: branches/fixes_1_8@57340 -
This commit is contained in:
parent
e67c6c2ac8
commit
44aba04214
@ -1699,6 +1699,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>]
|
||||||
@ -1970,10 +1971,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;
|
||||||
if not Extract then ReadNextAtom else ExtractNextAtom(true,Attr);
|
repeat
|
||||||
if not ReadConstant(ExceptionOnError,Extract,Attr) then exit;
|
if not Extract then ReadNextAtom else ExtractNextAtom(true,Attr);
|
||||||
|
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
|
||||||
|
@ -34,6 +34,7 @@ type
|
|||||||
property Code: TCodeBuffer read FCode;
|
property Code: TCodeBuffer read FCode;
|
||||||
published
|
published
|
||||||
procedure TestRecord_ClassOperators;
|
procedure TestRecord_ClassOperators;
|
||||||
|
procedure TestParseExternalConcat;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -155,6 +156,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
|
||||||
AddToPascalTestSuite(TTestPascalParser);
|
AddToPascalTestSuite(TTestPascalParser);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user