* Fix bug ID #31690

git-svn-id: trunk@35896 -
This commit is contained in:
michael 2017-04-22 11:31:16 +00:00
parent 992c8bd98b
commit 57e9677088
2 changed files with 15 additions and 2 deletions

View File

@ -2805,7 +2805,8 @@ begin
if Declarations is TProcedureBody then
begin
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']);
SetBlock(declNone);
ParseProcAsmBlock(TProcedureBody(Declarations));

View File

@ -110,8 +110,9 @@ Type
Procedure TestTryExceptOn2;
Procedure TestTryExceptOnElse;
Procedure TestTryExceptOnIfElse;
procedure TestTryExceptRaise;
procedure TestTryExceptRaise;
Procedure TestAsm;
Procedure TestAsmBlock;
Procedure TestGotoInIfThen;
end;
@ -1647,6 +1648,17 @@ begin
AssertEquals('token 4 ','1',T.Tokens[3]);
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;
begin