summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralainfrisch <alain@frisch.fr>2018-02-05 19:31:46 +0100
committeralainfrisch <alain@frisch.fr>2018-02-05 19:48:49 +0100
commitc5f30afb0426de4093454e0e1229a5f92826d770 (patch)
tree2abdf2724a6e19af67316126d077c79aeda4f7a4
parentefb4916a5c1dc4ffb0d729cbd50387ae59b356a4 (diff)
downloadocaml-fix_ocamllex.tar.gz
Fix bug introduced in #1585.fix_ocamllex
-rw-r--r--lex/outputbis.ml10
1 files changed, 5 insertions, 5 deletions
diff --git a/lex/outputbis.ml b/lex/outputbis.ml
index 7f5a0a515d..37ff25b008 100644
--- a/lex/outputbis.ml
+++ b/lex/outputbis.ml
@@ -260,7 +260,7 @@ let output_automata ctx auto inline =
(* Output the entries *)
-let output_init ctx pref e =
+let output_init ctx pref e init_moves =
if e.auto_mem_size > 0 then
pr ctx "%slexbuf.Lexing.lex_mem <- Array.make %d (-1);\n"
pref e.auto_mem_size;
@@ -269,7 +269,8 @@ let output_init ctx pref e =
pr ctx "%slet _len = lexbuf.Lexing.lex_buffer_len in\n" pref;
pr ctx "%slet _buf = lexbuf.Lexing.lex_buffer in\n" pref;
pr ctx "%slet _last_action = -1 in\n" pref;
- pr ctx "%slexbuf.Lexing.lex_start_pos <- _curr;\n" pref
+ pr ctx "%slexbuf.Lexing.lex_start_pos <- _curr;\n" pref;
+ output_memory_actions pref ctx.oc init_moves
let output_rules ic ctx pref tr e =
pr ctx "%sbegin\n" pref;
@@ -294,17 +295,16 @@ let output_rules ic ctx pref tr e =
let output_entry ic ctx tr e =
let init_num, init_moves = e.auto_initial_state in
pr ctx "%s %alexbuf =\n" e.auto_name output_args e.auto_args;
- output_memory_actions " " ctx.oc init_moves;
if ctx.has_refill then begin
pr ctx " let k lexbuf __ocaml_lex_result =\n";
output_rules ic ctx " " tr e;
pr ctx " in\n";
- output_init ctx " " e;
+ output_init ctx " " e init_moves;
ctx.goto_state ctx " " init_num
end else begin
pr ctx " let __ocaml_lex_result =\n";
- output_init ctx " " e;
+ output_init ctx " " e init_moves;
ctx.goto_state ctx " " init_num;
pr ctx " in\n";
output_rules ic ctx " " tr e