summaryrefslogtreecommitdiff
path: root/lex/output.ml
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>1997-03-10 13:57:06 +0000
committerXavier Leroy <xavier.leroy@inria.fr>1997-03-10 13:57:06 +0000
commit0954f07be71668d9bbd2612f8eddcc3e64e84150 (patch)
tree05cc23d85b71949124875a1ad0fe20abae5d0b02 /lex/output.ml
parent1002bcd11972414751fc27b2015475b4e61a1a76 (diff)
downloadocaml-0954f07be71668d9bbd2612f8eddcc3e64e84150.tar.gz
Lexing: ne pas sauver l'etat courant dans le lexbuf pendant un refill,
mais le repasser explicitement en resultat/argument de lex_engine. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1362 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'lex/output.ml')
-rw-r--r--lex/output.ml9
1 files changed, 5 insertions, 4 deletions
diff --git a/lex/output.ml b/lex/output.ml
index 78e23b4138..c5426905b5 100644
--- a/lex/output.ml
+++ b/lex/output.ml
@@ -74,9 +74,10 @@ let output_tables oc tbl =
(* Output the entries *)
let output_entry ic oc e =
- fprintf oc "%s lexbuf =\n" e.auto_name;
- fprintf oc " match Lexing.engine lex_tables %d lexbuf with\n "
- e.auto_initial_state;
+ fprintf oc "%s lexbuf = %s_rec lexbuf %d\n"
+ e.auto_name e.auto_name e.auto_initial_state;
+ fprintf oc "and %s_rec lexbuf state =\n" e.auto_name;
+ fprintf oc " match Lexing.engine lex_tables state lexbuf with\n ";
let first = ref true in
List.iter
(fun (num, loc) ->
@@ -85,7 +86,7 @@ let output_entry ic oc e =
copy_chunk ic oc loc;
fprintf oc ")\n")
e.auto_actions;
- fprintf oc " | _ -> lexbuf.Lexing.refill_buff lexbuf; %s lexbuf\n\n"
+ fprintf oc " | n -> lexbuf.Lexing.refill_buff lexbuf; %s_rec lexbuf n\n\n"
e.auto_name
(* Main output function *)