@@ -143,16 +143,41 @@ external ( or ) : bool -> bool -> bool = "%sequor"
143
143
(* * {6 Debugging} *)
144
144
145
145
external __LOC__ : string = " %loc_LOC"
146
+ (* * [__LOC__] returns the location at which this expression appears in
147
+ the file currently being parsed by the compiler, with the standard
148
+ error format of OCaml: "File %S, line %d, characters %d-%d" *)
146
149
external __FILE__ : string = " %loc_FILE"
150
+ (* * [__FILE__] returns the name of the file currently being
151
+ parsed by the compiler. *)
147
152
external __LINE__ : int = " %loc_LINE"
153
+ (* * [__LINE__] returns the line number at which this expression
154
+ appears in the file currently being parsed by the compiler. *)
148
155
external __MODULE__ : string = " %loc_MODULE"
156
+ (* * [__MODULE__] returns the module name of the file being
157
+ parsed by the compiler. *)
149
158
external __POS__ : string * int * int * int = " %loc_POS"
159
+ (* * [__POS__] returns a tuple [(file,lnum,cnum,enum)], corresponding
160
+ to the location at which this expression appears in the file
161
+ currently being parsed by the compiler. [file] is the current
162
+ filename, [lnum] the line number, [cnum] the character position in
163
+ the line and [enum] the last character position in the line. *)
150
164
151
165
external __LOC_OF__ : 'a -> string * 'a = " %loc_LOC"
152
- external __FILE_OF__ : 'a -> string * 'a = " %loc_FILE"
166
+ (* * [__LOC_OF__ expr] returns a pair [(loc, expr)] where [loc] is the
167
+ location of [expr] in the file currently being parsed by the
168
+ compiler, with the standard error format of OCaml: "File %S, line
169
+ %d, characters %d-%d" *)
153
170
external __LINE_OF__ : 'a -> int * 'a = " %loc_LINE"
154
- external __MODULE_OF__ : 'a -> string * 'a = " %loc_MODULE"
171
+ (* * [__LINE__ expr] returns a pair [(line, expr)], where [line] is the
172
+ line number at which the expression [expr] appears in the file
173
+ currently being parsed by the compiler. *)
155
174
external __POS_OF__ : 'a -> (string * int * int * int ) * 'a = " %loc_POS"
175
+ (* * [__POS_OF__ expr] returns a pair [(expr,loc)], where [loc] is a
176
+ tuple [(file,lnum,cnum,enum)] corresponding to the location at
177
+ which the expression [expr] appears in the file currently being
178
+ parsed by the compiler. [file] is the current filename, [lnum] the
179
+ line number, [cnum] the character position in the line and [enum]
180
+ the last character position in the line. *)
156
181
157
182
(* * {6 Composition operators} *)
158
183
0 commit comments