mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-13 10:39:39 +02:00
* changed yywrap into a procedure variable so it can be overriden
git-svn-id: trunk@10498 -
This commit is contained in:
parent
5cc0477dfa
commit
989f5eb367
@ -115,7 +115,10 @@ procedure start ( state : Integer );
|
||||
file. In particular, yywrap may arrange for more input and return false
|
||||
in which case the yylex routine resumes lexical analysis. *)
|
||||
|
||||
function yywrap : Boolean;
|
||||
type
|
||||
yywrap_t = function (): Boolean;
|
||||
var
|
||||
yywrap: yywrap_t;
|
||||
(* The default yywrap routine supplied here closes input and output files
|
||||
and returns true (causing yylex to terminate). *)
|
||||
|
||||
@ -305,10 +308,11 @@ procedure start ( state : Integer );
|
||||
|
||||
(* yywrap: *)
|
||||
|
||||
function yywrap : Boolean;
|
||||
function lexlib_yywrap : Boolean;
|
||||
begin
|
||||
close(yyinput); close(yyoutput);
|
||||
yywrap := true;
|
||||
close(yyinput);
|
||||
close(yyoutput);
|
||||
lexlib_yywrap := true;
|
||||
end(*yywrap*);
|
||||
|
||||
(* Internal routines: *)
|
||||
@ -401,6 +405,7 @@ procedure yyclear;
|
||||
end(*yyclear*);
|
||||
|
||||
begin
|
||||
yywrap := @lexlib_yywrap;
|
||||
assign(yyinput, '');
|
||||
assign(yyoutput, '');
|
||||
reset(yyinput);
|
||||
|
@ -5924,7 +5924,7 @@ action:
|
||||
yyaction(yyrule);
|
||||
if yyreject then goto action;
|
||||
end
|
||||
else if not yydefault and yywrap then
|
||||
else if not yydefault and yywrap() then
|
||||
begin
|
||||
yyclear;
|
||||
return(0);
|
||||
|
@ -66,7 +66,7 @@ action:
|
||||
yyaction(yyrule);
|
||||
if yyreject then goto action;
|
||||
end
|
||||
else if not yydefault and yywrap then
|
||||
else if not yydefault and yywrap() then
|
||||
begin
|
||||
yyclear;
|
||||
return(0);
|
||||
|
@ -117,7 +117,10 @@ procedure start ( state : Integer );
|
||||
file. In particular, yywrap may arrange for more input and return false
|
||||
in which case the yylex routine resumes lexical analysis. *)
|
||||
|
||||
function yywrap : Boolean;
|
||||
type
|
||||
yywrap_t = function (): Boolean;
|
||||
var
|
||||
yywrap: yywrap_t;
|
||||
(* The default yywrap routine supplied here closes input and output files
|
||||
and returns true (causing yylex to terminate). *)
|
||||
|
||||
@ -305,10 +308,11 @@ procedure start ( state : Integer );
|
||||
|
||||
(* yywrap: *)
|
||||
|
||||
function yywrap : Boolean;
|
||||
function lexlib_yywrap : Boolean;
|
||||
begin
|
||||
close(yyinput); close(yyoutput);
|
||||
yywrap := true;
|
||||
close(yyinput);
|
||||
close(yyoutput);
|
||||
lexlib_yywrap := true;
|
||||
end(*yywrap*);
|
||||
|
||||
(* Internal routines: *)
|
||||
@ -401,6 +405,7 @@ procedure yyclear;
|
||||
end(*yyclear*);
|
||||
|
||||
begin
|
||||
yywrap := @lexlib_yywrap;
|
||||
assign(yyinput, '');
|
||||
assign(yyoutput, '');
|
||||
reset(yyinput); rewrite(yyoutput);
|
||||
|
@ -66,7 +66,7 @@ action:
|
||||
yyaction(yyrule);
|
||||
if yyreject then goto action;
|
||||
end
|
||||
else if not yydefault and yywrap then
|
||||
else if not yydefault and yywrap() then
|
||||
begin
|
||||
yyclear;
|
||||
return(0);
|
||||
|
Loading…
Reference in New Issue
Block a user