Attention une mise à jour du service Gitlab va être effectuée le mardi 30 novembre entre 17h30 et 18h00. Cette mise à jour va générer une interruption du service dont nous ne maîtrisons pas complètement la durée mais qui ne devrait pas excéder quelques minutes. Cette mise à jour intermédiaire en version 14.0.12 nous permettra de rapidement pouvoir mettre à votre disposition une version plus récente.

Commit 15021b8a authored by POTTIER Francois's avatar POTTIER Francois
Browse files

Comments.

parent 3389a4f3
......@@ -29,13 +29,19 @@ module PreliminaryMake (X : sig
val f: channel
(* This controls the way we print OCaml stretches (types and
semantic actions). We either surround them with #line directives
(for better error reports if the generated code is ill - typed) or
don't (for better readability). The value is either [None] -- do
not provide #line directives -- or [Some filename] -- do provide
them. [filename] is the name of the file that is being written
to. *)
(* [locate_stretches] controls the way we print OCaml stretches (types and
semantic actions). If it is [Some filename], then we surround them with
OCaml line number directives of the form # <line number> <filename>. If
it is [None], then we don't. *)
(* Providing line number directives allows the OCaml typechecker to report
type errors in the .mly file, instead of in the generated .ml / .mli
files. Line number directives also affect the dynamic semantics of any
[assert] statements contained in semantic actions: when they are provided,
the [Assert_failure] exception carries a location in the .mly file. As a
general rule of thumb, line number directives should always be provided,
except perhaps where we think that they decrease readability (e.g., in a
generated .mli file). *)
val locate_stretches: string option
......@@ -87,7 +93,7 @@ let indent ofs producer f x =
producer f x;
indentation := old_indentation
(* This produces a #line directive. *)
(* This produces a line number directive. *)
let sharp f line file =
fprintf f "%t# %d \"%s\"%t" rawnl line file rawnl
......
......@@ -19,12 +19,19 @@ module Make (X : sig
val f: out_channel
(* This controls the way we print OCaml stretches (types and
semantic actions). We either surround them with #line directives
(for better error reports if the generated code is ill-typed) or
don't (for better readability). The value is either [None] -- do
not provide #line directives -- or [Some filename] -- do provide
them. [filename] is the name of the file that is being written. *)
(* [locate_stretches] controls the way we print OCaml stretches (types and
semantic actions). If it is [Some filename], then we surround them with
OCaml line number directives of the form # <line number> <filename>. If
it is [None], then we don't. *)
(* Providing line number directives allows the OCaml typechecker to report
type errors in the .mly file, instead of in the generated .ml / .mli
files. Line number directives also affect the dynamic semantics of any
[assert] statements contained in semantic actions: when they are provided,
the [Assert_failure] exception carries a location in the .mly file. As a
general rule of thumb, line number directives should always be provided,
except perhaps where we think that they decrease readability (e.g., in a
generated .mli file). *)
val locate_stretches: string option
......@@ -39,7 +46,7 @@ end) : sig
end
(* Common instantiations. In the following two functions, [locate_stretches]
is [None], so no #line directives are printed. *)
is [None], so no line number directives are printed. *)
val print_expr: out_channel -> IL.expr -> unit
val string_of_expr: IL.expr -> string
......@@ -13,7 +13,7 @@
(* A stretch is a fragment of a source file. It holds the file name,
the line number, and the line count (that is, the length) of the
fragment. These are used for generating #line directives when the
fragment. These are used to generate line number directives when the
fragment is copied to an output file. It also holds the textual
content of the fragment, as a string. The [raw_content] field holds
the text that was found in the source file, while the [content]
......@@ -36,4 +36,3 @@ type t = {
type ocamltype =
| Declared of t
| Inferred of string
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment