+ allow in ISO mode that { ... } and (* ... *) comments are paired, resolves at least partly #37428

git-svn-id: trunk@46903 -
This commit is contained in:
florian 2020-09-20 08:47:00 +00:00
parent 85a11c8204
commit e83d214e98
2 changed files with 24 additions and 4 deletions

View File

@ -4601,6 +4601,16 @@ type
inc_comment_level;
'}' :
dec_comment_level;
'*' :
{ in iso mode, comments opened by a curly bracket can be closed by asterisk, round bracket }
if m_iso in current_settings.modeswitches then
begin
readchar;
if c=')' then
dec_comment_level
else
continue;
end;
#10,#13 :
linebreak;
#26 :
@ -4690,6 +4700,16 @@ type
else
found:=0;
end;
'}' :
{ in iso mode, comments opened by asterisk, round bracket can be closed by a curly bracket }
if m_iso in current_settings.modeswitches then
begin
dec_comment_level;
if comment_level=0 then
found:=2
else
found:=0;
end;
'(' :
begin
if found=4 then

View File

@ -1,8 +1,8 @@
{$mode iso}
label
0;
{$goto on}
begin
0:
writeln('ok');
writeln{comment*);{}
writeln(*comment};(* *)
writeln;
end.