diff options
author | Damien Doligez <damien.doligez-inria.fr> | 1999-10-15 18:37:55 +0000 |
---|---|---|
committer | Damien Doligez <damien.doligez-inria.fr> | 1999-10-15 18:37:55 +0000 |
commit | 62dcdbce7cb69bea639ff581c6d2990257d91f86 (patch) | |
tree | e80da46cb677df654346481ed99003aa6cd235ed /lex/output.ml | |
parent | 7a4d450b0f417fd5ba71bdabe85c2a064b5017dc (diff) | |
download | ocaml-62dcdbce7cb69bea639ff581c6d2990257d91f86.tar.gz |
Ajout de ";;" a la fin de l'output pour qu'on puisse mettre une expression
dans le postlude.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2438 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'lex/output.ml')
-rw-r--r-- | lex/output.ml | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lex/output.ml b/lex/output.ml index c272f776a9..7775282db1 100644 --- a/lex/output.ml +++ b/lex/output.ml @@ -5,7 +5,7 @@ (* Xavier Leroy, projet Cristal, INRIA Rocquencourt *) (* *) (* Copyright 1996 Institut National de Recherche en Informatique et *) -(* Automatique. Distributed only by permission. *) +(* en Automatique. Distributed only by permission. *) (* *) (***********************************************************************) @@ -80,9 +80,9 @@ let output_tables oc tbl = (* Output the entries *) let output_entry sourcefile ic oc e = - fprintf oc "%s lexbuf = %s_rec lexbuf %d\n" + fprintf oc "%s lexbuf = __ocaml_lex_%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 "and __ocaml_lex_%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 @@ -92,7 +92,8 @@ let output_entry sourcefile ic oc e = copy_chunk sourcefile ic oc loc; fprintf oc ")\n") e.auto_actions; - fprintf oc " | n -> lexbuf.Lexing.refill_buff lexbuf; %s_rec lexbuf n\n\n" + fprintf oc " | n -> lexbuf.Lexing.refill_buff lexbuf; \ + __ocaml_lex_%s_rec lexbuf n\n\n" e.auto_name (* Main output function *) @@ -116,6 +117,7 @@ let output_lexdef sourcefile ic oc header tables entry_points trailer = output_string oc "let rec "; output_entry sourcefile ic oc entry1; List.iter (fun e -> output_string oc "and "; output_entry sourcefile ic oc e) - entries + entries; + output_string oc ";;\n\n"; end; copy_chunk sourcefile ic oc trailer |