* more fixes for skipuntildirective

This commit is contained in:
peter 2004-02-29 13:28:57 +00:00
parent 401d1891ae
commit 1dd1cfe20a

View File

@ -1857,15 +1857,11 @@ implementation
procedure tscannerfile.skipuntildirective; procedure tscannerfile.skipuntildirective;
var var
incomment : boolean;
found : longint; found : longint;
next_char_loaded : boolean; next_char_loaded : boolean;
oldcommentstyle : tcommentstyle;
begin begin
found:=0; found:=0;
next_char_loaded:=false; next_char_loaded:=false;
incomment:=true;
oldcommentstyle:=aktcommentstyle;
repeat repeat
case c of case c of
#10, #10,
@ -1880,29 +1876,24 @@ implementation
end; end;
'{' : '{' :
begin begin
if (not incomment) or if (aktcommentstyle in [comment_tp,comment_none]) then
(aktcommentstyle=comment_tp) then begin
begin aktcommentstyle:=comment_tp;
if (comment_level=0) then if (comment_level=0) then
begin found:=1;
found:=1;
aktcommentstyle:=comment_tp;
end;
inc_comment_level; inc_comment_level;
incomment:=true; end;
end;
end; end;
'*' : '*' :
begin begin
if incomment and if (aktcommentstyle=comment_oldtp) then
(aktcommentstyle=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;
incomment:=false; aktcommentstyle:=comment_none;
end end
else else
next_char_loaded:=true; next_char_loaded:=true;
@ -1912,13 +1903,13 @@ implementation
end; end;
'}' : '}' :
begin begin
if incomment and if (aktcommentstyle=comment_tp) then
(aktcommentstyle=comment_tp) then begin
begin
dec_comment_level; dec_comment_level;
if (comment_level=0) then
aktcommentstyle:=comment_none;
found:=0; found:=0;
incomment:=false; end;
end;
end; end;
'$' : '$' :
begin begin
@ -1926,7 +1917,7 @@ implementation
found:=2; found:=2;
end; end;
'''' : '''' :
if not incomment then if (aktcommentstyle=comment_none) then
begin begin
repeat repeat
readchar; readchar;
@ -1949,7 +1940,7 @@ implementation
end; end;
'(' : '(' :
begin begin
if not incomment then if (aktcommentstyle=comment_none) then
begin begin
readchar; readchar;
if c='*' then if c='*' then
@ -1964,24 +1955,22 @@ implementation
else else
begin begin
skipoldtpcomment; skipoldtpcomment;
aktcommentstyle:=oldcommentstyle; next_char_loaded:=true;
end; end;
end; end
next_char_loaded:=true; else
next_char_loaded:=true;
end end
else else
found:=0; found:=0;
end; end;
'/' : '/' :
begin begin
if not incomment then if (aktcommentstyle=comment_none) then
begin begin
readchar; readchar;
if c='/' then if c='/' then
begin skipdelphicomment;
skipdelphicomment;
aktcommentstyle:=oldcommentstyle;
end;
next_char_loaded:=true; next_char_loaded:=true;
end end
else else
@ -2988,7 +2977,10 @@ exit_label:
end. end.
{ {
$Log$ $Log$
Revision 1.73 2004-02-27 11:50:13 michael Revision 1.74 2004-02-29 13:28:57 peter
* more fixes for skipuntildirective
Revision 1.73 2004/02/27 11:50:13 michael
+ Patch from peter to fix webtb[fs]/tw2853*.pp + Patch from peter to fix webtb[fs]/tw2853*.pp
Revision 1.72 2004/02/26 16:15:45 peter Revision 1.72 2004/02/26 16:15:45 peter