mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-13 22:50:30 +02:00
parent
992c8bd98b
commit
57e9677088
@ -2805,7 +2805,8 @@ begin
|
|||||||
if Declarations is TProcedureBody then
|
if Declarations is TProcedureBody then
|
||||||
begin
|
begin
|
||||||
Proc:=Declarations.Parent as TPasProcedure;
|
Proc:=Declarations.Parent as TPasProcedure;
|
||||||
if not (pmAssembler in Proc.Modifiers) then
|
// Assembler keyword is optional in Delphi mode (bug 31690)
|
||||||
|
if not ((pmAssembler in Proc.Modifiers) or (msDelphi in CurrentModeswitches)) then
|
||||||
ParseExc(nParserExpectTokenError,SParserExpectTokenError,['begin']);
|
ParseExc(nParserExpectTokenError,SParserExpectTokenError,['begin']);
|
||||||
SetBlock(declNone);
|
SetBlock(declNone);
|
||||||
ParseProcAsmBlock(TProcedureBody(Declarations));
|
ParseProcAsmBlock(TProcedureBody(Declarations));
|
||||||
|
@ -110,8 +110,9 @@ Type
|
|||||||
Procedure TestTryExceptOn2;
|
Procedure TestTryExceptOn2;
|
||||||
Procedure TestTryExceptOnElse;
|
Procedure TestTryExceptOnElse;
|
||||||
Procedure TestTryExceptOnIfElse;
|
Procedure TestTryExceptOnIfElse;
|
||||||
procedure TestTryExceptRaise;
|
procedure TestTryExceptRaise;
|
||||||
Procedure TestAsm;
|
Procedure TestAsm;
|
||||||
|
Procedure TestAsmBlock;
|
||||||
Procedure TestGotoInIfThen;
|
Procedure TestGotoInIfThen;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1647,6 +1648,17 @@ begin
|
|||||||
AssertEquals('token 4 ','1',T.Tokens[3]);
|
AssertEquals('token 4 ','1',T.Tokens[3]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TTestStatementParser.TestAsmBlock;
|
||||||
|
begin
|
||||||
|
Source.Add('{$MODE DELPHI}');
|
||||||
|
Source.Add('function BitsHighest(X: Cardinal): Integer;');
|
||||||
|
Source.Add('asm');
|
||||||
|
Source.Add('end;');
|
||||||
|
Source.Add('begin');
|
||||||
|
Source.Add('end.');
|
||||||
|
ParseModule;
|
||||||
|
end;
|
||||||
|
|
||||||
Procedure TTestStatementParser.TestGotoInIfThen;
|
Procedure TTestStatementParser.TestGotoInIfThen;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user