mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 03:09:11 +02:00
* aktcommentstyle => current_commentstyle
git-svn-id: trunk@30872 -
This commit is contained in:
parent
420309ec59
commit
afa5546ff8
@ -243,7 +243,7 @@ interface
|
|||||||
|
|
||||||
current_scanner : tscannerfile; { current scanner in use }
|
current_scanner : tscannerfile; { current scanner in use }
|
||||||
|
|
||||||
aktcommentstyle : tcommentstyle; { needed to use read_comment from directives }
|
current_commentstyle : tcommentstyle; { needed to use read_comment from directives }
|
||||||
{$ifdef PREPROCWRITE}
|
{$ifdef PREPROCWRITE}
|
||||||
preprocfile : tpreprocfile; { used with only preprocessing }
|
preprocfile : tpreprocfile; { used with only preprocessing }
|
||||||
{$endif PREPROCWRITE}
|
{$endif PREPROCWRITE}
|
||||||
@ -3803,7 +3803,7 @@ type
|
|||||||
if (comment_level>0) then
|
if (comment_level>0) then
|
||||||
readcomment;
|
readcomment;
|
||||||
{ we've read the whole comment }
|
{ we've read the whole comment }
|
||||||
aktcommentstyle:=comment_none;
|
current_commentstyle:=comment_none;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
{ Check for compiler switches }
|
{ Check for compiler switches }
|
||||||
@ -3858,7 +3858,7 @@ type
|
|||||||
if (current_scanner.comment_level>0) then
|
if (current_scanner.comment_level>0) then
|
||||||
current_scanner.readcomment;
|
current_scanner.readcomment;
|
||||||
{ we've read the whole comment }
|
{ we've read the whole comment }
|
||||||
aktcommentstyle:=comment_none;
|
current_commentstyle:=comment_none;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -4009,12 +4009,12 @@ type
|
|||||||
case c of
|
case c of
|
||||||
'{' :
|
'{' :
|
||||||
begin
|
begin
|
||||||
if aktcommentstyle=comment_tp then
|
if current_commentstyle=comment_tp then
|
||||||
inc_comment_level;
|
inc_comment_level;
|
||||||
end;
|
end;
|
||||||
'}' :
|
'}' :
|
||||||
begin
|
begin
|
||||||
if aktcommentstyle=comment_tp then
|
if current_commentstyle=comment_tp then
|
||||||
begin
|
begin
|
||||||
readchar;
|
readchar;
|
||||||
dec_comment_level;
|
dec_comment_level;
|
||||||
@ -4026,7 +4026,7 @@ type
|
|||||||
end;
|
end;
|
||||||
'*' :
|
'*' :
|
||||||
begin
|
begin
|
||||||
if aktcommentstyle=comment_oldtp then
|
if current_commentstyle=comment_oldtp then
|
||||||
begin
|
begin
|
||||||
readchar;
|
readchar;
|
||||||
if c=')' then
|
if c=')' then
|
||||||
@ -4213,9 +4213,9 @@ type
|
|||||||
end;
|
end;
|
||||||
'{' :
|
'{' :
|
||||||
begin
|
begin
|
||||||
if (aktcommentstyle in [comment_tp,comment_none]) then
|
if (current_commentstyle in [comment_tp,comment_none]) then
|
||||||
begin
|
begin
|
||||||
aktcommentstyle:=comment_tp;
|
current_commentstyle:=comment_tp;
|
||||||
if (comment_level=0) then
|
if (comment_level=0) then
|
||||||
found:=1;
|
found:=1;
|
||||||
inc_comment_level;
|
inc_comment_level;
|
||||||
@ -4223,14 +4223,14 @@ type
|
|||||||
end;
|
end;
|
||||||
'*' :
|
'*' :
|
||||||
begin
|
begin
|
||||||
if (aktcommentstyle=comment_oldtp) then
|
if (current_commentstyle=comment_oldtp) then
|
||||||
begin
|
begin
|
||||||
readchar;
|
readchar;
|
||||||
if c=')' then
|
if c=')' then
|
||||||
begin
|
begin
|
||||||
dec_comment_level;
|
dec_comment_level;
|
||||||
found:=0;
|
found:=0;
|
||||||
aktcommentstyle:=comment_none;
|
current_commentstyle:=comment_none;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
next_char_loaded:=true;
|
next_char_loaded:=true;
|
||||||
@ -4240,11 +4240,11 @@ type
|
|||||||
end;
|
end;
|
||||||
'}' :
|
'}' :
|
||||||
begin
|
begin
|
||||||
if (aktcommentstyle=comment_tp) then
|
if (current_commentstyle=comment_tp) then
|
||||||
begin
|
begin
|
||||||
dec_comment_level;
|
dec_comment_level;
|
||||||
if (comment_level=0) then
|
if (comment_level=0) then
|
||||||
aktcommentstyle:=comment_none;
|
current_commentstyle:=comment_none;
|
||||||
found:=0;
|
found:=0;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -4254,7 +4254,7 @@ type
|
|||||||
found:=2;
|
found:=2;
|
||||||
end;
|
end;
|
||||||
'''' :
|
'''' :
|
||||||
if (aktcommentstyle=comment_none) then
|
if (current_commentstyle=comment_none) then
|
||||||
begin
|
begin
|
||||||
repeat
|
repeat
|
||||||
readchar;
|
readchar;
|
||||||
@ -4277,7 +4277,7 @@ type
|
|||||||
end;
|
end;
|
||||||
'(' :
|
'(' :
|
||||||
begin
|
begin
|
||||||
if (aktcommentstyle=comment_none) then
|
if (current_commentstyle=comment_none) then
|
||||||
begin
|
begin
|
||||||
readchar;
|
readchar;
|
||||||
if c='*' then
|
if c='*' then
|
||||||
@ -4287,7 +4287,7 @@ type
|
|||||||
begin
|
begin
|
||||||
found:=2;
|
found:=2;
|
||||||
inc_comment_level;
|
inc_comment_level;
|
||||||
aktcommentstyle:=comment_oldtp;
|
current_commentstyle:=comment_oldtp;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
@ -4303,7 +4303,7 @@ type
|
|||||||
end;
|
end;
|
||||||
'/' :
|
'/' :
|
||||||
begin
|
begin
|
||||||
if (aktcommentstyle=comment_none) then
|
if (current_commentstyle=comment_none) then
|
||||||
begin
|
begin
|
||||||
readchar;
|
readchar;
|
||||||
if c='/' then
|
if c='/' then
|
||||||
@ -4330,7 +4330,7 @@ type
|
|||||||
|
|
||||||
procedure tscannerfile.skipcomment;
|
procedure tscannerfile.skipcomment;
|
||||||
begin
|
begin
|
||||||
aktcommentstyle:=comment_tp;
|
current_commentstyle:=comment_tp;
|
||||||
readchar;
|
readchar;
|
||||||
inc_comment_level;
|
inc_comment_level;
|
||||||
{ handle compiler switches }
|
{ handle compiler switches }
|
||||||
@ -4356,13 +4356,13 @@ type
|
|||||||
end;
|
end;
|
||||||
readchar;
|
readchar;
|
||||||
end;
|
end;
|
||||||
aktcommentstyle:=comment_none;
|
current_commentstyle:=comment_none;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure tscannerfile.skipdelphicomment;
|
procedure tscannerfile.skipdelphicomment;
|
||||||
begin
|
begin
|
||||||
aktcommentstyle:=comment_delphi;
|
current_commentstyle:=comment_delphi;
|
||||||
inc_comment_level;
|
inc_comment_level;
|
||||||
readchar;
|
readchar;
|
||||||
{ this is not supported }
|
{ this is not supported }
|
||||||
@ -4372,7 +4372,7 @@ type
|
|||||||
while not (c in [#10,#13,#26]) do
|
while not (c in [#10,#13,#26]) do
|
||||||
readchar;
|
readchar;
|
||||||
dec_comment_level;
|
dec_comment_level;
|
||||||
aktcommentstyle:=comment_none;
|
current_commentstyle:=comment_none;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -4380,7 +4380,7 @@ type
|
|||||||
var
|
var
|
||||||
found : longint;
|
found : longint;
|
||||||
begin
|
begin
|
||||||
aktcommentstyle:=comment_oldtp;
|
current_commentstyle:=comment_oldtp;
|
||||||
inc_comment_level;
|
inc_comment_level;
|
||||||
{ only load a char if last already processed,
|
{ only load a char if last already processed,
|
||||||
was cause of bug1634 PM }
|
was cause of bug1634 PM }
|
||||||
@ -4445,7 +4445,7 @@ type
|
|||||||
readchar;
|
readchar;
|
||||||
until (found=2);
|
until (found=2);
|
||||||
end;
|
end;
|
||||||
aktcommentstyle:=comment_none;
|
current_commentstyle:=comment_none;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user