+Objective Caml 3.10.1:
+----------------------
+
+Bug fixes:
+- PR#3830 small bugs in docs
+- PR#4053 compilers: improved compilation time for large variant types
+- PR#4174 ocamlopt: fixed ocamlopt -nopervasives
+- PR#4199 otherlibs: documented a small problem in Unix.utimes
+- PR#4280 camlp4: parsing of identifier (^)
+- PR#4281 camlp4: parsing of type constraint
+- PR#4285 runtime: cannot compile under AIX
+- PR#4286 ocamlbuild: cannot compile under AIX and SunOS
+- PR#4288 compilers: including a functor application with side effects
+- PR#4295 camlp4 toplevel: synchronization after an error
+- PR#4300 ocamlopt: crash with backtrace and illegal array access
+- PR#4302 camlp4: list comprehension parsing problem
+- PR#4304 ocamlbuild: handle -I correctly
+- PR#4305 stdlib: alignment of Arg.Symbol
+- PR#4307 camlp4: assertion failure
+- PR#4312 camlp4: accept "let _ : int = 1"
+- PR#4313 ocamlbuild: -log and missing directories
+- PR#4315 camlp4: constraints in classes
+- PR#4316 compilers: crash with recursive modules and Lazy
+- PR#4318 ocamldoc: installation problem with Cygwin (tentative fix)
+- PR#4322 ocamlopt: stack overflow under Windows
+- PR#4325 compilers: wrong error message for unused var
+- PR#4326 otherlibs: marshal Big_int on win64
+- PR#4327 ocamlbuild: make emacs look for .annot in _build directory
+- PR#4328 camlp4: stack overflow with nil nodes
+- PR#4331 camlp4: guards on fun expressions
+- PR#4332 camlp4: parsing of negative 32/64 bit numbers
+- PR#4336 compilers: unsafe recursive modules
+- PR#4337 (note) camlp4: invalid character escapes
+- PR#4339 ocamlopt: problems on HP-UX (tentative fix)
+- PR#4340 camlp4: wrong pretty-printing of optional arguments
+- PR#4348 ocamlopt: crash on Mac Intel
+- PR#4349 camlp4: bug in private type definitions
+- PR#4350 compilers: type errors with records and polymorphic variants
+- PR#4352 compilers: terminal recursion under Windows (tentative fix)
+- PR#4354 ocamlcp: mismatch with ocaml on polymorphic let
+- PR#4358 ocamlopt: float constants wrong on ARM
+- PR#4360 ocamldoc: string inside comment
+- PR#4365 toplevel: wrong pretty-printing of polymorphic variants
+- PR#4373 otherlibs: leaks in win32unix
+- PR#4374 otherlibs: threads module not initialized
+- PR#4375 configure: fails to build on bytecode-only architectures
+- PR#4377 runtime: finalisation of infix pointers
+- PR#4378 ocamlbuild: typo in plugin.ml
+- PR#4379 ocamlbuild: problem with plugins under Windows
+- PR#4382 compilers: typing of polymorphic record fields
+- PR#4383 compilers: including module with private type
+- PR#4385 stdlib: Int32/Int64.format are unsafe
+- PR#4386 otherlibs: wrong signal numbers with Unix.sigprocmask etc.
+- PR#4387 ocamlbuild: build directory not used properly
+- PR#4392 ocamldep: optional argument of class
+- PR#4394 otherlibs: infinite loops in Str
+- PR#4397 otherlibs: wrong size for flag arrays in win32unix
+- PR#4402 ocamldebug: doesn't work with -rectypes
+- PR#4410 ocamlbuild: problem with plugin and -build
+- PR#4411 otherlibs: crash with Unix.access under Windows
+- PR#4412 stdlib: marshalling broken on 64 bit architectures
+- PR#4413 ocamlopt: crash on AMD64 with out-of-bound access and reraise
+- PR#4417 camlp4: pretty-printing of unary minus
+- PR#4419 camlp4: problem with constraint in type class
+- PR#4426 compilers: problem with optional labels
+- PR#4427 camlp4: wrong pretty-printing of lists of functions
+- PR#4433 ocamlopt: fails to build on MacOSX 10.5
+- PR#4435 compilers: crash with objects
+- PR#4439 fails to build on MacOSX 10.5
+- PR#4441 crash when build on sparc64 linux
+- PR#4442 stdlib: crash with weak pointers
+- PR#4446 configure: fails to detect X11 on MacOSX 10.5
+- PR#4448 runtime: huge page table on 64-bit architectures
+- PR#4450 compilers: stack overflow with recursive modules
+- PR#4470 compilers: type-checking of recursive modules too restrictive
+- PR#4472 configure: autodetection of libX11.so on Fedora x86_64
+- printf: removed (partially implemented) positional specifications
+- polymorphic < and <= comparisons: some C compiler optimizations
+ were causing incorrect results when arguments are incomparable
+
+New features:
+- made configure script work on PlayStation 3
+- ARM port: brought up-to-date for Debian 4.0 (Etch)
+- many other small changes and bugfixes in camlp4, ocamlbuild, labltk,
+ emacs files,
+
Objective Caml 3.10.0:
----------------------
* First public release.
-$Id: Changes,v 1.168.2.3 2007/03/06 15:38:21 xleroy Exp $
+$Id: Changes,v 1.168.2.7 2008/01/04 13:27:04 doligez Exp $
# #
#########################################################################
-# $Id: Makefile,v 1.207.4.4 2007/04/16 16:01:59 pouillar Exp $
+# $Id: Makefile,v 1.207.4.5 2007/06/20 13:26:29 ertai Exp $
# The main Makefile
# Compile the native-code compiler
opt-core:runtimeopt ocamlopt libraryopt
-opt: runtimeopt ocamlopt libraryopt otherlibrariesopt
+opt: runtimeopt ocamlopt libraryopt otherlibrariesopt ocamlbuildlib.native
# Native-code versions of the tools
opt.opt: checkstack runtime core ocaml opt-core ocamlc.opt otherlibraries \
./build/ocamlbuild-byte-only.sh
ocamlbuild.native: ocamlopt otherlibrariesopt ocamlbuild-partial-boot
./build/ocamlbuild-native-only.sh
+ocamlbuildlib.native: ocamlopt otherlibrariesopt ocamlbuild-partial-boot
+ ./build/ocamlbuildlib-native-only.sh
.PHONY: ocamlbuild-partial-boot
ocamlbuild-partial-boot:
# #
#########################################################################
-# $Id: Makefile.nt,v 1.102.4.3 2007/04/16 16:01:59 pouillar Exp $
+# $Id: Makefile.nt,v 1.102.4.4 2007/06/20 13:26:29 ertai Exp $
# The main Makefile
rm -rf boot/Saved/Saved.prev/*
# Compile the native-code compiler
-opt: runtimeopt ocamlopt libraryopt otherlibrariesopt
+opt: runtimeopt ocamlopt libraryopt otherlibrariesopt ocamlbuildlib.native
# Native-code versions of the tools
opt.opt: ocamlc.opt ocamlopt.opt ocamllex.opt ocamltoolsopt.opt \
./build/ocamlbuild-byte-only.sh
ocamlbuild.native: ocamlopt otherlibrariesopt ocamlbuild-partial-boot
./build/ocamlbuild-native-only.sh
+ocamlbuildlib.native: ocamlopt otherlibrariesopt ocamlbuild-partial-boot
+ ./build/ocamlbuildlib-native-only.sh
+
.PHONY: ocamlbuild-partial-boot
ocamlbuild-partial-boot:
the Microsoft Windows Server 2003 SP1 Platform SDK, which can
be downloaded for free from http://www.microsoft.com/.
-[3] MASM version 6.11 or later. MASM can be
- downloaded for free from Microsoft's Web site; for directions, see
+[3] MASM version 6.11 or later. The full distribution of Visual C++ 2005
+ contains MASM version 8. Users of the Express Edition of Visual C++
+ 2005 can download MASM version 8 from
+http://www.microsoft.com/downloads/details.aspx?FamilyID=7A1C9DA0-0510-44A2-B042-7EF370530C64&displaylang=en
+ To obtain MASM version 6.11, see
http://users.easystreet.com/jkirwan/new/pctools.html.
[4] TCL/TK version 8.4. Windows binaries are available as part of the
for Windows.
You will need the following software components to perform the recompilation:
-- Windows NT, 2000, or XP.
+- Windows NT, 2000, XP, or Vista.
- Items [1], [2], [3] and [4] from the list of recommended software above.
- The Cygwin port of GNU tools, available from http://www.cygwin.com/
make -f Makefile.nt opt.opt
make -f Makefile.nt install
-Alternatively you can use the experimental build procdure using ocamlbuild:
+Alternatively you can use the experimental build procedure using ocamlbuild:
./build/fastworld.sh
./build/install.sh
RECOMPILATION FROM THE SOURCES:
You will need the following software components to perform the recompilation:
-- Windows NT, 2000, or XP.
+- Windows NT, 2000, XP, or Vista.
- Cygwin: http://sourceware.cygnus.com/cygwin/
- TCL/TK version 8.4 (see above).
-3.10.0
+3.10.1
# The version string is the first line of this file.
# It must be in the format described in stdlib/sys.mli
-# $Id: VERSION,v 1.2.2.4 2007/05/13 15:13:25 xleroy Exp $
+# $Id: VERSION,v 1.2.2.11 2008/01/11 11:17:21 doligez Exp $
# By default everything we link needs the stdlib
true: use_stdlib
-# The stdlib don't require the stdlib
-<stdlib/**>: -use_stdlib
+# The stdlib neither requires the stdlib nor debug information
+<stdlib/**>: -use_stdlib, -debug
<**/*.ml*>: warn_Alez
"ocamldoc/odoc_opt.native": use_unix, use_str
<camlp4/**/*.ml*>: camlp4boot, -warn_Alez, warn_Ale
-<camlp4/Camlp4_config.ml*>: -camlp4boot
+<camlp4/Camlp4_{config,import}.ml*>: -camlp4boot
+"camlp4/Camlp4_import.ml": -warn_Ale
<camlp4/build/*> or <camlp4/boot/*> or "camlp4/Camlp4/Struct/Lexer.ml": -camlp4boot, -warn_Ale, warn_a
"camlp4/Camlp4Bin.byte" or "camlp4/mkcamlp4.byte" or "camlp4/camlp4lib.cma": use_dynlink
"camlp4/Camlp4/Printers/OCaml.ml" or "camlp4/Camlp4/Printers/OCamlr.ml": warn_Alezv
(* *)
(***********************************************************************)
-(* $Id: emit.mlp,v 1.13 2007/01/29 12:10:50 xleroy Exp $ *)
+(* $Id: emit.mlp,v 1.13.4.2 2007/10/23 09:09:43 xleroy Exp $ *)
(* Emission of x86-64 (AMD 64) assembly code *)
let emit_call_bound_errors () =
List.iter emit_call_bound_error !bound_error_sites;
if !bound_error_call > 0 then
- `{emit_label !bound_error_call}: jmp {emit_symbol "caml_ml_array_bound_error"}\n`
+ `{emit_label !bound_error_call}: call {emit_symbol "caml_ml_array_bound_error"}\n`
(* Names for instructions *)
| Lswitch jumptbl ->
let lbl = new_label() in
if !pic_code then begin
- ` leaq {emit_label lbl}(%rip), %r11\n`;
- ` jmp *(%r11, {emit_reg i.arg.(0)}, 8)\n`
+ (* PR#4424: r11 is known to be clobbered by the Lswitch,
+ meaning that no variable that is live across the Lswitch
+ is assigned to r11. However, the argument to Lswitch
+ can still be assigned to r11, so we need to special-case
+ this situation. *)
+ if i.arg.(0).loc = Reg 9 (* ie r11, cf amd64/proc.ml *) then begin
+ ` salq $3, %r11\n`;
+ ` pushq %r11\n`;
+ ` leaq {emit_label lbl}(%rip), %r11\n`;
+ ` addq 0(%rsp), %r11\n`;
+ ` addq $8, %rsp\n`;
+ ` jmp *(%r11)\n`
+ end else begin
+ ` leaq {emit_label lbl}(%rip), %r11\n`;
+ ` jmp *(%r11, {emit_reg i.arg.(0)}, 8)\n`
+ end
end else begin
` jmp *{emit_label lbl}(, {emit_reg i.arg.(0)}, 8)\n`
end;
(* *)
(***********************************************************************)
-(* $Id: emit_nt.mlp,v 1.6 2007/03/01 10:26:51 xleroy Exp $ *)
+(* $Id: emit_nt.mlp,v 1.6.2.1 2007/10/09 14:03:01 xleroy Exp $ *)
(* Emission of x86-64 (AMD 64) assembly code, MASM syntax *)
let emit_call_bound_errors () =
List.iter emit_call_bound_error !bound_error_sites;
if !bound_error_call > 0 then
- `{emit_label !bound_error_call}: jmp caml_ml_array_bound_error\n`
+ `{emit_label !bound_error_call}: call caml_ml_array_bound_error\n`
(* Names for instructions *)
(* *)
(***********************************************************************)
-(* $Id: emit.mlp,v 1.18 2004/05/03 12:46:50 xleroy Exp $ *)
+(* $Id: emit.mlp,v 1.18.18.1 2007/10/23 11:54:04 xleroy Exp $ *)
(* Emission of ARM assembly code *)
`trap_ptr .req r11\n`;
`alloc_ptr .req r8\n`;
`alloc_limit .req r9\n`;
- `sp .req r13\n`;
- `lr .req r14\n`;
- `pc .req r15\n`;
let lbl_begin = Compilenv.make_symbol (Some "data_begin") in
` .data\n`;
` .global {emit_symbol lbl_begin}\n`;
(* *)
(***********************************************************************)
-(* $Id: selection.ml,v 1.6 2001/03/30 12:22:32 xleroy Exp $ *)
+(* $Id: selection.ml,v 1.6.36.1 2007/10/23 11:53:24 xleroy Exp $ *)
(* Instruction selection for the ARM processor *)
| _ ->
(Iextcall("__modsi3", false), args)
end
- | Ccheckbound ->
+ | Ccheckbound _ ->
begin match args with
[Cop(Clsr, [arg1; Cconst_int n]); arg2]
when n > 0 && n < 32 && not(is_intconst arg2) ->
end
| _ -> super#select_operation op args
-(* In mul rd, rm, rs, rm and rd must be different.
+(* In mul rd, rm, rs, the registers rm and rd must be different.
We deal with this by pretending that rm is also a result of the mul
operation. *)
-method insert_op op rs rd =
+method insert_op_debug op dbg rs rd =
if op = Iintop(Imul) then begin
- self#insert (Iop op) rs [| rd.(0); rs.(0) |]; rd
+ self#insert_debug (Iop op) dbg rs [| rd.(0); rs.(0) |]; rd
end else
- super#insert_op op rs rd
+ super#insert_op_debug op dbg rs rd
end
(* *)
(***********************************************************************)
-(* $Id: asmlink.ml,v 1.70 2007/02/15 18:35:20 frisch Exp $ *)
+(* $Id: asmlink.ml,v 1.70.2.1 2007/11/10 12:23:37 xleroy Exp $ *)
(* Link a set of .cmx/.o files and produce an executable *)
else "libasmrun" ^ ext_lib in
let runtime_lib =
try
- if !Clflags.nopervasives then ""
- else find_in_path !load_path libname
+ if !Clflags.nopervasives then None
+ else Some(find_in_path !load_path libname)
with Not_found ->
raise(Error(File_not_found libname)) in
let c_lib =
(List.map (fun dir -> if dir = "" then "" else "-L" ^ dir)
!load_path))
(Ccomp.quote_files (List.rev !Clflags.ccobjs))
- (Filename.quote runtime_lib)
+ (Ccomp.quote_optfile runtime_lib)
c_lib
else
Printf.sprintf "%s -o %s %s %s"
(Ccomp.quote_files (List.rev file_list))
(Ccomp.quote_files
(List.rev_map Ccomp.expand_libname !Clflags.ccobjs))
- (Filename.quote runtime_lib)
+ (Ccomp.quote_optfile runtime_lib)
c_lib
(Ccomp.make_link_options !Clflags.ccopts) in
if Ccomp.command cmd <> 0 then raise(Error Linking_error);
(* *)
(***********************************************************************)
-(* $Id: reload.ml,v 1.3 1999/11/17 18:56:42 xleroy Exp $ *)
+(* $Id: reload.ml,v 1.3.38.1 2007/12/20 08:53:03 xleroy Exp $ *)
(* Reloading for the HPPA *)
+
+open Cmm
+open Arch
+open Reg
+open Mach
+open Proc
+
+class reload = object (self)
+
+inherit Reloadgen.reload_generic as super
+
+method reload_operation op arg res =
+ match op with
+ Iintop(Idiv | Imod)
+ | Iintop_imm((Idiv | Imod), _) -> (arg, res)
+ | _ -> super#reload_operation op arg res
+end
+
+
+
let fundecl f =
- (new Reloadgen.reload_generic)#fundecl f
+ (new reload)#fundecl f
(* *)
(***********************************************************************)
-(* $Id: selection.ml,v 1.5 1999/11/17 18:56:42 xleroy Exp $ *)
+(* $Id: selection.ml,v 1.5.38.1 2007/10/25 09:08:20 xleroy Exp $ *)
(* Instruction selection for the HPPA processor *)
(* Deal with register constraints *)
-method insert_op op rs rd =
+method insert_op_debug op dbg rs rd =
match op with
Iintop(Idiv | Imod) -> (* handled via calls to millicode *)
let rs' = [|phys_reg 20; phys_reg 19|] (* %r26, %r25 *)
and rd' = [|phys_reg 22|] (* %r29 *) in
self#insert_moves rs rs';
- self#insert (Iop op) rs' rd';
+ self#insert_debug (Iop op) dbg rs' rd';
self#insert_moves rd' rd;
rd
| _ ->
- super#insert_op op rs rd
+ super#insert_op_debug op dbg rs rd
end
(* *)
(***********************************************************************)
-(* $Id: emit.mlp,v 1.38.4.1 2007/03/07 09:14:29 xleroy Exp $ *)
+(* $Id: emit.mlp,v 1.38.4.2 2007/10/09 13:54:27 xleroy Exp $ *)
(* Emission of Intel 386 assembly code *)
let emit_call_bound_errors () =
List.iter emit_call_bound_error !bound_error_sites;
if !bound_error_call > 0 then
- `{emit_label !bound_error_call}: jmp {emit_symbol "caml_ml_array_bound_error"}\n`
+ `{emit_label !bound_error_call}: call {emit_symbol "caml_ml_array_bound_error"}\n`
(* Names for instructions *)
(* *)
(***********************************************************************)
-(* $Id: emit_nt.mlp,v 1.27 2007/01/29 12:10:50 xleroy Exp $ *)
+(* $Id: emit_nt.mlp,v 1.27.4.1 2007/10/09 14:04:05 xleroy Exp $ *)
(* Emission of Intel 386 assembly code, MASM syntax. *)
let emit_call_bound_errors () =
List.iter emit_call_bound_error !bound_error_sites;
if !bound_error_call > 0 then
- `{emit_label !bound_error_call}: jmp _caml_ml_array_bound_error\n`
+ `{emit_label !bound_error_call}: call _caml_ml_array_bound_error\n`
(* Names for instructions *)
(* *)
(***********************************************************************)
-(* $Id: proc_nt.ml,v 1.5 2002/03/12 16:17:52 xleroy Exp $ *)
+(* $Id: proc_nt.ml,v 1.5.26.1 2007/10/09 14:11:26 xleroy Exp $ *)
(* Description of the Intel 386 processor, for Windows NT *)
(* Calling conventions *)
+(* To supplement the processor's meagre supply of registers, we also
+ use some global memory locations to pass arguments beyond the 6th.
+ These globals are denoted by Incoming and Outgoing stack locations
+ with negative offsets, starting at -64.
+ Unlike arguments passed on stack, arguments passed in globals
+ do not prevent tail-call elimination. The caller stores arguments
+ in these globals immediately before the call, and the first thing the
+ callee does is copy them to registers or stack locations.
+ Neither GC nor thread context switches can occur between these two
+ times. *)
+
let calling_conventions first_int last_int first_float last_float make_stack
arg =
let loc = Array.create (Array.length arg) Reg.dummy in
let int = ref first_int in
let float = ref first_float in
- let ofs = ref 0 in
+ let ofs = ref (-64) in
for i = 0 to Array.length arg - 1 do
match arg.(i).typ with
Int | Addr as ty ->
ofs := !ofs + size_float
end
done;
- (loc, !ofs)
+ (loc, max 0 !ofs)
let incoming ofs = Incoming ofs
let outgoing ofs = Outgoing ofs
/* */
/***********************************************************************/
-/* $Id: backtrace.c,v 1.2 2007/01/29 12:10:52 xleroy Exp $ */
+/* $Id: backtrace.c,v 1.2.4.1 2007/10/10 08:34:34 xleroy Exp $ */
/* Stack backtrace for uncaught exceptions */
h = Hash_retaddr(pc);
while(1) {
d = caml_frame_descriptors[h];
+ if (d == 0) return; /* can happen if some code not compiled with -g */
if (d->retaddr == pc) break;
- if (d->retaddr == 0) return; /* should not happen */
h = (h+1) & caml_frame_descriptors_mask;
}
/* Skip to next frame */
/* */
/***********************************************************************/
-/* $Id: i386.S,v 1.48 2007/01/29 15:44:42 xleroy Exp $ */
+/* $Id: i386.S,v 1.48.4.1 2007/10/09 13:32:25 xleroy Exp $ */
/* Asm part of the runtime system, Intel 386 processor */
/* Must be preprocessed by cpp */
ffree %st(5)
ffree %st(6)
ffree %st(7)
- /* Branch to [caml_array_bound_error] */
- movl $ G(caml_array_bound_error), %eax
- jmp G(caml_c_call)
+ /* Record lowest stack address and return address */
+ movl (%esp), %edx
+ movl %edx, G(caml_last_return_address)
+ leal 4(%esp), %edx
+ movl %edx, G(caml_bottom_of_stack)
+ /* For MacOS X: re-align the stack */
+#ifdef SYS_macosx
+ andl $-16, %esp
+#endif
+ /* Branch to [caml_array_bound_error] (never returns) */
+ call G(caml_array_bound_error)
.data
.globl G(caml_system__frametable)
/* */
/***********************************************************************/
-/* $Id: roots.c,v 1.41 2007/02/15 18:35:20 frisch Exp $ */
+/* $Id: roots.c,v 1.41.2.1 2007/10/25 09:08:20 xleroy Exp $ */
/* To walk the memory roots for garbage collection */
frame_descr * d;
uintnat h;
int i, j, n, ofs;
+#ifdef Stack_grows_upwards
+ short * p; /* PR#4339: stack offsets are negative in this case */
+#else
unsigned short * p;
+#endif
value glob;
value * root;
struct global_root * gr;
/* */
/***********************************************************************/
-/* $Id: signals_asm.c,v 1.2 2007/03/01 10:27:26 xleroy Exp $ */
+/* $Id: signals_asm.c,v 1.2.2.1 2007/11/06 12:26:15 xleroy Exp $ */
/* Signal handling, code specific to the native-code compiler */
/* Stack overflow handling */
#ifdef HAS_STACK_OVERFLOW_DETECTION
{
- struct sigaltstack stk;
+ stack_t stk;
struct sigaction act;
stk.ss_sp = sig_alt_stack;
stk.ss_size = SIGSTKSZ;
/* */
/***********************************************************************/
-/* $Id: signals_osdep.h,v 1.8 2007/01/29 12:10:52 xleroy Exp $ */
+/* $Id: signals_osdep.h,v 1.8.4.5 2007/11/26 16:58:51 doligez Exp $ */
/* Processor- and OS-dependent signal interface */
sigact.sa_flags = SA_SIGINFO
#include <sys/ucontext.h>
+ #include <AvailabilityMacros.h>
- #define CONTEXT_STATE (((struct ucontext *)context)->uc_mcontext->ss)
- #define CONTEXT_PC (CONTEXT_STATE.eip)
+#if !defined(MAC_OS_X_VERSION_10_5) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
+ #define CONTEXT_REG(r) r
+ #else
+ #define CONTEXT_REG(r) __##r
+ #endif
+
+ #define CONTEXT_STATE (((ucontext_t *)context)->uc_mcontext->CONTEXT_REG(ss))
+ #define CONTEXT_PC (CONTEXT_STATE.CONTEXT_REG(eip))
#define CONTEXT_FAULTING_ADDRESS ((char *) info->si_addr)
/****************** MIPS, all OS */
#elif defined(TARGET_power) && defined(SYS_rhapsody)
-#ifdef __ppc64__
-
#define DECLARE_SIGNAL_HANDLER(name) \
static void name(int sig, siginfo_t * info, void * context)
- #define SET_SIGACT(sigact,name) \
- sigact.sa_sigaction = (name); \
- sigact.sa_flags = SA_SIGINFO | SA_64REGSET
-
- typedef unsigned long long context_reg;
-
#include <sys/ucontext.h>
-
- #define CONTEXT_STATE (((struct ucontext64 *)context)->uc_mcontext64->ss)
-
- #define CONTEXT_PC (CONTEXT_STATE.srr0)
- #define CONTEXT_EXCEPTION_POINTER (CONTEXT_STATE.r29)
- #define CONTEXT_YOUNG_LIMIT (CONTEXT_STATE.r30)
- #define CONTEXT_YOUNG_PTR (CONTEXT_STATE.r31)
- #define CONTEXT_FAULTING_ADDRESS ((char *) info->si_addr)
- #define CONTEXT_SP (CONTEXT_STATE.r1)
-
-#else
-
- #include <sys/utsname.h>
-
- #define DECLARE_SIGNAL_HANDLER(name) \
- static void name(int sig, siginfo_t * info, void * context)
-
- #define SET_SIGACT(sigact,name) \
- sigact.sa_handler = (void (*)(int)) (name); \
- sigact.sa_flags = SA_SIGINFO
-
- typedef unsigned long context_reg;
-
- #define CONTEXT_PC (*context_gpr_p(context, -2))
- #define CONTEXT_EXCEPTION_POINTER (*context_gpr_p(context, 29))
- #define CONTEXT_YOUNG_LIMIT (*context_gpr_p(context, 30))
- #define CONTEXT_YOUNG_PTR (*context_gpr_p(context, 31))
- #define CONTEXT_FAULTING_ADDRESS ((char *) info->si_addr)
- #define CONTEXT_SP (*context_gpr_p(context, 1))
-
- static int ctx_version = 0;
- static void init_ctx (void)
- {
- struct utsname name;
- if (uname (&name) == 0){
- if (name.release[1] == '.' && name.release[0] <= '5'){
- ctx_version = 1;
- }else{
- ctx_version = 2;
- }
- }else{
- caml_fatal_error ("cannot determine SIGCONTEXT format");
- }
- }
-
- #ifdef DARWIN_VERSION_6
- #include <sys/ucontext.h>
- static unsigned long *context_gpr_p (void *ctx, int regno)
- {
- unsigned long *regs;
- if (ctx_version == 0) init_ctx ();
- if (ctx_version == 1){
- /* old-style context (10.0 and 10.1) */
- regs = (unsigned long *)(((struct sigcontext *)ctx)->sc_regs);
- }else{
- Assert (ctx_version == 2);
- /* new-style context (10.2) */
- regs = (unsigned long *)&(((struct ucontext *)ctx)->uc_mcontext->ss);
- }
- return &(regs[2 + regno]);
- }
+ #include <AvailabilityMacros.h>
+
+ #ifdef __LP64__
+ #define SET_SIGACT(sigact,name) \
+ sigact.sa_sigaction = (name); \
+ sigact.sa_flags = SA_SIGINFO | SA_64REGSET
+
+ typedef unsigned long long context_reg;
+
+ #define CONTEXT_MCONTEXT (((ucontext64_t *)context)->uc_mcontext64)
#else
- #define SA_SIGINFO 0x0040
- struct ucontext {
- int uc_onstack;
- sigset_t uc_sigmask;
- struct sigaltstack uc_stack;
- struct ucontext *uc_link;
- size_t uc_mcsize;
- unsigned long *uc_mcontext;
- };
- static unsigned long *context_gpr_p (void *ctx, int regno)
- {
- unsigned long *regs;
- if (ctx_version == 0) init_ctx ();
- if (ctx_version == 1){
- /* old-style context (10.0 and 10.1) */
- regs = (unsigned long *)(((struct sigcontext *)ctx)->sc_regs);
- }else{
- Assert (ctx_version == 2);
- /* new-style context (10.2) */
- regs = (unsigned long *)((struct ucontext *)ctx)->uc_mcontext + 8;
- }
- return &(regs[2 + regno]);
- }
+ #define SET_SIGACT(sigact,name) \
+ sigact.sa_sigaction = (name); \
+ sigact.sa_flags = SA_SIGINFO
+
+ typedef unsigned long context_reg;
+
+ #define CONTEXT_MCONTEXT (((ucontext_t *)context)->uc_mcontext)
+ #endif
+
+#if !defined(MAC_OS_X_VERSION_10_5) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
+ #define CONTEXT_REG(r) r
+ #else
+ #define CONTEXT_REG(r) __##r
#endif
-#endif
+ #define CONTEXT_STATE (CONTEXT_MCONTEXT->CONTEXT_REG(ss))
+ #define CONTEXT_PC (CONTEXT_STATE.CONTEXT_REG(srr0))
+ #define CONTEXT_EXCEPTION_POINTER (CONTEXT_STATE.CONTEXT_REG(r29))
+ #define CONTEXT_YOUNG_LIMIT (CONTEXT_STATE.CONTEXT_REG(r30))
+ #define CONTEXT_YOUNG_PTR (CONTEXT_STATE.CONTEXT_REG(r31))
+ #define CONTEXT_SP (CONTEXT_STATE.CONTEXT_REG(r1))
+ #define CONTEXT_FAULTING_ADDRESS ((char *) info->si_addr)
/****************** PowerPC, ELF (Linux) */
#!/bin/sh
+# If you want to help me by participating to the build/test effort:
+# http://gallium.inria.fr/~pouillar/ocaml-testing.html
+# -- Nicolas Pouillard
+
usage() {
echo "Usage: $0 (make|ocb|ocamlbuild) (win (mingw|msvc|msvc64) | <configure-arg>*)"
exit 1
curl -s -0 -F "log=@$logfile" \
-F "host=`hostname`" \
-F "mode=$mode-$opt_win-$opt_win2" \
- http://weblog.feydakins.org/dropbox || :
+ http://buildbot.feydakins.org/dropbox || :
}
rm -f buildbot.failed
#!/bin/sh
-# $Id: distclean.sh,v 1.4.2.5 2007/03/12 11:58:48 pouillar Exp $
+# $Id: distclean.sh,v 1.4.2.6 2007/12/18 09:03:12 ertai Exp $
cd `dirname $0`/..
set -ex
(cd byterun && make clean) || :
rm -f boot/ocamlrun boot/ocamlrun.exe boot/camlheader \
boot/myocamlbuild boot/myocamlbuild.native boot/myocamlbuild.native.exe \
myocamlbuild_config.ml config/config.sh config/Makefile \
+ boot/ocamlyacc tools/cvt_emit.bak tools/*.bak \
config/s.h config/m.h boot/*.cm* _log _*_log*
# from partial boot
#!/bin/sh
-# $Id: install.sh,v 1.6.2.12 2007/04/05 08:12:39 pouillar Exp $
+# $Id: install.sh,v 1.6.2.16 2007/11/27 13:27:48 ertai Exp $
set -e
cd `dirname $0`/..
installdir yacc/ocamlyacc byterun/ocamlrun $BINDIR
+installdir config/Makefile $LIBDIR/Makefile.config
installdir byterun/ld.conf $LIBDIR
cd _build
(cd ../man && make install)
echo "Installing ocamldoc..."
-installbin ocamldoc/ocamldoc$EXE $BINDIR/ocamldoc$EXE
-installbin ocamldoc/ocamldoc.opt$EXE $BINDIR/ocamldoc.opt$EXE
+installbin ocamldoc/ocamldoc $BINDIR/ocamldoc$EXE
+installbin ocamldoc/ocamldoc.opt $BINDIR/ocamldoc.opt$EXE
installdir \
../ocamldoc/ocamldoc.hva \
camlp4o.cma camlp4of.cma camlp4oof.cma \
camlp4orf.cma camlp4r.cma camlp4rf.cma \
Camlp4Bin.cm[iox] Camlp4Bin.$O Camlp4Top.cm[io] \
- Camlp4_config.cmi camlp4prof.cm[iox] camlp4prof.$O \
+ Camlp4_config.cmi camlp4prof.cm[iox] camlp4prof.$O Camlp4_import.cmi \
$CAMLP4DIR
installlibdir camlp4lib.$A camlp4fulllib.$A $CAMLP4DIR
cd ..
echo "Installing ocamlbuild..."
-installbin ocamlbuild/ocamlbuild.byte$EXE $BINDIR/ocamlbuild.byte$EXE
-installbin ocamlbuild/ocamlbuild.native$EXE $BINDIR/ocamlbuild.native$EXE
-installbestbin ocamlbuild/ocamlbuild.native$EXE ocamlbuild/ocamlbuild.byte$EXE $BINDIR/ocamlbuild$EXE
+cd ocamlbuild
+installbin ocamlbuild.byte$EXE $BINDIR/ocamlbuild.byte$EXE
+installbin ocamlbuild.native$EXE $BINDIR/ocamlbuild.native$EXE
+installbestbin ocamlbuild.native$EXE ocamlbuild.byte$EXE $BINDIR/ocamlbuild$EXE
installlibdir \
- ocamlbuild/ocamlbuildlib.$A \
+ ocamlbuildlib.$A \
$LIBDIR/ocamlbuild
installdir \
- ocamlbuild/ocamlbuildlib.cmxa \
- ocamlbuild/ocamlbuildlib.cma \
- ocamlbuild/ocamlbuild_plugin.cmi \
- ocamlbuild/ocamlbuild_pack.cmi \
- ocamlbuild/ocamlbuild.cmo \
- ocamlbuild/ocamlbuild.cmx \
- ocamlbuild/ocamlbuild.$O \
+ ocamlbuildlib.cmxa \
+ ocamlbuildlib.cma \
+ ocamlbuild_plugin.cmi \
+ ocamlbuild_pack.cmi \
+ ocamlbuild_unix_plugin.cmi \
+ ocamlbuild_unix_plugin.cmo \
+ ocamlbuild_unix_plugin.cmx \
+ ocamlbuild_unix_plugin.$O \
+ ocamlbuild_executor.cmi \
+ ocamlbuild_executor.cmo \
+ ocamlbuild_executor.cmx \
+ ocamlbuild_executor.$O \
+ ocamlbuild.cmo \
+ ocamlbuild.cmx \
+ ocamlbuild.$O \
$LIBDIR/ocamlbuild
+cd ..
installdir \
../ocamlbuild/man/ocamlbuild.1 \
#!/bin/sh
-# $Id: mkmyocamlbuild_config.sh,v 1.5.2.1 2007/03/12 11:58:48 pouillar Exp $
+# $Id: mkmyocamlbuild_config.sh,v 1.5.2.3 2007/05/28 09:26:51 pouillar Exp $
cd `dirname $0`/..
-e 's/^\(#.*\)$/(* \1 *)/' \
-e 's/^\(.*\$([0-9]).*\)$/(* \1 *)/' \
-e 's/^\([^(=]*\)=\([^"]*\)$/let <:lower<\1>> = "\2";;/' \
+ -e 's/\$(AS)/as/g' \
-e 's/\$(\([^)]*\))/"\^<:lower<\1>>\^"/g' \
-e 's/""\^//g' \
-e 's/\^""//g' \
- -e 's/^let <:lower<\(MAKE\|DO\).*$//g' \
+ -e 's/^let <:lower<MAKE.*$//g' \
+ -e 's/^let <:lower<DO.*$//g' \
-e 's/"true"/true/g' \
-e 's/"false"/false/g' \
- config/Makefile | \
- sed -f build/tolower.sed | \
- sed -f build/tolower.sed | \
- sed -f build/tolower.sed > myocamlbuild_config.ml
+ config/Makefile \
+ | sed -f build/tolower.sed \
+ | sed -f build/tolower.sed \
+ | sed -f build/tolower.sed \
+ | sed -f build/tolower.sed \
+ | sed -f build/tolower.sed \
+ | sed -f build/tolower.sed \
+ > myocamlbuild_config.ml
--- /dev/null
+#!/bin/sh
+# $Id: ocamlbuildlib-native-only.sh,v 1.1.2.1 2007/06/20 13:34:03 ertai Exp $
+set -e
+OCAMLBUILD_PARTIAL="true"
+export OCAMLBUILD_PARTIAL
+cd `dirname $0`/..
+. build/targets.sh
+set -x
+$OCAMLBUILD $@ native_stdlib_partial_mode $OCAMLOPT_BYTE $OCAMLLEX_BYTE $OCAMLBUILDLIB_NATIVE
#!/bin/sh
-# $Id: partial-boot.sh,v 1.2.4.8 2007/03/12 11:58:48 pouillar Exp $
+# $Id: partial-boot.sh,v 1.2.4.9 2007/05/22 10:54:59 pouillar Exp $
set -ex
cd `dirname $0`/..
OCAMLBUILD_PARTIAL="true"
export OCAMLBUILD_PARTIAL
mkdir -p _build
cp -rf boot _build/
-cp parsing/location.ml parsing/location.mli camlp4/build
-cp parsing/linenum.mll parsing/linenum.mli camlp4/build
-cp utils/terminfo.ml utils/terminfo.mli camlp4/build
./build/mkconfig.sh
./build/mkmyocamlbuild_config.sh
./build/boot.sh
#!/bin/sh
-# $Id: partial-install.sh,v 1.5.2.9 2007/04/05 08:12:39 pouillar Exp $
+# $Id: partial-install.sh,v 1.5.2.11 2007/11/22 18:45:18 ertai Exp $
######################################
######### Copied from build/install.sh
camlp4o.cma camlp4of.cma camlp4oof.cma \
camlp4orf.cma camlp4r.cma camlp4rf.cma \
Camlp4Bin.cm[iox] Camlp4Bin.$O Camlp4Top.cm[io] \
- Camlp4_config.cmi camlp4prof.cm[iox] camlp4prof.$O \
+ Camlp4_config.cmi camlp4prof.cm[iox] camlp4prof.$O Camlp4_import.cmi \
$CAMLP4DIR
installlibdir camlp4lib.$A camlp4fulllib.$A $CAMLP4DIR
cd ..
ocamlbuildlib.cma \
ocamlbuild_plugin.cmi \
ocamlbuild_pack.cmi \
+ ocamlbuild_unix_plugin.cmi \
+ ocamlbuild_unix_plugin.cmo \
+ ocamlbuild_unix_plugin.cmx \
+ ocamlbuild_unix_plugin.$O \
+ ocamlbuild_executor.cmi \
+ ocamlbuild_executor.cmo \
+ ocamlbuild_executor.cmx \
+ ocamlbuild_executor.$O \
ocamlbuild.cmo \
ocamlbuild.cmx \
ocamlbuild.$O \
-# $Id: targets.sh,v 1.2.4.6 2007/03/12 11:58:48 pouillar Exp $
+# $Id: targets.sh,v 1.2.4.7 2007/06/20 13:26:29 ertai Exp $
. config/config.sh
. build/otherlibs-targets.sh
. build/camlp4-targets.sh
OCAMLLEX_NATIVE=lex/ocamllex.opt$EXE
TOOLS_NATIVE=tools/ocamldep.native$EXE
OCAMLDOC_NATIVE="ocamldoc/ocamldoc.opt$EXE ocamldoc/odoc_info.cmxa ocamldoc/stdlib_man/Pervasives.3o"
-OCAMLBUILD_NATIVE="ocamlbuild/ocamlbuildlib.cmxa \
- ocamlbuild/ocamlbuildlightlib.cmxa \
+OCAMLBUILDLIB_NATIVE="ocamlbuild/ocamlbuildlib.cmxa \
+ ocamlbuild/ocamlbuildlightlib.cmxa"
+OCAMLBUILD_NATIVE="$OCAMLBUILDLIB_NATIVE \
ocamlbuild/ocamlbuild.native$EXE \
ocamlbuild/ocamlbuildlight.native$EXE"
if [ -x boot/myocamlbuild.native ]; then
(* *)
(***********************************************************************)
-(* $Id: matching.ml,v 1.67 2005/09/07 16:07:48 maranget Exp $ *)
+(* $Id: matching.ml,v 1.67.12.1 2007/06/08 08:03:16 garrigue Exp $ *)
(* Compilation of pattern matching *)
ctx pm
| Tpat_variant(lab, _, row) ->
compile_test (compile_match repr partial) partial
- (divide_variant row)
- (combine_variant row arg partial)
+ (divide_variant !row)
+ (combine_variant !row arg partial)
ctx pm
| _ -> assert false
end
(* *)
(***********************************************************************)
-(* $Id: translclass.ml,v 1.41 2006/07/06 07:32:28 garrigue Exp $ *)
+(* $Id: translclass.ml,v 1.41.8.4 2007/10/29 06:56:26 garrigue Exp $ *)
open Misc
open Asttypes
Lapply (oo_prim (if create then "new_variable" else "get_variable"),
[Lvar tbl; transl_label name])
-let transl_vals tbl create vals rem =
+let transl_vals tbl create strict vals rem =
List.fold_right
(fun (name, id) rem ->
- Llet(StrictOpt, id, transl_val tbl create name, rem))
+ Llet(strict, id, transl_val tbl create name, rem))
vals rem
let meths_super tbl meths inh_meths =
inh_meths []
let bind_super tbl (vals, meths) cl_init =
- transl_vals tbl false vals
+ transl_vals tbl false StrictOpt vals
(List.fold_right (fun (nm, id, def) rem -> Llet(StrictOpt, id, def, rem))
meths cl_init)
let bind_method tbl lab id cl_init =
- Llet(StrictOpt, id, Lapply (oo_prim "get_method_label",
- [Lvar tbl; transl_label lab]),
+ Llet(Strict, id, Lapply (oo_prim "get_method_label",
+ [Lvar tbl; transl_label lab]),
cl_init)
let bind_methods tbl meths vals cl_init =
let methl = Meths.fold (fun lab id tl -> (lab,id) :: tl) meths [] in
let len = List.length methl and nvals = List.length vals in
if len < 2 && nvals = 0 then Meths.fold (bind_method tbl) meths cl_init else
- if len = 0 && nvals < 2 then transl_vals tbl true vals cl_init else
+ if len = 0 && nvals < 2 then transl_vals tbl true Strict vals cl_init else
let ids = Ident.create "ids" in
let i = ref (len + nvals) in
let getter, names =
if nvals = 0 then "get_method_labels", [] else
"new_methods_variables", [transl_meth_list (List.map fst vals)]
in
- Llet(StrictOpt, ids,
+ Llet(Strict, ids,
Lapply (oo_prim getter,
[Lvar tbl; transl_meth_list (List.map fst methl)] @ names),
List.fold_right
| b :: l ->
if b = a then 0 else 1 + index a l
+let bind_id_as_val (id, _) = ("", id)
+
let rec build_class_init cla cstr super inh_init cl_init msubst top cl =
match cl.cl_desc with
Tclass_ident path ->
let (inh_init, cl_init) =
build_class_init cla cstr super inh_init cl_init msubst top cl
in
- let vals = List.map (function (id, _) -> (Ident.name id, id)) vals in
- (inh_init, transl_vals cla true vals cl_init)
+ let vals = List.map bind_id_as_val vals in
+ (inh_init, transl_vals cla true StrictOpt vals cl_init)
| Tclass_apply (cl, exprs) ->
build_class_init cla cstr super inh_init cl_init msubst top cl
| Tclass_let (rec_flag, defs, vals, cl) ->
let (inh_init, cl_init) =
build_class_init cla cstr super inh_init cl_init msubst top cl
in
- let vals = List.map (function (id, _) -> (Ident.name id, id)) vals in
- (inh_init, transl_vals cla true vals cl_init)
+ let vals = List.map bind_id_as_val vals in
+ (inh_init, transl_vals cla true StrictOpt vals cl_init)
| Tclass_constraint (cl, vals, meths, concr_meths) ->
let virt_meths =
List.filter (fun lab -> not (Concr.mem lab concr_meths)) meths in
Si ids=0 (objet immediat), alors on ne conserve que env_init.
*)
+let prerr_ids msg ids =
+ let names = List.map Ident.unique_toplevel_name ids in
+ prerr_endline (String.concat " " (msg :: names))
let transl_class ids cl_id arity pub_meths cl vflag =
(* First check if it is not only a rebind *)
let subst env lam i0 new_ids' =
let fv = free_variables lam in
let fv = List.fold_right IdentSet.remove !new_ids' fv in
- (* IdentSet.iter
- (fun id ->
- if not (List.mem id new_ids) then prerr_endline (Ident.name id))
- fv; *)
let fv = IdentSet.filter (fun id -> List.mem id new_ids) fv in
(* need to handle methods specially (PR#3576) *)
let fm = IdentSet.diff (free_methods lam) meth_ids in
(* *)
(***********************************************************************)
-(* $Id: translmod.ml,v 1.52 2006/04/05 02:28:12 garrigue Exp $ *)
+(* $Id: translmod.ml,v 1.52.8.1 2007/11/10 14:32:43 xleroy Exp $ *)
(* Translation from typed abstract syntax to lambda terms,
for the module language *)
| id :: ids ->
Llet(Alias, id, Lprim(Pfield pos, [Lvar mid]),
rebind_idents (pos + 1) (id :: newfields) ids) in
- Llet(Alias, mid, transl_module Tcoerce_none None modl,
+ Llet(Strict, mid, transl_module Tcoerce_none None modl,
rebind_idents 0 fields ids)
(* Update forward declaration in Translcore *)
/* */
/***********************************************************************/
-/* $Id: compare.c,v 1.36 2007/02/09 13:31:15 doligez Exp $ */
+/* $Id: compare.c,v 1.36.4.1 2008/01/03 09:54:17 xleroy Exp $ */
#include <string.h>
#include <stdlib.h>
{
intnat res = compare_val(v1, v2, 0);
if (compare_stack != compare_stack_init) compare_free_stack();
- return Val_int(res - 1 < -1);
+ return Val_int(res < 0 && res != UNORDERED);
}
CAMLprim value caml_lessequal(value v1, value v2)
{
intnat res = compare_val(v1, v2, 0);
if (compare_stack != compare_stack_init) compare_free_stack();
- return Val_int(res - 1 <= -1);
+ return Val_int(res <= 0 && res != UNORDERED);
}
CAMLprim value caml_greaterthan(value v1, value v2)
/* */
/***********************************************************************/
-/* $Id: finalise.c,v 1.19 2005/09/22 14:21:50 xleroy Exp $ */
+/* $Id: finalise.c,v 1.19.10.1 2007/11/19 17:15:53 doligez Exp $ */
/* Handling of finalised values. */
struct final {
value fun;
value val;
+ int offset;
};
static struct final *final_table = NULL;
{
uintnat i, j, k;
uintnat todo_count = 0;
-
+
Assert (young == old);
for (i = 0; i < old; i++){
Assert (Is_block (final_table[i].val));
Assert (Is_in_heap (final_table[i].val));
if (Is_white_val (final_table[i].val)){
if (Tag_val (final_table[i].val) == Forward_tag){
+ Assert (final_table[i].offset == 0);
value fv = Forward_val (final_table[i].val);
if (Is_block (fv) && (Is_young (fv) || Is_in_heap (fv))
&& (Tag_val (fv) == Forward_tag || Tag_val (fv) == Lazy_tag
-- to_do_hd->size;
f = to_do_hd->item[to_do_hd->size];
running_finalisation_function = 1;
- caml_callback (f.fun, f.val);
+ caml_callback (f.fun, f.val + f.offset);
running_finalisation_function = 0;
}
caml_gc_message (0x80, "Done calling finalisation functions.\n", 0);
Assert (old == young);
for (i = 0; i < old; i++) Call_action (f, final_table[i].fun);
-
+
for (todo = to_do_hd; todo != NULL; todo = todo->next){
for (i = 0; i < todo->size; i++){
Call_action (f, todo->item[i].fun);
void caml_final_do_young_roots (scanning_action f)
{
uintnat i;
-
+
Assert (old <= young);
for (i = old; i < young; i++){
Call_action (f, final_table[i].fun);
caml_invalid_argument ("Gc.finalise");
}
Assert (old <= young);
-
+
if (young >= size){
if (final_table == NULL){
uintnat new_size = 30;
}
Assert (young < size);
final_table[young].fun = f;
- if (Tag_val (v) == Infix_tag) v -= Infix_offset_val (v);
- final_table[young].val = v;
+ if (Tag_val (v) == Infix_tag){
+ final_table[young].offset = Infix_offset_val (v);
+ final_table[young].val = v - Infix_offset_val (v);
+ }else{
+ final_table[young].offset = 0;
+ final_table[young].val = v;
+ }
++ young;
return Val_unit;
/* */
/***********************************************************************/
-/* $Id: gc_ctrl.c,v 1.50 2005/09/22 14:21:50 xleroy Exp $ */
+/* $Id: gc_ctrl.c,v 1.50.10.1 2007/11/20 18:27:06 doligez Exp $ */
#include "alloc.h"
#include "compact.h"
mlsize_t i;
value v = Val_hp (hp);
value f;
-
+
check_head (v);
switch (Tag_hp (hp)){
case Abstract_tag: break;
case Custom_tag:
Assert (!Is_in_heap (Custom_ops_val (v)));
break;
-
+
case Infix_tag:
Assert (0);
break;
Assert (Tag_hp (hp) < No_scan_tag);
for (i = 0; i < Wosize_hp (hp); i++){
f = Field (v, i);
- if (Is_block (f) && Is_in_heap (f)) check_head (f);
+ if (Is_block (f) && Is_in_heap (f)){
+ check_head (f);
+ Assert (Color_val (f) != Caml_blue);
+ }
}
}
}
/* */
/***********************************************************************/
-/* $Id: intern.c,v 1.60 2005/09/22 14:21:50 xleroy Exp $ */
+/* $Id: intern.c,v 1.60.10.1 2007/10/09 12:48:54 xleroy Exp $ */
/* Structured input, compact format */
(Sign_extend(intern_src[-2]) << 8) + intern_src[-1])
#define read32u() \
(intern_src += 4, \
- (intern_src[-4] << 24) + (intern_src[-3] << 16) + \
+ ((uintnat)(intern_src[-4]) << 24) + (intern_src[-3] << 16) + \
(intern_src[-2] << 8) + intern_src[-1])
#define read32s() \
(intern_src += 4, \
/* */
/***********************************************************************/
-/* $Id: ints.c,v 1.50 2006/05/05 13:50:45 xleroy Exp $ */
+/* $Id: ints.c,v 1.50.6.1 2007/10/25 11:39:45 xleroy Exp $ */
#include <stdio.h>
#include <string.h>
CAMLprim value caml_int64_bits_of_float(value vd)
{
- union { double d; int64 i; } u;
+ union { double d; int64 i; int32 h[2]; } u;
u.d = Double_val(vd);
+#if defined(__arm__) && !defined(__ARM_EABI__)
+ { int32 t = u.h[0]; u.h[0] = u.h[1]; u.h[1] = t; }
+#endif
return caml_copy_int64(u.i);
}
CAMLprim value caml_int64_float_of_bits(value vi)
{
- union { double d; int64 i; } u;
+ union { double d; int64 i; int32 h[2]; } u;
u.i = Int64_val(vi);
+#if defined(__arm__) && !defined(__ARM_EABI__)
+ { int32 t = u.h[0]; u.h[0] = u.h[1]; u.h[1] = t; }
+#endif
return caml_copy_double(u.d);
}
/* */
/***********************************************************************/
-/* $Id: io.h,v 1.30 2006/09/20 17:37:08 xleroy Exp $ */
+/* $Id: io.h,v 1.30.6.1 2007/05/21 13:17:47 doligez Exp $ */
/* Buffered input/output */
};
enum {
- CHANNEL_FLAG_FROM_SOCKET = 1, /* For Windows */
+ CHANNEL_FLAG_FROM_SOCKET = 1 /* For Windows */
};
/* For an output channel:
/* */
/***********************************************************************/
-/* $Id: major_gc.c,v 1.58 2005/10/25 16:24:13 doligez Exp $ */
+/* $Id: major_gc.c,v 1.58.10.2 2007/11/26 16:11:49 doligez Exp $ */
#include <limits.h>
static char *markhp, *chunk, *limit;
-static int gc_subphase; /* Subphase_main, Subphase_weak, Subphase_final */
+static int gc_subphase; /* Subphase_main Subphase_weak[12] Subphase_final */
#define Subphase_main 10
-#define Subphase_weak 11
-#define Subphase_final 12
+#define Subphase_weak1 11
+#define Subphase_weak2 12
+#define Subphase_final 13
static value *weak_prev;
+#ifdef DEBUG
+static unsigned long major_gc_counter = 0;
+#endif
+
static void realloc_gray_vals (void)
{
value *new;
gc_subphase = Subphase_main;
markhp = NULL;
#ifdef DEBUG
+ ++ major_gc_counter;
caml_heap_check ();
#endif
}
mlsize_t size, i;
caml_gc_message (0x40, "Marking %ld words\n", work);
+ caml_gc_message (0x40, "Subphase = %ld\n", gc_subphase);
gray_vals_ptr = gray_vals_cur;
while (work > 0){
if (gray_vals_ptr > gray_vals){
chunk = caml_heap_start;
markhp = chunk;
limit = chunk + Chunk_size (chunk);
- }else if (gc_subphase == Subphase_main){
- /* The main marking phase is over. Start removing weak pointers to
- dead values. */
- gc_subphase = Subphase_weak;
- weak_prev = &caml_weak_list_head;
- }else if (gc_subphase == Subphase_weak){
- value cur, curfield;
- mlsize_t sz, i;
- header_t hd;
-
- cur = *weak_prev;
- if (cur != (value) NULL){
- hd = Hd_val (cur);
- if (Color_hd (hd) == Caml_white){
- /* The whole array is dead, remove it from the list. */
- *weak_prev = Field (cur, 0);
- }else{
+ }else{
+ switch (gc_subphase){
+ case Subphase_main: {
+ /* The main marking phase is over. Start removing weak pointers to
+ dead values. */
+ gc_subphase = Subphase_weak1;
+ weak_prev = &caml_weak_list_head;
+ }
+ break;
+ case Subphase_weak1: {
+ value cur, curfield;
+ mlsize_t sz, i;
+ header_t hd;
+
+ cur = *weak_prev;
+ if (cur != (value) NULL){
+ hd = Hd_val (cur);
sz = Wosize_hd (hd);
for (i = 1; i < sz; i++){
curfield = Field (cur, i);
- weak_again:
+ weak_again:
if (curfield != caml_weak_none
&& Is_block (curfield) && Is_in_heap (curfield)){
if (Tag_val (curfield) == Forward_tag){
}
}
weak_prev = &Field (cur, 0);
+ work -= Whsize_hd (hd);
+ }else{
+ /* Subphase_weak1 is done. Start removing dead weak arrays. */
+ gc_subphase = Subphase_weak2;
+ weak_prev = &caml_weak_list_head;
}
- work -= Whsize_hd (hd);
- }else{
- /* Subphase_weak is done. Handle finalised values. */
+ }
+ break;
+ case Subphase_weak2: {
+ value cur;
+ header_t hd;
+
+ cur = *weak_prev;
+ if (cur != (value) NULL){
+ hd = Hd_val (cur);
+ if (Color_hd (hd) == Caml_white){
+ /* The whole array is dead, remove it from the list. */
+ *weak_prev = Field (cur, 0);
+ }else{
+ weak_prev = &Field (cur, 0);
+ }
+ work -= 1;
+ }else{
+ /* Subphase_weak2 is done. Handle finalised values. */
+ gray_vals_cur = gray_vals_ptr;
+ caml_final_update ();
+ gray_vals_ptr = gray_vals_cur;
+ gc_subphase = Subphase_final;
+ }
+ }
+ break;
+ case Subphase_final: {
+ /* Initialise the sweep phase. */
gray_vals_cur = gray_vals_ptr;
- caml_final_update ();
- gray_vals_ptr = gray_vals_cur;
- gc_subphase = Subphase_final;
+ caml_gc_sweep_hp = caml_heap_start;
+ caml_fl_init_merge ();
+ caml_gc_phase = Phase_sweep;
+ chunk = caml_heap_start;
+ caml_gc_sweep_hp = chunk;
+ limit = chunk + Chunk_size (chunk);
+ work = 0;
+ caml_fl_size_at_phase_change = caml_fl_cur_size;
+ }
+ break;
+ default: Assert (0);
}
- }else{
- Assert (gc_subphase == Subphase_final);
- /* Initialise the sweep phase. */
- gray_vals_cur = gray_vals_ptr;
- caml_gc_sweep_hp = caml_heap_start;
- caml_fl_init_merge ();
- caml_gc_phase = Phase_sweep;
- chunk = caml_heap_start;
- caml_gc_sweep_hp = chunk;
- limit = chunk + Chunk_size (chunk);
- work = 0;
- caml_fl_size_at_phase_change = caml_fl_cur_size;
}
}
gray_vals_cur = gray_vals_ptr;
if (p < dp) p = dp;
if (p < caml_extra_heap_resources) p = caml_extra_heap_resources;
- caml_gc_message (0x40, "allocated_words = %"
+ caml_gc_message (0x40, "allocated_words = %"
ARCH_INTNAT_PRINTF_FORMAT "u\n",
caml_allocated_words);
caml_gc_message (0x40, "extra_heap_resources = %"
/* */
/***********************************************************************/
-/* $Id: minor_gc.c,v 1.43 2005/09/22 14:21:50 xleroy Exp $ */
+/* $Id: minor_gc.c,v 1.43.10.1 2007/11/20 18:27:06 doligez Exp $ */
#include <string.h>
#include "config.h"
static asize_t ref_table_size, ref_table_reserve;
int caml_in_minor_collection = 0;
+#ifdef DEBUG
+static unsigned long minor_gc_counter = 0;
+#endif
+
void caml_set_minor_heap_size (asize_t size)
{
char *new_heap;
for (p = (value *) caml_young_start; p < (value *) caml_young_end; ++p){
*p = Debug_free_minor;
}
+ ++ minor_gc_counter;
}
#endif
}
ref_table_size *= 2;
sz = (ref_table_size + ref_table_reserve) * sizeof (value *);
- caml_gc_message (0x08, "Growing ref_table to %"
+ caml_gc_message (0x08, "Growing ref_table to %"
ARCH_INTNAT_PRINTF_FORMAT "dk bytes\n",
(intnat) sz/1024);
ref_table = (value **) realloc ((char *) ref_table, sz);
/* */
/***********************************************************************/
-/* $Id: unix.c,v 1.28 2007/02/12 07:57:25 weis Exp $ */
+/* $Id: unix.c,v 1.28.4.1 2007/11/20 15:47:41 xleroy Exp $ */
/* Unix-specific stuff */
{
char *raw_mem;
uintnat aligned_mem;
+ static char * last_addr = NULL; /* hint, see PR#4448 */
+
Assert (modulo < Page_size);
- raw_mem = (char *) mmap(NULL, size + Page_size, PROT_READ | PROT_WRITE,
+ raw_mem = (char *) mmap(last_addr, size + Page_size, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (raw_mem == MAP_FAILED) return NULL;
+ last_addr = raw_mem + size + 2 * Page_size;
*block = raw_mem;
raw_mem += modulo; /* Address to be aligned */
aligned_mem = (((uintnat) raw_mem / Page_size + 1) * Page_size);
-
- type meta_bool =
+ type loc = Loc.t
+ and meta_bool =
[ BTrue
| BFalse
- | BAnt of string ];
- type meta_option 'a =
+ | BAnt of string ]
+ and meta_option 'a =
[ ONone
| OSome of 'a
- | OAnt of string ];
- type meta_list 'a =
+ | OAnt of string ]
+ and meta_list 'a =
[ LNil
| LCons of 'a and meta_list 'a
- | LAnt of string ];
- type ident =
- [ IdAcc of Loc.t and ident and ident (* i . i *)
- | IdApp of Loc.t and ident and ident (* i i *)
- | IdLid of Loc.t and string (* foo *)
- | IdUid of Loc.t and string (* Bar *)
- | IdAnt of Loc.t and string (* $s$ *) ];
- type ctyp =
- [ TyNil of Loc.t
- | TyAli of Loc.t and ctyp and ctyp (* t as t *) (* list 'a as 'a *)
- | TyAny of Loc.t (* _ *)
- | TyApp of Loc.t and ctyp and ctyp (* t t *) (* list 'a *)
- | TyArr of Loc.t and ctyp and ctyp (* t -> t *) (* int -> string *)
- | TyCls of Loc.t and ident (* #i *) (* #point *)
- | TyLab of Loc.t and string and ctyp (* ~s *)
- | TyId of Loc.t and ident (* i *) (* Lazy.t *)
- | TyMan of Loc.t and ctyp and ctyp (* t == t *) (* type t = [ A | B ] == Foo.t *)
+ | LAnt of string ]
+ and ident =
+ [ IdAcc of loc and ident and ident (* i . i *)
+ | IdApp of loc and ident and ident (* i i *)
+ | IdLid of loc and string (* foo *)
+ | IdUid of loc and string (* Bar *)
+ | IdAnt of loc and string (* $s$ *) ]
+ and ctyp =
+ [ TyNil of loc
+ | TyAli of loc and ctyp and ctyp (* t as t *) (* list 'a as 'a *)
+ | TyAny of loc (* _ *)
+ | TyApp of loc and ctyp and ctyp (* t t *) (* list 'a *)
+ | TyArr of loc and ctyp and ctyp (* t -> t *) (* int -> string *)
+ | TyCls of loc and ident (* #i *) (* #point *)
+ | TyLab of loc and string and ctyp (* ~s:t *)
+ | TyId of loc and ident (* i *) (* Lazy.t *)
+ | TyMan of loc and ctyp and ctyp (* t == t *) (* type t = [ A | B ] == Foo.t *)
(* type t 'a 'b 'c = t constraint t = t constraint t = t *)
- | TyDcl of Loc.t and string and list ctyp and ctyp and list (ctyp * ctyp)
+ | TyDcl of loc and string and list ctyp and ctyp and list (ctyp * ctyp)
(* < (t)? (..)? > *) (* < move : int -> 'a .. > as 'a *)
- | TyObj of Loc.t and ctyp and meta_bool
- | TyOlb of Loc.t and string and ctyp (* ?s *)
- | TyPol of Loc.t and ctyp and ctyp (* ! t . t *) (* ! 'a . list 'a -> 'a *)
- | TyQuo of Loc.t and string (* 's *)
- | TyQuP of Loc.t and string (* +'s *)
- | TyQuM of Loc.t and string (* -'s *)
- | TyVrn of Loc.t and string (* `s *)
- | TyRec of Loc.t and ctyp (* { t } *) (* { foo : int ; bar : mutable string } *)
- | TyCol of Loc.t and ctyp and ctyp (* t : t *)
- | TySem of Loc.t and ctyp and ctyp (* t; t *)
- | TyCom of Loc.t and ctyp and ctyp (* t, t *)
- | TySum of Loc.t and ctyp (* [ t ] *) (* [ A of int and string | B ] *)
- | TyOf of Loc.t and ctyp and ctyp (* t of t *) (* A of int *)
- | TyAnd of Loc.t and ctyp and ctyp (* t and t *)
- | TyOr of Loc.t and ctyp and ctyp (* t | t *)
- | TyPrv of Loc.t and ctyp (* private t *)
- | TyMut of Loc.t and ctyp (* mutable t *)
- | TyTup of Loc.t and ctyp (* ( t ) *) (* (int * string) *)
- | TySta of Loc.t and ctyp and ctyp (* t * t *)
- | TyVrnEq of Loc.t and ctyp (* [ = t ] *)
- | TyVrnSup of Loc.t and ctyp (* [ > t ] *)
- | TyVrnInf of Loc.t and ctyp (* [ < t ] *)
- | TyVrnInfSup of Loc.t and ctyp and ctyp (* [ < t > t ] *)
- | TyAmp of Loc.t and ctyp and ctyp (* t & t *)
- | TyOfAmp of Loc.t and ctyp and ctyp (* t of & t *)
- | TyAnt of Loc.t and string (* $s$ *)
+ | TyObj of loc and ctyp and meta_bool
+ | TyOlb of loc and string and ctyp (* ?s:t *)
+ | TyPol of loc and ctyp and ctyp (* ! t . t *) (* ! 'a . list 'a -> 'a *)
+ | TyQuo of loc and string (* 's *)
+ | TyQuP of loc and string (* +'s *)
+ | TyQuM of loc and string (* -'s *)
+ | TyVrn of loc and string (* `s *)
+ | TyRec of loc and ctyp (* { t } *) (* { foo : int ; bar : mutable string } *)
+ | TyCol of loc and ctyp and ctyp (* t : t *)
+ | TySem of loc and ctyp and ctyp (* t; t *)
+ | TyCom of loc and ctyp and ctyp (* t, t *)
+ | TySum of loc and ctyp (* [ t ] *) (* [ A of int and string | B ] *)
+ | TyOf of loc and ctyp and ctyp (* t of t *) (* A of int *)
+ | TyAnd of loc and ctyp and ctyp (* t and t *)
+ | TyOr of loc and ctyp and ctyp (* t | t *)
+ | TyPrv of loc and ctyp (* private t *)
+ | TyMut of loc and ctyp (* mutable t *)
+ | TyTup of loc and ctyp (* ( t ) *) (* (int * string) *)
+ | TySta of loc and ctyp and ctyp (* t * t *)
+ | TyVrnEq of loc and ctyp (* [ = t ] *)
+ | TyVrnSup of loc and ctyp (* [ > t ] *)
+ | TyVrnInf of loc and ctyp (* [ < t ] *)
+ | TyVrnInfSup of loc and ctyp and ctyp (* [ < t > t ] *)
+ | TyAmp of loc and ctyp and ctyp (* t & t *)
+ | TyOfAmp of loc and ctyp and ctyp (* t of & t *)
+ | TyAnt of loc and string (* $s$ *)
]
- ;
- type patt =
- [ PaNil of Loc.t
- | PaId of Loc.t and ident (* i *)
- | PaAli of Loc.t and patt and patt (* p as p *) (* (Node x y as n) *)
- | PaAnt of Loc.t and string (* $s$ *)
- | PaAny of Loc.t (* _ *)
- | PaApp of Loc.t and patt and patt (* p p *) (* fun x y -> *)
- | PaArr of Loc.t and patt (* [| p |] *)
- | PaCom of Loc.t and patt and patt (* p, p *)
- | PaSem of Loc.t and patt and patt (* p; p *)
- | PaChr of Loc.t and string (* c *) (* 'x' *)
- | PaInt of Loc.t and string
- | PaInt32 of Loc.t and string
- | PaInt64 of Loc.t and string
- | PaNativeInt of Loc.t and string
- | PaFlo of Loc.t and string
- | PaLab of Loc.t and string and patt (* ~s or ~s:(p) *)
- (* ?s or ?s:(p = e) or ?(p = e) *)
- (* | PaOlb of Loc.t and string and meta_option(*FIXME*) (patt * meta_option(*FIXME*) expr) *)
+ and patt =
+ [ PaNil of loc
+ | PaId of loc and ident (* i *)
+ | PaAli of loc and patt and patt (* p as p *) (* (Node x y as n) *)
+ | PaAnt of loc and string (* $s$ *)
+ | PaAny of loc (* _ *)
+ | PaApp of loc and patt and patt (* p p *) (* fun x y -> *)
+ | PaArr of loc and patt (* [| p |] *)
+ | PaCom of loc and patt and patt (* p, p *)
+ | PaSem of loc and patt and patt (* p; p *)
+ | PaChr of loc and string (* c *) (* 'x' *)
+ | PaInt of loc and string
+ | PaInt32 of loc and string
+ | PaInt64 of loc and string
+ | PaNativeInt of loc and string
+ | PaFlo of loc and string
+ | PaLab of loc and string and patt (* ~s or ~s:(p) *)
(* ?s or ?s:(p) *)
- | PaOlb of Loc.t and string and patt
+ | PaOlb of loc and string and patt
(* ?s:(p = e) or ?(p = e) *)
- | PaOlbi of Loc.t and string and patt and expr
- | PaOrp of Loc.t and patt and patt (* p | p *)
- | PaRng of Loc.t and patt and patt (* p .. p *)
- | PaRec of Loc.t and patt (* { p } *)
- | PaEq of Loc.t and ident and patt (* i = p *)
- | PaStr of Loc.t and string (* s *)
- | PaTup of Loc.t and patt (* ( p ) *)
- | PaTyc of Loc.t and patt and ctyp (* (p : t) *)
- | PaTyp of Loc.t and ident (* #i *)
- | PaVrn of Loc.t and string (* `s *) ]
+ | PaOlbi of loc and string and patt and expr
+ | PaOrp of loc and patt and patt (* p | p *)
+ | PaRng of loc and patt and patt (* p .. p *)
+ | PaRec of loc and patt (* { p } *)
+ | PaEq of loc and ident and patt (* i = p *)
+ | PaStr of loc and string (* s *)
+ | PaTup of loc and patt (* ( p ) *)
+ | PaTyc of loc and patt and ctyp (* (p : t) *)
+ | PaTyp of loc and ident (* #i *)
+ | PaVrn of loc and string (* `s *) ]
and expr =
- [ ExNil of Loc.t
- | ExId of Loc.t and ident (* i *)
- | ExAcc of Loc.t and expr and expr (* e.e *)
- | ExAnt of Loc.t and string (* $s$ *)
- | ExApp of Loc.t and expr and expr (* e e *)
- | ExAre of Loc.t and expr and expr (* e.(e) *)
- | ExArr of Loc.t and expr (* [| e |] *)
- | ExSem of Loc.t and expr and expr (* e; e *)
- | ExAsf of Loc.t (* assert False *)
- | ExAsr of Loc.t and expr (* assert e *)
- | ExAss of Loc.t and expr and expr (* e := e *)
- | ExChr of Loc.t and string (* 'c' *)
- | ExCoe of Loc.t and expr and ctyp and ctyp (* (e : t) or (e : t :> t) *)
- | ExFlo of Loc.t and string (* 3.14 *)
+ [ ExNil of loc
+ | ExId of loc and ident (* i *)
+ | ExAcc of loc and expr and expr (* e.e *)
+ | ExAnt of loc and string (* $s$ *)
+ | ExApp of loc and expr and expr (* e e *)
+ | ExAre of loc and expr and expr (* e.(e) *)
+ | ExArr of loc and expr (* [| e |] *)
+ | ExSem of loc and expr and expr (* e; e *)
+ | ExAsf of loc (* assert False *)
+ | ExAsr of loc and expr (* assert e *)
+ | ExAss of loc and expr and expr (* e := e *)
+ | ExChr of loc and string (* 'c' *)
+ | ExCoe of loc and expr and ctyp and ctyp (* (e : t) or (e : t :> t) *)
+ | ExFlo of loc and string (* 3.14 *)
(* for s = e to/downto e do { e } *)
- | ExFor of Loc.t and string and expr and expr and meta_bool and expr
- | ExFun of Loc.t and match_case (* fun [ a ] *)
- | ExIfe of Loc.t and expr and expr and expr (* if e then e else e *)
- | ExInt of Loc.t and string (* 42 *)
- | ExInt32 of Loc.t and string
- | ExInt64 of Loc.t and string
- | ExNativeInt of Loc.t and string
- | ExLab of Loc.t and string and expr (* ~s or ~s:e *)
- | ExLaz of Loc.t and expr (* lazy e *)
+ | ExFor of loc and string and expr and expr and meta_bool and expr
+ | ExFun of loc and match_case (* fun [ mc ] *)
+ | ExIfe of loc and expr and expr and expr (* if e then e else e *)
+ | ExInt of loc and string (* 42 *)
+ | ExInt32 of loc and string
+ | ExInt64 of loc and string
+ | ExNativeInt of loc and string
+ | ExLab of loc and string and expr (* ~s or ~s:e *)
+ | ExLaz of loc and expr (* lazy e *)
(* let b in e or let rec b in e *)
- | ExLet of Loc.t and meta_bool and binding and expr
+ | ExLet of loc and meta_bool and binding and expr
(* let module s = me in e *)
- | ExLmd of Loc.t and string and module_expr and expr
- (* match e with [ a ] *)
- | ExMat of Loc.t and expr and match_case
+ | ExLmd of loc and string and module_expr and expr
+ (* match e with [ mc ] *)
+ | ExMat of loc and expr and match_case
(* new i *)
- | ExNew of Loc.t and ident
+ | ExNew of loc and ident
(* object ((p))? (cst)? end *)
- | ExObj of Loc.t and patt and class_str_item
+ | ExObj of loc and patt and class_str_item
(* ?s or ?s:e *)
- | ExOlb of Loc.t and string and expr
- (* {< b >} *)
- | ExOvr of Loc.t and rec_binding
- (* { b } or { (e) with b } *)
- | ExRec of Loc.t and rec_binding and expr
+ | ExOlb of loc and string and expr
+ (* {< rb >} *)
+ | ExOvr of loc and rec_binding
+ (* { rb } or { (e) with rb } *)
+ | ExRec of loc and rec_binding and expr
(* do { e } *)
- | ExSeq of Loc.t and expr
+ | ExSeq of loc and expr
(* e#s *)
- | ExSnd of Loc.t and expr and string
+ | ExSnd of loc and expr and string
(* e.[e] *)
- | ExSte of Loc.t and expr and expr
+ | ExSte of loc and expr and expr
(* s *) (* "foo" *)
- | ExStr of Loc.t and string
- (* try e with [ a ] *)
- | ExTry of Loc.t and expr and match_case
+ | ExStr of loc and string
+ (* try e with [ mc ] *)
+ | ExTry of loc and expr and match_case
(* (e) *)
- | ExTup of Loc.t and expr
+ | ExTup of loc and expr
(* e, e *)
- | ExCom of Loc.t and expr and expr
+ | ExCom of loc and expr and expr
(* (e : t) *)
- | ExTyc of Loc.t and expr and ctyp
+ | ExTyc of loc and expr and ctyp
(* `s *)
- | ExVrn of Loc.t and string
+ | ExVrn of loc and string
(* while e do { e } *)
- | ExWhi of Loc.t and expr and expr ]
+ | ExWhi of loc and expr and expr ]
and module_type =
- [ MtNil of Loc.t
+ [ MtNil of loc
(* i *) (* A.B.C *)
- | MtId of Loc.t and ident
+ | MtId of loc and ident
(* functor (s : mt) -> mt *)
- | MtFun of Loc.t and string and module_type and module_type
+ | MtFun of loc and string and module_type and module_type
(* 's *)
- | MtQuo of Loc.t and string
- (* sig (sg)? end *)
- | MtSig of Loc.t and sig_item
+ | MtQuo of loc and string
+ (* sig sg end *)
+ | MtSig of loc and sig_item
(* mt with wc *)
- | MtWit of Loc.t and module_type and with_constr
- | MtAnt of Loc.t and string (* $s$ *) ]
+ | MtWit of loc and module_type and with_constr
+ | MtAnt of loc and string (* $s$ *) ]
and sig_item =
- [ SgNil of Loc.t
+ [ SgNil of loc
(* class cict *)
- | SgCls of Loc.t and class_type
+ | SgCls of loc and class_type
(* class type cict *)
- | SgClt of Loc.t and class_type
+ | SgClt of loc and class_type
(* sg ; sg *)
- | SgSem of Loc.t and sig_item and sig_item
+ | SgSem of loc and sig_item and sig_item
(* # s or # s e *)
- | SgDir of Loc.t and string and expr
+ | SgDir of loc and string and expr
(* exception t *)
- | SgExc of Loc.t and ctyp
+ | SgExc of loc and ctyp
(* external s : t = s ... s *)
- | SgExt of Loc.t and string and ctyp and meta_list string
+ | SgExt of loc and string and ctyp and meta_list string
(* include mt *)
- | SgInc of Loc.t and module_type
+ | SgInc of loc and module_type
(* module s : mt *)
- | SgMod of Loc.t and string and module_type
+ | SgMod of loc and string and module_type
(* module rec mb *)
- | SgRecMod of Loc.t and module_binding
+ | SgRecMod of loc and module_binding
(* module type s = mt *)
- | SgMty of Loc.t and string and module_type
+ | SgMty of loc and string and module_type
(* open i *)
- | SgOpn of Loc.t and ident
+ | SgOpn of loc and ident
(* type t *)
- | SgTyp of Loc.t and ctyp
+ | SgTyp of loc and ctyp
(* value s : t *)
- | SgVal of Loc.t and string and ctyp
- | SgAnt of Loc.t and string (* $s$ *) ]
+ | SgVal of loc and string and ctyp
+ | SgAnt of loc and string (* $s$ *) ]
and with_constr =
- [ WcNil of Loc.t
+ [ WcNil of loc
(* type t = t *)
- | WcTyp of Loc.t and ctyp and ctyp
+ | WcTyp of loc and ctyp and ctyp
(* module i = i *)
- | WcMod of Loc.t and ident and ident
+ | WcMod of loc and ident and ident
(* wc and wc *)
- | WcAnd of Loc.t and with_constr and with_constr
- | WcAnt of Loc.t and string (* $s$ *) ]
+ | WcAnd of loc and with_constr and with_constr
+ | WcAnt of loc and string (* $s$ *) ]
and binding =
- [ BiNil of Loc.t
- (* b and b *) (* let a = 42 and c = 43 *)
- | BiAnd of Loc.t and binding and binding
+ [ BiNil of loc
+ (* bi and bi *) (* let a = 42 and c = 43 *)
+ | BiAnd of loc and binding and binding
(* p = e *) (* let patt = expr *)
- | BiEq of Loc.t and patt and expr
- | BiAnt of Loc.t and string (* $s$ *) ]
+ | BiEq of loc and patt and expr
+ | BiAnt of loc and string (* $s$ *) ]
and rec_binding =
- [ RbNil of Loc.t
- (* b ; b *)
- | RbSem of Loc.t and rec_binding and rec_binding
+ [ RbNil of loc
+ (* rb ; rb *)
+ | RbSem of loc and rec_binding and rec_binding
(* i = e *)
- | RbEq of Loc.t and ident and expr
- | RbAnt of Loc.t and string (* $s$ *) ]
+ | RbEq of loc and ident and expr
+ | RbAnt of loc and string (* $s$ *) ]
and module_binding =
- [ MbNil of Loc.t
+ [ MbNil of loc
(* mb and mb *) (* module rec (s : mt) = me and (s : mt) = me *)
- | MbAnd of Loc.t and module_binding and module_binding
+ | MbAnd of loc and module_binding and module_binding
(* s : mt = me *)
- | MbColEq of Loc.t and string and module_type and module_expr
+ | MbColEq of loc and string and module_type and module_expr
(* s : mt *)
- | MbCol of Loc.t and string and module_type
- | MbAnt of Loc.t and string (* $s$ *) ]
+ | MbCol of loc and string and module_type
+ | MbAnt of loc and string (* $s$ *) ]
and match_case =
- [ McNil of Loc.t
+ [ McNil of loc
(* a | a *)
- | McOr of Loc.t and match_case and match_case
+ | McOr of loc and match_case and match_case
(* p (when e)? -> e *)
- | McArr of Loc.t and patt and expr and expr
- | McAnt of Loc.t and string (* $s$ *) ]
+ | McArr of loc and patt and expr and expr
+ | McAnt of loc and string (* $s$ *) ]
and module_expr =
- [ MeNil of Loc.t
+ [ MeNil of loc
(* i *)
- | MeId of Loc.t and ident
+ | MeId of loc and ident
(* me me *)
- | MeApp of Loc.t and module_expr and module_expr
+ | MeApp of loc and module_expr and module_expr
(* functor (s : mt) -> me *)
- | MeFun of Loc.t and string and module_type and module_expr
- (* struct (st)? end *)
- | MeStr of Loc.t and str_item
+ | MeFun of loc and string and module_type and module_expr
+ (* struct st end *)
+ | MeStr of loc and str_item
(* (me : mt) *)
- | MeTyc of Loc.t and module_expr and module_type
- | MeAnt of Loc.t and string (* $s$ *) ]
+ | MeTyc of loc and module_expr and module_type
+ | MeAnt of loc and string (* $s$ *) ]
and str_item =
- [ StNil of Loc.t
+ [ StNil of loc
(* class cice *)
- | StCls of Loc.t and class_expr
+ | StCls of loc and class_expr
(* class type cict *)
- | StClt of Loc.t and class_type
+ | StClt of loc and class_type
(* st ; st *)
- | StSem of Loc.t and str_item and str_item
+ | StSem of loc and str_item and str_item
(* # s or # s e *)
- | StDir of Loc.t and string and expr
+ | StDir of loc and string and expr
(* exception t or exception t = i *)
- | StExc of Loc.t and ctyp and meta_option(*FIXME*) ident
+ | StExc of loc and ctyp and meta_option(*FIXME*) ident
(* e *)
- | StExp of Loc.t and expr
+ | StExp of loc and expr
(* external s : t = s ... s *)
- | StExt of Loc.t and string and ctyp and meta_list string
+ | StExt of loc and string and ctyp and meta_list string
(* include me *)
- | StInc of Loc.t and module_expr
+ | StInc of loc and module_expr
(* module s = me *)
- | StMod of Loc.t and string and module_expr
+ | StMod of loc and string and module_expr
(* module rec mb *)
- | StRecMod of Loc.t and module_binding
+ | StRecMod of loc and module_binding
(* module type s = mt *)
- | StMty of Loc.t and string and module_type
+ | StMty of loc and string and module_type
(* open i *)
- | StOpn of Loc.t and ident
+ | StOpn of loc and ident
(* type t *)
- | StTyp of Loc.t and ctyp
- (* value b or value rec b *)
- | StVal of Loc.t and meta_bool and binding
- | StAnt of Loc.t and string (* $s$ *) ]
+ | StTyp of loc and ctyp
+ (* value (rec)? bi *)
+ | StVal of loc and meta_bool and binding
+ | StAnt of loc and string (* $s$ *) ]
and class_type =
- [ CtNil of Loc.t
+ [ CtNil of loc
(* (virtual)? i ([ t ])? *)
- | CtCon of Loc.t and meta_bool and ident and ctyp
+ | CtCon of loc and meta_bool and ident and ctyp
(* [t] -> ct *)
- | CtFun of Loc.t and ctyp and class_type
+ | CtFun of loc and ctyp and class_type
(* object ((t))? (csg)? end *)
- | CtSig of Loc.t and ctyp and class_sig_item
+ | CtSig of loc and ctyp and class_sig_item
(* ct and ct *)
- | CtAnd of Loc.t and class_type and class_type
+ | CtAnd of loc and class_type and class_type
(* ct : ct *)
- | CtCol of Loc.t and class_type and class_type
+ | CtCol of loc and class_type and class_type
(* ct = ct *)
- | CtEq of Loc.t and class_type and class_type
+ | CtEq of loc and class_type and class_type
(* $s$ *)
- | CtAnt of Loc.t and string ]
+ | CtAnt of loc and string ]
and class_sig_item =
- [ CgNil of Loc.t
+ [ CgNil of loc
(* type t = t *)
- | CgCtr of Loc.t and ctyp and ctyp
+ | CgCtr of loc and ctyp and ctyp
(* csg ; csg *)
- | CgSem of Loc.t and class_sig_item and class_sig_item
+ | CgSem of loc and class_sig_item and class_sig_item
(* inherit ct *)
- | CgInh of Loc.t and class_type
+ | CgInh of loc and class_type
(* method s : t or method private s : t *)
- | CgMth of Loc.t and string and meta_bool and ctyp
+ | CgMth of loc and string and meta_bool and ctyp
(* value (virtual)? (mutable)? s : t *)
- | CgVal of Loc.t and string and meta_bool and meta_bool and ctyp
+ | CgVal of loc and string and meta_bool and meta_bool and ctyp
(* method virtual (mutable)? s : t *)
- | CgVir of Loc.t and string and meta_bool and ctyp
- | CgAnt of Loc.t and string (* $s$ *) ]
+ | CgVir of loc and string and meta_bool and ctyp
+ | CgAnt of loc and string (* $s$ *) ]
and class_expr =
- [ CeNil of Loc.t
+ [ CeNil of loc
(* ce e *)
- | CeApp of Loc.t and class_expr and expr
+ | CeApp of loc and class_expr and expr
(* (virtual)? i ([ t ])? *)
- | CeCon of Loc.t and meta_bool and ident and ctyp
+ | CeCon of loc and meta_bool and ident and ctyp
(* fun p -> ce *)
- | CeFun of Loc.t and patt and class_expr
- (* let (rec)? b in ce *)
- | CeLet of Loc.t and meta_bool and binding and class_expr
+ | CeFun of loc and patt and class_expr
+ (* let (rec)? bi in ce *)
+ | CeLet of loc and meta_bool and binding and class_expr
(* object ((p))? (cst)? end *)
- | CeStr of Loc.t and patt and class_str_item
+ | CeStr of loc and patt and class_str_item
(* ce : ct *)
- | CeTyc of Loc.t and class_expr and class_type
+ | CeTyc of loc and class_expr and class_type
(* ce and ce *)
- | CeAnd of Loc.t and class_expr and class_expr
+ | CeAnd of loc and class_expr and class_expr
(* ce = ce *)
- | CeEq of Loc.t and class_expr and class_expr
+ | CeEq of loc and class_expr and class_expr
(* $s$ *)
- | CeAnt of Loc.t and string ]
+ | CeAnt of loc and string ]
and class_str_item =
- [ CrNil of Loc.t
+ [ CrNil of loc
(* cst ; cst *)
- | CrSem of Loc.t and class_str_item and class_str_item
+ | CrSem of loc and class_str_item and class_str_item
(* type t = t *)
- | CrCtr of Loc.t and ctyp and ctyp
+ | CrCtr of loc and ctyp and ctyp
(* inherit ce or inherit ce as s *)
- | CrInh of Loc.t and class_expr and string
+ | CrInh of loc and class_expr and string
(* initializer e *)
- | CrIni of Loc.t and expr
+ | CrIni of loc and expr
(* method (private)? s : t = e or method (private)? s = e *)
- | CrMth of Loc.t and string and meta_bool and expr and ctyp
+ | CrMth of loc and string and meta_bool and expr and ctyp
(* value (mutable)? s = e *)
- | CrVal of Loc.t and string and meta_bool and expr
+ | CrVal of loc and string and meta_bool and expr
(* method virtual (private)? s : t *)
- | CrVir of Loc.t and string and meta_bool and ctyp
+ | CrVir of loc and string and meta_bool and ctyp
(* value virtual (private)? s : t *)
- | CrVvr of Loc.t and string and meta_bool and ctyp
- | CrAnt of Loc.t and string (* $s$ *) ];
+ | CrVvr of loc and string and meta_bool and ctyp
+ | CrAnt of loc and string (* $s$ *) ];
and module Ast = Ast
and module Token = Gram.Token
and module Gram = Gram
- and module AntiquotSyntax.Ast = Sig.Camlp4AstToAst Ast
and module Quotation = Quotation
= struct
module Id = struct
value name = "Camlp4Printers.DumpCamlp4Ast";
- value version = "$Id: DumpCamlp4Ast.ml,v 1.5.4.1 2007/03/30 15:50:12 pouillar Exp $";
+ value version = "$Id: DumpCamlp4Ast.ml,v 1.5.4.2 2007/05/22 09:05:39 pouillar Exp $";
end;
module Make (Syntax : Sig.Syntax)
value with_open_out_file x f =
match x with
- [ Some file -> do { let oc = open_out_bin file in f oc;
+ [ Some file -> do { let oc = open_out_bin file;
+ f oc;
flush oc;
close_out oc }
| None -> do { set_binary_mode_out stdout True; f stdout; flush stdout } ];
module Id : Sig.Id = struct
value name = "Camlp4Printers.DumpOCamlAst";
- value version = "$Id: DumpOCamlAst.ml,v 1.5.4.1 2007/03/30 15:50:12 pouillar Exp $";
+ value version = "$Id: DumpOCamlAst.ml,v 1.5.4.2 2007/05/22 09:05:39 pouillar Exp $";
end;
module Make (Syntax : Sig.Camlp4Syntax)
value with_open_out_file x f =
match x with
- [ Some file -> do { let oc = open_out_bin file in f oc;
+ [ Some file -> do { let oc = open_out_bin file;
+ f oc;
flush oc;
close_out oc }
| None -> do { set_binary_mode_out stdout True; f stdout; flush stdout } ];
module Id = struct
value name = "Camlp4.Printers.OCaml";
- value version = "$Id: OCaml.ml,v 1.21.2.9 2007/05/12 22:44:55 pouillar Exp $";
+ value version = "$Id: OCaml.ml,v 1.21.2.24 2007/11/27 14:35:12 ertai Exp $";
end;
module Make (Syntax : Sig.Camlp4Syntax) = struct
include Syntax;
+ type sep = format unit formatter unit;
+
value pp = fprintf;
value cut f = fprintf f "@ ";
module StringSet = Set.Make String;
+ value infix_lidents = ["asr"; "land"; "lor"; "lsl"; "lsr"; "lxor"; "mod"; "or"];
+
value is_infix =
let first_chars = ['='; '<'; '>'; '|'; '&'; '$'; '@'; '^'; '+'; '-'; '*'; '/'; '%'; '\\']
and infixes =
- List.fold_right StringSet.add
- ["asr"; "land"; "lor"; "lsl"; "lsr"; "lxor"; "mod"; "or"] StringSet.empty
+ List.fold_right StringSet.add infix_lidents StringSet.empty
in fun s -> (StringSet.mem s infixes
|| (s <> "" && List.mem s.[0] first_chars));
value is_keyword =
- let keywords =
+ let keywords = (* without infix_lidents *)
List.fold_right StringSet.add
- ["and"; "as"; "assert"; "asr"; "begin"; "class"; "constraint"; "do";
- "done"; "downto"; "else"; "end"; "exception"; "external"; "false";
- "for"; "fun"; "function"; "functor"; "if"; "in"; "include";
- "inherit"; "initializer"; "land"; "lazy"; "let"; "lor"; "lsl"; "lsr";
- "lxor"; "match"; "method"; "mod"; "module"; "mutable"; "new";
- "object"; "of"; "open"; "or"; "parser"; "private"; "rec"; "sig";
+ ["and"; "as"; "assert"; "begin"; "class"; "constraint"; "do";
+ "done"; "downto"; "else"; "end"; "exception"; "external"; "false";
+ "for"; "fun"; "function"; "functor"; "if"; "in"; "include";
+ "inherit"; "initializer"; "lazy"; "let"; "match"; "method"; "module";
+ "mutable"; "new"; "object"; "of"; "open"; "parser"; "private"; "rec"; "sig";
"struct"; "then"; "to"; "true"; "try"; "type"; "val"; "virtual";
"when"; "while"; "with"] StringSet.empty
in fun s -> StringSet.mem s keywords;
try match lexer str with parser
[: `(tok, _); `(EOI, _) :] -> tok
with
- [ Stream.Failure ->
+ [ Stream.Failure | Stream.Error _ ->
failwith (sprintf
"Cannot print %S this string contains more than one token" str)
| Lexer.Error.E exn ->
method reset_semi = {< semi = False >};
method reset = {< pipe = False; semi = False >};
- value semisep = ";;";
- value andsep : format unit formatter unit = "@]@ @[<2>and@ ";
+ value semisep : sep = ";;";
+ value andsep : sep = "@]@ @[<2>and@ ";
value value_val = "val";
value value_let = "let";
value mode = if comments then `comments else `no_comments;
| _ ->
match lex_string v with
[ (LIDENT s | UIDENT s | ESCAPED_IDENT s) when is_keyword s ->
- pp f "%s__" s
+ pp f "%s__" s
+ | (LIDENT s | ESCAPED_IDENT s) when List.mem s infix_lidents ->
+ pp f "( %s )" s
| SYMBOL s ->
pp f "( %s )" s
| LIDENT s | UIDENT s | ESCAPED_IDENT s ->
o#under_semi#record_binding f b2 }
| <:rec_binding< $anti:s$ >> -> o#anti f s ];
- method object_dup f =
- list (fun f (s, e) -> pp f "@[<2>%a =@ %a@]" o#var s o#expr e) ";@ " f;
-
method mk_patt_list =
fun
[ <:patt< [$p1$ :: $p2$] >> ->
method expr_list f =
fun
[ [] -> pp f "[]"
- | [e] -> pp f "[ %a ]" o#expr e
- | el -> pp f "@[<2>[ %a@] ]" (list o#expr ";@ ") el ];
+ | [e] -> pp f "[ %a ]" o#under_semi#expr e
+ | el -> pp f "@[<2>[ %a@] ]" (list o#under_semi#expr ";@ ") el ];
method expr_list_cons simple f e =
let (el, c) = o#mk_expr_list e in
[ None -> o#expr_list f el
| Some x ->
(if simple then pp f "@[<2>(%a)@]" else pp f "@[<2>%a@]")
- (list o#dot_expr " ::@ ") (el @ [x]) ];
+ (list o#under_semi#dot_expr " ::@ ") (el @ [x]) ];
method patt_expr_fun_args f (p, e) =
let (pl, e) = expr_fun_args e
method constrain f (t1, t2) =
pp f "@[<2>constraint@ %a =@ %a@]" o#ctyp t1 o#ctyp t2;
- method sum_type f t = do {
- (* FIXME pp_print_if_newline f (); *)
- pp_print_string f "| ";
- o#ctyp f t;
- };
+ method sum_type f t =
+ match Ast.list_of_ctyp t [] with
+ [ [] -> ()
+ | ts ->
+ pp f "@[<hv0>| %a@]" (list o#ctyp "@ | ") ts ];
+
method string f = pp f "%s";
method quoted_string f = pp f "%S";
- method intlike f s = if s.[0] = '-' then pp f "(%s)" s else pp f "%s" s;
+ method numeric f num suff =
+ if num.[0] = '-' then pp f "(%s%s)" num suff else pp f "%s%s" num suff;
method module_expr_get_functor_args accu =
fun
pp f "(%a)" o#reset#expr e
| <:expr< - $x$ >> ->
- pp f "@[<2>-@,%a@]" o#expr x
+ (* If you want to remove the space take care of - !r *)
+ pp f "@[<2>-@ %a@]" o#dot_expr x
| <:expr< -. $x$ >> ->
- pp f "@[<2>-.@,%a@]" o#expr x
+ pp f "@[<2>-.@ %a@]" o#dot_expr x (* same note as above *)
| <:expr< [$_$ :: $_$] >> -> o#expr_list_cons False f e
| <:expr@_loc< $lid:n$ $x$ $y$ >> when is_infix n ->
pp f "@[<2>%a@ %s@ %a@]" o#apply_expr x n o#apply_expr y
(list o#under_pipe#expr ",@ ") al ]
else pp f "@[<2>%a@]" (list o#apply_expr "@ ") [a::al]
| <:expr< $e1$.val := $e2$ >> ->
- pp f "@[<2>%a :=@ %a@]" o#expr e1 o#expr e2
+ pp f "@[<2>%a :=@ %a@]" o#dot_expr e1 o#expr e2
| <:expr< $e1$ := $e2$ >> ->
- pp f "@[<2>%a@ <-@ %a@]" o#expr e1 o#expr e2
+ pp f "@[<2>%a@ <-@ %a@]" o#dot_expr e1 o#expr e2
| <:expr@loc< fun [] >> ->
pp f "@[<2>fun@ _@ ->@ %a@]" o#raise_match_failure loc
| <:expr< fun $p$ -> $e$ >> when is_irrefut_patt p ->
| <:expr< assert False >> -> pp f "@[<2>assert@ false@]"
| <:expr< assert $e$ >> -> pp f "@[<2>assert@ %a@]" o#dot_expr e
| <:expr< let module $s$ = $me$ in $e$ >> ->
- pp f "@[<2>let module %a =@ %a@]@ @[<2>in@ %a@]" o#var s o#module_expr me o#expr e
+ pp f "@[<2>let module %a =@ %a@]@ @[<2>in@ %a@]" o#var s o#module_expr me o#reset_semi#expr e
| e -> o#apply_expr f e ];
method apply_expr f e =
| <:expr< for $s$ = $e1$ $to:df$ $e2$ do { $e3$ } >> ->
pp f "@[<hv0>@[<hv2>@[<2>for %a =@ %a@ %a@ %a@ do@]@ %a@]@ done@]"
o#var s o#expr e1 o#direction_flag df o#expr e2 o#seq e3
- | <:expr< $int:s$ >> -> pp f "%a" o#intlike s
- | <:expr< $nativeint:s$ >> -> pp f "%an" o#intlike s
- | <:expr< $int64:s$ >> -> pp f "%aL" o#intlike s
- | <:expr< $int32:s$ >> -> pp f "%al" o#intlike s
- | <:expr< $flo:s$ >> -> pp f "%s" s
+ | <:expr< $int:s$ >> -> o#numeric f s ""
+ | <:expr< $nativeint:s$ >> -> o#numeric f s "n"
+ | <:expr< $int64:s$ >> -> o#numeric f s "L"
+ | <:expr< $int32:s$ >> -> o#numeric f s "l"
+ | <:expr< $flo:s$ >> -> o#numeric f s ""
| <:expr< $chr:s$ >> -> pp f "'%s'" (ocaml_char s)
| <:expr< $id:i$ >> -> o#var_ident f i
| <:expr< { $b$ } >> ->
[ <:patt< [$_$ :: $_$] >> as p -> o#simple_patt f p
| <:patt< $x$ $y$ >> ->
let (a, al) = get_patt_args x [y] in
- if (not curry_constr) && Ast.is_patt_constructor a then
+ if not (Ast.is_patt_constructor a) then
+ Format.eprintf "WARNING: strange pattern application of a non constructor@."
+ else if curry_constr then
+ pp f "@[<2>%a@]" (list o#simple_patt "@ ") [a::al]
+ else
match al with
[ [ <:patt< ($tup:_$) >> ] ->
pp f "@[<2>%a@ (%a)@]" o#simple_patt x o#patt y
| [_] -> pp f "@[<2>%a@ %a@]" o#patt5 x o#simple_patt y
| al -> pp f "@[<2>%a@ (%a)@]" o#patt5 a
(list o#simple_patt ",@ ") al ]
- else
- pp f "@[<2>%a@]" (list o#simple_patt "@ ") [a::al]
| p -> o#simple_patt f p ];
method simple_patt f p =
| <:patt< { $p$ } >> -> pp f "@[<hv2>{@ %a@]@ }" o#patt p
| <:patt< $str:s$ >> -> pp f "\"%s\"" s
| <:patt< ( $p$ : $t$ ) >> -> pp f "@[<1>(%a :@ %a)@]" o#patt p o#ctyp t
- | <:patt< $nativeint:s$ >> -> pp f "%an" o#intlike s
- | <:patt< $int64:s$ >> -> pp f "%aL" o#intlike s
- | <:patt< $int32:s$ >> -> pp f "%al" o#intlike s
- | <:patt< $int:s$ >> -> pp f "%a" o#intlike s
- | <:patt< $flo:s$ >> -> pp f "%s" s
+ | <:patt< $nativeint:s$ >> -> o#numeric f s "n"
+ | <:patt< $int64:s$ >> -> o#numeric f s "L"
+ | <:patt< $int32:s$ >> -> o#numeric f s "l"
+ | <:patt< $int:s$ >> -> o#numeric f s ""
+ | <:patt< $flo:s$ >> -> o#numeric f s ""
| <:patt< $chr:s$ >> -> pp f "'%s'" (ocaml_char s)
| <:patt< ~ $s$ >> -> pp f "~%s" s
| <:patt< ` $uid:s$ >> -> pp f "`%a" o#var s
| <:patt< ~ $s$ : ($p$) >> -> pp f "@[<2>~%s:@ (%a)@]" s o#patt p
| <:patt< ? $s$ >> -> pp f "?%s" s
| <:patt< ?($p$) >> ->
- pp f "@[<2>?(%a)@]" o#patt p
+ pp f "@[<2>?(%a)@]" o#patt_tycon p
| <:patt< ? $s$ : ($p$) >> ->
- pp f "@[<2>?%s:@,@[<1>(%a)@]@]" s o#patt p
+ pp f "@[<2>?%s:@,@[<1>(%a)@]@]" s o#patt_tycon p
| <:patt< ?($p$ = $e$) >> ->
- pp f "@[<2>?(%a =@ %a)@]" o#patt p o#expr e
+ pp f "@[<2>?(%a =@ %a)@]" o#patt_tycon p o#expr e
| <:patt< ? $s$ : ($p$ = $e$) >> ->
- pp f "@[<2>?%s:@,@[<1>(%a =@ %a)@]@]" s o#patt p o#expr e
+ pp f "@[<2>?%s:@,@[<1>(%a =@ %a)@]@]" s o#patt_tycon p o#expr e
| <:patt< $_$ $_$ >> | <:patt< ($_$ as $_$) >> | <:patt< $_$ | $_$ >> |
<:patt< $_$ .. $_$ >> | <:patt< $_$, $_$ >> |
<:patt< $_$; $_$ >> | <:patt< $_$ = $_$ >> as p ->
pp f "@[<1>(%a)@]" o#patt p ];
+ method patt_tycon f =
+ fun
+ [ <:patt< ( $p$ : $t$ ) >> -> pp f "%a :@ %a" o#patt p o#ctyp t
+ | p -> o#patt f p ];
+
method simple_ctyp f t =
let () = o#node f t Ast.loc_of_ctyp in
match t with
| <:ctyp< { $t$ } >> -> pp f "@[<2>{@ %a@]@ }" o#ctyp t
| <:ctyp< [ $t$ ] >> -> pp f "@[<0>%a@]" o#sum_type t
| <:ctyp< ( $tup:t$ ) >> -> pp f "@[<1>(%a)@]" o#ctyp t
- | <:ctyp< [ = $t$ ] >> -> pp f "@[<2>[@ %a@]@ ]" o#ctyp t
- | <:ctyp< [ < $t$ ] >> -> pp f "@[<2>[<@ %a@]@,]" o#ctyp t
+ | <:ctyp< [ = $t$ ] >> -> pp f "@[<2>[@ %a@]@ ]" o#sum_type t
+ | <:ctyp< [ < $t$ ] >> -> pp f "@[<2>[<@ %a@]@,]" o#sum_type t
| <:ctyp< [ < $t1$ > $t2$ ] >> ->
- pp f "@[<2>[<@ %a@ >@ %a@]@ ]" o#ctyp t1 o#ctyp t2
- | <:ctyp< [ > $t$ ] >> -> pp f "@[<2>[>@ %a@]@,]" o#ctyp t
+ let (a, al) = get_ctyp_args t2 [] in
+ pp f "@[<2>[<@ %a@ >@ %a@]@ ]" o#sum_type t1
+ (list o#simple_ctyp "@ ") [a::al]
+ | <:ctyp< [ > $t$ ] >> -> pp f "@[<2>[>@ %a@]@,]" o#sum_type t
| <:ctyp< # $i$ >> -> pp f "@[<2>#%a@]" o#ident i
| <:ctyp< $t1$ == $t2$ >> ->
pp f "@[<2>%a =@ %a@]" o#simple_ctyp t1 o#simple_ctyp t2
| <:ctyp< `$s$ >> -> pp f "`%a" o#var s
| <:ctyp< $t1$ * $t2$ >> -> pp f "%a *@ %a" o#simple_ctyp t1 o#simple_ctyp t2
+ | <:ctyp<>> -> assert False
| t -> pp f "@[<1>(%a)@]" o#ctyp t ];
method ctyp f t =
| <:sig_item< $sg1$; $sg2$ >> ->
do { o#sig_item f sg1; cut f; o#sig_item f sg2 }
| <:sig_item< exception $t$ >> ->
- pp f "@[<2>exception@ %a%s@]" o#ctyp t semisep
+ pp f "@[<2>exception@ %a%(%)@]" o#ctyp t semisep
| <:sig_item< external $s$ : $t$ = $sl$ >> ->
- pp f "@[<2>external@ %a :@ %a =@ %a%s@]"
+ pp f "@[<2>external@ %a :@ %a =@ %a%(%)@]"
o#var s o#ctyp t (meta_list o#quoted_string "@ ") sl semisep
| <:sig_item< module $s1$ ($s2$ : $mt1$) : $mt2$ >> ->
let rec loop accu =
loop [(s, mt1)::accu] mt2
| mt -> (List.rev accu, mt) ] in
let (al, mt) = loop [(s2, mt1)] mt2 in
- pp f "@[<2>module %a@ @[<0>%a@] :@ %a%s@]"
+ pp f "@[<2>module %a@ @[<0>%a@] :@ %a%(%)@]"
o#var s1 o#functor_args al o#module_type mt semisep
| <:sig_item< module $s$ : $mt$ >> ->
- pp f "@[<2>module %a :@ %a%s@]"
+ pp f "@[<2>module %a :@ %a%(%)@]"
o#var s o#module_type mt semisep
| <:sig_item< module type $s$ = $ <:module_type<>> $ >> ->
- pp f "@[<2>module type %a%s@]" o#var s semisep
+ pp f "@[<2>module type %a%(%)@]" o#var s semisep
| <:sig_item< module type $s$ = $mt$ >> ->
- pp f "@[<2>module type %a =@ %a%s@]"
+ pp f "@[<2>module type %a =@ %a%(%)@]"
o#var s o#module_type mt semisep
| <:sig_item< open $sl$ >> ->
- pp f "@[<2>open@ %a%s@]" o#ident sl semisep
+ pp f "@[<2>open@ %a%(%)@]" o#ident sl semisep
| <:sig_item< type $t$ >> ->
- pp f "@[<hv0>@[<hv2>type %a@]%s@]" o#ctyp t semisep
+ pp f "@[<hv0>@[<hv2>type %a@]%(%)@]" o#ctyp t semisep
| <:sig_item< value $s$ : $t$ >> ->
- pp f "@[<2>%s %a :@ %a%s@]"
+ pp f "@[<2>%s %a :@ %a%(%)@]"
value_val o#var s o#ctyp t semisep
| <:sig_item< include $mt$ >> ->
- pp f "@[<2>include@ %a%s@]" o#module_type mt semisep
+ pp f "@[<2>include@ %a%(%)@]" o#module_type mt semisep
| <:sig_item< class type $ct$ >> ->
- pp f "@[<2>class type %a%s@]" o#class_type ct semisep
+ pp f "@[<2>class type %a%(%)@]" o#class_type ct semisep
| <:sig_item< class $ce$ >> ->
- pp f "@[<2>class %a%s@]" o#class_type ce semisep
+ pp f "@[<2>class %a%(%)@]" o#class_type ce semisep
| <:sig_item< module rec $mb$ >> ->
- pp f "@[<2>module rec %a%s@]"
+ pp f "@[<2>module rec %a%(%)@]"
o#module_rec_binding mb semisep
| <:sig_item< # $_$ $_$ >> -> ()
| <:sig_item< $anti:s$ >> ->
- pp f "%a%s" o#anti s semisep ];
+ pp f "%a%(%)" o#anti s semisep ];
method str_item f st =
let () = o#node f st Ast.loc_of_str_item in
| <:str_item< $st1$; $st2$ >> ->
do { o#str_item f st1; cut f; o#str_item f st2 }
| <:str_item< exception $t$ >> ->
- pp f "@[<2>exception@ %a%s@]" o#ctyp t semisep
+ pp f "@[<2>exception@ %a%(%)@]" o#ctyp t semisep
| <:str_item< exception $t$ = $sl$ >> ->
- pp f "@[<2>exception@ %a =@ %a%s@]" o#ctyp t o#ident sl semisep
+ pp f "@[<2>exception@ %a =@ %a%(%)@]" o#ctyp t o#ident sl semisep
| <:str_item< external $s$ : $t$ = $sl$ >> ->
- pp f "@[<2>external@ %a :@ %a =@ %a%s@]"
+ pp f "@[<2>external@ %a :@ %a =@ %a%(%)@]"
o#var s o#ctyp t (meta_list o#quoted_string "@ ") sl semisep
| <:str_item< module $s1$ ($s2$ : $mt1$) = $me$ >> ->
match o#module_expr_get_functor_args [(s2, mt1)] me with
[ (al, me, Some mt2) ->
- pp f "@[<2>module %a@ @[<0>%a@] :@ %a =@ %a%s@]"
+ pp f "@[<2>module %a@ @[<0>%a@] :@ %a =@ %a%(%)@]"
o#var s1 o#functor_args al o#module_type mt2
o#module_expr me semisep
| (al, me, _) ->
- pp f "@[<2>module %a@ @[<0>%a@] =@ %a%s@]"
+ pp f "@[<2>module %a@ @[<0>%a@] =@ %a%(%)@]"
o#var s1 o#functor_args al o#module_expr me semisep ]
| <:str_item< module $s$ : $mt$ = $me$ >> ->
- pp f "@[<2>module %a :@ %a =@ %a%s@]"
+ pp f "@[<2>module %a :@ %a =@ %a%(%)@]"
o#var s o#module_type mt o#module_expr me semisep
| <:str_item< module $s$ = $me$ >> ->
- pp f "@[<2>module %a =@ %a%s@]" o#var s o#module_expr me semisep
+ pp f "@[<2>module %a =@ %a%(%)@]" o#var s o#module_expr me semisep
| <:str_item< module type $s$ = $mt$ >> ->
- pp f "@[<2>module type %a =@ %a%s@]"
+ pp f "@[<2>module type %a =@ %a%(%)@]"
o#var s o#module_type mt semisep
| <:str_item< open $sl$ >> ->
- pp f "@[<2>open@ %a%s@]" o#ident sl semisep
+ pp f "@[<2>open@ %a%(%)@]" o#ident sl semisep
| <:str_item< type $t$ >> ->
- pp f "@[<hv0>@[<hv2>type %a@]%s@]" o#ctyp t semisep
+ pp f "@[<hv0>@[<hv2>type %a@]%(%)@]" o#ctyp t semisep
| <:str_item< value $rec:r$ $bi$ >> ->
- pp f "@[<2>%s %a%a%s@]" value_let o#rec_flag r o#binding bi semisep
+ pp f "@[<2>%s %a%a%(%)@]" value_let o#rec_flag r o#binding bi semisep
| <:str_item< $exp:e$ >> ->
- pp f "@[<2>let _ =@ %a%s@]" o#expr e semisep
+ pp f "@[<2>let _ =@ %a%(%)@]" o#expr e semisep
| <:str_item< include $me$ >> ->
- pp f "@[<2>include@ %a%s@]" o#module_expr me semisep
+ pp f "@[<2>include@ %a%(%)@]" o#module_expr me semisep
| <:str_item< class type $ct$ >> ->
- pp f "@[<2>class type %a%s@]" o#class_type ct semisep
+ pp f "@[<2>class type %a%(%)@]" o#class_type ct semisep
| <:str_item< class $ce$ >> ->
- pp f "@[<hv2>class %a%s@]" o#class_declaration ce semisep
+ pp f "@[<hv2>class %a%(%)@]" o#class_declaration ce semisep
| <:str_item< module rec $mb$ >> ->
- pp f "@[<2>module rec %a%s@]" o#module_rec_binding mb semisep
+ pp f "@[<2>module rec %a%(%)@]" o#module_rec_binding mb semisep
| <:str_item< # $_$ $_$ >> -> ()
- | <:str_item< $anti:s$ >> -> pp f "%a%s" o#anti s semisep
+ | <:str_item< $anti:s$ >> -> pp f "%a%(%)" o#anti s semisep
| Ast.StExc _ _ (Ast.OAnt _) -> assert False ];
method module_type f mt =
o#class_sig_item f csg
| <:class_sig_item< $csg1$; $csg2$ >> ->
do { o#class_sig_item f csg1; cut f; o#class_sig_item f csg2 }
- | <:class_sig_item< type $t1$ = $t2$ >> ->
- pp f "@[<2>type@ %a =@ %a%s@]" o#ctyp t1 o#ctyp t2 semisep
+ | <:class_sig_item< constraint $t1$ = $t2$ >> ->
+ pp f "@[<2>constraint@ %a =@ %a%(%)@]" o#ctyp t1 o#ctyp t2 semisep
| <:class_sig_item< inherit $ct$ >> ->
- pp f "@[<2>inherit@ %a%s@]" o#class_type ct semisep
+ pp f "@[<2>inherit@ %a%(%)@]" o#class_type ct semisep
| <:class_sig_item< method $private:pr$ $s$ : $t$ >> ->
- pp f "@[<2>method %a%a :@ %a%s@]" o#private_flag pr o#var s
+ pp f "@[<2>method %a%a :@ %a%(%)@]" o#private_flag pr o#var s
o#ctyp t semisep
| <:class_sig_item< method virtual $private:pr$ $s$ : $t$ >> ->
- pp f "@[<2>method virtual %a%a :@ %a%s@]"
+ pp f "@[<2>method virtual %a%a :@ %a%(%)@]"
o#private_flag pr o#var s o#ctyp t semisep
| <:class_sig_item< value $mutable:mu$ $virtual:vi$ $s$ : $t$ >> ->
- pp f "@[<2>%s %a%a%a :@ %a%s@]"
+ pp f "@[<2>%s %a%a%a :@ %a%(%)@]"
value_val o#mutable_flag mu o#virtual_flag vi o#var s o#ctyp t
semisep
| <:class_sig_item< $anti:s$ >> ->
- pp f "%a%s" o#anti s semisep ];
+ pp f "%a%(%)" o#anti s semisep ];
method class_str_item f cst =
let () = o#node f cst Ast.loc_of_class_str_item in
o#class_str_item f cst
| <:class_str_item< $cst1$; $cst2$ >> ->
do { o#class_str_item f cst1; cut f; o#class_str_item f cst2 }
- | <:class_str_item< type $t1$ = $t2$ >> ->
- pp f "@[<2>type %a =@ %a%s@]" o#ctyp t1 o#ctyp t2 semisep
+ | <:class_str_item< constraint $t1$ = $t2$ >> ->
+ pp f "@[<2>constraint %a =@ %a%(%)@]" o#ctyp t1 o#ctyp t2 semisep
| <:class_str_item< inherit $ce$ >> ->
- pp f "@[<2>inherit@ %a%s@]" o#class_expr ce semisep
+ pp f "@[<2>inherit@ %a%(%)@]" o#class_expr ce semisep
| <:class_str_item< inherit $ce$ as $lid:s$ >> ->
- pp f "@[<2>inherit@ %a as@ %a%s@]" o#class_expr ce o#var s semisep
+ pp f "@[<2>inherit@ %a as@ %a%(%)@]" o#class_expr ce o#var s semisep
| <:class_str_item< initializer $e$ >> ->
- pp f "@[<2>initializer@ %a%s@]" o#expr e semisep
+ pp f "@[<2>initializer@ %a%(%)@]" o#expr e semisep
| <:class_str_item< method $private:pr$ $s$ = $e$ >> ->
- pp f "@[<2>method %a%a =@ %a%s@]"
+ pp f "@[<2>method %a%a =@ %a%(%)@]"
o#private_flag pr o#var s o#expr e semisep
| <:class_str_item< method $private:pr$ $s$ : $t$ = $e$ >> ->
- pp f "@[<2>method %a%a :@ %a =@ %a%s@]"
+ pp f "@[<2>method %a%a :@ %a =@ %a%(%)@]"
o#private_flag pr o#var s o#ctyp t o#expr e semisep
| <:class_str_item< method virtual $private:pr$ $s$ : $t$ >> ->
- pp f "@[<2>method virtual@ %a%a :@ %a%s@]"
+ pp f "@[<2>method virtual@ %a%a :@ %a%(%)@]"
o#private_flag pr o#var s o#ctyp t semisep
| <:class_str_item< value virtual $mutable:mu$ $s$ : $t$ >> ->
- pp f "@[<2>%s virtual %a%a :@ %a%s@]"
+ pp f "@[<2>%s virtual %a%a :@ %a%(%)@]"
value_val o#mutable_flag mu o#var s o#ctyp t semisep
| <:class_str_item< value $mutable:mu$ $s$ = $e$ >> ->
- pp f "@[<2>%s %a%a =@ %a%s@]"
+ pp f "@[<2>%s %a%a =@ %a%(%)@]"
value_val o#mutable_flag mu o#var s o#expr e semisep
| <:class_str_item< $anti:s$ >> ->
- pp f "%a%s" o#anti s semisep ];
+ pp f "%a%(%)" o#anti s semisep ];
method implem f st =
match st with
- [ <:str_item< $exp:e$ >> -> pp f "@[<0>%a%s@]@." o#expr e semisep
+ [ <:str_item< $exp:e$ >> -> pp f "@[<0>%a%(%)@]@." o#expr e semisep
| st -> pp f "@[<v0>%a@]@." o#str_item st ];
method interf f sg = pp f "@[<v0>%a@]@." o#sig_item sg;
include Make Syntax;
- value semisep = ref False;
+ value semisep : ref sep = ref ("@\n" : sep);
value margin = ref 78;
value comments = ref True;
value locations = ref False;
value print output_file fct =
let o = new printer ~comments:comments.val
~curry_constr:curry_constr.val () in
- let o = if semisep.val then o#set_semisep ";;" else o#set_semisep "" in
+ let o = o#set_semisep semisep.val in
let o = if locations.val then o#set_loc_and_comments else o in
with_outfile output_file
(fun f ->
value print_implem ?input_file:(_) ?output_file st =
print output_file (fun o -> o#implem) st;
+ value check_sep s =
+ if String.contains s '%' then failwith "-sep Format error, % found in string"
+ else (Obj.magic (Struct.Token.Eval.string s : string) : sep);
+
Options.add "-l" (Arg.Int (fun i -> margin.val := i))
"<length> line length for pretty printing.";
- Options.add "-ss" (Arg.Set semisep) "Print double semicolons.";
+ Options.add "-ss" (Arg.Unit (fun () -> semisep.val := ";;"))
+ " Print double semicolons.";
- Options.add "-curry-constr" (Arg.Set curry_constr) "Use currified constructors.";
+ Options.add "-no_ss" (Arg.Unit (fun () -> semisep.val := ""))
+ " Do not print double semicolons (default).";
- Options.add "-no_ss" (Arg.Clear semisep)
- "Do not print double semicolons (default).";
+ Options.add "-sep" (Arg.String (fun s -> semisep.val := check_sep s))
+ " Use this string between phrases.";
+
+ Options.add "-curry-constr" (Arg.Set curry_constr) "Use currified constructors.";
Options.add "-no_comments" (Arg.Clear comments) "Do not add comments.";
and module Ast = Syntax.Ast
and module Gram = Syntax.Gram;
+ type sep = format unit formatter unit;
+
value list' :
(formatter -> 'a -> unit) ->
format 'b formatter unit ->
value pipe : bool;
value semi : bool;
- value semisep : string;
+ value semisep : sep;
value value_val : string;
value value_let : string;
method anti : formatter -> string -> unit;
formatter ->
list (string * Ast.module_type) -> unit;
method ident : formatter -> Ast.ident -> unit;
- method intlike : formatter -> string -> unit;
+ method numeric : formatter -> string -> string -> unit;
method binding : formatter -> Ast.binding -> unit;
method record_binding : formatter -> Ast.rec_binding -> unit;
method match_case : formatter -> Ast.match_case -> unit;
method rec_flag : formatter -> Ast.meta_bool -> unit;
method flag : formatter -> Ast.meta_bool -> string -> unit;
method node : formatter -> 'b -> ('b -> Loc.t) -> unit;
- method object_dup :
- formatter -> list (string * Ast.expr) -> unit;
method patt : formatter -> Ast.patt -> unit;
method patt1 : formatter -> Ast.patt -> unit;
method patt2 : formatter -> Ast.patt -> unit;
method patt3 : formatter -> Ast.patt -> unit;
method patt4 : formatter -> Ast.patt -> unit;
method patt5 : formatter -> Ast.patt -> unit;
+ method patt_tycon : formatter -> Ast.patt -> unit;
method patt_expr_fun_args :
formatter -> (Ast.patt * Ast.expr) -> unit;
method patt_class_expr_fun_args :
method raise_match_failure : formatter -> Loc.t -> unit;
method reset : 'a;
method reset_semi : 'a;
- method semisep : string;
+ method semisep : sep;
method set_comments : bool -> 'a;
method set_curry_constr : bool -> 'a;
method set_loc_and_comments : 'a;
- method set_semisep : string -> 'a;
+ method set_semisep : sep -> 'a;
method simple_ctyp : formatter -> Ast.ctyp -> unit;
method simple_expr : formatter -> Ast.expr -> unit;
method simple_patt : formatter -> Ast.patt -> unit;
module Id = struct
value name = "Camlp4.Printers.OCamlr";
- value version = "$Id: OCamlr.ml,v 1.17.4.4 2007/05/10 22:43:18 pouillar Exp $";
+ value version = "$Id: OCamlr.ml,v 1.17.4.6 2007/11/27 14:35:13 ertai Exp $";
end;
module Make (Syntax : Sig.Camlp4Syntax) = struct
object (o)
inherit PP_o.printer ~curry_constr:init_curry_constr ~comments () as super;
- value semisep = ";";
- value andsep : format unit formatter unit = "@]@ @[<2>and@ ";
+ value semisep : sep = ";";
+ value andsep : sep = "@]@ @[<2>and@ ";
value value_val = "value";
value value_let = "value";
value mode = if comments then `comments else `no_comments;
let () = o#node f e Ast.loc_of_expr in
match e with
[ <:expr< $e1$ := $e2$ >> ->
- pp f "@[<2>%a@ :=@ %a@]" o#expr e1 o#expr e2
+ pp f "@[<2>%a@ :=@ %a@]" o#dot_expr e1 o#expr e2
| <:expr< fun $p$ -> $e$ >> when Ast.is_irrefut_patt p ->
pp f "@[<2>fun@ %a@]" o#patt_expr_fun_args (p, e)
| <:expr< fun [ $a$ ] >> ->
method str_item f st =
match st with
- [ <:str_item< $exp:e$ >> -> pp f "@[<2>%a%s@]" o#expr e semisep
+ [ <:str_item< $exp:e$ >> -> pp f "@[<2>%a%(%)@]" o#expr e semisep
| st -> super#str_item f st ];
method module_expr f me =
* - Nicolas Pouillard: refactoring
*)
+(** Camlp4 signature repository *)
+
+(** {6 Basic signatures} *)
+
+(** Signature with just a type. *)
module type Type = sig
type t;
end;
(** The name of the extension, typically the module name. *)
value name : string;
- (** The version of the extension, typically $Id: Sig.ml,v 1.2.2.10 2007/05/10 22:43:18 pouillar Exp $ with a versionning system. *)
+ (** The version of the extension, typically $Id: Sig.ml,v 1.2.2.13 2007/06/23 16:00:09 ertai Exp $ with a versionning system. *)
value version : string;
end;
+(** A signature for warnings abstract from locations. *)
+module Warning (Loc : Type) = struct
+ module type S = sig
+ type warning = Loc.t -> string -> unit;
+ value default_warning : warning;
+ value current_warning : ref warning;
+ value print_warning : warning;
+ end;
+end;
+
+(** {6 Advanced signatures} *)
+
+(** A signature for locations. *)
module type Loc = sig
type t;
value of_lexing_position : Lexing.position -> t;
(** Return an OCaml location. *)
- value to_ocaml_location : t -> Location.t;
+ value to_ocaml_location : t -> Camlp4_import.Location.t;
(** Return a location from an OCaml location. *)
- value of_ocaml_location : Location.t -> t;
+ value of_ocaml_location : Camlp4_import.Location.t -> t;
(** Return a location from ocamllex buffer. *)
value of_lexbuf : Lexing.lexbuf -> t;
The "begin of line" of both positions become the current offset. *)
value move_line : int -> t -> t;
- (** Accessors *)
+ (** {6 Accessors} *)
(** Return the file name *)
value file_name : t -> string;
end;
-module Warning (Loc : Loc) = struct
- module type S = sig
- type warning = Loc.t -> string -> unit;
- value default_warning : warning;
- value current_warning : ref warning;
- value print_warning : warning;
- end;
-end;
-
-(** Base class for map traversal, it includes some builtin types. *)
-class mapper : object
- method string : string -> string;
- method int : int -> int;
- method float : float -> float;
- method bool : bool -> bool;
- method list : ! 'a 'b . ('a -> 'b) -> list 'a -> list 'b;
- method option : ! 'a 'b . ('a -> 'b) -> option 'a -> option 'b;
- method array : ! 'a 'b . ('a -> 'b) -> array 'a -> array 'b;
- method ref : ! 'a 'b . ('a -> 'b) -> ref 'a -> ref 'b;
-end = object
- method string x : string = x;
- method int x : int = x;
- method float x : float = x;
- method bool x : bool = x;
- method list : ! 'a 'b . ('a -> 'b) -> list 'a -> list 'b =
- List.map;
- method option : ! 'a 'b . ('a -> 'b) -> option 'a -> option 'b =
- fun f -> fun [ None -> None | Some x -> Some (f x) ];
- method array : ! 'a 'b . ('a -> 'b) -> array 'a -> array 'b =
- Array.map;
- method ref : ! 'a 'b . ('a -> 'b) -> ref 'a -> ref 'b =
- fun f { val = x } -> { val = f x };
-end;
-
(** Abstract syntax tree minimal signature.
Types of this signature are abstract.
See the {!Camlp4Ast} signature for a concrete definition. *)
module type Ast = sig
- module Loc : Loc;
+ (** {6 Syntactic categories as abstract types} *)
+ type loc;
type meta_bool;
type meta_option 'a;
type meta_list 'a;
type rec_binding;
type module_binding;
- value loc_of_ctyp : ctyp -> Loc.t;
- value loc_of_patt : patt -> Loc.t;
- value loc_of_expr : expr -> Loc.t;
- value loc_of_module_type : module_type -> Loc.t;
- value loc_of_module_expr : module_expr -> Loc.t;
- value loc_of_sig_item : sig_item -> Loc.t;
- value loc_of_str_item : str_item -> Loc.t;
- value loc_of_class_type : class_type -> Loc.t;
- value loc_of_class_sig_item : class_sig_item -> Loc.t;
- value loc_of_class_expr : class_expr -> Loc.t;
- value loc_of_class_str_item : class_str_item -> Loc.t;
- value loc_of_with_constr : with_constr -> Loc.t;
- value loc_of_binding : binding -> Loc.t;
- value loc_of_rec_binding : rec_binding -> Loc.t;
- value loc_of_module_binding : module_binding -> Loc.t;
- value loc_of_match_case : match_case -> Loc.t;
- value loc_of_ident : ident -> Loc.t;
+ (** {6 Location accessors} *)
+
+ value loc_of_ctyp : ctyp -> loc;
+ value loc_of_patt : patt -> loc;
+ value loc_of_expr : expr -> loc;
+ value loc_of_module_type : module_type -> loc;
+ value loc_of_module_expr : module_expr -> loc;
+ value loc_of_sig_item : sig_item -> loc;
+ value loc_of_str_item : str_item -> loc;
+ value loc_of_class_type : class_type -> loc;
+ value loc_of_class_sig_item : class_sig_item -> loc;
+ value loc_of_class_expr : class_expr -> loc;
+ value loc_of_class_str_item : class_str_item -> loc;
+ value loc_of_with_constr : with_constr -> loc;
+ value loc_of_binding : binding -> loc;
+ value loc_of_rec_binding : rec_binding -> loc;
+ value loc_of_module_binding : module_binding -> loc;
+ value loc_of_match_case : match_case -> loc;
+ value loc_of_ident : ident -> loc;
+
+ (** {6 Traversals} *)
(** This class is the base class for map traversal on the Ast.
To make a custom traversal class one just extend it like that:
value map = (new swap)#expr;
assert (map <:expr< fun x -> (x, 42) >> = <:expr< fun x -> (42, x) >>);]
*)
- class map : object
- inherit mapper;
+ class map : object ('self_type)
+ method string : string -> string;
+ method list : ! 'a 'b . ('self_type -> 'a -> 'b) -> list 'a -> list 'b;
method meta_bool : meta_bool -> meta_bool;
- method meta_option : ! 'a 'b . ('a -> 'b) -> meta_option 'a -> meta_option 'b;
- method meta_list : ! 'a 'b . ('a -> 'b) -> meta_list 'a -> meta_list 'b;
- method _Loc_t : Loc.t -> Loc.t;
+ method meta_option : ! 'a 'b . ('self_type -> 'a -> 'b) -> meta_option 'a -> meta_option 'b;
+ method meta_list : ! 'a 'b . ('self_type -> 'a -> 'b) -> meta_list 'a -> meta_list 'b;
+ method loc : loc -> loc;
method expr : expr -> expr;
method patt : patt -> patt;
method ctyp : ctyp -> ctyp;
method module_binding : module_binding -> module_binding;
method match_case : match_case -> match_case;
method ident : ident -> ident;
+
+ method unknown : ! 'a. 'a -> 'a;
end;
+ (** Fold style traversal *)
class fold : object ('self_type)
method string : string -> 'self_type;
- method int : int -> 'self_type;
- method float : float -> 'self_type;
- method bool : bool -> 'self_type;
method list : ! 'a . ('self_type -> 'a -> 'self_type) -> list 'a -> 'self_type;
- method option : ! 'a . ('self_type -> 'a -> 'self_type) -> option 'a -> 'self_type;
- method array : ! 'a . ('self_type -> 'a -> 'self_type) -> array 'a -> 'self_type;
- method ref : ! 'a . ('self_type -> 'a -> 'self_type) -> ref 'a -> 'self_type;
method meta_bool : meta_bool -> 'self_type;
method meta_option : ! 'a . ('self_type -> 'a -> 'self_type) -> meta_option 'a -> 'self_type;
method meta_list : ! 'a . ('self_type -> 'a -> 'self_type) -> meta_list 'a -> 'self_type;
- method _Loc_t : Loc.t -> 'self_type;
+ method loc : loc -> 'self_type;
method expr : expr -> 'self_type;
method patt : patt -> 'self_type;
method ctyp : ctyp -> 'self_type;
method module_binding : module_binding -> 'self_type;
method match_case : match_case -> 'self_type;
method ident : ident -> 'self_type;
+
+ method unknown : ! 'a. 'a -> 'self_type;
end;
end;
-(** The AntiquotSyntax signature describe the minimal interface needed
- for antiquotation handling. *)
-module type AntiquotSyntax = sig
- module Ast : Ast;
-
- (** The parse function for expressions.
- The underlying expression grammar entry is generally "expr; EOI". *)
- value parse_expr : Ast.Loc.t -> string -> Ast.expr;
-
- (** The parse function for patterns.
- The underlying pattern grammar entry is generally "patt; EOI". *)
- value parse_patt : Ast.Loc.t -> string -> Ast.patt;
-end;
-
-(** Signature for OCaml syntax trees.
+(** Signature for OCaml syntax trees. *) (*
This signature is an extension of {!Ast}
It provides:
- Types for all kinds of structure.
- Map: A base class for map traversals.
- Map classes and functions for common kinds.
- (* Core language *)
- ctyp (* Representaion of types *)
- patt (* The type of patterns *)
- expr (* The type of expressions *)
- match_case (* The type of cases for match/function/try constructions *)
- ident (* The type of identifiers (including path like Foo(X).Bar.y) *)
- binding (* The type of let bindings *)
- rec_binding (* The type of record definitions *)
-
- (* Modules *)
- module_type (* The type of module types *)
- sig_item (* The type of signature items *)
- str_item (* The type of structure items *)
- module_expr (* The type of module expressions *)
- module_binding (* The type of recursive module definitions *)
- with_constr (* The type of `with' constraints *)
-
- (* Classes *)
- class_type (* The type of class types *)
- class_sig_item (* The type of class signature items *)
- class_expr (* The type of class expressions *)
- class_str_item (* The type of class structure items *)
+ == Core language ==
+ ctyp :: Representaion of types
+ patt :: The type of patterns
+ expr :: The type of expressions
+ match_case :: The type of cases for match/function/try constructions
+ ident :: The type of identifiers (including path like Foo(X).Bar.y)
+ binding :: The type of let bindings
+ rec_binding :: The type of record definitions
+
+ == Modules ==
+ module_type :: The type of module types
+ sig_item :: The type of signature items
+ str_item :: The type of structure items
+ module_expr :: The type of module expressions
+ module_binding :: The type of recursive module definitions
+ with_constr :: The type of `with' constraints
+
+ == Classes ==
+ class_type :: The type of class types
+ class_sig_item :: The type of class signature items
+ class_expr :: The type of class expressions
+ class_str_item :: The type of class structure items
*)
module type Camlp4Ast = sig
+ (** The inner module for locations *)
module Loc : Loc;
INCLUDE "camlp4/Camlp4/Camlp4Ast.partial.ml";
- value loc_of_ctyp : ctyp -> Loc.t;
- value loc_of_patt : patt -> Loc.t;
- value loc_of_expr : expr -> Loc.t;
- value loc_of_module_type : module_type -> Loc.t;
- value loc_of_module_expr : module_expr -> Loc.t;
- value loc_of_sig_item : sig_item -> Loc.t;
- value loc_of_str_item : str_item -> Loc.t;
- value loc_of_class_type : class_type -> Loc.t;
- value loc_of_class_sig_item : class_sig_item -> Loc.t;
- value loc_of_class_expr : class_expr -> Loc.t;
- value loc_of_class_str_item : class_str_item -> Loc.t;
- value loc_of_with_constr : with_constr -> Loc.t;
- value loc_of_binding : binding -> Loc.t;
- value loc_of_rec_binding : rec_binding -> Loc.t;
- value loc_of_module_binding : module_binding -> Loc.t;
- value loc_of_match_case : match_case -> Loc.t;
- value loc_of_ident : ident -> Loc.t;
+ value loc_of_ctyp : ctyp -> loc;
+ value loc_of_patt : patt -> loc;
+ value loc_of_expr : expr -> loc;
+ value loc_of_module_type : module_type -> loc;
+ value loc_of_module_expr : module_expr -> loc;
+ value loc_of_sig_item : sig_item -> loc;
+ value loc_of_str_item : str_item -> loc;
+ value loc_of_class_type : class_type -> loc;
+ value loc_of_class_sig_item : class_sig_item -> loc;
+ value loc_of_class_expr : class_expr -> loc;
+ value loc_of_class_str_item : class_str_item -> loc;
+ value loc_of_with_constr : with_constr -> loc;
+ value loc_of_binding : binding -> loc;
+ value loc_of_rec_binding : rec_binding -> loc;
+ value loc_of_module_binding : module_binding -> loc;
+ value loc_of_match_case : match_case -> loc;
+ value loc_of_ident : ident -> loc;
module Meta : sig
module type META_LOC = sig
- (** The first location is where to put the returned pattern.
+ (* The first location is where to put the returned pattern.
Generally it's _loc to match with <:patt< ... >> quotations.
The second location is the one to treat. *)
- value meta_loc_patt : Loc.t -> Loc.t -> patt;
- (** The first location is where to put the returned expression.
+ value meta_loc_patt : loc -> loc -> patt;
+ (* The first location is where to put the returned expression.
Generally it's _loc to match with <:expr< ... >> quotations.
The second location is the one to treat. *)
- value meta_loc_expr : Loc.t -> Loc.t -> expr;
+ value meta_loc_expr : loc -> loc -> expr;
end;
module MetaLoc : sig
- value meta_loc_patt : Loc.t -> Loc.t -> patt;
- value meta_loc_expr : Loc.t -> Loc.t -> expr;
+ value meta_loc_patt : loc -> loc -> patt;
+ value meta_loc_expr : loc -> loc -> expr;
end;
module MetaGhostLoc : sig
- value meta_loc_patt : Loc.t -> 'a -> patt;
- value meta_loc_expr : Loc.t -> 'a -> expr;
+ value meta_loc_patt : loc -> 'a -> patt;
+ value meta_loc_expr : loc -> 'a -> expr;
end;
module MetaLocVar : sig
- value meta_loc_patt : Loc.t -> 'a -> patt;
- value meta_loc_expr : Loc.t -> 'a -> expr;
+ value meta_loc_patt : loc -> 'a -> patt;
+ value meta_loc_expr : loc -> 'a -> expr;
end;
module Make (MetaLoc : META_LOC) : sig
module Expr : sig
- value meta_string : Loc.t -> string -> expr;
- value meta_int : Loc.t -> string -> expr;
- value meta_float : Loc.t -> string -> expr;
- value meta_char : Loc.t -> string -> expr;
- value meta_bool : Loc.t -> bool -> expr;
- value meta_list : (Loc.t -> 'a -> expr) -> Loc.t -> list 'a -> expr;
- value meta_binding : Loc.t -> binding -> expr;
- value meta_rec_binding : Loc.t -> rec_binding -> expr;
- value meta_class_expr : Loc.t -> class_expr -> expr;
- value meta_class_sig_item : Loc.t -> class_sig_item -> expr;
- value meta_class_str_item : Loc.t -> class_str_item -> expr;
- value meta_class_type : Loc.t -> class_type -> expr;
- value meta_ctyp : Loc.t -> ctyp -> expr;
- value meta_expr : Loc.t -> expr -> expr;
- value meta_ident : Loc.t -> ident -> expr;
- value meta_match_case : Loc.t -> match_case -> expr;
- value meta_module_binding : Loc.t -> module_binding -> expr;
- value meta_module_expr : Loc.t -> module_expr -> expr;
- value meta_module_type : Loc.t -> module_type -> expr;
- value meta_patt : Loc.t -> patt -> expr;
- value meta_sig_item : Loc.t -> sig_item -> expr;
- value meta_str_item : Loc.t -> str_item -> expr;
- value meta_with_constr : Loc.t -> with_constr -> expr;
+ value meta_string : loc -> string -> expr;
+ value meta_int : loc -> string -> expr;
+ value meta_float : loc -> string -> expr;
+ value meta_char : loc -> string -> expr;
+ value meta_bool : loc -> bool -> expr;
+ value meta_list : (loc -> 'a -> expr) -> loc -> list 'a -> expr;
+ value meta_binding : loc -> binding -> expr;
+ value meta_rec_binding : loc -> rec_binding -> expr;
+ value meta_class_expr : loc -> class_expr -> expr;
+ value meta_class_sig_item : loc -> class_sig_item -> expr;
+ value meta_class_str_item : loc -> class_str_item -> expr;
+ value meta_class_type : loc -> class_type -> expr;
+ value meta_ctyp : loc -> ctyp -> expr;
+ value meta_expr : loc -> expr -> expr;
+ value meta_ident : loc -> ident -> expr;
+ value meta_match_case : loc -> match_case -> expr;
+ value meta_module_binding : loc -> module_binding -> expr;
+ value meta_module_expr : loc -> module_expr -> expr;
+ value meta_module_type : loc -> module_type -> expr;
+ value meta_patt : loc -> patt -> expr;
+ value meta_sig_item : loc -> sig_item -> expr;
+ value meta_str_item : loc -> str_item -> expr;
+ value meta_with_constr : loc -> with_constr -> expr;
end;
module Patt : sig
- value meta_string : Loc.t -> string -> patt;
- value meta_int : Loc.t -> string -> patt;
- value meta_float : Loc.t -> string -> patt;
- value meta_char : Loc.t -> string -> patt;
- value meta_bool : Loc.t -> bool -> patt;
- value meta_list : (Loc.t -> 'a -> patt) -> Loc.t -> list 'a -> patt;
- value meta_binding : Loc.t -> binding -> patt;
- value meta_rec_binding : Loc.t -> rec_binding -> patt;
- value meta_class_expr : Loc.t -> class_expr -> patt;
- value meta_class_sig_item : Loc.t -> class_sig_item -> patt;
- value meta_class_str_item : Loc.t -> class_str_item -> patt;
- value meta_class_type : Loc.t -> class_type -> patt;
- value meta_ctyp : Loc.t -> ctyp -> patt;
- value meta_expr : Loc.t -> expr -> patt;
- value meta_ident : Loc.t -> ident -> patt;
- value meta_match_case : Loc.t -> match_case -> patt;
- value meta_module_binding : Loc.t -> module_binding -> patt;
- value meta_module_expr : Loc.t -> module_expr -> patt;
- value meta_module_type : Loc.t -> module_type -> patt;
- value meta_patt : Loc.t -> patt -> patt;
- value meta_sig_item : Loc.t -> sig_item -> patt;
- value meta_str_item : Loc.t -> str_item -> patt;
- value meta_with_constr : Loc.t -> with_constr -> patt;
+ value meta_string : loc -> string -> patt;
+ value meta_int : loc -> string -> patt;
+ value meta_float : loc -> string -> patt;
+ value meta_char : loc -> string -> patt;
+ value meta_bool : loc -> bool -> patt;
+ value meta_list : (loc -> 'a -> patt) -> loc -> list 'a -> patt;
+ value meta_binding : loc -> binding -> patt;
+ value meta_rec_binding : loc -> rec_binding -> patt;
+ value meta_class_expr : loc -> class_expr -> patt;
+ value meta_class_sig_item : loc -> class_sig_item -> patt;
+ value meta_class_str_item : loc -> class_str_item -> patt;
+ value meta_class_type : loc -> class_type -> patt;
+ value meta_ctyp : loc -> ctyp -> patt;
+ value meta_expr : loc -> expr -> patt;
+ value meta_ident : loc -> ident -> patt;
+ value meta_match_case : loc -> match_case -> patt;
+ value meta_module_binding : loc -> module_binding -> patt;
+ value meta_module_expr : loc -> module_expr -> patt;
+ value meta_module_type : loc -> module_type -> patt;
+ value meta_patt : loc -> patt -> patt;
+ value meta_sig_item : loc -> sig_item -> patt;
+ value meta_str_item : loc -> str_item -> patt;
+ value meta_with_constr : loc -> with_constr -> patt;
end;
end;
end;
(** See {!Ast.map}. *)
- class map : object
- inherit mapper;
+ class map : object ('self_type)
+ method string : string -> string;
+ method list : ! 'a 'b . ('self_type -> 'a -> 'b) -> list 'a -> list 'b;
method meta_bool : meta_bool -> meta_bool;
- method meta_option : ! 'a 'b . ('a -> 'b) -> meta_option 'a -> meta_option 'b;
- method meta_list : ! 'a 'b . ('a -> 'b) -> meta_list 'a -> meta_list 'b;
- method _Loc_t : Loc.t -> Loc.t;
+ method meta_option : ! 'a 'b . ('self_type -> 'a -> 'b) -> meta_option 'a -> meta_option 'b;
+ method meta_list : ! 'a 'b . ('self_type -> 'a -> 'b) -> meta_list 'a -> meta_list 'b;
+ method loc : loc -> loc;
method expr : expr -> expr;
method patt : patt -> patt;
method ctyp : ctyp -> ctyp;
method module_binding : module_binding -> module_binding;
method match_case : match_case -> match_case;
method ident : ident -> ident;
+
+ method unknown : ! 'a. 'a -> 'a;
end;
(** See {!Ast.fold}. *)
class fold : object ('self_type)
method string : string -> 'self_type;
- method int : int -> 'self_type;
- method float : float -> 'self_type;
- method bool : bool -> 'self_type;
method list : ! 'a . ('self_type -> 'a -> 'self_type) -> list 'a -> 'self_type;
- method option : ! 'a . ('self_type -> 'a -> 'self_type) -> option 'a -> 'self_type;
- method array : ! 'a . ('self_type -> 'a -> 'self_type) -> array 'a -> 'self_type;
- method ref : ! 'a . ('self_type -> 'a -> 'self_type) -> ref 'a -> 'self_type;
method meta_bool : meta_bool -> 'self_type;
method meta_option : ! 'a . ('self_type -> 'a -> 'self_type) -> meta_option 'a -> 'self_type;
method meta_list : ! 'a . ('self_type -> 'a -> 'self_type) -> meta_list 'a -> 'self_type;
- method _Loc_t : Loc.t -> 'self_type;
+ method loc : loc -> 'self_type;
method expr : expr -> 'self_type;
method patt : patt -> 'self_type;
method ctyp : ctyp -> 'self_type;
method module_binding : module_binding -> 'self_type;
method match_case : match_case -> 'self_type;
method ident : ident -> 'self_type;
+
+ method unknown : ! 'a. 'a -> 'self_type;
end;
value map_expr : (expr -> expr) -> map;
value map_ctyp : (ctyp -> ctyp) -> map;
value map_str_item : (str_item -> str_item) -> map;
value map_sig_item : (sig_item -> sig_item) -> map;
- value map_loc : (Loc.t -> Loc.t) -> map;
+ value map_loc : (loc -> loc) -> map;
value ident_of_expr : expr -> ident;
value ident_of_patt : patt -> ident;
Typical use is for [with] constraints.
Example: ... with module Ast = Camlp4.Sig.Camlp4AstToAst Camlp4Ast *)
module Camlp4AstToAst (M : Camlp4Ast) : Ast
- with module Loc = M.Loc
+ with type loc = M.loc
and type meta_bool = M.meta_bool
and type meta_option 'a = M.meta_option 'a
and type meta_list 'a = M.meta_list 'a
and type ident = M.ident
= M;
-(** Since the Ast contains locations. This functor produces Ast types
+(** Concrete definition of Camlp4 ASTs abstracted from locations.
+ Since the Ast contains locations, this functor produces Ast types
for a given location type. *)
module MakeCamlp4Ast (Loc : Type) = struct
end;
+(** {6 Filters} *)
+
+(** A type for stream filters. *)
+type stream_filter 'a 'loc = Stream.t ('a * 'loc) -> Stream.t ('a * 'loc);
+
(** Registerinng and folding of Ast filters.
Two kinds of filters must be handled:
- Implementation filters: str_item -> str_item.
module Ast : Camlp4Ast;
- (** {6 Filters} *)
-
type filter 'a = 'a -> 'a;
value register_sig_item_filter : (filter Ast.sig_item) -> unit;
end;
-(** Ast as one single type *)
-
+(** ASTs as one single dynamic type *)
module type DynAst = sig
module Ast : Ast;
type tag 'a;
end;
-(** Quotation operations. *)
+(** {6 Quotation operations} *)
+(** The generic quotation type.
+ To see how fields are used here is an example:
+ <:q_name@q_loc<q_contents>>
+ The last one, q_shift is equal to the length of "<:q_name@q_loc<". *)
type quotation =
{ q_name : string ;
q_loc : string ;
q_shift : int ;
q_contents : string };
+(** The signature for a quotation expander registery. *)
module type Quotation = sig
module Ast : Ast;
module DynAst : DynAst with module Ast = Ast;
open Ast;
- (** The Loc.t is the initial location. The option string is the optional name
+ (** The [loc] is the initial location. The option string is the optional name
for the location variable. The string is the quotation contents. *)
- type expand_fun 'a = Loc.t -> option string -> string -> 'a;
+ type expand_fun 'a = loc -> option string -> string -> 'a;
(** [add name exp] adds the quotation [name] associated with the
expander [exp]. *)
(** [parse_quotation_result parse_function loc position_tag quotation quotation_result]
It's a parser wrapper, this function handles the error reporting for you. *)
value parse_quotation_result :
- (Loc.t -> string -> 'a) -> Loc.t -> quotation -> string -> string -> 'a;
+ (loc -> string -> 'a) -> loc -> quotation -> string -> string -> 'a;
(** function translating quotation names; default = identity *)
value translate : ref (string -> string);
- value expand : Loc.t -> quotation -> DynAst.tag 'a -> 'a;
+ value expand : loc -> quotation -> DynAst.tag 'a -> 'a;
(** [dump_file] optionally tells Camlp4 to dump the
result of an expander if this result is syntactically incorrect.
end;
-type stream_filter 'a 'loc = Stream.t ('a * 'loc) -> Stream.t ('a * 'loc);
+(** {6 Tokens} *)
+(** A signature for tokens. *)
module type Token = sig
module Loc : Loc;
("42", "4_2", "0000042", "0b0101010"...).
The meaning of the tokens are:
-- * [KEYWORD s] is the keyword [s].
-- * [LIDENT s] is the ident [s] starting with a lowercase letter.
-- * [UIDENT s] is the ident [s] starting with an uppercase letter.
-- * [INT i s] (resp. [INT32 i s], [INT64 i s] and [NATIVEINT i s])
- is the integer constant [i] whose string source is [s].
-- * [FLOAT f s] is the float constant [f] whose string source is [s].
-- * [STRING s s'] is the string constant [s] whose string source is [s'].
-- * [CHAR c s] is the character constant [c] whose string source is [s].
-- * [QUOTATION q] is a quotation [q], see {!Quotation.t} for more information.
-- * [ANTIQUOT n s] is an antiquotation [n] holding the string [s].
-- * [EOI] is the end of input.
+- [KEYWORD s] is the keyword [s].
+- [LIDENT s] is the ident [s] starting with a lowercase letter.
+- [UIDENT s] is the ident [s] starting with an uppercase letter.
+- [INT i s] (resp. [INT32 i s], [INT64 i s] and [NATIVEINT i s])
+ the integer constant [i] whose string source is [s].
+- [FLOAT f s] is the float constant [f] whose string source is [s].
+- [STRING s s'] is the string constant [s] whose string source is [s'].
+- [CHAR c s] is the character constant [c] whose string source is [s].
+- [QUOTATION q] is a quotation [q], see {!Quotation.t} for more information.
+- [ANTIQUOT n s] is an antiquotation [n] holding the string [s].
+- [EOI] is the end of input.
Warning: the second string associated with the constructor [STRING] is
the string found in the source without any interpretation. In particular,
["n"]. To interpret a string use the first string of the [STRING]
constructor (or if you need to compute it use the module
{!Camlp4.Struct.Token.Eval}. Same thing for the constructor [CHAR]. *)
-
type camlp4_token =
[ KEYWORD of string
| SYMBOL of string
| LINE_DIRECTIVE of int and option string
| EOI ];
+(** A signature for specialized tokens. *)
module type Camlp4Token = Token with type t = camlp4_token;
+(** {6 Dynamic loaders} *)
+
+(** A signature for dynamic loaders. *)
module type DynLoader = sig
type t;
exception Error of string and string;
value find_in_path : t -> string -> string;
end;
+(** A signature for grammars. *)
module Grammar = struct
(** Internal signature for sematantic actions of grammars,
(** Same as {!print} but show the left-factorization. *)
value dump : Format.formatter -> t 'a -> unit;
- (*/*)
+ (**/**)
value obj : t 'a -> internal_entry;
value clear : t 'a -> unit;
+ (**/**)
end;
(** [get_filter g] Get the {!Token.Filter} associated to the [g]. *)
(** Same as {!print} but show the left-factorization. *)
value dump : Format.formatter -> t 'a -> unit;
- (*/*)
+ (**/**)
value obj : t 'a -> internal_entry;
value clear : t 'a -> unit;
+ (**/**)
end;
(** Get the {!Token.Filter} associated to the grammar module. *)
end;
+(** A signature for lexers. *)
module type Lexer = sig
module Loc : Loc;
module Token : Token with module Loc = Loc;
end;
-(** {6 Parser} *)
+(** A signature for parsers abstract from ASTs. *)
module Parser (Ast : Ast) = struct
+ module type SIMPLE = sig
+ (** The parse function for expressions.
+ The underlying expression grammar entry is generally "expr; EOI". *)
+ value parse_expr : Ast.loc -> string -> Ast.expr;
+
+ (** The parse function for patterns.
+ The underlying pattern grammar entry is generally "patt; EOI". *)
+ value parse_patt : Ast.loc -> string -> Ast.patt;
+ end;
+
module type S = sig
(** Called when parsing an implementation (ml file) to build the syntax
syntax), the given [directive_handler] function evaluates it and
the parsing starts again. *)
value parse_implem : ?directive_handler:(Ast.str_item -> option Ast.str_item) ->
- Ast.Loc.t -> Stream.t char -> Ast.str_item;
+ Ast.loc -> Stream.t char -> Ast.str_item;
(** Same as {!parse_implem} but for interface (mli file). *)
value parse_interf : ?directive_handler:(Ast.sig_item -> option Ast.sig_item) ->
- Ast.Loc.t -> Stream.t char -> Ast.sig_item;
+ Ast.loc -> Stream.t char -> Ast.sig_item;
end;
end;
-(** {6 Printer} *)
-
+(** A signature for printers abstract from ASTs. *)
module Printer (Ast : Ast) = struct
module type S = sig
There is also the main grammar entries. *)
module type Syntax = sig
module Loc : Loc;
- module Ast : Ast with module Loc = Loc;
+ module Ast : Ast with type loc = Loc.t;
module Token : Token with module Loc = Loc;
module Gram : Grammar.Static with module Loc = Loc and module Token = Token;
- module AntiquotSyntax : AntiquotSyntax with module Ast = Ast;
- (* Gram is not constrained here for flexibility *)
module Quotation : Quotation with module Ast = Ast;
+ module AntiquotSyntax : (Parser Ast).SIMPLE;
+
include (Warning Loc).S;
include (Parser Ast).S;
include (Printer Ast).S;
module Token : Camlp4Token with module Loc = Loc;
module Gram : Grammar.Static with module Loc = Loc and module Token = Token;
- module AntiquotSyntax : AntiquotSyntax with module Ast = Camlp4AstToAst Ast;
- (* Gram is not constrained here for flexibility *)
module Quotation : Quotation with module Ast = Camlp4AstToAst Ast;
+ module AntiquotSyntax : (Parser Ast).SIMPLE;
+
include (Warning Loc).S;
include (Parser Ast).S;
include (Printer Ast).S;
value infixop4 : Gram.Entry.t Ast.expr;
end;
+(** A signature for syntax extension (syntax -> syntax functors). *)
module type SyntaxExtension = functor (Syn : Syntax)
-> (Syntax with module Loc = Syn.Loc
and module Ast = Syn.Ast
and module Token = Syn.Token
and module Gram = Syn.Gram
- and module AntiquotSyntax = Syn.AntiquotSyntax
and module Quotation = Syn.Quotation);
| <:patt< _ >> -> True
| <:patt< ($x$ as $y$) >> -> is_irrefut_patt x && is_irrefut_patt y
| <:patt< { $p$ } >> -> is_irrefut_patt p
- | <:patt< $lid:_$ = $p$ >> -> is_irrefut_patt p
+ | <:patt< $_$ = $p$ >> -> is_irrefut_patt p
| <:patt< $p1$; $p2$ >> -> is_irrefut_patt p1 && is_irrefut_patt p2
| <:patt< $p1$, $p2$ >> -> is_irrefut_patt p1 && is_irrefut_patt p2
| <:patt< ($p$ : $_$) >> -> is_irrefut_patt p
list_of_module_binding x (list_of_module_binding y acc)
| x -> [x :: acc] ];
+ module Camlp4Trash = struct
+ INCLUDE "camlp4/Camlp4/Camlp4Ast.partial.ml";
+ end;
+
module Meta = struct
module type META_LOC = sig
module Make (MetaLoc : META_LOC) = struct
open MetaLoc;
- value meta_acc_Loc_t = meta_loc_expr;
+ value meta_loc = meta_loc_expr;
module Expr = Camlp4Filters.MetaGeneratorExpr Ast;
- value meta_acc_Loc_t = meta_loc_patt;
+ value meta_loc = meta_loc_patt;
module Patt = Camlp4Filters.MetaGeneratorPatt Ast;
end;
end;
- class map = Camlp4Filters.GenerateMap.generated;
+ class map = Camlp4MapGenerator.generated;
- class fold = Camlp4Filters.GenerateFold.generated;
+ class fold = Camlp4FoldGenerator.generated;
value map_expr f = object
inherit map as super;
end;
value map_loc f = object
inherit map as super;
- method _Loc_t x = f (super#_Loc_t x);
+ method loc x = f (super#loc x);
end;
end;
-
-module Camlp4Trash = struct
-(* #use "camlp4/Camlp4/Camlp4Ast.partial.ml"; *)
- INCLUDE "camlp4/Camlp4/Camlp4Ast.partial.ml";
-end;
* - Nicolas Pouillard: refactoring
*)
-(* $Id: Camlp4Ast2OCamlAst.ml,v 1.15.2.4 2007/05/10 13:31:20 pouillar Exp $ *)
+(* $Id: Camlp4Ast2OCamlAst.ml,v 1.15.2.8 2007/09/19 13:20:33 ertai Exp $ *)
module Make (Ast : Sig.Camlp4Ast) = struct
open Format;
- open Parsetree;
- open Longident;
- open Asttypes;
+ open Camlp4_import.Parsetree;
+ open Camlp4_import.Longident;
+ open Camlp4_import.Asttypes;
open Ast;
value constructors_arity () =
let t1 = TyApp loc1 <:ctyp@loc1< option >> t1 in
mktyp loc (Ptyp_arrow ("?" ^ lab) (ctyp t1) (ctyp t2))
| TyArr loc t1 t2 -> mktyp loc (Ptyp_arrow "" (ctyp t1) (ctyp t2))
- | <:ctyp@loc< < > >> -> mktyp loc (Ptyp_object [])
- | <:ctyp@loc< < .. > >> -> mktyp loc (Ptyp_object [mkfield loc Pfield_var])
| <:ctyp@loc< < $fl$ > >> -> mktyp loc (Ptyp_object (meth_list fl []))
| <:ctyp@loc< < $fl$ .. > >> ->
mktyp loc (Ptyp_object (meth_list fl [mkfield loc Pfield_var]))
TyObj _ _ (BAnt _) | TyNil _ | TyTup _ _ ->
assert False ]
and row_field = fun
- [ <:ctyp< `$i$ >> -> [Rtag i True []]
+ [ <:ctyp<>> -> []
+ | <:ctyp< `$i$ >> -> [Rtag i True []]
| <:ctyp< `$i$ of & $t$ >> -> [Rtag i True (List.map ctyp (list_of_ctyp t []))]
| <:ctyp< `$i$ of $t$ >> -> [Rtag i False (List.map ctyp (list_of_ctyp t []))]
| <:ctyp< $t1$ | $t2$ >> -> row_field t1 @ row_field t2
| _ -> assert False ]
and meth_list fl acc =
match fl with
- [ <:ctyp< $t1$; $t2$ >> -> meth_list t1 (meth_list t2 acc)
+ [ <:ctyp<>> -> acc
+ | <:ctyp< $t1$; $t2$ >> -> meth_list t1 (meth_list t2 acc)
| <:ctyp@loc< $lid:lab$ : $t$ >> ->
[mkfield loc (Pfield lab (mkpolytype (ctyp t))) :: acc]
| _ -> assert False ]
| _ -> assert False ]
and mkideexp x acc =
match x with
- [ <:rec_binding< $x$; $y$ >> ->
+ [ <:rec_binding<>> -> acc
+ | <:rec_binding< $x$; $y$ >> ->
mkideexp x (mkideexp y acc)
| <:rec_binding< $lid:s$ = $e$ >> -> [(s, expr e) :: acc]
| _ -> assert False ]
*)
-(* $Id: Camlp4Ast2OCamlAst.mli,v 1.3 2007/02/07 10:09:21 ertai Exp $ *)
+(* $Id: Camlp4Ast2OCamlAst.mli,v 1.3.4.1 2007/05/22 09:09:45 pouillar Exp $ *)
module Make (Camlp4Ast : Sig.Camlp4Ast) : sig
open Camlp4Ast;
(** {6 Useful functions} *)
- value sig_item : sig_item -> Parsetree.signature;
- value str_item : str_item -> Parsetree.structure;
- value phrase : str_item -> Parsetree.toplevel_phrase;
+ value sig_item : sig_item -> Camlp4_import.Parsetree.signature;
+ value str_item : str_item -> Camlp4_import.Parsetree.structure;
+ value phrase : str_item -> Camlp4_import.Parsetree.toplevel_phrase;
end;
(** This module is suppose to contain nils elimination. *)
module Make (Ast : Sig.Camlp4Ast) = struct
- class clean_ast = object (self)
+ class clean_ast = object
inherit Ast.map as super;
- method with_constr = fun
- [ <:with_constr< $ <:with_constr<>> $ and $wc$ >> |
- <:with_constr< $wc$ and $ <:with_constr<>> $ >> -> self#with_constr wc
- | wc -> super#with_constr wc ];
-
- method expr = fun
- [ <:expr< let $rec:_$ $ <:binding<>> $ in $e$ >> |
- <:expr< { ($e$) with $ <:rec_binding<>> $ } >> |
- <:expr< $ <:expr<>> $, $e$ >> |
- <:expr< $e$, $ <:expr<>> $ >> |
- <:expr< $ <:expr<>> $; $e$ >> |
- <:expr< $e$; $ <:expr<>> $ >> -> self#expr e
- | e -> super#expr e ];
-
- method patt = fun
- [ <:patt< ( $p$ as $ <:patt<>> $ ) >> |
- <:patt< $ <:patt<>> $ | $p$ >> |
- <:patt< $p$ | $ <:patt<>> $ >> |
- <:patt< $ <:patt<>> $, $p$ >> |
- <:patt< $p$, $ <:patt<>> $ >> |
- <:patt< $ <:patt<>> $; $p$ >> |
- <:patt< $p$; $ <:patt<>> $ >> -> self#patt p
- | p -> super#patt p ];
-
- method match_case = fun
- [ <:match_case< $ <:match_case<>> $ | $mc$ >> |
- <:match_case< $mc$ | $ <:match_case<>> $ >> -> self#match_case mc
- | mc -> super#match_case mc ];
-
- method binding = fun
- [ <:binding< $ <:binding<>> $ and $bi$ >> |
- <:binding< $bi$ and $ <:binding<>> $ >> -> self#binding bi
- | bi -> super#binding bi ];
-
- method rec_binding = fun
- [ <:rec_binding< $ <:rec_binding<>> $ ; $bi$ >> |
- <:rec_binding< $bi$ ; $ <:rec_binding<>> $ >> -> self#rec_binding bi
- | bi -> super#rec_binding bi ];
-
- method module_binding = fun
- [ <:module_binding< $ <:module_binding<>> $ and $mb$ >> |
- <:module_binding< $mb$ and $ <:module_binding<>> $ >> ->
- self#module_binding mb
- | mb -> super#module_binding mb ];
-
- method ctyp = fun
- [ <:ctyp< ! $ <:ctyp<>> $ . $t$ >> |
- <:ctyp< $ <:ctyp<>> $ as $t$ >> |
- <:ctyp< $t$ as $ <:ctyp<>> $ >> |
- <:ctyp< $t$ -> $ <:ctyp<>> $ >> |
- <:ctyp< $ <:ctyp<>> $ -> $t$ >> |
- <:ctyp< $ <:ctyp<>> $ | $t$ >> |
- <:ctyp< $t$ | $ <:ctyp<>> $ >> |
- <:ctyp< $t$ of $ <:ctyp<>> $ >> |
- <:ctyp< $ <:ctyp<>> $ and $t$ >> |
- <:ctyp< $t$ and $ <:ctyp<>> $ >> |
- <:ctyp< $t$; $ <:ctyp<>> $ >> |
- <:ctyp< $ <:ctyp<>> $; $t$ >> |
- <:ctyp< $ <:ctyp<>> $, $t$ >> |
- <:ctyp< $t$, $ <:ctyp<>> $ >> |
- <:ctyp< $t$ & $ <:ctyp<>> $ >> |
- <:ctyp< $ <:ctyp<>> $ & $t$ >> |
- <:ctyp< $ <:ctyp<>> $ * $t$ >> |
- <:ctyp< $t$ * $ <:ctyp<>> $ >> -> self#ctyp t
- | t -> super#ctyp t ];
-
- method sig_item = fun
- [ <:sig_item< $ <:sig_item<>> $; $sg$ >> |
- <:sig_item< $sg$; $ <:sig_item<>> $ >> -> self#sig_item sg
- | sg -> super#sig_item sg ];
-
- method str_item = fun
- [ <:str_item< $ <:str_item<>> $; $st$ >> |
- <:str_item< $st$; $ <:str_item<>> $ >> -> self#str_item st
- | st -> super#str_item st ];
-
- method module_type = fun
- [ <:module_type< $mt$ with $ <:with_constr<>> $ >> -> self#module_type mt
- | mt -> super#module_type mt ];
-
- method class_expr = fun
- [ <:class_expr< $ <:class_expr<>> $ and $ce$ >> |
- <:class_expr< $ce$ and $ <:class_expr<>> $ >> -> self#class_expr ce
- | ce -> super#class_expr ce ];
-
- method class_type = fun
- [ <:class_type< $ <:class_type<>> $ and $ct$ >> |
- <:class_type< $ct$ and $ <:class_type<>> $ >> -> self#class_type ct
- | ct -> super#class_type ct ];
-
- method class_sig_item = fun
- [ <:class_sig_item< $ <:class_sig_item<>> $; $csg$ >> |
- <:class_sig_item< $csg$; $ <:class_sig_item<>> $ >> ->
- self#class_sig_item csg
- | csg -> super#class_sig_item csg ];
-
- method class_str_item = fun
- [ <:class_str_item< $ <:class_str_item<>> $; $cst$ >> |
- <:class_str_item< $cst$; $ <:class_str_item<>> $ >> ->
- self#class_str_item cst
- | cst -> super#class_str_item cst ];
+ method with_constr wc =
+ match super#with_constr wc with
+ [ <:with_constr< $ <:with_constr<>> $ and $wc$ >> |
+ <:with_constr< $wc$ and $ <:with_constr<>> $ >> -> wc
+ | wc -> wc ];
+
+ method expr e =
+ match super#expr e with
+ [ <:expr< let $rec:_$ $ <:binding<>> $ in $e$ >> |
+ <:expr< { ($e$) with $ <:rec_binding<>> $ } >> |
+ <:expr< $ <:expr<>> $, $e$ >> |
+ <:expr< $e$, $ <:expr<>> $ >> |
+ <:expr< $ <:expr<>> $; $e$ >> |
+ <:expr< $e$; $ <:expr<>> $ >> -> e
+ | e -> e ];
+
+ method patt p =
+ match super#patt p with
+ [ <:patt< ( $p$ as $ <:patt<>> $ ) >> |
+ <:patt< $ <:patt<>> $ | $p$ >> |
+ <:patt< $p$ | $ <:patt<>> $ >> |
+ <:patt< $ <:patt<>> $, $p$ >> |
+ <:patt< $p$, $ <:patt<>> $ >> |
+ <:patt< $ <:patt<>> $; $p$ >> |
+ <:patt< $p$; $ <:patt<>> $ >> -> p
+ | p -> p ];
+
+ method match_case mc =
+ match super#match_case mc with
+ [ <:match_case< $ <:match_case<>> $ | $mc$ >> |
+ <:match_case< $mc$ | $ <:match_case<>> $ >> -> mc
+ | mc -> mc ];
+
+ method binding bi =
+ match super#binding bi with
+ [ <:binding< $ <:binding<>> $ and $bi$ >> |
+ <:binding< $bi$ and $ <:binding<>> $ >> -> bi
+ | bi -> bi ];
+
+ method rec_binding rb =
+ match super#rec_binding rb with
+ [ <:rec_binding< $ <:rec_binding<>> $ ; $bi$ >> |
+ <:rec_binding< $bi$ ; $ <:rec_binding<>> $ >> -> bi
+ | bi -> bi ];
+
+ method module_binding mb =
+ match super#module_binding mb with
+ [ <:module_binding< $ <:module_binding<>> $ and $mb$ >> |
+ <:module_binding< $mb$ and $ <:module_binding<>> $ >> -> mb
+ | mb -> mb ];
+
+ method ctyp t =
+ match super#ctyp t with
+ [ <:ctyp< ! $ <:ctyp<>> $ . $t$ >> |
+ <:ctyp< $ <:ctyp<>> $ as $t$ >> |
+ <:ctyp< $t$ as $ <:ctyp<>> $ >> |
+ <:ctyp< $t$ -> $ <:ctyp<>> $ >> |
+ <:ctyp< $ <:ctyp<>> $ -> $t$ >> |
+ <:ctyp< $ <:ctyp<>> $ | $t$ >> |
+ <:ctyp< $t$ | $ <:ctyp<>> $ >> |
+ <:ctyp< $t$ of $ <:ctyp<>> $ >> |
+ <:ctyp< $ <:ctyp<>> $ and $t$ >> |
+ <:ctyp< $t$ and $ <:ctyp<>> $ >> |
+ <:ctyp< $t$; $ <:ctyp<>> $ >> |
+ <:ctyp< $ <:ctyp<>> $; $t$ >> |
+ <:ctyp< $ <:ctyp<>> $, $t$ >> |
+ <:ctyp< $t$, $ <:ctyp<>> $ >> |
+ <:ctyp< $t$ & $ <:ctyp<>> $ >> |
+ <:ctyp< $ <:ctyp<>> $ & $t$ >> |
+ <:ctyp< $ <:ctyp<>> $ * $t$ >> |
+ <:ctyp< $t$ * $ <:ctyp<>> $ >> -> t
+ | t -> t ];
+
+ method sig_item sg =
+ match super#sig_item sg with
+ [ <:sig_item< $ <:sig_item<>> $; $sg$ >> |
+ <:sig_item< $sg$; $ <:sig_item<>> $ >> -> sg
+ | <:sig_item@loc< type $ <:ctyp<>> $ >> -> <:sig_item@loc<>>
+ | sg -> sg ];
+
+ method str_item st =
+ match super#str_item st with
+ [ <:str_item< $ <:str_item<>> $; $st$ >> |
+ <:str_item< $st$; $ <:str_item<>> $ >> -> st
+ | <:str_item@loc< type $ <:ctyp<>> $ >> -> <:str_item@loc<>>
+ | <:str_item@loc< value $rec:_$ $ <:binding<>> $ >> -> <:str_item@loc<>>
+ | st -> st ];
+
+ method module_type mt =
+ match super#module_type mt with
+ [ <:module_type< $mt$ with $ <:with_constr<>> $ >> -> mt
+ | mt -> mt ];
+
+ method class_expr ce =
+ match super#class_expr ce with
+ [ <:class_expr< $ <:class_expr<>> $ and $ce$ >> |
+ <:class_expr< $ce$ and $ <:class_expr<>> $ >> -> ce
+ | ce -> ce ];
+
+ method class_type ct =
+ match super#class_type ct with
+ [ <:class_type< $ <:class_type<>> $ and $ct$ >> |
+ <:class_type< $ct$ and $ <:class_type<>> $ >> -> ct
+ | ct -> ct ];
+
+ method class_sig_item csg =
+ match super#class_sig_item csg with
+ [ <:class_sig_item< $ <:class_sig_item<>> $; $csg$ >> |
+ <:class_sig_item< $csg$; $ <:class_sig_item<>> $ >> -> csg
+ | csg -> csg ];
+
+ method class_str_item cst =
+ match super#class_str_item cst with
+ [ <:class_str_item< $ <:class_str_item<>> $; $cst$ >> |
+ <:class_str_item< $cst$; $ <:class_str_item<>> $ >> -> cst
+ | cst -> cst ];
end;
in
do {
if entry.egram.error_verbose.val then do {
- let tree = Search.tree_in_entry prev_symb tree entry.edesc in
- let ppf = err_formatter in
+ let tree = Search.tree_in_entry prev_symb tree entry.edesc;
+ let ppf = err_formatter;
fprintf ppf "@[<v 0>@,";
fprintf ppf "----------------------------------@,";
fprintf ppf "Parse error in entry [%s], rule:@;<0 2>" entry.ename;
let symbols = List.map (change_to_self entry) symbols in
do {
List.iter (check_gram entry) symbols;
- let (e1, symbols) = get_initial symbols in
+ let (e1, symbols) = get_initial symbols;
insert_tokens entry.egram symbols;
insert_level entry e1 symbols action lev
})
*)
-(* $Id: Lexer.mll,v 1.6.4.7 2007/05/10 22:43:18 pouillar Exp $ *)
+(* $Id: Lexer.mll,v 1.6.4.11 2007/11/27 14:38:03 ertai Exp $ *)
(* The lexer definition *)
let not_star_symbolchar =
['$' '!' '%' '&' '+' '-' '.' '/' ':' '<' '=' '>' '?' '@' '^' '|' '~' '\\']
let symbolchar = '*' | not_star_symbolchar
+ let quotchar =
+ ['!' '%' '&' '+' '-' '.' '/' ':' '=' '?' '@' '^' '|' '~' '\\' '*']
let hexa_char = ['0'-'9' 'A'-'F' 'a'-'f']
let decimal_literal =
['0'-'9'] ['0'-'9' '_']*
(* Delimitors are extended (from 3.09) in a conservative way *)
(* These chars that can't start an expression or a pattern: *)
- let safe_delimchars = ['%' '&' '.' '/' '@' '^']
+ let safe_delimchars = ['%' '&' '/' '@' '^']
(* These symbols are unsafe since "[<", "[|", etc. exsist. *)
- let delimchars = safe_delimchars | ['|' '<' '>' ':' '=']
+ let delimchars = safe_delimchars | ['|' '<' '>' ':' '=' '.']
let left_delims = ['(' '[' '{']
let right_delims = [')' ']' '}']
let left_delimitor =
(* At least a safe_delimchars *)
- left_delims (delimchars|left_delims)* safe_delimchars (delimchars|left_delims)*
+ left_delims delimchars* safe_delimchars (delimchars|left_delims)*
(* A '(' or a new super '(' without "(<" *)
| '(' (['|' ':'] delimchars*)?
| "*)"
{ warn Comment_not_end (Loc.of_lexbuf lexbuf) ;
move_start_p (-1) c; SYMBOL "*" }
- | "<<"
+ | "<<" (quotchar* as beginning)
{ if quotations c
- then mk_quotation quotation c "" "" 2
- else parse (symbolchar_star "<<") c }
+ then (move_start_p (-String.length beginning);
+ mk_quotation quotation c "" "" 2)
+ else parse (symbolchar_star ("<<" ^ beginning)) c }
| "<<>>"
{ if quotations c
then QUOTATION { q_name = ""; q_loc = ""; q_shift = 2; q_contents = "" }
and maybe_quotation_at c = parse
| (ident as loc) '<'
- { mk_quotation quotation c "" loc (3 + String.length loc) }
+ { mk_quotation quotation c "" loc (1 + String.length loc) }
| symbolchar* as tok { SYMBOL("<@" ^ tok) }
and maybe_quotation_colon c = parse
| (ident as name) '<'
- { mk_quotation quotation c name "" (3 + String.length name) }
+ { mk_quotation quotation c name "" (1 + String.length name) }
| (ident as name) '@' (locname as loc) '<'
{ mk_quotation quotation c name loc
- (4 + String.length loc + String.length name) }
+ (2 + String.length loc + String.length name) }
| symbolchar* as tok { SYMBOL("<:" ^ tok) }
and quotation c = parse
value to_ocaml_location x =
debug loc "to_ocaml_location: %a@\n" dump x in
- { Location.
+ { Camlp4_import.Location.
loc_start = pos_to_lexing_position x.start x.file_name;
loc_end = pos_to_lexing_position x.stop x.file_name;
loc_ghost = x.ghost };
-value of_ocaml_location x =
- let (a, b) = (x.Location.loc_start, x.Location.loc_end) in
+value of_ocaml_location { Camlp4_import.Location.loc_start = a; loc_end = b; loc_ghost = g } =
let res =
{ file_name = better_file_name a.Lexing.pos_fname b.Lexing.pos_fname;
start = pos_of_lexing_position a;
stop = pos_of_lexing_position b;
- ghost = x.Location.loc_ghost } in
+ ghost = g } in
debug loc "of_ocaml_location: %a@\n" dump res in
res;
* - Nicolas Pouillard: refactoring
*)
-(* $Id: Quotation.ml,v 1.4.4.1 2007/03/29 14:31:04 pouillar Exp $ *)
+(* $Id: Quotation.ml,v 1.4.4.3 2007/06/23 16:00:09 ertai Exp $ *)
-module Make (Ast : Sig.Ast)
+module Make (Ast : Sig.Camlp4Ast)
: Sig.Quotation with module Ast = Ast
= struct
module Ast = Ast;
let pp x = fprintf ppf "@?@[<2>While %s %S in a position of %S:" x name position in
let () =
match ctx with
- [ Finding -> do {
+ [ Finding -> begin
pp "finding quotation";
- fprintf ppf "@ @[<hv2>Available quotations are:@\n";
- List.iter begin fun ((s,t),_) ->
- fprintf ppf "@[<2>%s@ (in@ a@ position@ of %a)@]@ "
- s Exp_key.print_tag t
- end expanders_table.val;
- fprintf ppf "@]"
- }
+ if expanders_table.val = [] then
+ fprintf ppf "@ There is no quotation expander available."
+ else
+ begin
+ fprintf ppf "@ @[<hv2>Available quotation expanders are:@\n";
+ List.iter begin fun ((s,t),_) ->
+ fprintf ppf "@[<2>%s@ (in@ a@ position@ of %a)@]@ "
+ s Exp_key.print_tag t
+ end expanders_table.val;
+ fprintf ppf "@]"
+ end
+ end
| Expanding -> pp "expanding quotation"
| Locating -> pp "parsing"
| ParsingResult loc str ->
let () = fprintf ppf " dumping result...\n" in
try
let oc = open_out_bin dump_file in
- do {
+ begin
output_string oc str;
output_string oc "\n";
flush oc;
close_out oc;
fprintf ppf "%a:" Loc.print (Loc.set_file_name dump_file loc);
- }
+ end
with _ ->
fprintf ppf
"Error while dumping result in file %S; dump aborted"
[ [: `'\010' :] -> ()
| [: :] -> () ];
+ value chr c =
+ if c < 0 || c > 255 then failwith "invalid char token" else Char.chr c;
+
value rec backslash = parser
[ [: `'\010' :] -> '\010'
| [: `'\013' :] -> '\013'
| [: `''' :] -> '''
| [: `' ' :] -> ' '
| [: `('0'..'9' as c1); `('0'..'9' as c2); `('0'..'9' as c3) :] ->
- Char.chr (100 * (valch c1) + 10 * (valch c2) + (valch c3))
+ chr (100 * (valch c1) + 10 * (valch c2) + (valch c3))
| [: `'x'; `('0'..'9' | 'a'..'f' | 'A'..'F' as c1) ;
`('0'..'9' | 'a'..'f' | 'A'..'F' as c2) :] ->
- Char.chr (16 * (valch_hex c1) + (valch_hex c2)) ];
+ chr (16 * (valch_hex c1) + (valch_hex c2)) ];
value rec backslash_in_string strict store = parser
[ [: `'\010'; s :] -> skip_indent s
* - Nicolas Pouillard: refactoring
*)
-(* $Id: Camlp4Bin.ml,v 1.14.2.3 2007/03/30 15:50:12 pouillar Exp $ *)
+(* $Id: Camlp4Bin.ml,v 1.14.2.6 2007/06/23 16:00:09 ertai Exp $ *)
open Camlp4;
open PreCast.Syntax;
| ("Filters"|"", "lift" | "camlp4astlifter.cmo") -> load ["Camlp4AstLifter"]
| ("Filters"|"", "exn" | "camlp4exceptiontracer.cmo") -> load ["Camlp4ExceptionTracer"]
| ("Filters"|"", "prof" | "camlp4profiler.cmo") -> load ["Camlp4Profiler"]
- | ("Filters"|"", "map" | "camlp4mapgenerator.cmo") -> load ["Camlp4MapGenerator"]
+ (* map is now an alias of fold since fold handles map too *)
+ | ("Filters"|"", "map" | "camlp4mapgenerator.cmo") -> load ["Camlp4FoldGenerator"]
| ("Filters"|"", "fold" | "camlp4foldgenerator.cmo") -> load ["Camlp4FoldGenerator"]
| ("Filters"|"", "meta" | "camlp4metagenerator.cmo") -> load ["Camlp4MetaGenerator"]
| ("Filters"|"", "trash" | "camlp4trashremover.cmo") -> load ["Camlp4TrashRemover"]
let loc = Loc.mk name
in do {
current_warning.val := print_warning;
- let ic = if name = "-" then stdin else open_in_bin name in
- let cs = Stream.of_channel ic in
- let clear () = if name = "-" then () else close_in ic in
+ let ic = if name = "-" then stdin else open_in_bin name;
+ let cs = Stream.of_channel ic;
+ let clear () = if name = "-" then () else close_in ic;
let phr =
try pa ?directive_handler loc cs
- with x -> do { clear (); raise x }
- in
+ with x -> do { clear (); raise x };
clear ();
phr
};
match x with
[ Intf file_name -> task (process_intf dyn_loader) file_name
| Impl file_name -> task (process_impl dyn_loader) file_name
- | Str s -> do {
- let (f, o) = Filename.open_temp_file "from_string" ".ml";
- output_string o s;
- close_out o;
- task (process_impl dyn_loader) f;
- }
+ | Str s ->
+ begin
+ let (f, o) = Filename.open_temp_file "from_string" ".ml";
+ output_string o s;
+ close_out o;
+ task (process_impl dyn_loader) f;
+ at_exit (fun () -> Sys.remove f);
+ end
| ModuleImpl file_name -> rewrite_and_load "" file_name
| IncludeDir dir -> DynLoader.include_dir dyn_loader dir ];
rcall_callback.val ();
(* *)
(* INRIA Rocquencourt *)
(* *)
-(* Copyright 2006 Institut National de Recherche en Informatique et *)
+(* Copyright 2006,2007 Institut National de Recherche en Informatique et *)
(* en Automatique. All rights reserved. This file is distributed under *)
(* the terms of the GNU Library General Public License, with the special *)
(* exception on linking described in LICENSE at the top of the Objective *)
module Id = struct
value name = "Camlp4FoldGenerator";
- value version = "$Id: Camlp4FoldGenerator.ml,v 1.1.4.4 2007/05/01 07:24:06 pouillar Exp $";
+ value version = "$Id: Camlp4FoldGenerator.ml,v 1.1.4.10 2007/07/25 13:06:27 ertai Exp $";
end;
module Make (AstFilters : Camlp4.Sig.AstFilters) = struct
value _loc = Loc.ghost;
- value xi i = "_x" ^ string_of_int i;
+ value sf = Printf.sprintf;
+
+ value xik i k =
+ let i =
+ if i < 0 then assert False
+ else if i = 0 then ""
+ else sf "_i%d" i
+ in
+ let k =
+ if k < 1 then assert False
+ else if k = 1 then ""
+ else sf "_k%d" k
+ in
+ sf "_x%s%s" i k;
+ value exik i k = <:expr< $lid:xik i k$ >>;
+ value pxik i k = <:patt< $lid:xik i k$ >>;
+ value elidk y k = <:expr< $lid:sf "%s_%d" y k$ >>;
+ value plidk y k = <:patt< $lid:sf "%s_%d" y k$ >>;
value xs s = "_x_" ^ s;
+ value xsk = sf "_x_%s_%d";
+ value exsk s k = <:expr< $lid:xsk s k$>>;
value rec apply_expr accu =
fun
let _loc = Ast.loc_of_ctyp x
in apply_ctyp <:ctyp< $accu$ $x$ >> xs ];
- value list_mapi f =
- let rec self i =
- fun
- [ [] -> []
- | [ x :: xs ] -> [ f i x :: self (succ i) xs ] ]
- in self 0;
+ value opt_map f = fun [ Some x -> Some (f x) | None -> None ];
value list_init f n =
let rec self m =
else [f m :: self (succ m)]
in self 0;
- (* Yes this is a poor fresh function *)
- value fresh =
- let count = ref 0 in
- fun basename ->
- let res = basename ^ (string_of_int count.val)
- in do { incr count; res };
-
- value mk_tuple self t =
- let tl = Ast.list_of_ctyp t [] in
- let n = List.length tl in
- let exi i = <:expr< $lid:xi i$ >> in
- let pxi i = <:patt< $lid:xi i$ >> in
- let (e, _) =
- List.fold_left
- (fun (acc, i) t -> (self ?obj:(Some acc) (Some (exi i)) t, succ i))
- (<:expr<o>>, 0) tl in
- <:expr< fun ($tup:Ast.paCom_of_list (list_init pxi n)$) -> $e$ >>;
-
- value builtins =
- <:class_str_item<
- method string (_ : string) : 'self_type = o;
- method int (_ : int) : 'self_type = o;
- method float (_ : float) : 'self_type = o;
- method bool (_ : bool) : 'self_type = o;
- method list : ! 'a . ('self_type -> 'a -> 'self_type) -> list 'a -> 'self_type =
- fun f -> List.fold_left f o;
- method option : ! 'a . ('self_type -> 'a -> 'self_type) -> option 'a -> 'self_type =
- fun f -> fun [ None -> o | Some x -> f o x ];
- method array : ! 'a . ('self_type -> 'a -> 'self_type) -> array 'a -> 'self_type =
- fun f -> Array.fold_left f o;
- method ref : ! 'a . ('self_type -> 'a -> 'self_type) -> ref 'a -> 'self_type =
- fun f { val = x } -> f o x;
- >>;
-
value rec lid_of_ident sep =
fun
[ <:ident< $lid:s$ >> | <:ident< $uid:s$ >> -> s
| <:ident< $i1$.$i2$ >> -> lid_of_ident sep i1 ^ sep ^ lid_of_ident sep i2
| _ -> assert False ];
- type type_decl = (string * Ast.ident * list Ast.ctyp * Ast.ctyp);
-
- value (unknown_type, fold_unknown_types) =
- let set = ref StringMap.empty in
- let add id1 id2 ty = set.val := StringMap.add id1 (id1, id2, [], ty) set.val
- and fold f = StringMap.fold f set.val in (add, fold);
-
- value rec expr_of_ty ?obj x ty =
- let rec self ?(obj = <:expr<o>>) ox =
- fun
- [ <:ctyp< $lid:id$ >> ->
+ type type_decl = (string * Ast.ident * list Ast.ctyp * Ast.ctyp * bool);
+
+ value builtin_types =
+ let tyMap = StringMap.empty in
+ let tyMap =
+ let abstr = ["string"; "int"; "float"; "int32"; "int64"; "nativeint"; "char"] in
+ List.fold_right
+ (fun name -> StringMap.add name (name, <:ident< $lid:name$ >>, [], <:ctyp<>>, False))
+ abstr tyMap
+ in
+ let tyMap =
+ let concr =
+ [("bool", <:ident<bool>>, [], <:ctyp< [ False | True ] >>, False);
+ ("list", <:ident<list>>, [ <:ctyp< 'a >> ], <:ctyp< [ $uid:"[]"$ | $uid:"::"$ of 'a and list 'a ] >>, False);
+ ("option", <:ident<option>>, [ <:ctyp< 'a >> ], <:ctyp< [ None | Some of 'a ] >>, False);
+ ("ref", <:ident<ref>>, [ <:ctyp< 'a >> ], <:ctyp< { contents : 'a } >>, False)]
+ in
+ List.fold_right (fun ((name, _, _, _, _) as decl) -> StringMap.add name decl) concr tyMap
+ in
+ tyMap;
+
+ value used_builtins = ref StringMap.empty;
+
+ value store_if_builtin_type id =
+ if StringMap.mem id builtin_types then
+ used_builtins.val := StringMap.add id (StringMap.find id builtin_types) used_builtins.val
+ else ();
+
+ type mode = [ Fold | Map | Fold_map ];
+
+ value string_of_mode = fun [ Fold -> "fold" | Map -> "map" | Fold_map -> "fold_map" ];
+
+ module Gen (X :
+ sig
+ value size : int;
+ value mode : mode;
+ end) =
+ struct
+
+ value size = X.size;
+ value mode = X.mode;
+
+ value tuplify_expr f =
+ if size <= 0 then assert False
+ else if size = 1 then f 1
+ else
+ let rec loop k =
+ if k = 2 then f 2
+ else <:expr< $loop (k - 1)$, $f k$ >>
+ in <:expr< ($f 1$, $loop size$) >>;
+
+ value tuplify_patt f =
+ if size <= 0 then assert False
+ else if size = 1 then f 1
+ else
+ let rec loop k =
+ if k = 2 then f 2
+ else <:patt< $loop (k - 1)$, $f k$ >>
+ in <:patt< ($f 1$, $loop size$) >>;
+
+ value xiks i = tuplify_expr (exik i);
+
+ value tuplify_type typ =
+ if size <= 0 then assert False
+ else if size = 1 then typ
+ else
+ let rec loop k =
+ if k = 2 then typ
+ else <:ctyp< $loop (k - 1)$ * $typ$ >>
+ in <:ctyp< ($typ$ * $loop size$) >>;
+
+ value tuplify_tycon tycon = tuplify_type <:ctyp< $lid:tycon$ >>;
+
+ value rec patt_of_expr =
+ fun
+ [ <:expr<>> -> <:patt<>>
+ | <:expr< $id:i$ >> -> <:patt< $id:i$ >>
+ | <:expr< $e1$, $e2$ >> -> <:patt< $patt_of_expr e1$, $patt_of_expr e2$ >>
+ | <:expr< $tup:e$ >> -> <:patt< $tup:patt_of_expr e$ >>
+ | _ -> assert False ];
+
+ value bind p e1 e2 =
+ match mode with
+ [ Fold_map -> <:expr< let (o, $p$) = $e1$ in $e2$ >>
+ | Map -> <:expr< let $p$ = $e1$ in $e2$ >>
+ | Fold -> <:expr< let o = $e1$ in $e2$ >> ];
+
+ value return e =
+ match mode with
+ [ Fold_map -> <:expr< (o, $e$) >>
+ | Map -> e
+ | Fold -> <:expr<o>> ];
+
+ value rec opt_bind opt_patt e1 mk_e2 =
+ match e1 with
+ [ <:expr< $id:_$ >> | <:expr< $lid:_$#$_$ >> -> mk_e2 e1
+ | <:expr< let $p1$ = $e1$ in $e2$ >> ->
+ <:expr< let $p1$ = $e1$ in $opt_bind None e2 mk_e2$ >>
+ | _ ->
+ let e2 = mk_e2 <:expr<o>> in
+ match opt_patt with
+ [ Some patt -> bind patt e1 e2
+ | None -> <:expr< (fun o -> $e1$) $e2$ >> ] ];
+
+ (* ts = [t1; ...; tN] *)
+ value chain_tuple mkp mke expr_of_ty ts =
+ (* exiks = [<<(x_i0_k1, ..., x_i0_kM)>>; ...; <<(x_iN_k1, ..., x_iN_kM)>>] *)
+ let exiks = list_init (fun i -> tuplify_expr (exik i)) (List.length ts) in
+ (* exi1s, pxi1s = [<<x_i0_k1>>; ...; <<x_iN_k1>>] *)
+ let exi1s = list_init (fun i -> exik i 1) (List.length ts) in
+ let pxi1s = list_init (fun i -> pxik i 1) (List.length ts) in
+ let ps k = mkp (list_init (fun i -> pxik i k) (List.length ts)) in
+ let p = tuplify_patt ps in
+ let e1 = mke exi1s in
+ let es = List.map2 (fun x -> expr_of_ty (Some x)) exiks ts in
+ let e =
+ List.fold_right2 begin fun pxi1 e acc ->
+ bind pxi1 e acc
+ end pxi1s es (return e1)
+ in
+ <:match_case< $p$ -> $e$ >>;
+
+ value mk_tuple expr_of_ty t =
+ let mc =
+ chain_tuple
+ (fun ps -> <:patt< ($tup:Ast.paCom_of_list ps$) >>)
+ (fun es -> <:expr< ($tup:Ast.exCom_of_list es$) >>)
+ expr_of_ty (Ast.list_of_ctyp t [])
+ in <:expr< fun [ $mc$ ] >>;
+
+ value default_match_case =
+ let mk k = if k = 1 then <:patt< x >> else <:patt< _ >> in
+ match mode with
+ [ Fold_map -> <:match_case< $tuplify_patt mk$ -> (o, x) >>
+ | Fold -> <:match_case< _ -> o >>
+ | Map -> <:match_case< $tuplify_patt mk$ -> x >> ];
+
+ value default_expr = <:expr< fun [ $default_match_case$ ] >>;
+
+ value mkfuno e =
+ match e with
+ [ <:expr< $e$ o >> -> e
+ | _ -> <:expr< fun o -> $e$ >> ];
+
+ value is_unknown t =
+ let rec loop t =
+ match t with
+ [ <:ctyp< $lid:_$ >> -> False
+ | <:ctyp< $id:_$ >> -> True
+ | <:ctyp< $t$ $_$ >> -> loop t
+ | _ -> False ]
+ in
+ match t with
+ [ <:ctyp< $uid:_$ >> -> False
+ | t -> loop t ];
+
+ value contains_unknown t =
+ try
+ let (_ : < .. >) =
+ object
+ inherit Ast.fold as super;
+ method ctyp t = if is_unknown t then raise Exit else super#ctyp t;
+ end#ctyp t
+ in False
+ with [ Exit -> True ];
+
+ value opt_bind' ox e1 mk_e2 =
+ let mk_e2 =
match ox with
- [ Some x -> <:expr< $obj$#$id$ $x$ >>
- | _ -> <:expr< $obj$#$id$ >> ]
- | <:ctyp< $t1$ $t2$ >> ->
- let e = <:expr< $self ~obj None t1$ (fun o -> $self None t2$) >> in
- match ox with
- [ Some x -> <:expr< $e$ $x$ >>
- | _ -> e ]
- | <:ctyp< $t1$ -> $t2$ >> ->
- let mk_fun x =
- let y = fresh "y" in
- let py = <:expr< $lid:y$ >> in
- let e = <:expr< $x$ $self (Some py) t1$ >>
- in <:expr< fun $lid:y$ -> $self ~obj (Some e) t2$ >> in
- match ox with
- [ Some x -> mk_fun x
+ [ Some x -> fun e1 -> <:expr< $mk_e2 e1$ $x$ >>
+ | _ -> mk_e2 ]
+ in
+ opt_bind (opt_map patt_of_expr ox) e1 mk_e2;
+
+ (* FIXME finish me
+ value rec is_simple =
+ fun
+ [ <:expr< $id:_$ >> -> True
+ | <:expr< $e$#$_$ >> | <:expr< $tup:e$ >> -> is_simple e
+ | <:expr< $e1$ $e2$ >> | <:expr< $e1$, $e2$ >> -> is_simple e1 && is_simple e2
+ | _ -> False ];
+
+ value app e1 e2 =
+ let is_e1_simple = is_simple e1 in
+ let is_e2_simple = is_simple e2 in
+ if is_e1_simple then
+ if is_e2_simple then <:expr< $e1$ $e2$ >>
+ else let x = fresh "y" in <:expr< let $lid:y$ = $e2$ in $e1$ $lid:y$ >>
+ else
+ if is_e2_simple then
+ let x = fresh "y" in <:expr< let $lid:y$ = $e1$ in $lid:y$ $e2$ >>
+ else ; *)
+
+ value opt_app e ox =
+ match ox with
+ [ Some x -> <:expr< $e$ $x$ >> (* call app *)
+ | _ -> e ];
+
+ value rec expr_of_ty x ty =
+ let rec self ?(arity=0) ox =
+ fun
+ [ t when is_unknown t ->
+ self ox <:ctyp< unknown >>
+ | <:ctyp< $lid:id$ >> ->
+ let () = store_if_builtin_type id in
+ opt_bind' ox <:expr<o>> (fun e1 -> <:expr< $e1$#$id$ >>)
+ | <:ctyp@_loc< $t1$ $t2$ >> ->
+ let e = opt_bind None
+ (self ~arity:(arity+1) None t1)
+ (fun e1 -> <:expr< $e1$ $mkfuno (self None t2)$ >>) in
+ opt_app e ox
+ | <:ctyp< ( $tup:t$ ) >> ->
+ opt_app (mk_tuple (self ~arity:0) t) ox
+ | <:ctyp< '$s$ >> ->
+ opt_app <:expr< $lid:"_f_" ^ s$ o >> ox
| _ ->
- let z = fresh "z" in
- let pz = <:expr< $lid:z$ >> in
- <:expr< fun $lid:z$ -> $mk_fun pz$ >> ]
- | <:ctyp< ( $tup:t$ ) >> ->
- let e = mk_tuple self t in
- match ox with
- [ Some x -> <:expr< $e$ $x$ >>
- | _ -> e ]
- | <:ctyp< '$s$ >> ->
- let id = "_f_" ^ s in
- match ox with
- [ Some x -> <:expr< $lid:id$ o $x$ >>
- | _ -> <:expr< $lid:id$ o >> ]
- | <:ctyp< $id:i$ >> ->
- let id1 = "_" ^ lid_of_ident "_" i in
- let ty = <:ctyp< $lid:id1$ >> in
- let () = unknown_type id1 i ty in
- self ox ty
- | _ ->
- match ox with
- [ Some x -> <:expr< $x$ >>
- | _ -> <:expr< fun _ -> o >> ] ]
- in self ?obj x ty
-
- and expr_of_constructor t (i, acc) =
- match t with
- [ <:ctyp< $t1$ and $t2$ >> ->
- expr_of_constructor t2 (expr_of_constructor t1 (i, acc))
- | _ -> (succ i, <:expr< $expr_of_ty ~obj:acc (Some <:expr< $lid:xi i$ >>) t$ >>) ]
-
-(* and expr_of_constructor_for_fold t (i, acc) =
- match t with
- [ <:ctyp< $t1$ and $t2$ >> ->
- expr_of_constructor_for_fold t2 (expr_of_constructor_for_fold t1 (i, acc))
- | _ -> (succ i, <:expr< $acc$ $expr_of_ty (Some <:expr< $lid:xi i$ >>) t$ >>) ]
- *)
- and patt_of_constructor t (i, acc) =
+ self ox <:ctyp< unknown >> ]
+ in self x ty
+
+ and expr_of_ty' e t = expr_of_ty (Some e) t
+
+ and out_constr_patt s =
+ <:patt< $uid:s$ >>
+ (* <:patt< `$s$ >>
+ <:patt< M.$uid:s$ >> *)
+ and out_constr_expr s =
+ <:expr< $uid:s$ >>
+ (* <:expr< `$s$ >>
+ <:expr< M.$uid:s$ >> *)
+
+ (* method term t =
+ match t with
+ | C(x1, ..., xn) ->
+ let o, x1 = o#t1 x1 in
+ let o, x2 = o#t2 x2 in
+ ...
+ let o, xn = o#tn xn in
+ o, C(x1, ..., xn)
+ *)
+
+ (* s = C, t = t1 and ... and tN *)
+ and match_case_of_constructor s t =
+ chain_tuple
+ (apply_patt (out_constr_patt s))
+ (apply_expr (out_constr_expr s))
+ expr_of_ty (Ast.list_of_ctyp t [])
+
+ and match_case_of_sum_type =
+ fun
+ [ <:ctyp< $t1$ | $t2$ >> ->
+ <:match_case< $match_case_of_sum_type t1$ | $match_case_of_sum_type t2$ >>
+ | <:ctyp< $uid:s$ of $t$ >> -> match_case_of_constructor s t
+ | <:ctyp< $uid:s$ >> -> match_case_of_constructor s <:ctyp<>>
+ | _ -> assert False ]
+
+ and match_case_of_poly_constructor s ts =
+ chain_tuple
+ (fun [ [] -> <:patt< `$s$ >> | [p] -> <:patt< `$s$ $p$ >> | ps -> <:patt< `$s$ ($tup:Ast.paCom_of_list ps$) >> ])
+ (fun [ [] -> <:expr< `$s$ >> | [e] -> <:expr< `$s$ $e$ >> | es -> <:expr< `$s$ ($tup:Ast.exCom_of_list es$) >> ])
+ expr_of_ty ts
+
+ and match_case_of_poly_sum_type =
+ fun
+ [ <:ctyp< $t1$ | $t2$ >> ->
+ <:match_case< $match_case_of_poly_sum_type t1$ | $match_case_of_poly_sum_type t2$ >>
+ | <:ctyp< `$i$ of ($tup:t$) >> -> match_case_of_poly_constructor i (Ast.list_of_ctyp t [])
+ | <:ctyp< `$i$ of $t$ >> -> match_case_of_poly_constructor i [t]
+ | <:ctyp< `$i$ >> -> match_case_of_poly_constructor i []
+ | _ -> assert False ]
+
+ and record_patt_of_type k =
+ fun
+ [ <:ctyp< $lid:s$ : $_$ >> ->
+ <:patt< $lid:s$ = $lid:xsk s k$ >>
+ | <:ctyp< $t1$ ; $t2$ >> ->
+ <:patt< $record_patt_of_type k t1$; $record_patt_of_type k t2$ >>
+ | _ -> assert False ]
+
+ and type_list_of_record_type t ((acc1, acc2) as acc) =
+ match t with
+ [ <:ctyp<>> -> acc
+ | <:ctyp< $lid:s$ : mutable $t$ >> | <:ctyp< $lid:s$ : $t$ >> ->
+ ([s :: acc1], [t :: acc2])
+ | <:ctyp< $t1$ ; $t2$ >> ->
+ type_list_of_record_type t1 (type_list_of_record_type t2 acc)
+ | _ -> assert False ]
+
+ and expr_of_record_type t =
+ let (ls, ts) = type_list_of_record_type t ([], []) in
+ let mkp ps = <:patt< { $list:List.map2 (fun l p -> <:patt< $lid:l$ = $p$ >>) ls ps$ } >> in
+ let mke es = <:expr< { $list:List.map2 (fun l e -> <:rec_binding< $lid:l$ = $e$ >>) ls es$ } >> in
+ chain_tuple mkp mke expr_of_ty ts
+
+ and failure_match_case =
+ <:match_case< $tuplify_patt (pxik 0)$ ->
+ o#$lid:sf "%s%d_failure" (string_of_mode mode) size$ $tuplify_expr (exik 0)$ >>
+
+ and complete_match_case mk t =
+ match t with
+ [ <:ctyp< $_$ | $_$ >> when size > 1 ->
+ <:match_case< $mk t$ | $failure_match_case$ >>
+ | _ -> mk t ]
+
+ and fun_of_ctyp tyid =
+ fun
+ [ <:ctyp< [ $t$ ] >> ->
+ <:expr< fun [ $complete_match_case match_case_of_sum_type t$ ] >>
+ | <:ctyp< { $t$ } >> ->
+ <:expr< fun [ $expr_of_record_type t$ ] >>
+ | <:ctyp< ( $tup:t$ ) >> -> mk_tuple expr_of_ty t
+ | <:ctyp< $lid:i$ >> when i = tyid -> default_expr
+ | <:ctyp< $_$ $_$ >> | <:ctyp< $_$ -> $_$ >> | <:ctyp< '$_$ >> | <:ctyp< $id:_$ >> as t ->
+ expr_of_ty None t
+ | <:ctyp<>> ->
+ expr_of_ty None <:ctyp< unknown >>
+ | <:ctyp< [ = $t$ ] >> | <:ctyp< [ < $t$ ] >> | <:ctyp< private [ < $t$ ] >> ->
+ <:expr< fun [ $complete_match_case match_case_of_poly_sum_type t$ ] >>
+ | <:ctyp< [ > $t$ ] >> | <:ctyp< private [ > $t$ ] >> ->
+ if size > 1 then
+ <:expr< fun [ $complete_match_case match_case_of_poly_sum_type t$ ] >>
+ else
+ <:expr< fun [ $match_case_of_poly_sum_type t$ | $default_match_case$ ] >>
+ | _ -> assert False ]
+
+ and string_of_type_param t =
+ match t with
+ [ <:ctyp< '$s$ >> | <:ctyp< +'$s$ >> | <:ctyp< -'$s$ >> -> s
+ | _ -> assert False ]
+
+ and method_of_type_decl _ ((id1, _, params, ctyp, priv) as type_decl) acc =
+ let rec lambda acc =
+ fun
+ [ [] -> acc
+ | [ x :: xs ] -> lambda <:expr< fun $lid:"_f_" ^ x$ -> $acc$ >> xs ] in
+ let params' = List.map string_of_type_param params in
+ let funs = lambda (fun_of_ctyp id1 ctyp) params' in
+ let ty = method_type_of_type_decl type_decl in
+ let priv = if priv then Ast.BTrue else Ast.BFalse in
+ <:class_str_item< method $private:priv$ $lid:id1$ : $ty$ = $funs$; $acc$ >>
+
+ and ctyp_name_of_name_params name params =
+ apply_ctyp <:ctyp< $id:name$ >> params
+
+ and method_type_of_type_decl (_, name, params, ctyp, _) =
+ let t = ctyp_name_of_name_params name params in
+ if mode = Map && not (contains_unknown ctyp) then
+ let out_params = List.map (fun [ <:ctyp< '$i$ >> -> <:ctyp< '$i^"_out"$ >> | _ -> assert False ]) params in
+ let t_out = ctyp_name_of_name_params name out_params in
+ method_type_of_type t t_out params out_params
+ else
+ method_type_of_type t t params []
+
+ and method_type_of_type t_in t_out params_in params_out =
+ let rt t =
+ match mode with
+ [ Fold_map -> <:ctyp< ('self_type * $t$) >>
+ | Fold -> <:ctyp< 'self_type >>
+ | Map -> t ]
+ in
+ match (params_in, params_out) with
+ [ ([param_in], [param_out]) ->
+ let alphas = tuplify_type param_in in
+ <:ctyp< ! $param_in$ $param_out$ . ('self_type -> $alphas$ -> $rt param_out$) -> $tuplify_type t_in$ -> $rt t_out$ >>
+ | ([param], []) ->
+ let alphas = tuplify_type param in
+ <:ctyp< ! $param$ . ('self_type -> $alphas$ -> $rt param$) -> $tuplify_type t_in$ -> $rt t_out$ >>
+ | ([], []) ->
+ <:ctyp< $tuplify_type t_in$ -> $rt t_out$ >>
+ | _ ->
+ let i = List.length params_in in
+ failwith (Printf.sprintf
+ "Camlp4FoldGenerator: FIXME not implemented for types with %d parameters" i) ]
+
+ and class_sig_item_of_type_decl _ ((name, _, _, t, _) as type_decl) acc =
+ let (_ : < .. >) =
+ object (self)
+ inherit Ast.fold as super;
+ method ctyp =
+ fun
+ [ <:ctyp< $lid:id$ >> -> let () = store_if_builtin_type id in self
+ | t -> super#ctyp t ];
+ end#ctyp t
+ in
+ <:class_sig_item<
+ method $lid:name$ : $method_type_of_type_decl type_decl$;
+ $acc$ >>
+
+ and generate_structure tyMap =
+ StringMap.fold method_of_type_decl used_builtins.val
+ (StringMap.fold method_of_type_decl tyMap <:class_str_item<>>)
+
+ and generate_signature tyMap =
+ StringMap.fold class_sig_item_of_type_decl used_builtins.val
+ (StringMap.fold class_sig_item_of_type_decl tyMap <:class_sig_item<>>);
+
+ end;
+
+ value rec tyMap_of_type_decls t acc =
match t with
- [ <:ctyp< $t1$ and $t2$ >> ->
- patt_of_constructor t2 (patt_of_constructor t1 (i, acc))
- | _ -> (succ i, <:patt< $acc$ $lid:xi i$ >>) ]
-
- and match_case_of_sum_type =
- fun
- [ <:ctyp< $t1$ | $t2$ >> ->
- <:match_case< $match_case_of_sum_type t1$ | $match_case_of_sum_type t2$ >>
- | <:ctyp< $uid:s$ of $t$ >> ->
- <:match_case< $pat:snd (patt_of_constructor t (0, <:patt< $uid:s$ >>))$
- -> $snd (expr_of_constructor t (0, <:expr< o >>))$ >>
- | <:ctyp< $uid:s$ >> ->
- <:match_case< $uid:s$ -> o >>
- | _ -> assert False ]
-
- and match_case_of_poly_sum_type =
- fun
- [ <:ctyp< $t1$ | $t2$ >> ->
- <:match_case< $match_case_of_poly_sum_type t1$ | $match_case_of_poly_sum_type t2$ >>
- | <:ctyp< `$i$ of $t$ >> ->
- <:match_case< `$i$ x -> $expr_of_ty ~obj:<:expr< o >> (Some <:expr< x >>) t$ >>
- | <:ctyp< `$i$ >> ->
- <:match_case< `$i$ -> o >>
- | _ -> assert False ]
-
- and record_patt_of_type =
- fun
- [ <:ctyp< $lid:s$ : $_$ >> ->
- <:patt< $lid:s$ = $lid:xs s$ >>
- | <:ctyp< $t1$ ; $t2$ >> ->
- <:patt< $record_patt_of_type t1$; $record_patt_of_type t2$ >>
- | _ -> assert False ]
-
- and record_binding_of_type =
- fun
- [ <:ctyp< $lid:s$ : mutable $t$ >> | <:ctyp< $lid:s$ : $t$ >> ->
- <:rec_binding< $lid:s$ = $expr_of_ty (Some <:expr< $lid:xs s$ >>) t$ >>
- | <:ctyp< $t1$ ; $t2$ >> ->
- <:rec_binding< $record_binding_of_type t1$; $record_binding_of_type t2$ >>
- | _ -> assert False ]
-
- and fun_of_ctyp tyid =
- fun
- [ <:ctyp< [ $t$ ] >> ->
- <:expr< fun [ $match_case_of_sum_type t$ ] >>
- | <:ctyp< { $t$ } >> ->
- <:expr< fun { $record_patt_of_type t$ } -> { $record_binding_of_type t$ } >>
- | <:ctyp< ( $tup:t$ ) >> -> mk_tuple expr_of_ty t
- | <:ctyp< $_$ $_$ >> | <:ctyp< $_$ -> $_$ >> | <:ctyp< '$_$ >> as t ->
- expr_of_ty None t
- | <:ctyp< $lid:i$ >> when i = tyid -> <:expr< fun _ -> o >>
- | <:ctyp< $id:i$ >> as t ->
- let id1 = "_" ^ lid_of_ident "_" i in
- if id1 = tyid then <:expr< fun _ -> o >>
- else expr_of_ty None t
- | <:ctyp< [ = $t$ ] >> | <:ctyp< [ < $t$ ] >> | <:ctyp< private [ < $t$ ] >> ->
- <:expr< fun [ $match_case_of_poly_sum_type t$ ] >>
- | <:ctyp< [ > $t$ ] >> | <:ctyp< private [ > $t$ ] >> ->
- <:expr< fun [ $match_case_of_poly_sum_type t$ | x -> x ] >>
- | _ -> assert False ]
-
- and string_of_type_param t =
- match t with
- [ <:ctyp< '$s$ >> | <:ctyp< +'$s$ >> | <:ctyp< -'$s$ >> -> s
- | _ -> assert False ]
-
- and method_of_type_decl ((id1, _, params, ctyp) as type_decl) =
- let rec lambda acc =
- fun
- [ [] -> acc
- | [ x :: xs ] -> lambda <:expr< fun $lid:"_f_" ^ x$ -> $acc$ >> xs ] in
- let params' = List.map string_of_type_param params in
- let funs = lambda (fun_of_ctyp id1 ctyp) params' in
- let ty = method_type_of_type_decl type_decl in
- <:class_str_item< method $lid:id1$ : $ty$ = $funs$ >>
-
- and ctyp_name_of_name_params name params =
- apply_ctyp <:ctyp< $id:name$ >> params
-
- and method_type_of_type_decl (_, name, params, _) =
- let t = ctyp_name_of_name_params name [] (* FIXME params *) in
- match List.length params with
- [ 1 -> <:ctyp< ! 'a . ('self_type -> 'a -> 'self_type) -> $t$ 'a -> 'self_type >>
- | 0 -> <:ctyp< $t$ -> 'self_type >>
- | _ -> failwith "FIXME not implemented" ]
-
- and class_sig_item_of_type_decl _ ((name, _, _, _) as type_decl) acc =
- <:class_sig_item<
- method $lid:name$ : $method_type_of_type_decl type_decl$;
- $acc$ >>
-
- and tyMap_of_type_decls t acc =
- match t with
- [ <:ctyp< $t1$ and $t2$ >> ->
+ [ <:ctyp<>> -> acc
+ | <:ctyp< $t1$ and $t2$ >> ->
tyMap_of_type_decls t1 (tyMap_of_type_decls t2 acc)
| Ast.TyDcl _ name tl tk _ ->
- StringMap.add name (name, <:ident< $lid:name$ >>, tl, tk) acc
- | _ -> assert False ]
+ StringMap.add name (name, <:ident< $lid:name$ >>, tl, tk, False) acc
+ | _ -> assert False ];
- and fold_types_in_str_item f =
- fun
- [ <:str_item< type $t$ >> -> f t
- | <:str_item< $st1$; $st2$ >> -> fun acc ->
- fold_types_in_str_item f st1 (fold_types_in_str_item f st2 acc)
- | <:str_item< module $_$ = struct $st$ end >> |
- <:str_item< module $_$ ($_$:$_$) = struct $st$ end >> ->
- fold_types_in_str_item f st
- | _ -> fun x -> x ]
-
- and fold_types_in_sig_item f =
- fun
- [ <:sig_item< type $t$ >> -> f t
- | <:sig_item< $sg1$; $sg2$ >> -> fun acc ->
- fold_types_in_sig_item f sg1 (fold_types_in_sig_item f sg2 acc)
- | <:sig_item< module $_$ : sig $sg$ end >> |
- <:sig_item< module $_$ ($_$:$_$) : sig $sg$ end >> ->
- fold_types_in_sig_item f sg
- | _ -> fun x -> x ]
-
- and collect_types_in_str_item str_item =
- fold_types_in_str_item tyMap_of_type_decls str_item StringMap.empty
-
- and collect_types_in_sig_item sig_item =
- fold_types_in_sig_item tyMap_of_type_decls sig_item StringMap.empty
-
- and generate_structure tyMap =
- let f x acc = <:class_str_item< $method_of_type_decl x$; $acc$ >> in
- let g _ ty = f ty in
- fold_unknown_types g (StringMap.fold g tyMap <:class_str_item<>>)
-
- and generate_signature tyMap =
- StringMap.fold class_sig_item_of_type_decl tyMap <:class_sig_item<>>
-
- and inject_structure_drop_trash generated =
- (Ast.map_str_item
- (fun
- [ <:str_item@_loc< class $lid:c$ = Camlp4Filters.GenerateFold.generated >> ->
- (* FIXME <:str_item< class $lid:c$ = object (o) $builtins$; $generated$ end >> *)
- let x = <:class_str_item< $builtins$; $generated$ >> in
- <:str_item< class $lid:c$ = object (o : 'self_type) $x$ end >>
- | s -> s ]))#str_item
-
- and inject_signature generated =
- (Ast.map_sig_item
- (fun
- [ <:sig_item@_loc< class $lid:c$ : Camlp4Filters.GenerateFold.generated >> ->
- <:sig_item< class $lid:c$ : object $generated$ end >>
- | s -> s ]))#sig_item
-
- and process_str_item str_item =
- let tyMap = collect_types_in_str_item str_item in
- let generated = generate_structure tyMap in
- inject_structure_drop_trash generated str_item
-
- and process_sig_item sig_item =
- let tyMap = collect_types_in_sig_item sig_item in
- let generated = generate_signature tyMap in
- inject_signature generated sig_item;
-
- register_str_item_filter process_str_item;
- register_sig_item_filter process_sig_item;
+ value generate_class_implem mode c tydcl n =
+ let tyMap = tyMap_of_type_decls tydcl StringMap.empty in
+ let module M = Gen(struct value size = n; value mode = mode; end) in
+ let generated = M.generate_structure tyMap in
+ let gen_type =
+ <:ctyp< ! 'a 'b . $M.method_type_of_type <:ctyp< 'a >> <:ctyp< 'b >> [] []$ >>
+ in
+ let failure =
+ if n > 1 then
+ let name = string_of_mode mode in
+ <:class_str_item< method $lid:sf "%s%d_failure" name n$ : $gen_type$ =
+ fun $M.tuplify_patt (pxik 0)$ ->
+ failwith $`str:sf "%s%d_failure: default implementation" name n$ >>
+ else <:class_str_item<>>
+ in
+ let gen_type =
+ <:ctyp< ! 'a . $M.method_type_of_type <:ctyp< 'a >> <:ctyp< 'a >> [] []$ >>
+ in
+ let unknown =
+ <:class_str_item< method unknown : $gen_type$ = $M.default_expr$ >>
+ in
+ <:str_item< class $lid:c$ = object (o : 'self_type) $generated$; $failure$; $unknown$ end >>;
+
+ value generate_class_interf mode c tydcl n =
+ let tyMap = tyMap_of_type_decls tydcl StringMap.empty in
+ let module M = Gen(struct value size = n; value mode = mode; end) in
+ let generated = M.generate_signature tyMap in
+ let gen_type =
+ <:ctyp< ! 'a 'b . $M.method_type_of_type <:ctyp< 'a >> <:ctyp< 'b >> [] []$ >>
+ in
+ let failure =
+ if n > 1 then
+ let name = string_of_mode mode in
+ <:class_sig_item< method $lid:sf "%s%d_failure" name n$ : $gen_type$ >>
+ else <:class_sig_item<>>
+ in
+ let gen_type =
+ <:ctyp< ! 'a . $M.method_type_of_type <:ctyp< 'a >> <:ctyp< 'a >> [] []$ >>
+ in
+ let unknown =
+ <:class_sig_item< method unknown : $gen_type$ >>
+ in
+ <:sig_item< class $lid:c$ : object ('self_type) $generated$; $failure$; $unknown$ end >>;
+
+ value processor =
+ let last = ref <:ctyp<>> in
+ let generate_class' generator default c s n =
+ match s with
+ [ "Fold" -> generator Fold c last.val n
+ | "Map" -> generator Map c last.val n
+ | "FoldMap" -> generator Fold_map c last.val n
+ | _ -> default ]
+ in
+ let generate_class_from_module_name generator c default m =
+ try Scanf.sscanf m "Camlp4%[^G]Generator" begin fun m' ->
+ try Scanf.sscanf m' "%[^0-9]%d" (generate_class' generator default c)
+ with [ End_of_file | Scanf.Scan_failure _ -> generate_class' generator default c m' 1 ]
+ end with [ End_of_file | Scanf.Scan_failure _ -> default ]
+ in
+ object (self)
+ inherit Ast.map as super;
+
+ method str_item st =
+ match st with
+ [ <:str_item< type $t$ >> -> (last.val := t; st)
+
+ (* backward compatibility *)
+ | <:str_item@_loc< class $lid:c$ = Camlp4Filters.GenerateFold.generated >> ->
+ generate_class_implem Fold c last.val 1
+ | <:str_item@_loc< class $lid:c$ = Camlp4Filters.GenerateMap.generated >> ->
+ generate_class_implem Map c last.val 1
+
+ (* Handle Camlp4(Fold|Map|FoldMap)\d*Generator *)
+ | <:str_item@_loc< class $lid:c$ = $uid:m$.generated >> ->
+ generate_class_from_module_name generate_class_implem c st m
+
+ (* It's a hack to force to recurse on the left to right order *)
+ | <:str_item< $st1$; $st2$ >> ->
+ let st1 = self#str_item st1 in
+ <:str_item< $st1$; $self#str_item st2$ >>
+
+ | st -> super#str_item st ];
+
+ method sig_item sg =
+ match sg with
+ [ <:sig_item< type $t$ >> -> (last.val := t; sg)
+
+ (* backward compatibility *)
+ | <:sig_item@_loc< class $lid:c$ : Camlp4Filters.GenerateFold.generated >> ->
+ generate_class_interf Fold c last.val 1
+ | <:sig_item@_loc< class $lid:c$ : Camlp4Filters.GenerateMap.generated >> ->
+ generate_class_interf Map c last.val 1
+
+ (* Handle Camlp4(Fold|Map|FoldMap)\d*Generator *)
+ | <:sig_item@_loc< class $lid:c$ : $uid:m$.generated >> ->
+ generate_class_from_module_name generate_class_interf c sg m
+
+ (* It's a hack to force to recurse on the left to right order *)
+ | <:sig_item< $sg1$; $sg2$ >> ->
+ let sg1 = self#sig_item sg1 in
+ <:sig_item< $sg1$; $self#sig_item sg2$ >>
+
+ | sg -> super#sig_item sg ];
+ end;
+
+ register_str_item_filter processor#str_item;
+ register_sig_item_filter processor#sig_item;
end;
-(* camlp4r *)
-(****************************************************************************)
-(* *)
-(* Objective Caml *)
-(* *)
-(* INRIA Rocquencourt *)
-(* *)
-(* Copyright 2006 Institut National de Recherche en Informatique et *)
-(* en Automatique. All rights reserved. This file is distributed under *)
-(* the terms of the GNU Library General Public License, with the special *)
-(* exception on linking described in LICENSE at the top of the Objective *)
-(* Caml source tree. *)
-(* *)
-(****************************************************************************)
-
-(* Authors:
- * - Nicolas Pouillard: initial version
- *)
-
-
-open Camlp4;
-
+(* This module is useless now. Camlp4FoldGenerator handles map too. *)
module Id = struct
value name = "Camlp4MapGenerator";
- value version = "$Id: Camlp4MapGenerator.ml,v 1.1.4.4 2007/05/01 07:24:06 pouillar Exp $";
+ value version = "$Id: Camlp4MapGenerator.ml,v 1.1.4.5 2007/06/23 16:00:09 ertai Exp $";
end;
-
-module Make (AstFilters : Camlp4.Sig.AstFilters) = struct
- open AstFilters;
- module StringMap = Map.Make String;
- open Ast;
-
- value _loc = Loc.ghost;
-
- value xi i = "_x" ^ string_of_int i;
-
- value xs s = "_x_" ^ s;
-
- value rec apply_expr accu =
- fun
- [ [] -> accu
- | [x :: xs] ->
- let _loc = Ast.loc_of_expr x
- in apply_expr <:expr< $accu$ $x$ >> xs ];
-
- value rec apply_patt accu =
- fun
- [ [] -> accu
- | [x :: xs] ->
- let _loc = Ast.loc_of_patt x
- in apply_patt <:patt< $accu$ $x$ >> xs ];
-
- value rec apply_ctyp accu =
- fun
- [ [] -> accu
- | [x :: xs] ->
- let _loc = Ast.loc_of_ctyp x
- in apply_ctyp <:ctyp< $accu$ $x$ >> xs ];
-
- value list_mapi f =
- let rec self i =
- fun
- [ [] -> []
- | [ x :: xs ] -> [ f i x :: self (succ i) xs ] ]
- in self 0;
-
- value list_init f n =
- let rec self m =
- if m = n then []
- else [f m :: self (succ m)]
- in self 0;
-
- (* Yes this is a poor fresh function *)
- value fresh =
- let count = ref 0 in
- fun basename ->
- let res = basename ^ (string_of_int count.val)
- in do { incr count; res };
-
- value mk_tuple self t =
- let tl = Ast.list_of_ctyp t [] in
- let n = List.length tl in
- let exi i = <:expr< $lid:xi i$ >> in
- let pxi i = <:patt< $lid:xi i$ >> in
- let el = list_mapi (fun i -> self (Some (exi i))) tl in
- <:expr< fun ($tup:Ast.paCom_of_list (list_init pxi n)$)
- -> ($tup:Ast.exCom_of_list el$) >>;
-
- value builtins =
- <:class_str_item<
- method string x : string = x;
- method int x : int = x;
- method float x : float = x;
- method bool x : bool = x;
- method list : ! 'a 'b . ('a -> 'b) -> list 'a -> list 'b =
- List.map;
- method option : ! 'a 'b . ('a -> 'b) -> option 'a -> option 'b =
- fun f -> fun [ None -> None | Some x -> Some (f x) ];
- method array : ! 'a 'b . ('a -> 'b) -> array 'a -> array 'b =
- Array.map;
- method ref : ! 'a 'b . ('a -> 'b) -> ref 'a -> ref 'b =
- fun f { val = x } -> { val = f x };
- >>;
-
- (* FIXME UNUSED *)
- value builtins_sig =
- <:sig_item<
- value string : string -> string;
- value int : int -> int;
- value float : float -> float;
- value bool : bool -> bool;
- value list : ('a -> 'b) -> list 'a -> list 'b;
- value array : ('a -> 'b) -> array 'a -> array 'b;
- value option : ('a -> 'b) -> option 'a -> option 'b;
- value ref : ('a -> 'b) -> ref 'a -> ref 'b;
- >>;
-
- value rec lid_of_ident sep =
- fun
- [ <:ident< $lid:s$ >> | <:ident< $uid:s$ >> -> s
- | <:ident< $i1$.$i2$ >> -> lid_of_ident sep i1 ^ sep ^ lid_of_ident sep i2
- | _ -> assert False ];
-
- type type_decl = (string * Ast.ident * list Ast.ctyp * Ast.ctyp);
-
- value (unknown_type, fold_unknown_types) =
- let set = ref StringMap.empty in
- let add id1 id2 ty = set.val := StringMap.add id1 (id1, id2, [], ty) set.val
- and fold f = StringMap.fold f set.val in (add, fold);
-
- value rec expr_of_ty x ty =
- let rec self ox =
- fun
- [ <:ctyp< $lid:id$ >> ->
- match ox with
- [ Some x -> <:expr< o#$id$ $x$ >>
- | _ -> <:expr< o#$id$ >> ]
- | <:ctyp< $t1$ $t2$ >> ->
- let e = <:expr< $self None t1$ $self None t2$ >> in
- match ox with
- [ Some x -> <:expr< $e$ $x$ >>
- | _ -> e ]
- | <:ctyp< $t1$ -> $t2$ >> ->
- let mk_fun x =
- let y = fresh "y" in
- let py = <:expr< $lid:y$ >> in
- let e = <:expr< $x$ $self (Some py) t1$ >>
- in <:expr< fun $lid:y$ -> $self (Some e) t2$ >> in
- match ox with
- [ Some x -> mk_fun x
- | _ ->
- let z = fresh "z" in
- let pz = <:expr< $lid:z$ >> in
- <:expr< fun $lid:z$ -> $mk_fun pz$ >> ]
- | <:ctyp< ( $tup:t$ ) >> ->
- let e = mk_tuple self t in
- match ox with
- [ Some x -> <:expr< $e$ $x$ >>
- | _ -> e ]
- | <:ctyp< '$s$ >> ->
- let id = "_f_" ^ s in
- match ox with
- [ Some x -> <:expr< $lid:id$ $x$ >>
- | _ -> <:expr< $lid:id$ >> ]
- | <:ctyp< $id:i$ >> ->
- let id1 = "_" ^ lid_of_ident "_" i in
- let ty = <:ctyp< $lid:id1$ >> in
- let () = unknown_type id1 i ty in
- self ox ty
- | _ ->
- match ox with
- [ Some x -> <:expr< $x$ >>
- | _ -> <:expr< fun x -> x >> ] ]
- in self x ty
-
- and expr_of_constructor t (i, acc) =
- match t with
- [ <:ctyp< $t1$ and $t2$ >> ->
- expr_of_constructor t2 (expr_of_constructor t1 (i, acc))
- | _ -> (succ i, <:expr< $acc$ $expr_of_ty (Some <:expr< $lid:xi i$ >>) t$ >>) ]
-
- and patt_of_constructor t (i, acc) =
- match t with
- [ <:ctyp< $t1$ and $t2$ >> ->
- patt_of_constructor t2 (patt_of_constructor t1 (i, acc))
- | _ -> (succ i, <:patt< $acc$ $lid:xi i$ >>) ]
-
- and match_case_of_sum_type =
- fun
- [ <:ctyp< $t1$ | $t2$ >> ->
- <:match_case< $match_case_of_sum_type t1$ | $match_case_of_sum_type t2$ >>
- | <:ctyp< $uid:s$ of $t$ >> ->
- <:match_case< $pat:snd (patt_of_constructor t (0, <:patt< $uid:s$ >>))$
- -> $snd (expr_of_constructor t (0, <:expr< $uid:s$ >>))$ >>
- | <:ctyp< $uid:s$ >> ->
- <:match_case< $uid:s$ -> $uid:s$ >>
- | _ -> assert False ]
-
- and match_case_of_poly_sum_type =
- fun
- [ <:ctyp< $t1$ | $t2$ >> ->
- <:match_case< $match_case_of_poly_sum_type t1$ | $match_case_of_poly_sum_type t2$ >>
- | <:ctyp< `$i$ of $t$ >> ->
- <:match_case< `$i$ x -> `$i$ $expr_of_ty (Some <:expr< x >>) t$ >>
- | <:ctyp< `$i$ >> ->
- <:match_case< `$i$ -> `$i$ >>
- | _ -> assert False ]
-
- and record_patt_of_type =
- fun
- [ <:ctyp< $lid:s$ : $_$ >> ->
- <:patt< $lid:s$ = $lid:xs s$ >>
- | <:ctyp< $t1$ ; $t2$ >> ->
- <:patt< $record_patt_of_type t1$; $record_patt_of_type t2$ >>
- | _ -> assert False ]
-
- and record_binding_of_type =
- fun
- [ <:ctyp< $lid:s$ : mutable $t$ >> | <:ctyp< $lid:s$ : $t$ >> ->
- <:rec_binding< $lid:s$ = $expr_of_ty (Some <:expr< $lid:xs s$ >>) t$ >>
- | <:ctyp< $t1$ ; $t2$ >> ->
- <:rec_binding< $record_binding_of_type t1$; $record_binding_of_type t2$ >>
- | _ -> assert False ]
-
- and fun_of_ctyp tyid =
- fun
- [ <:ctyp< [ $t$ ] >> ->
- <:expr< fun [ $match_case_of_sum_type t$ ] >>
- | <:ctyp< { $t$ } >> ->
- <:expr< fun { $record_patt_of_type t$ } -> { $record_binding_of_type t$ } >>
- | <:ctyp< ( $tup:t$ ) >> -> mk_tuple expr_of_ty t
- | <:ctyp< $_$ $_$ >> | <:ctyp< $_$ -> $_$ >> | <:ctyp< '$_$ >> as t ->
- expr_of_ty None t
- | <:ctyp< $lid:i$ >> when i = tyid -> <:expr< fun x -> x >>
- | <:ctyp< $id:i$ >> as t ->
- let id1 = "_" ^ lid_of_ident "_" i in
- if id1 = tyid then <:expr< fun x -> x >>
- else expr_of_ty None t
- | <:ctyp< [ = $t$ ] >> | <:ctyp< [ < $t$ ] >> | <:ctyp< private [ < $t$ ] >> ->
- <:expr< fun [ $match_case_of_poly_sum_type t$ ] >>
- | <:ctyp< [ > $t$ ] >> | <:ctyp< private [ > $t$ ] >> ->
- <:expr< fun [ $match_case_of_poly_sum_type t$ | x -> x ] >>
- | _ -> assert False ]
-
- and string_of_type_param t =
- match t with
- [ <:ctyp< '$s$ >> | <:ctyp< +'$s$ >> | <:ctyp< -'$s$ >> -> s
- | _ -> assert False ]
-
- and method_of_type_decl ((id1, _, params, ctyp) as type_decl) =
- let rec lambda acc =
- fun
- [ [] -> acc
- | [ x :: xs ] -> lambda <:expr< fun $lid:"_f_" ^ x$ -> $acc$ >> xs ] in
- let params' = List.map string_of_type_param params in
- let funs = lambda (fun_of_ctyp id1 ctyp) params' in
- let ty = method_type_of_type_decl type_decl in
- <:class_str_item< method $lid:id1$ : $ty$ = $funs$ >>
-
- and ctyp_name_of_name_params name params =
- apply_ctyp <:ctyp< $id:name$ >> params
-
- and method_type_of_type_decl (_, name, params, _) =
- let t = ctyp_name_of_name_params name [] (* FIXME params *) in
- match List.length params with
- [ 1 -> <:ctyp< ! 'a 'b . ('a -> 'b) -> $t$ 'a -> $t$ 'b >>
- | 0 -> <:ctyp< $t$ -> $t$ >>
- | _ -> failwith "FIXME not implemented" ]
-
- and class_sig_item_of_type_decl _ ((name, _, _, _) as type_decl) acc =
- <:class_sig_item<
- method $lid:name$ : $method_type_of_type_decl type_decl$;
- $acc$ >>
-
- and tyMap_of_type_decls t acc =
- match t with
- [ <:ctyp< $t1$ and $t2$ >> ->
- tyMap_of_type_decls t1 (tyMap_of_type_decls t2 acc)
- | Ast.TyDcl _ name tl tk _ ->
- StringMap.add name (name, <:ident< $lid:name$ >>, tl, tk) acc
- | _ -> assert False ]
-
- and fold_types_in_str_item f =
- fun
- [ <:str_item< type $t$ >> -> f t
- | <:str_item< $st1$; $st2$ >> -> fun acc ->
- fold_types_in_str_item f st1 (fold_types_in_str_item f st2 acc)
- | <:str_item< module $_$ = struct $st$ end >> |
- <:str_item< module $_$ ($_$:$_$) = struct $st$ end >> ->
- fold_types_in_str_item f st
- | _ -> fun x -> x ]
-
- and fold_types_in_sig_item f =
- fun
- [ <:sig_item< type $t$ >> -> f t
- | <:sig_item< $sg1$; $sg2$ >> -> fun acc ->
- fold_types_in_sig_item f sg1 (fold_types_in_sig_item f sg2 acc)
- | <:sig_item< module $_$ : sig $sg$ end >> |
- <:sig_item< module $_$ ($_$:$_$) : sig $sg$ end >> ->
- fold_types_in_sig_item f sg
- | _ -> fun x -> x ]
-
- and collect_types_in_str_item str_item =
- fold_types_in_str_item tyMap_of_type_decls str_item StringMap.empty
-
- and collect_types_in_sig_item sig_item =
- fold_types_in_sig_item tyMap_of_type_decls sig_item StringMap.empty
-
- and generate_structure tyMap =
- let f x acc = <:class_str_item< $method_of_type_decl x$; $acc$ >> in
- let g _ ty = f ty in
- fold_unknown_types g (StringMap.fold g tyMap <:class_str_item<>>)
-
- and generate_signature tyMap =
- StringMap.fold class_sig_item_of_type_decl tyMap <:class_sig_item<>>
-
- and inject_structure_drop_trash generated =
- (Ast.map_str_item
- (fun
- [ <:str_item@_loc< class $lid:c$ = Camlp4Filters.GenerateMap.generated >> ->
- let x = <:class_str_item< $builtins$; $generated$ >> in
- <:str_item< class $lid:c$ = object (o) $x$ end >>
- | <:str_item@_loc< class $lid:c$ = Camlp4Filters.Camlp4MapGenerator.generated >> ->
- (* FIXME <:str_item< class $lid:c$ = object (o) $builtins$; $generated$ end >> *)
- let x = <:class_str_item< $builtins$; $generated$ >> in
- <:str_item< class $lid:c$ = object (o) $x$ end >>
- | s -> s ]))#str_item
-
- and inject_signature generated =
- (Ast.map_sig_item
- (fun
- [ <:sig_item@_loc< class $lid:c$ : Camlp4Filters.GenerateMap.generated >> ->
- <:sig_item< class $lid:c$ : object $generated$ end >>
- | <:sig_item@_loc< class $lid:c$ : Camlp4Filters.Camlp4MapGenerator.generated >> ->
- <:sig_item< class $lid:c$ : object $generated$ end >>
- | s -> s ]))#sig_item
-
- and process_str_item str_item =
- let tyMap = collect_types_in_str_item str_item in
- let generated = generate_structure tyMap in
- inject_structure_drop_trash generated str_item
-
- and process_sig_item sig_item =
- let tyMap = collect_types_in_sig_item sig_item in
- let generated = generate_signature tyMap in
- inject_signature generated sig_item;
-
- register_str_item_filter process_str_item;
- register_sig_item_filter process_sig_item;
-
-end;
-
-let module M = Camlp4.Register.AstFilter Id Make in ();
value fold_args ty f init =
let (_, res) =
- List.fold_left (fun (i, acc) ty -> (succ i, f ty i acc)
- ) (0, init) ty
+ List.fold_left begin fun (i, acc) ty ->
+ (succ i, f ty i acc)
+ end (0, init) ty
in res;
value fold_data_ctors ty f init =
MapTy.fold f m.type_decls init;
value patt_of_data_ctor_decl cons tyargs =
- fold_args tyargs (fun _ i acc ->
+ fold_args tyargs begin fun _ i acc ->
<:patt< $acc$ $id:x i$ >>
- ) <:patt< $id:cons$ >>;
+ end <:patt< $id:cons$ >>;
value expr_of_data_ctor_decl cons tyargs =
- fold_args tyargs (fun _ i acc ->
+ fold_args tyargs begin fun _ i acc ->
<:expr< $acc$ $id:x i$ >>
- ) <:expr< $id:cons$ >>;
+ end <:expr< $id:cons$ >>;
value is_antiquot_data_ctor s =
let ls = String.length s in
value mk_meta m =
let m_name_uid x = <:ident< $m.name$.$uid:x$ >> in
- fold_type_decls m (fun tyname tydcl acc ->
- let funct =
- match tydcl with
- [ Ast.TyDcl _ _ tyvars <:ctyp< [$ty$] >> _ ->
- let match_case =
- fold_data_ctors ty (fun cons tyargs acc ->
- let m_name_cons = m_name_uid cons in
- let init = m_id m (meta_ident m m_name_cons) in
- let p = patt_of_data_ctor_decl m_name_cons tyargs in
- let e =
- if cons = "BAnt" || cons = "OAnt" || cons = "LAnt" then
- <:expr< $id:m.ant$ _loc x0 >>
- else if is_antiquot_data_ctor cons then
- expr_of_data_ctor_decl m.ant tyargs
- else
- fold_args tyargs (fun ty i acc ->
- let rec fcall_of_ctyp ty =
- match ty with
- [ <:ctyp< $id:id$ >> ->
- <:expr< $id:meta_ (string_of_ident id)$ >>
- | <:ctyp< ($t1$ * $t2$) >> ->
- <:expr< (fun _loc (x1, x2) ->
- $m.tup$ _loc
- ($m.com$ _loc
- ($fcall_of_ctyp t1$ _loc x1)
- ($fcall_of_ctyp t2$ _loc x2))) >>
- | <:ctyp< $t1$ $t2$ >> ->
- <:expr< $fcall_of_ctyp t1$ $fcall_of_ctyp t2$ >>
- | <:ctyp< '$s$ >> -> <:expr< $lid:mf_ s$ >>
- | _ -> failure ]
- in m_app m acc <:expr< $fcall_of_ctyp ty$ _loc $id:x i$ >>
- ) init
- in <:match_case< $p$ -> $e$ | $acc$ >>
- ) <:match_case<>> in
- List.fold_right (fun tyvar acc ->
- match tyvar with
- [ <:ctyp< +'$s$ >> | <:ctyp< -'$s$ >> | <:ctyp< '$s$ >> ->
+ fold_type_decls m begin fun tyname tydcl binding_acc ->
+ match tydcl with
+ [ Ast.TyDcl _ _ tyvars <:ctyp< [$ty$] >> _ ->
+ let match_case =
+ fold_data_ctors ty begin fun cons tyargs acc ->
+ let m_name_cons = m_name_uid cons in
+ let init = m_id m (meta_ident m m_name_cons) in
+ let p = patt_of_data_ctor_decl m_name_cons tyargs in
+ let e =
+ if cons = "BAnt" || cons = "OAnt" || cons = "LAnt" then
+ <:expr< $id:m.ant$ _loc x0 >>
+ else if is_antiquot_data_ctor cons then
+ expr_of_data_ctor_decl m.ant tyargs
+ else
+ fold_args tyargs begin fun ty i acc ->
+ let rec fcall_of_ctyp ty =
+ match ty with
+ [ <:ctyp< $id:id$ >> ->
+ <:expr< $id:meta_ (string_of_ident id)$ >>
+ | <:ctyp< ($t1$ * $t2$) >> ->
+ <:expr< fun _loc (x1, x2) ->
+ $m.tup$ _loc
+ ($m.com$ _loc
+ ($fcall_of_ctyp t1$ _loc x1)
+ ($fcall_of_ctyp t2$ _loc x2)) >>
+ | <:ctyp< $t1$ $t2$ >> ->
+ <:expr< $fcall_of_ctyp t1$ $fcall_of_ctyp t2$ >>
+ | <:ctyp< '$s$ >> -> <:expr< $lid:mf_ s$ >>
+ | _ -> failure ]
+ in m_app m acc <:expr< $fcall_of_ctyp ty$ _loc $id:x i$ >>
+ end init
+ in <:match_case< $p$ -> $e$ | $acc$ >>
+ end <:match_case<>> in
+ let funct =
+ List.fold_right begin fun tyvar acc ->
+ match tyvar with
+ [ <:ctyp< +'$s$ >> | <:ctyp< -'$s$ >> | <:ctyp< '$s$ >> ->
<:expr< fun $lid:mf_ s$ -> $acc$ >>
- | _ -> assert False ])
- tyvars <:expr< fun _loc -> fun [ $match_case$ ] >>
- | Ast.TyDcl _ _ _ _ _ -> <:expr< fun _ -> $failure$ >>
- | _ -> assert False ]
- in <:binding< $acc$ and $lid:"meta_"^tyname$ = $funct$ >>) <:binding<>>;
+ | _ -> assert False ]
+ end tyvars <:expr< fun _loc -> fun [ $match_case$ ] >>
+ in <:binding< $binding_acc$ and $lid:"meta_"^tyname$ = $funct$ >>
+ | Ast.TyDcl _ _ _ _ _ -> binding_acc
+ | _ -> assert False ]
+ end <:binding<>>;
value find_type_decls = object
inherit Ast.fold as super;
module Id = struct
value name = "Camlp4GrammarParser";
- value version = "$Id: Camlp4GrammarParser.ml,v 1.1.4.4 2007/04/20 14:57:28 pouillar Exp $";
+ value version = "$Id: Camlp4GrammarParser.ml,v 1.1.4.6 2007/12/18 08:59:35 ertai Exp $";
end;
module Make (Syntax : Sig.Camlp4Syntax) = struct
| STself of loc and string
| STtok of loc
| STstring_tok of loc
- | STany of loc
| STtyp of Ast.ctyp ]
;
try
List.map
(fun
- (* ...; [ "foo" ]; ... ==> ...; (x = [ "foo" ] -> Token.extract_string x); ... *)
+ (* ...; [ "foo" ]; ... ==> ...; (x = [ "foo" ] -> Gram.Token.extract_string x); ... *)
[ {prod = [({pattern = None; styp = STtok _} as s)]; action = None} ->
{prod = [{ (s) with pattern = Some <:patt< x >> }];
- action = Some <:expr< Token.extract_string x >>}
+ action = Some <:expr< $uid:gm$.Token.extract_string x >>}
(* ...; [ symb ]; ... ==> ...; (x = [ symb ] -> x); ... *)
| {prod = [({pattern = None} as s)]; action = None} ->
{prod = [{ (s) with pattern = Some <:patt< x >> }];
Loc.raise _loc
(Stream.Error ("'" ^ x ^ "' illegal in anonymous entry level"))
else <:ctyp< '$tvar$ >>
- | STany _loc -> <:ctyp< _ >>
| STtok _loc -> <:ctyp< $uid:gm$.Token.t >>
| STstring_tok _loc -> <:ctyp< string >>
| STtyp t -> t ]
<:expr< match $tok$ with
[ $pat:match_$ -> $e1$
| _ -> assert False ] >> ] in
- <:expr< fun ($locid$ : Loc.t) -> $e2$ >> in
+ <:expr< fun ($locid$ : $uid:gm$.Loc.t) -> $e2$ >> in
let (txt, _) =
List.fold_left
(fun (txt, i) s ->
TXlist loc min symb sep
;
+ (*
value sstoken _loc s =
let n = mk_name _loc <:ident< $lid:"a_" ^ s$ >> in
TXnterm _loc n None
let styp = STquo _loc "a_opt" in
{used = used; text = text; styp = styp; pattern = None}
;
+ *)
value text_of_entry _loc e =
let ent =
END;
+ (*
EXTEND Gram
symbol: LEVEL "top"
[ NONA
ssopt _loc s ] ]
;
END;
+ *)
value sfold _loc n foldfun f e s =
let styp = STquo _loc (new_type_var ()) in
module Id = struct
value name = "Camlp4ListComprenhsion";
- value version = "$Id: Camlp4ListComprehension.ml,v 1.1 2007/02/27 15:50:57 pouillar Exp $";
+ value version = "$Id: Camlp4ListComprehension.ml,v 1.1.2.1 2007/05/27 16:23:35 pouillar Exp $";
end;
module Make (Syntax : Sig.Camlp4Syntax) = struct
skip_patt (ignore_upto ")" (n + 1) + 1)
| Some (KEYWORD "{") ->
skip_patt (ignore_upto "}" (n + 1) + 1)
- | Some (KEYWORD ("as" | "::" | ";" | "," | "_"))
+ | Some (KEYWORD ("as" | "::" | "," | "_"))
| Some (LIDENT _ | UIDENT _) -> skip_patt (n + 1)
| Some _ | None -> raise Stream.Failure ]
and ignore_upto end_kwd n =
module Id = struct
value name = "Camlp4MacroParser";
- value version = "$Id: Camlp4MacroParser.ml,v 1.1.4.5 2007/04/26 19:51:49 pouillar Exp $";
+ value version = "$Id: Camlp4MacroParser.ml,v 1.1.4.6 2007/06/23 16:00:09 ertai Exp $";
end;
(*
class reloc _loc = object
inherit Ast.map as super;
- method _Loc_t _ = _loc;
+ method loc _ = _loc;
+ (* method _Loc_t _ = _loc; *)
end;
class subst _loc env = object
module Id : Sig.Id = struct
value name = "Camlp4OCamlParser";
- value version = "$Id: Camlp4OCamlParser.ml,v 1.3.2.11 2007/05/10 22:43:18 pouillar Exp $";
+ value version = "$Id: Camlp4OCamlParser.ml,v 1.3.2.19 2007/12/18 08:53:26 ertai Exp $";
end;
module Make (Syntax : Sig.Camlp4Syntax) = struct
(Ast.loc_of_expr e2) in
<:expr< do { $e1$; $e2$ } >> ];
- value is_operator =
- let ht = Hashtbl.create 73 in
- let ct = Hashtbl.create 73 in
- do {
- List.iter (fun x -> Hashtbl.add ht x True)
- ["asr"; "land"; "lor"; "lsl"; "lsr"; "lxor"; "mod"; "or"];
- List.iter (fun x -> Hashtbl.add ct x True)
- ['!'; '&'; '*'; '+'; '-'; '/'; ':'; '<'; '='; '>'; '@'; '^'; '|'; '~';
- '?'; '%'; '.'; '$'];
- fun x ->
- try Hashtbl.find ht x with
- [ Not_found -> try Hashtbl.find ct x.[0] with [ Not_found -> False ] ]
- }
- ;
-
value test_constr_decl =
Gram.Entry.of_parser "test_constr_decl"
(fun strm ->
test 1)
;
- value test_just_a_lident_or_patt =
- Gram.Entry.of_parser "test_just_a_lident_or_patt"
- (fun strm ->
- match Stream.npeek 3 strm with
- [ [(KEYWORD "(", _); (KEYWORD s | SYMBOL s, _); (KEYWORD ")", _)] when is_operator s -> ()
- | [((LIDENT _ | ANTIQUOT "lid" _), _); (KEYWORD ("as"|"|"|"::"|","|"."), _); _] ->
- raise Stream.Failure
- | [((LIDENT _ | ANTIQUOT "lid" _), _); _; _] -> ()
- | _ -> raise Stream.Failure ])
- ;
-
value lident_colon =
Gram.Entry.of_parser "lident_colon"
(fun strm ->
DELETE_RULE Gram value_val: "value" END;
DELETE_RULE Gram str_item: value_let; opt_rec; binding END;
DELETE_RULE Gram module_type: "'"; a_ident END;
- DELETE_RULE Gram module_type: SELF; SELF END;
+ DELETE_RULE Gram module_type: SELF; SELF; dummy END;
DELETE_RULE Gram module_type: SELF; "."; SELF END;
DELETE_RULE Gram label_expr: label_longident; fun_binding END;
DELETE_RULE Gram expr: "let"; opt_rec; binding; "in"; SELF END;
clear labeled_ipatt;
clear semi;
clear do_sequence;
- clear let_binding;
clear type_kind;
clear constructor_arg_list;
clear poly_type;
clear star_ctyp;
clear match_case;
clear with_constr;
+ clear top_phrase;
EXTEND Gram
GLOBAL:
[ `ANTIQUOT (""|"pat"|"anti" as n) s ->
<:patt< $anti:mk_anti ~c:"patt" n s$ >>
| `ANTIQUOT ("tup" as n) s -> <:patt< ($tup:<:patt< $anti:mk_anti ~c:"patt" n s$ >>$) >>
+ | `ANTIQUOT ("`bool" as n) s -> <:patt< $anti:mk_anti n s$ >>
| `QUOTATION x -> Quotation.expand _loc x Quotation.DynAst.patt_tag
| i = ident -> <:patt< $id:i$ >>
| s = a_INT -> <:patt< $int:s$ >>
[ [ e1 = SELF; ","; e2 = SELF -> <:expr< $e1$, $e2$ >>
| e = expr LEVEL ":=" -> e ] ]
; *)
- let_binding:
- [ [ test_just_a_lident_or_patt; s = a_LIDENT; e = fun_binding ->
- <:binding< $lid:s$ = $e$ >>
- | p = patt; "="; e = expr ->
- <:binding< $p$ = $e$ >> ] ]
- ;
(* comma_patt:
[ [ p1 = SELF; ","; p2 = SELF -> <:patt< $p1$, $p2$ >>
| p = patt LEVEL ".." -> p ] ]
<:ctyp< ( ~ $i$ : $t1$ ) -> $t2$ >>
| i = a_OPTLABEL; t1 = ctyp LEVEL "star"; "->"; t2 = SELF ->
<:ctyp< ( ? $i$ : $t1$ ) -> $t2$ >>
- | "?"; i=lident_colon;t1 = ctyp LEVEL "star"; "->"; t2 = SELF ->
+ | "?"; i = a_LIDENT; ":"; t1 = ctyp LEVEL "star"; "->"; t2 = SELF ->
<:ctyp< ( ? $i$ : $t1$ ) -> $t2$ >> ]
| "star"
[ t = SELF; "*"; tl = star_ctyp ->
| "{"; t = label_declaration; "}" ->
<:ctyp< { $t$ } >> ] ]
;
+ module_expr: LEVEL "apply"
+ [ [ i = SELF; "("; j = SELF; ")" -> <:module_expr< $i$ $j$ >> ] ]
+ ;
+ ident_quot: LEVEL "apply"
+ [ [ i = SELF; "("; j = SELF; ")" -> <:ident< $i$ $j$ >> ] ]
+ ;
module_longident_with_app: LEVEL "apply"
[ [ i = SELF; "("; j = SELF; ")" -> <:ident< $i$ $j$ >> ] ]
;
| `UIDENT s -> s
] ]
;
+ top_phrase:
+ [ [ "#"; n = a_LIDENT; dp = opt_expr; ";;" ->
+ Some <:str_item< # $n$ $dp$ >>
+ | l = LIST1 str_item; ";;" -> Some (Ast.stSem_of_list l)
+ | `EOI -> None
+ ] ]
+ ;
END;
(* Some other DELETE_RULE are before the grammar *)
+ DELETE_RULE Gram module_longident_with_app: "("; SELF; ")" END;
+ DELETE_RULE Gram type_longident: "("; SELF; ")" END;
+ DELETE_RULE Gram ident_quot: "("; SELF; ")" END;
DELETE_RULE Gram module_longident_with_app: SELF; SELF END;
DELETE_RULE Gram type_longident: SELF; SELF END;
+ DELETE_RULE Gram ident_quot: SELF; SELF END;
+ DELETE_RULE Gram module_expr: SELF; SELF END;
end;
let module M = Register.OCamlSyntaxExtension Id Make in ();
*)
module Id = struct
- value name = "Camlp4RevisedParserParser";
- value version = "$Id: Camlp4OCamlRevisedParser.ml,v 1.2.2.19 2007/05/12 22:48:16 pouillar Exp $";
+ value name = "Camlp4OCamlRevisedParser";
+ value version = "$Id: Camlp4OCamlRevisedParser.ml,v 1.2.2.31 2007/12/18 09:02:19 ertai Exp $";
end;
module Make (Syntax : Sig.Camlp4Syntax) = struct
<:expr< $lid:x$ >>)
;
+ value rec infix_kwds_filter =
+ parser
+ [ [: `((KEYWORD "(", _) as tok); xs :] ->
+ match xs with parser
+ [ [: `(KEYWORD ("mod"|"land"|"lor"|"lxor"|"lsl"|"lsr"|"asr" as i), _loc);
+ `(KEYWORD ")", _); xs :] ->
+ [: `(LIDENT i, _loc); infix_kwds_filter xs :]
+ | [: xs :] ->
+ [: `tok; infix_kwds_filter xs :] ]
+ | [: `x; xs :] -> [: `x; infix_kwds_filter xs :] ];
+
+ Token.Filter.define_filter (Gram.get_filter ())
+ (fun f strm -> infix_kwds_filter (f strm));
(* transmit the context *)
Gram.Entry.setup_parser sem_expr begin
use_file val_longident value_let value_val with_constr with_constr_quot
infixop0 infixop1 infixop2 infixop3 infixop4 do_sequence;
module_expr:
- [ [ "functor"; "("; i = a_UIDENT; ":"; t = module_type; ")"; "->";
+ [ "top"
+ [ "functor"; "("; i = a_UIDENT; ":"; t = module_type; ")"; "->";
me = SELF ->
<:module_expr< functor ( $i$ : $t$ ) -> $me$ >>
| "struct"; st = str_items; "end" ->
<:module_expr< struct $st$ end >> ]
- | [ me1 = SELF; me2 = SELF -> <:module_expr< $me1$ $me2$ >> ]
+ | "apply"
+ [ me1 = SELF; me2 = SELF -> <:module_expr< $me1$ $me2$ >> ]
| "simple"
[ `ANTIQUOT (""|"mexp"|"anti"|"list" as n) s ->
<:module_expr< $anti:mk_anti ~c:"module_expr" n s$ >>
<:module_binding< $m$ : $mt$ = $me$ >> ] ]
;
module_type:
- [ [ "functor"; "("; i = a_UIDENT; ":"; t = SELF; ")"; "->"; mt = SELF ->
+ [ "top"
+ [ "functor"; "("; i = a_UIDENT; ":"; t = SELF; ")"; "->"; mt = SELF ->
<:module_type< functor ( $i$ : $t$ ) -> $mt$ >> ]
- | [ mt = SELF; "with"; wc = with_constr ->
+ | "with"
+ [ mt = SELF; "with"; wc = with_constr ->
<:module_type< $mt$ with $wc$ >> ]
- | [ mt1 = SELF; mt2 = SELF -> module_type_app mt1 mt2 ]
- | [ mt1 = SELF; "."; mt2 = SELF -> module_type_acc mt1 mt2 ]
- | [ "sig"; sg = sig_items; "end" ->
+ | "apply"
+ [ mt1 = SELF; mt2 = SELF; dummy -> module_type_app mt1 mt2 ]
+ | "."
+ [ mt1 = SELF; "."; mt2 = SELF -> module_type_acc mt1 mt2 ]
+ | "sig"
+ [ "sig"; sg = sig_items; "end" ->
<:module_type< sig $sg$ end >> ]
| "simple"
[ `ANTIQUOT (""|"mtyp"|"anti"|"list" as n) s ->
<:expr< let module $m$ = $mb$ in $e$ >>
| "fun"; "["; a = LIST0 match_case0 SEP "|"; "]" ->
<:expr< fun [ $list:a$ ] >>
- | "fun"; p = labeled_ipatt; e = fun_def ->
- <:expr< fun $p$ -> $e$ >>
+ | "fun"; e = fun_def -> e
| "match"; e = sequence; "with"; a = match_case ->
<:expr< match $mksequence' _loc e$ with [ $a$ ] >>
| "try"; e = sequence; "with"; a = match_case ->
| `ANTIQUOT ("exp"|""|"anti" as n) s ->
<:expr< $anti:mk_anti ~c:"expr" n s$ >>
| `ANTIQUOT ("`bool" as n) s ->
- <:expr< $anti:mk_anti n s$ >>
+ <:expr< $id:<:ident< $anti:mk_anti n s$ >>$ >>
| `ANTIQUOT ("tup" as n) s ->
<:expr< $tup: <:expr< $anti:mk_anti ~c:"expr" n s$ >>$ >>
| `ANTIQUOT ("seq" as n) s ->
dummy:
[ [ -> () ] ]
;
+ sequence':
+ [ [ -> fun e -> e
+ | ";" -> fun e -> e
+ | ";"; el = sequence -> fun e -> <:expr< $e$; $el$ >> ] ]
+ ;
sequence:
- [ [ "let"; rf = opt_rec; bi = binding; [ "in" | ";" ]; el = SELF ->
+ [ [ "let"; rf = opt_rec; bi = binding; "in"; e = expr; k = sequence' ->
+ k <:expr< let $rec:rf$ $bi$ in $e$ >>
+ | "let"; rf = opt_rec; bi = binding; ";"; el = SELF ->
<:expr< let $rec:rf$ $bi$ in $mksequence _loc el$ >>
+ | "let"; "module"; m = a_UIDENT; mb = module_binding0; "in"; e = expr; k = sequence' ->
+ k <:expr< let module $m$ = $mb$ in $e$ >>
+ | "let"; "module"; m = a_UIDENT; mb = module_binding0; ";"; el = SELF ->
+ <:expr< let module $m$ = $mb$ in $mksequence _loc el$ >>
| `ANTIQUOT ("list" as n) s -> <:expr< $anti:mk_anti ~c:"expr;" n s$ >>
- | e = expr; ";"; el = SELF -> <:expr< $e$; $el$ >>
- | e = expr; ";" -> e
- | e = expr -> e ] ]
+ | e = expr; k = sequence' -> k e ] ]
;
binding:
[ LEFTA
| i = label_longident; e = fun_binding -> <:rec_binding< $i$ = $e$ >> ] ]
;
fun_def:
+ [ [ p = labeled_ipatt; (w, e) = fun_def_cont ->
+ <:expr< fun [ $p$ when $w$ -> $e$ ] >> ] ]
+ ;
+ fun_def_cont:
[ RIGHTA
- [ p = labeled_ipatt; e = SELF -> <:expr< fun $p$ -> $e$ >>
- | "->"; e = expr -> e ] ]
+ [ p = labeled_ipatt; (w,e) = SELF -> (<:expr<>>, <:expr< fun [ $p$ when $w$ -> $e$ ] >>)
+ | "when"; w = expr; "->"; e = expr -> (w, e)
+ | "->"; e = expr -> (<:expr<>>, e) ] ]
;
patt:
- [ LEFTA
+ [ "|" LEFTA
[ p1 = SELF; "|"; p2 = SELF -> <:patt< $p1$ | $p2$ >> ]
- | NONA
+ | ".." NONA
[ p1 = SELF; ".."; p2 = SELF -> <:patt< $p1$ .. $p2$ >> ]
- | LEFTA
+ | "apply" LEFTA
[ p1 = SELF; p2 = SELF -> <:patt< $p1$ $p2$ >> ]
| "simple"
[ `ANTIQUOT (""|"pat"|"anti" as n) s ->
<:patt< $anti:mk_anti ~c:"patt" n s$ >>
| `ANTIQUOT ("tup" as n) s -> <:patt< ($tup:<:patt< $anti:mk_anti ~c:"patt" n s$ >>$) >>
+ | `ANTIQUOT ("`bool" as n) s -> <:patt< $id:<:ident< $anti:mk_anti n s$ >>$ >>
| i = ident -> <:patt< $id:i$ >>
| s = a_INT -> <:patt< $int:s$ >>
| s = a_INT32 -> <:patt< $int32:s$ >>
| "-"; "'"; i = a_ident -> <:ctyp< -'$lid:i$ >> ] ]
;
ctyp:
- [ LEFTA
+ [ "==" LEFTA
[ t1 = SELF; "=="; t2 = SELF -> <:ctyp< $t1$ == $t2$ >> ]
- | NONA
+ | "private" NONA
[ "private"; t = ctyp LEVEL "alias" -> <:ctyp< private $t$ >> ]
| "alias" LEFTA
[ t1 = SELF; "as"; t2 = SELF -> <:ctyp< $t1$ as $t2$ >> ]
- | LEFTA
+ | "forall" LEFTA
[ "!"; t1 = typevars; "."; t2 = ctyp -> <:ctyp< ! $t1$ . $t2$ >> ]
| "arrow" RIGHTA
[ t1 = SELF; "->"; t2 = SELF -> <:ctyp< $t1$ -> $t2$ >> ]
| i = a_LABEL; t = SELF -> <:ctyp< ~ $i$ : $t$ >>
| "?"; i = a_LIDENT; ":"; t = SELF -> <:ctyp< ? $i$ : $t$ >>
| i = a_OPTLABEL; t = SELF -> <:ctyp< ? $i$ : $t$ >> ]
- | LEFTA
+ | "apply" LEFTA
[ t1 = SELF; t2 = SELF ->
let t = <:ctyp< $t1$ $t2$ >> in
try <:ctyp< $id:Ast.ident_of_ctyp t$ >>
with [ Invalid_argument _ -> t ] ]
- | LEFTA
+ | "." LEFTA
[ t1 = SELF; "."; t2 = SELF ->
try <:ctyp< $id:Ast.ident_of_ctyp t1$.$id:Ast.ident_of_ctyp t2$ >>
with [ Invalid_argument s -> raise (Stream.Error s) ] ]
<:class_str_item< inherit $ce$ as $pb$ >>
| value_val; mf = opt_mutable; lab = label; e = cvalue_binding ->
<:class_str_item< value $mutable:mf$ $lab$ = $e$ >>
+ | value_val; mf = opt_mutable; "virtual"; l = label; ":"; t = poly_type ->
+ <:class_str_item< value virtual $mutable:mf$ $l$ : $t$ >>
| value_val; "virtual"; mf = opt_mutable; l = label; ":"; t = poly_type ->
<:class_str_item< value virtual $mutable:mf$ $l$ : $t$ >>
| "method"; "virtual"; pf = opt_private; l = label; ":"; t = poly_type ->
| "method"; pf = opt_private; l = label; topt = opt_polyt;
e = fun_binding ->
<:class_str_item< method $private:pf$ $l$ : $topt$ = $e$ >>
- | "type"; t1 = ctyp; "="; t2 = ctyp ->
+ | type_constraint; t1 = ctyp; "="; t2 = ctyp ->
<:class_str_item< type $t1$ = $t2$ >>
| "initializer"; se = expr -> <:class_str_item< initializer $se$ >> ] ]
;
<:rec_binding< $anti:mk_anti ~c:"rec_binding" n s$ >>
| `ANTIQUOT ("list" as n) s ->
<:rec_binding< $anti:mk_anti ~c:"rec_binding" n s$ >>
- | l = label; "="; e = expr -> <:rec_binding< $lid:l$ = $e$ >> ] ]
+ | l = label; "="; e = expr LEVEL "top" -> <:rec_binding< $lid:l$ = $e$ >> ] ]
;
meth_list:
[ LEFTA
;
more_ctyp:
[ [ "mutable"; x = SELF -> <:ctyp< mutable $x$ >>
- | "`"; x = a_LIDENT -> <:ctyp< `$x$ >>
+ | "`"; x = a_ident -> <:ctyp< `$x$ >>
| x = type_kind -> x
| x = type_parameter -> x
] ]
] ]
;
ident_quot:
- [ [ i = SELF; j = SELF -> <:ident< $i$ $j$ >> ]
- | [ i = SELF; "."; j = SELF -> <:ident< $i$.$j$ >> ]
- | [ `ANTIQUOT (""|"id"|"anti"|"list" as n) s ->
+ [ "apply"
+ [ i = SELF; j = SELF -> <:ident< $i$ $j$ >> ]
+ | "."
+ [ i = SELF; "."; j = SELF -> <:ident< $i$.$j$ >> ]
+ | "simple"
+ [ `ANTIQUOT (""|"id"|"anti"|"list" as n) s ->
<:ident< $anti:mk_anti ~c:"ident" n s$ >>
| i = a_UIDENT -> <:ident< $uid:i$ >>
| i = a_LIDENT -> <:ident< $lid:i$ >>
module Id : Sig.Id = struct
value name = "Camlp4OCamlRevisedParserParser";
- value version = "$Id: Camlp4OCamlRevisedParserParser.ml,v 1.1.4.2 2007/04/05 18:06:36 pouillar Exp $";
+ value version = "$Id: Camlp4OCamlRevisedParserParser.ml,v 1.1.4.3 2007/05/16 12:48:13 pouillar Exp $";
end;
module Make (Syntax : Sig.Camlp4Syntax) = struct
| se = stream_expr_comp -> [se] ] ]
;
stream_expr_comp:
- [ [ stream_quot; e = stream_expr -> SeTrm _loc e | e = stream_expr -> SeNtr _loc e ] ]
+ [ [ stream_quot; e = stream_expr -> SeTrm _loc e
+ | e = stream_expr -> SeNtr _loc e ] ]
;
- (*
- Gram.Entry.clear stream_expr;
- Gram.Entry.clear stream_expr;
- stream_expr:
- [ [ e = expr LEVEL "stream_expr" -> e ] ]
- ;
- stream_begin:
- [ [ "[<" -> () ] ]
- ;
- stream_end:
- [ [ ">]" -> () ] ]
- ;
- stream_quot:
- [ [ "'" -> () ] ]
- ;
- *)
END;
end;
module Id = struct
value name = "Camlp4QuotationCommon";
- value version = "$Id: Camlp4QuotationCommon.ml,v 1.1.4.5 2007/05/10 14:24:22 pouillar Exp $";
+ value version = "$Id: Camlp4QuotationCommon.ml,v 1.1.4.7 2007/12/18 09:02:19 ertai Exp $";
end;
module Make (Syntax : Sig.Camlp4Syntax)
- (TheAntiquotSyntax : Sig.AntiquotSyntax
- with module Ast = Sig.Camlp4AstToAst Syntax.Ast)
+ (TheAntiquotSyntax : (Sig.Parser Syntax.Ast).SIMPLE)
= struct
open Sig;
include Syntax; (* Be careful an AntiquotSyntax module appears here *)
| "`flo" -> <:expr< string_of_float $e$ >>
| "`str" -> <:expr< Ast.safe_string_escaped $e$ >>
| "`chr" -> <:expr< Char.escaped $e$ >>
- | "`bool" ->
- <:expr< if $e$ then $ME.meta_expr _loc <:expr<True>>$
- else $ME.meta_expr _loc <:expr<False>>$ >>
+ | "`bool" -> <:expr< Ast.IdUid $mloc _loc$ (if $e$ then "True" else "False") >>
| "liststr_item" -> <:expr< Ast.stSem_of_list $e$ >>
| "listsig_item" -> <:expr< Ast.sgSem_of_list $e$ >>
| "listclass_sig_item" -> <:expr< Ast.cgSem_of_list $e$ >>
*)
-(* $Id: Rprint.ml,v 1.2.6.1 2007/05/10 13:31:21 pouillar Exp $ *)
+(* $Id: Rprint.ml,v 1.2.6.3 2007/05/22 10:54:59 pouillar Exp $ *)
+
+(* There is a few Obj.magic due to the fact that we no longer have compiler
+ files like Parsetree, Location, Longident but Camlp4_import that wrap them to
+ avoid name clashing. *)
+module Toploop : sig
+ open Format;
+ open Camlp4_import;
+ value print_out_value :
+ ref (formatter -> Outcometree.out_value -> unit);
+ value print_out_type :
+ ref (formatter -> Outcometree.out_type -> unit);
+ value print_out_class_type :
+ ref (formatter -> Outcometree.out_class_type -> unit);
+ value print_out_module_type :
+ ref (formatter -> Outcometree.out_module_type -> unit);
+ value print_out_sig_item :
+ ref (formatter -> Outcometree.out_sig_item -> unit);
+ value print_out_signature :
+ ref (formatter -> list Outcometree.out_sig_item -> unit);
+ value print_out_phrase :
+ ref (formatter -> Outcometree.out_phrase -> unit);
+end = struct
+ open Toploop;
+ value print_out_value = Obj.magic print_out_value;
+ value print_out_type = Obj.magic print_out_type;
+ value print_out_class_type = Obj.magic print_out_class_type;
+ value print_out_module_type = Obj.magic print_out_module_type;
+ value print_out_sig_item = Obj.magic print_out_sig_item;
+ value print_out_signature = Obj.magic print_out_signature;
+ value print_out_phrase = Obj.magic print_out_phrase;
+end;
(* This file originally come from typing/oprint.ml *)
open Format;
-open Outcometree;
+open Camlp4_import.Outcometree;
open Camlp4;
exception Ellipsis;
(print_list type_parameter (fun ppf -> fprintf ppf "@ ")) args ]
and print_kind ppf ty =
fprintf ppf "%s@ %a"
- (if priv = Asttypes.Private then " private" else "")
+ (if priv = Obj.magic Camlp4_import.Asttypes.Private then " private" else "")
Toploop.print_out_type.val ty
in
let print_types ppf = fun
* - Nicolas Pouillard: refactoring
*)
-(* $Id: Top.ml,v 1.1.4.2 2007/04/10 13:54:03 pouillar Exp $ *)
+(* $Id: Top.ml,v 1.1.4.3 2007/05/22 09:09:45 pouillar Exp $ *)
-open Parsetree;
+(* There is a few Obj.magic due to the fact that we no longer have compiler
+ files like Parsetree, Location, Longident but Camlp4_import that wrap them to
+ avoid name clashing. *)
+module Toploop : sig
+ value print_location :
+ Format.formatter -> Camlp4_import.Location.t -> unit;
+ value print_warning :
+ Camlp4_import.Location.t -> Format.formatter -> Camlp4_import.Warnings.t -> unit;
+ value parse_toplevel_phrase :
+ ref (Lexing.lexbuf -> Camlp4_import.Parsetree.toplevel_phrase);
+ value parse_use_file :
+ ref (Lexing.lexbuf -> list Camlp4_import.Parsetree.toplevel_phrase);
+end = struct
+ value print_location fmt loc =
+ Toploop.print_location fmt (Obj.magic loc);
+ value parse_toplevel_phrase =
+ Obj.magic Toploop.parse_toplevel_phrase;
+ value parse_use_file =
+ Obj.magic Toploop.parse_use_file;
+ value print_warning loc fmt w =
+ Toploop.print_warning (Obj.magic loc) fmt (Obj.magic w);
+end;
+
+open Camlp4_import.Parsetree;
open Lexing;
open Camlp4;
open PreCast;
current_warning.val :=
fun loc txt ->
Toploop.print_warning (Loc.to_ocaml_location loc) Format.err_formatter
- (Warnings.Camlp4 txt);
+ (Camlp4_import.Warnings.Camlp4 txt);
Register.iter_and_take_callbacks (fun (_, f) -> f ());
-(* camlp4r *)
(****************************************************************************)
(* *)
(* Objective Caml *)
* - Nicolas Pouillard: refactoring
*)
-let ocaml_standard_library = Config.standard_library;;
+let ocaml_standard_library = Camlp4_import.Config.standard_library;;
let camlp4_standard_library =
try Sys.getenv "CAMLP4LIB"
let inter_phrases = ref None;;
let camlp4_ast_impl_magic_number = "Camlp42006M001";;
let camlp4_ast_intf_magic_number = "Camlp42006N001";;
-let ocaml_ast_intf_magic_number = Config.ast_intf_magic_number;;
-let ocaml_ast_impl_magic_number = Config.ast_impl_magic_number;;
+let ocaml_ast_intf_magic_number = Camlp4_import.Config.ast_intf_magic_number;;
+let ocaml_ast_impl_magic_number = Camlp4_import.Config.ast_impl_magic_number;;
let current_input_file = ref "";;
"./Camlp4Filters/RemoveTrashModule.cmo -printer OCamlr"^^
i^^" -no_comments ) >"^^o^^"; else : ; fi")
-let misc_modules =
- let mk = ocaml_fake_IModule ~includes:[parsing;utils]
- ~o:options_without_camlp4 in
- [
- ocaml_Module ~o:options_without_camlp4 "build/camlp4_config";
- mk "../utils/misc";
- mk "../utils/warnings";
- mk "../parsing/linenum";
- mk "../parsing/location";
- ]
-
-let camlp4_package_as_one_file =
- ocaml_Module ~includes:[build]
- ~ext_includes:[parsing; dynlink]
- ~o:options_without_camlp4
- "Camlp4"
-
let camlp4_package_as_one_dir =
ocaml_PackageDir "Camlp4" (lazy [
ocaml_IModule ~includes:[build] "Config";
ocaml_IModule "Register"
])
-let camlp4_package =
- if Sys.file_exists "Camlp4.ml" && not (is_file_empty "Camlp4.ml")
- then camlp4_package_as_one_file
- else camlp4_package_as_one_dir
-
let camlp4_parsers =
ocaml_PackageDir "Camlp4Parsers" (lazy [
ocaml_Module "OCamlr";
ocaml_Module ~ext_includes:[toplevel; parsing; utils] "Camlp4Top";
])
-let extensions = [ camlp4_parsers; camlp4_printers; camlp4_filters; camlp4_top ]
-
-
-let pa_r = ocaml_Module "Camlp4Parsers/OCamlr"
-let pa_o = ocaml_Module "Camlp4Parsers/OCaml"
-let pa_q = ocaml_Module "Camlp4Parsers/OCamlQuotation"
-let pa_qb = ocaml_Module "Camlp4Parsers/OCamlQuotationBase"
-let pa_rq = ocaml_Module "Camlp4Parsers/OCamlRevisedQuotation"
-let pa_oq = ocaml_Module "Camlp4Parsers/OCamlOriginalQuotation"
-let pa_rp = ocaml_Module "Camlp4Parsers/OCamlRevisedParser"
-let pa_op = ocaml_Module "Camlp4Parsers/OCamlParser"
-let pa_g = ocaml_Module "Camlp4Parsers/Grammar"
-let pa_macro = ocaml_Module "Camlp4Parsers/Macro"
-let pa_debug = ocaml_Module "Camlp4Parsers/Debug"
-let pr_dump = ocaml_Module "Camlp4Printers/DumpOCamlAst"
-let pr_r = ocaml_Module "Camlp4Printers/OCamlr"
-let pr_o = ocaml_Module "Camlp4Printers/OCaml"
-let pr_a = ocaml_Module "Camlp4Printers/Auto"
-let fi_exc = ocaml_Module "Camlp4Filters/ExceptionTracer"
-let fi_tracer = ocaml_Module "Camlp4Filters/Tracer"
-let fi_meta = ocaml_Module "Camlp4Filters/MetaGenerator"
-let camlp4_bin = ocaml_Module "Camlp4Bin"
-let top_rprint = ocaml_Module "Camlp4Top/Rprint"
-let top_camlp4_top = ocaml_Module "Camlp4Top/Camlp4Top"
-let camlp4Profiler = ocaml_IModule "Camlp4Profiler"
-
-let byte_programs = ref []
-let opt_programs = ref []
-let byte_libraries = ref []
-(* let opt_libraries = ref [] *)
-
-let special_modules =
- if Sys.file_exists "./boot/Profiler.cmo" then [camlp4Profiler] else []
-
-let mk_camlp4_top_lib name modules =
- byte_libraries += (name ^ ".cma");
- ocaml_Library ~default:`Byte ~libraries:["Camlp4"] ~flags:"-linkall" name
- (special_modules @ modules @ [top_camlp4_top])
-
-let mk_camlp4_bin name ?unix:(link_unix=true) modules =
- byte_programs += (name ^ ".run");
- opt_programs += (name ^ ".opt");
- let libraries = ["Camlp4"] in
- let libraries = if link_unix then "unix" :: libraries else libraries in
- ocaml_Program ~default:`Byte ~includes:[unix] ~libraries ~flags:"-linkall" name
- (special_modules @ modules @ [camlp4_bin])
-
-let mk_camlp4_tool name modules =
- byte_programs += (name ^ ".run");
- opt_programs += (name ^ ".opt");
- [ocaml_Program ~default:`Byte ~libraries:["Camlp4"] ~flags:"-linkall" name modules]
-
-let mk_camlp4 name ?unix modules bin_mods top_mods =
- [mk_camlp4_bin name ?unix (modules @ bin_mods);
- mk_camlp4_top_lib name (modules @ top_mods)]
-
let split c s =
let rec self acc s =
try
let st = YaM.call cmd in
if st <> 0 then failwith ("Exit: " ^ string_of_int st)
-let mkdir l = run ("mkdir" :: "-p" :: l)
-
-let cp src dest = run ["cp"; src; dest]
-
let sed re str file =
run ["sed"; "-i"; "-e"; "'s/"^re^"/"^str^"/'"; file]
-let try_cp src dest = if Sys.file_exists src then cp src dest
-
let pack () =
let revised_to_ocaml f =
run ["./boot/camlp4boot -printer OCaml -o "^f^".ml -impl "^f^".ml4"] in
let doc () =
pack (); just_doc ()
-let other_objs =
- [
- (* "../utils/misc"; "../parsing/linenum"; "../utils/warnings"; *)
- (* "../parsing/location" *)
- ]
-let other_byte_objs = String.concat " " (List.map (fun x -> x ^ ".cmo") other_objs)
-let other_opt_objs = String.concat " " (List.map (fun x -> x ^ ".cmx") other_objs)
-let all =
- List.flatten [
- [ocaml_Library ~default:`Byte
- ~includes:[dynlink]
- ~byte_flags:("dynlink.cma"^^other_byte_objs) ~opt_flags:other_opt_objs
- ~flags:"-linkall" "Camlp4"
- (misc_modules @ special_modules @ [camlp4_package])];
- [mk_camlp4_bin "camlp4" []];
- mk_camlp4 "camlp4boot" ~unix:false
- [pa_r; pa_qb; pa_q; pa_rp; pa_g; pa_macro; pa_debug] [pr_dump] [top_rprint];
- mk_camlp4 "camlp4r"
- [pa_r; pa_rp] [pr_a] [top_rprint];
- mk_camlp4 "camlp4rf"
- [pa_r; pa_qb; pa_q; pa_rp; pa_g; pa_macro] [pr_a] [top_rprint];
- mk_camlp4 "camlp4o"
- [pa_r; pa_o; pa_rp; pa_op] [pr_a] [];
- mk_camlp4 "camlp4of"
- [pa_r; pa_qb; pa_q; pa_o; pa_rp; pa_op; pa_g; pa_macro] [pr_a] [];
- mk_camlp4 "camlp4oof"
- [pa_r; pa_o; pa_rp; pa_op; pa_qb; pa_oq; pa_g; pa_macro] [pr_a] [];
- mk_camlp4 "camlp4orf"
- [pa_r; pa_o; pa_rp; pa_op; pa_qb; pa_rq; pa_g; pa_macro] [pr_a] [];
- mk_camlp4_tool "mkcamlp4"
- [ocaml_Module ~o:(options_without_debug ()) "mkcamlp4"];
- mk_camlp4_tool "camlp4prof"
- [camlp4Profiler; ocaml_Module ~o:(options_without_debug ()) "camlp4prof"];
- ] @ extensions
-
-
-(* X.run -> X.exe || X.run -> X *)
-let conv_byte_extension f =
- if windows then
- let c = String.copy f in
- (String.blit c (String.rindex c '.') ".exe" 0 4; c)
- else String.sub f 0 (String.rindex f '.')
-
-(* X.opt -> X.opt.exe || X.opt -> X.opt *)
-let conv_opt_extension f =
- if windows then f ^ ".exe" else f
-
-let install_all dir =
- printf "Installing %s@. " dir;
- run ["for i in " ^ dir ^ "/*.cm[io]; do"^^
- "echo \" install $i\" ; mkdir -p"^^libdir_camlp4^
- "/`dirname $i`; cp $i"^^libdir_camlp4^"/`dirname $i`; done"]
-
-
-let byte =
- "Camlp4.cmi" ::
- "Camlp4.cma" ::
- "Camlp4Parsers.cmi" ::
- "Camlp4Printers.cmi" ::
- "Camlp4Filters.cmi" ::
- "Camlp4Top.cmi" ::
- "Camlp4Bin.cmi" ::
- "Camlp4Parsers.cmo" ::
- "Camlp4Printers.cmo" ::
- "Camlp4Filters.cmo" ::
- "Camlp4Top.cmo" ::
- "Camlp4Bin.cmo" ::
- !byte_libraries
-
-let opt =
- "Camlp4.cmxa" ::
- "Camlp4.a" ::
- "build/camlp4_config.cmx" ::
- "Camlp4Parsers.cmx" ::
- "Camlp4Printers.cmx" ::
- "Camlp4Filters.cmx" ::
- "Camlp4Bin.cmx" ::
- (* !opt_libraries @ *)
- []
-
-let install () =
- mkdir [libdir_camlp4; bindir];
- install_all "Camlp4Parsers";
- install_all "Camlp4Printers";
- install_all "Camlp4Filters";
- install_all "Camlp4Top";
- let cp_bin conv bin =
- if Sys.file_exists bin then cp bin (bindir ^ "/" ^ conv bin) in
- List.iter (fun x -> cp x libdir_camlp4) byte;
- List.iter (fun x -> try_cp x libdir_camlp4) opt;
- List.iter (cp_bin conv_byte_extension) !byte_programs;
- List.iter (cp_bin conv_opt_extension) !opt_programs;
- ()
- (* cp mkcamlp4.sh "$(BINDIR)/mkcamlp4" *)
- (* chmod a+x "$(BINDIR)/mkcamlp4" *)
-
-
-let byte = byte @ !byte_programs
-let opt = opt @ !opt_programs
-
-;;
-
-main ~rebuild:(ocaml ^^ "build/build.ml")
- (all @ [
- phony_unit ~depends:byte "all";
- phony_unit ~depends:opt "opt";
- generic_unit ~name:"install" ~targets:["install"] ~trash:[]
- ~dependencies:(fun ~native:_ _ -> [])
- ~compile_cmd:(fun _ -> install (); exit 0)
- ();
- generic_unit ~name:"doc" ~targets:["doc"] ~trash:[]
- ~dependencies:(fun ~native:_ _ -> [])
- ~compile_cmd:(fun _ -> doc (); exit 0)
- ();
- generic_unit ~name:"just_doc" ~targets:["just_doc"] ~trash:[]
- ~dependencies:(fun ~native:_ _ -> [])
- ~compile_cmd:(fun _ -> just_doc (); exit 0)
- ();
- generic_unit ~name:"pack" ~targets:["pack"] ~trash:[]
- ~dependencies:(fun ~native:_ _ -> [])
- ~compile_cmd:(fun _ -> pack (); exit 0)
- ();
- ])
-
*)
(* camlp4r *)
type section = string
+
val mode : section -> bool
+
val printf : section -> ('a, Format.formatter, unit) format -> 'a
+
end =
struct
(****************************************************************************)
*)
(* camlp4r *)
open Format
- module Debug = struct let mode _ = false end
+
+ module Debug = struct let mode _ = false
+ end
+
type section = string
+
let out_channel =
try
let f = Sys.getenv "CAMLP4_DEBUG_FILE"
open_out_gen [ Open_wronly; Open_creat; Open_append; Open_text ]
0o666 f
with | Not_found -> stderr
+
module StringSet = Set.Make(String)
+
let mode =
try
let str = Sys.getenv "CAMLP4_DEBUG" in
then (fun _ -> true)
else (fun x -> StringSet.mem x sections)
with | Not_found -> (fun _ -> false)
+
let formatter =
let header = "camlp4-debug: " in
let normal s =
(fun buf pos len ->
let p = pred len in output (String.sub buf pos p) buf.[pos + p])
(fun () -> flush out_channel)
+
let printf section fmt = fprintf formatter ("%s: " ^^ fmt) section
+
end
+
module Options :
sig
(****************************************************************************)
* - Nicolas Pouillard: refactoring
*)
type spec_list = (string * Arg.spec * string) list
+
val init : spec_list -> unit
+
val add : string -> Arg.spec -> string -> unit
+
(** Add an option to the command line options. *)
val print_usage_list : spec_list -> unit
+
val ext_spec_list : unit -> spec_list
+
val parse : (string -> unit) -> string array -> string list
+
end =
struct
(****************************************************************************)
* - Nicolas Pouillard: refactoring
*)
type spec_list = (string * Arg.spec * string) list
+
open Format
+
let rec action_arg s sl =
function
| Arg.Unit f -> if s = "" then (f (); Some sl) else None
(match if s = "" then sl else s :: sl with
| s :: sl when List.mem s syms -> (f s; Some sl)
| _ -> None)
+
let common_start s1 s2 =
let rec loop i =
if (i == (String.length s1)) || (i == (String.length s2))
then i
else if s1.[i] == s2.[i] then loop (i + 1) else i
in loop 0
+
let parse_arg fold s sl =
fold
(fun (name, action, _) acu ->
with | Arg.Bad _ -> acu)
else acu)
None
+
let rec parse_aux fold anon_fun =
function
| [] -> []
| Some sl -> parse_aux fold anon_fun sl
| None -> s :: (parse_aux fold anon_fun sl))
else ((anon_fun s : unit); parse_aux fold anon_fun sl)
+
let align_doc key s =
let s =
let rec loop i =
String.make (max 1 ((16 - (String.length key)) - (String.length p)))
' '
in p ^ (tab ^ s)
+
let make_symlist l =
match l with
| [] -> "<none>"
| h :: t ->
(List.fold_left (fun x y -> x ^ ("|" ^ y)) ("{" ^ h) t) ^ "}"
+
let print_usage_list l =
List.iter
(fun (key, spec, doc) ->
in eprintf " %s %s\n" synt (align_doc synt doc)
| _ -> eprintf " %s %s\n" key (align_doc key doc))
l
+
let remaining_args argv =
let rec loop l i =
if i == (Array.length argv) then l else loop (argv.(i) :: l) (i + 1)
in List.rev (loop [] (!Arg.current + 1))
+
let init_spec_list = ref []
+
let ext_spec_list = ref []
+
let init spec_list = init_spec_list := spec_list
+
let add name spec descr =
ext_spec_list := (name, spec, descr) :: !ext_spec_list
+
let fold f init =
let spec_list = !init_spec_list @ !ext_spec_list in
let specs = Sort.list (fun (k1, _, _) (k2, _, _) -> k1 >= k2) spec_list
in List.fold_right f specs init
+
let parse anon_fun argv =
let remaining_args = remaining_args argv
in parse_aux fold anon_fun remaining_args
+
let ext_spec_list () = !ext_spec_list
+
end
+
module Sig =
struct
(* camlp4r *)
* - Daniel de Rauglaudre: initial version
* - Nicolas Pouillard: refactoring
*)
- module type Type = sig type t end
+ (** Camlp4 signature repository *)
+ (** {6 Basic signatures} *)
+ (** Signature with just a type. *)
+ module type Type = sig type t
+ end
+
(** Signature for errors modules, an Error modules can be registred with
the {!ErrorHandler.Register} functor in order to be well printed. *)
module type Error =
sig
type t
+
exception E of t
+
val to_string : t -> string
+
val print : Format.formatter -> t -> unit
+
end
+
(** A signature for extensions identifiers. *)
module type Id =
sig
(** The name of the extension, typically the module name. *)
val name : string
- (** The version of the extension, typically $Id: Sig.ml,v 1.2.2.9 2007/05/10 13:31:20 pouillar Exp $ with a versionning system. *)
+
+ (** The version of the extension, typically $Id$ with a versionning system. *)
val version : string
+
+ end
+
+ (** A signature for warnings abstract from locations. *)
+ module Warning (Loc : Type) =
+ struct
+ module type S =
+ sig
+ type warning = Loc.t -> string -> unit
+
+ val default_warning : warning
+
+ val current_warning : warning ref
+
+ val print_warning : warning
+
+ end
+
end
+
+ (** {6 Advanced signatures} *)
+ (** A signature for locations. *)
module type Loc =
sig
type t
+
(** Return a start location for the given file name.
This location starts at the begining of the file. *)
val mk : string -> t
+
(** The [ghost] location can be used when no location
information is available. *)
val ghost : t
+
(** {6 Conversion functions} *)
(** Return a location where both positions are set the given position. *)
val of_lexing_position : Lexing.position -> t
+
(** Return an OCaml location. *)
- val to_ocaml_location : t -> Location.t
+ val to_ocaml_location : t -> Camlp4_import.Location.t
+
(** Return a location from an OCaml location. *)
- val of_ocaml_location : Location.t -> t
+ val of_ocaml_location : Camlp4_import.Location.t -> t
+
(** Return a location from ocamllex buffer. *)
val of_lexbuf : Lexing.lexbuf -> t
+
(** Return a location from [(file_name, start_line, start_bol, start_off,
stop_line, stop_bol, stop_off, ghost)]. *)
val of_tuple :
(string * int * int * int * int * int * int * bool) -> t
+
(** Return [(file_name, start_line, start_bol, start_off,
stop_line, stop_bol, stop_off, ghost)]. *)
val to_tuple :
t -> (string * int * int * int * int * int * int * bool)
+
(** [merge loc1 loc2] Return a location that starts at [loc1] and end at [loc2]. *)
val merge : t -> t -> t
+
(** The stop pos becomes equal to the start pos. *)
val join : t -> t
+
(** [move selector n loc]
Return the location where positions are moved.
Affected positions are chosen with [selector].
Returned positions have their character offset plus [n]. *)
- val move : [ `start | `stop | `both ] -> int -> t -> t
+ val move : [ | `start | `stop | `both ] -> int -> t -> t
+
(** [shift n loc] Return the location where the new start position is the old
stop position, and where the new stop position character offset is the
old one plus [n]. *)
val shift : int -> t -> t
+
(** [move_line n loc] Return the location with the old line count plus [n].
The "begin of line" of both positions become the current offset. *)
val move_line : int -> t -> t
- (** Accessors *)
+
+ (** {6 Accessors} *)
(** Return the file name *)
val file_name : t -> string
+
(** Return the line number of the begining of this location. *)
val start_line : t -> int
+
(** Return the line number of the ending of this location. *)
val stop_line : t -> int
+
(** Returns the number of characters from the begining of the file
to the begining of the line of location's begining. *)
val start_bol : t -> int
+
(** Returns the number of characters from the begining of the file
to the begining of the line of location's ending. *)
val stop_bol : t -> int
+
(** Returns the number of characters from the begining of the file
of the begining of this location. *)
val start_off : t -> int
+
(** Return the number of characters from the begining of the file
of the ending of this location. *)
val stop_off : t -> int
+
(** Return the start position as a Lexing.position. *)
val start_pos : t -> Lexing.position
+
(** Return the stop position as a Lexing.position. *)
val stop_pos : t -> Lexing.position
+
(** Generally, return true if this location does not come
from an input stream. *)
val is_ghost : t -> bool
+
(** Return the associated ghost location. *)
val ghostify : t -> t
+
(** Return the location with the give file name *)
val set_file_name : string -> t -> t
+
(** [strictly_before loc1 loc2] True if the stop position of [loc1] is
strictly_before the start position of [loc2]. *)
val strictly_before : t -> t -> bool
+
(** Return the location with an absolute file name. *)
val make_absolute : t -> t
+
(** Print the location into the formatter in a format suitable for error
reporting. *)
val print : Format.formatter -> t -> unit
+
(** Print the location in a short format useful for debugging. *)
val dump : Format.formatter -> t -> unit
+
(** Same as {!print} but return a string instead of printting it. *)
val to_string : t -> string
+
(** [Exc_located loc e] is an encapsulation of the exception [e] with
the input location [loc]. To be used in quotation expanders
and in grammars to specify some input location for an error.
Do not raise this exception directly: rather use the following
function [Loc.raise]. *)
exception Exc_located of t * exn
+
(** [raise loc e], if [e] is already an [Exc_located] exception,
re-raise it, else raise the exception [Exc_located loc e]. *)
val raise : t -> exn -> 'a
+
(** The name of the location variable used in grammars and in
the predefined quotations for OCaml syntax trees. Default: [_loc]. *)
val name : string ref
+
end
- module Warning (Loc : Loc) =
- struct
- module type S =
- sig
- type warning = Loc.t -> string -> unit
- val default_warning : warning
- val current_warning : warning ref
- val print_warning : warning
- end
- end
- (** Base class for map traversal, it includes some builtin types. *)
- class mapper =
- (object method string = fun x -> (x : string)
- method int = fun x -> (x : int)
- method float = fun x -> (x : float)
- method bool = fun x -> (x : bool)
- method list : 'a 'b. ('a -> 'b) -> 'a list -> 'b list = List.map
- method option : 'a 'b. ('a -> 'b) -> 'a option -> 'b option =
- fun f -> function | None -> None | Some x -> Some (f x)
- method array : 'a 'b. ('a -> 'b) -> 'a array -> 'b array = Array.map
- method ref : 'a 'b. ('a -> 'b) -> 'a ref -> 'b ref =
- fun f { contents = x } -> { contents = f x; }
- end :
- object
- method string : string -> string
- method int : int -> int
- method float : float -> float
- method bool : bool -> bool
- method list : 'a 'b. ('a -> 'b) -> 'a list -> 'b list
- method option : 'a 'b. ('a -> 'b) -> 'a option -> 'b option
- method array : 'a 'b. ('a -> 'b) -> 'a array -> 'b array
- method ref : 'a 'b. ('a -> 'b) -> 'a ref -> 'b ref
- end)
+
(** Abstract syntax tree minimal signature.
Types of this signature are abstract.
See the {!Camlp4Ast} signature for a concrete definition. *)
module type Ast =
sig
- module Loc : Loc
+ (** {6 Syntactic categories as abstract types} *)
+ type loc
+
type meta_bool
+
type 'a meta_option
+
type 'a meta_list
+
type ctyp
+
type patt
+
type expr
+
type module_type
+
type sig_item
+
type with_constr
+
type module_expr
+
type str_item
+
type class_type
+
type class_sig_item
+
type class_expr
+
type class_str_item
+
type match_case
+
type ident
+
type binding
+
type rec_binding
+
type module_binding
- val loc_of_ctyp : ctyp -> Loc.t
- val loc_of_patt : patt -> Loc.t
- val loc_of_expr : expr -> Loc.t
- val loc_of_module_type : module_type -> Loc.t
- val loc_of_module_expr : module_expr -> Loc.t
- val loc_of_sig_item : sig_item -> Loc.t
- val loc_of_str_item : str_item -> Loc.t
- val loc_of_class_type : class_type -> Loc.t
- val loc_of_class_sig_item : class_sig_item -> Loc.t
- val loc_of_class_expr : class_expr -> Loc.t
- val loc_of_class_str_item : class_str_item -> Loc.t
- val loc_of_with_constr : with_constr -> Loc.t
- val loc_of_binding : binding -> Loc.t
- val loc_of_rec_binding : rec_binding -> Loc.t
- val loc_of_module_binding : module_binding -> Loc.t
- val loc_of_match_case : match_case -> Loc.t
- val loc_of_ident : ident -> Loc.t
+
+ (** {6 Location accessors} *)
+ val loc_of_ctyp : ctyp -> loc
+
+ val loc_of_patt : patt -> loc
+
+ val loc_of_expr : expr -> loc
+
+ val loc_of_module_type : module_type -> loc
+
+ val loc_of_module_expr : module_expr -> loc
+
+ val loc_of_sig_item : sig_item -> loc
+
+ val loc_of_str_item : str_item -> loc
+
+ val loc_of_class_type : class_type -> loc
+
+ val loc_of_class_sig_item : class_sig_item -> loc
+
+ val loc_of_class_expr : class_expr -> loc
+
+ val loc_of_class_str_item : class_str_item -> loc
+
+ val loc_of_with_constr : with_constr -> loc
+
+ val loc_of_binding : binding -> loc
+
+ val loc_of_rec_binding : rec_binding -> loc
+
+ val loc_of_module_binding : module_binding -> loc
+
+ val loc_of_match_case : match_case -> loc
+
+ val loc_of_ident : ident -> loc
+
+ (** {6 Traversals} *)
(** This class is the base class for map traversal on the Ast.
To make a custom traversal class one just extend it like that:
assert (map <:expr< fun x -> (x, 42) >> = <:expr< fun x -> (42, x) >>);]
*)
class map :
- object
- inherit mapper
+ object ('self_type)
+ method string : string -> string
+
+ method list :
+ 'a 'b. ('self_type -> 'a -> 'b) -> 'a list -> 'b list
+
method meta_bool : meta_bool -> meta_bool
+
method meta_option :
- 'a 'b. ('a -> 'b) -> 'a meta_option -> 'b meta_option
+ 'a 'b.
+ ('self_type -> 'a -> 'b) -> 'a meta_option -> 'b meta_option
+
method meta_list :
- 'a 'b. ('a -> 'b) -> 'a meta_list -> 'b meta_list
- method _Loc_t : Loc.t -> Loc.t
+ 'a 'b. ('self_type -> 'a -> 'b) -> 'a meta_list -> 'b meta_list
+
+ method loc : loc -> loc
+
method expr : expr -> expr
+
method patt : patt -> patt
+
method ctyp : ctyp -> ctyp
+
method str_item : str_item -> str_item
+
method sig_item : sig_item -> sig_item
+
method module_expr : module_expr -> module_expr
+
method module_type : module_type -> module_type
+
method class_expr : class_expr -> class_expr
+
method class_type : class_type -> class_type
+
method class_sig_item : class_sig_item -> class_sig_item
+
method class_str_item : class_str_item -> class_str_item
+
method with_constr : with_constr -> with_constr
+
method binding : binding -> binding
+
method rec_binding : rec_binding -> rec_binding
+
method module_binding : module_binding -> module_binding
+
method match_case : match_case -> match_case
+
method ident : ident -> ident
+
+ method unknown : 'a. 'a -> 'a
+
end
+
+ (** Fold style traversal *)
class fold :
object ('self_type)
method string : string -> 'self_type
- method int : int -> 'self_type
- method float : float -> 'self_type
- method bool : bool -> 'self_type
+
method list :
'a. ('self_type -> 'a -> 'self_type) -> 'a list -> 'self_type
- method option :
- 'a. ('self_type -> 'a -> 'self_type) -> 'a option -> 'self_type
- method array :
- 'a. ('self_type -> 'a -> 'self_type) -> 'a array -> 'self_type
- method ref :
- 'a. ('self_type -> 'a -> 'self_type) -> 'a ref -> 'self_type
+
method meta_bool : meta_bool -> 'self_type
+
method meta_option :
'a.
('self_type -> 'a -> 'self_type) ->
'a meta_option -> 'self_type
+
method meta_list :
'a.
('self_type -> 'a -> 'self_type) ->
'a meta_list -> 'self_type
- method _Loc_t : Loc.t -> 'self_type
+
+ method loc : loc -> 'self_type
+
method expr : expr -> 'self_type
+
method patt : patt -> 'self_type
+
method ctyp : ctyp -> 'self_type
+
method str_item : str_item -> 'self_type
+
method sig_item : sig_item -> 'self_type
+
method module_expr : module_expr -> 'self_type
+
method module_type : module_type -> 'self_type
+
method class_expr : class_expr -> 'self_type
+
method class_type : class_type -> 'self_type
+
method class_sig_item : class_sig_item -> 'self_type
+
method class_str_item : class_str_item -> 'self_type
+
method with_constr : with_constr -> 'self_type
+
method binding : binding -> 'self_type
+
method rec_binding : rec_binding -> 'self_type
+
method module_binding : module_binding -> 'self_type
+
method match_case : match_case -> 'self_type
+
method ident : ident -> 'self_type
+
+ method unknown : 'a. 'a -> 'self_type
+
end
+
end
- (** The AntiquotSyntax signature describe the minimal interface needed
- for antiquotation handling. *)
- module type AntiquotSyntax =
- sig
- module Ast : Ast
- (** The parse function for expressions.
- The underlying expression grammar entry is generally "expr; EOI". *)
- val parse_expr : Ast.Loc.t -> string -> Ast.expr
- (** The parse function for patterns.
- The underlying pattern grammar entry is generally "patt; EOI". *)
- val parse_patt : Ast.Loc.t -> string -> Ast.patt
- end
- (** Signature for OCaml syntax trees.
+
+ (** Signature for OCaml syntax trees. *)
+ (*
This signature is an extension of {!Ast}
It provides:
- Types for all kinds of structure.
- Map: A base class for map traversals.
- Map classes and functions for common kinds.
- (* Core language *)
- ctyp (* Representaion of types *)
- patt (* The type of patterns *)
- expr (* The type of expressions *)
- match_case (* The type of cases for match/function/try constructions *)
- ident (* The type of identifiers (including path like Foo(X).Bar.y) *)
- binding (* The type of let bindings *)
- rec_binding (* The type of record definitions *)
+ == Core language ==
+ ctyp :: Representaion of types
+ patt :: The type of patterns
+ expr :: The type of expressions
+ match_case :: The type of cases for match/function/try constructions
+ ident :: The type of identifiers (including path like Foo(X).Bar.y)
+ binding :: The type of let bindings
+ rec_binding :: The type of record definitions
- (* Modules *)
- module_type (* The type of module types *)
- sig_item (* The type of signature items *)
- str_item (* The type of structure items *)
- module_expr (* The type of module expressions *)
- module_binding (* The type of recursive module definitions *)
- with_constr (* The type of `with' constraints *)
+ == Modules ==
+ module_type :: The type of module types
+ sig_item :: The type of signature items
+ str_item :: The type of structure items
+ module_expr :: The type of module expressions
+ module_binding :: The type of recursive module definitions
+ with_constr :: The type of `with' constraints
- (* Classes *)
- class_type (* The type of class types *)
- class_sig_item (* The type of class signature items *)
- class_expr (* The type of class expressions *)
- class_str_item (* The type of class structure items *)
+ == Classes ==
+ class_type :: The type of class types
+ class_sig_item :: The type of class signature items
+ class_expr :: The type of class expressions
+ class_str_item :: The type of class structure items
*)
module type Camlp4Ast =
sig
+ (** The inner module for locations *)
module Loc : Loc
- type meta_bool = | BTrue | BFalse | BAnt of string
- type 'a meta_option = | ONone | OSome of 'a | OAnt of string
- type 'a meta_list =
- | LNil | LCons of 'a * 'a meta_list | LAnt of string
- type ident =
- | (* i . i *) (* i i *) (* foo *) (* Bar *)
- IdAcc of Loc.t * ident * ident | IdApp of Loc.t * ident * ident
- | IdLid of Loc.t * string | IdUid of Loc.t * string
- | IdAnt of Loc.t * string
- (* $s$ *)
- type ctyp =
- | (* t as t *) (* list 'a as 'a *) (* _ *) (* t t *) (* list 'a *)
- (* t -> t *) (* int -> string *) (* #i *) (* #point *) (* ~s *)
- (* i *) (* Lazy.t *) (* t == t *) (* type t = [ A | B ] == Foo.t *)
+
+ type (* i . i *)
+ (* i i *)
+ (* foo *)
+ (* Bar *)
+ (* $s$ *)
+ (* t as t *)
+ (* list 'a as 'a *)
+ (* _ *)
+ (* t t *)
+ (* list 'a *)
+ (* t -> t *)
+ (* int -> string *)
+ (* #i *)
+ (* #point *)
+ (* ~s:t *)
+ (* i *)
+ (* Lazy.t *)
+ (* t == t *)
+ (* type t = [ A | B ] == Foo.t *)
(* type t 'a 'b 'c = t constraint t = t constraint t = t *)
- (* < (t)? (..)? > *) (* < move : int -> 'a .. > as 'a *) (* ?s *)
- (* ! t . t *) (* ! 'a . list 'a -> 'a *) (* 's *) (* +'s *)
- (* -'s *) (* `s *) (* { t } *)
- (* { foo : int ; bar : mutable string } *) (* t : t *) (* t; t *)
- (* t, t *) (* [ t ] *) (* [ A of int and string | B ] *)
- (* t of t *) (* A of int *) (* t and t *) (* t | t *)
- (* private t *) (* mutable t *) (* ( t ) *) (* (int * string) *)
- (* t * t *) (* [ = t ] *) (* [ > t ] *) (* [ < t ] *)
- (* [ < t > t ] *) (* t & t *) (* t of & t *) TyNil of Loc.t
- | TyAli of Loc.t * ctyp * ctyp | TyAny of Loc.t
- | TyApp of Loc.t * ctyp * ctyp | TyArr of Loc.t * ctyp * ctyp
- | TyCls of Loc.t * ident | TyLab of Loc.t * string * ctyp
- | TyId of Loc.t * ident | TyMan of Loc.t * ctyp * ctyp
- | TyDcl of Loc.t * string * ctyp list * ctyp * (ctyp * ctyp) list
- | TyObj of Loc.t * ctyp * meta_bool
- | TyOlb of Loc.t * string * ctyp | TyPol of Loc.t * ctyp * ctyp
- | TyQuo of Loc.t * string | TyQuP of Loc.t * string
- | TyQuM of Loc.t * string | TyVrn of Loc.t * string
- | TyRec of Loc.t * ctyp | TyCol of Loc.t * ctyp * ctyp
- | TySem of Loc.t * ctyp * ctyp | TyCom of Loc.t * ctyp * ctyp
- | TySum of Loc.t * ctyp | TyOf of Loc.t * ctyp * ctyp
- | TyAnd of Loc.t * ctyp * ctyp | TyOr of Loc.t * ctyp * ctyp
- | TyPrv of Loc.t * ctyp | TyMut of Loc.t * ctyp
- | TyTup of Loc.t * ctyp | TySta of Loc.t * ctyp * ctyp
- | TyVrnEq of Loc.t * ctyp | TyVrnSup of Loc.t * ctyp
- | TyVrnInf of Loc.t * ctyp | TyVrnInfSup of Loc.t * ctyp * ctyp
- | TyAmp of Loc.t * ctyp * ctyp | TyOfAmp of Loc.t * ctyp * ctyp
- | TyAnt of Loc.t * string
- (* $s$ *)
- type (* i *)
+ (* < (t)? (..)? > *)
+ (* < move : int -> 'a .. > as 'a *)
+ (* ?s:t *)
+ (* ! t . t *)
+ (* ! 'a . list 'a -> 'a *)
+ (* 's *)
+ (* +'s *)
+ (* -'s *)
+ (* `s *)
+ (* { t } *)
+ (* { foo : int ; bar : mutable string } *)
+ (* t : t *)
+ (* t; t *)
+ (* t, t *)
+ (* [ t ] *)
+ (* [ A of int and string | B ] *)
+ (* t of t *)
+ (* A of int *)
+ (* t and t *)
+ (* t | t *)
+ (* private t *)
+ (* mutable t *)
+ (* ( t ) *)
+ (* (int * string) *)
+ (* t * t *)
+ (* [ = t ] *)
+ (* [ > t ] *)
+ (* [ < t ] *)
+ (* [ < t > t ] *)
+ (* t & t *)
+ (* t of & t *)
+ (* $s$ *)
+ (* i *)
(* p as p *)
(* (Node x y as n) *)
(* $s$ *)
(* c *)
(* 'x' *)
(* ~s or ~s:(p) *)
- (* ?s or ?s:(p = e) or ?(p = e) *)
- (* | PaOlb of Loc.t and string and meta_option(*FIXME*) (patt * meta_option(*FIXME*) expr) *)
(* ?s or ?s:(p) *)
(* ?s:(p = e) or ?(p = e) *)
(* p | p *)
(* (e : t) or (e : t :> t) *)
(* 3.14 *)
(* for s = e to/downto e do { e } *)
- (* fun [ a ] *)
+ (* fun [ mc ] *)
(* if e then e else e *)
(* 42 *)
(* ~s or ~s:e *)
(* lazy e *)
(* let b in e or let rec b in e *)
(* let module s = me in e *)
- (* match e with [ a ] *)
+ (* match e with [ mc ] *)
(* new i *)
(* object ((p))? (cst)? end *)
(* ?s or ?s:e *)
- (* {< b >} *)
- (* { b } or { (e) with b } *)
+ (* {< rb >} *)
+ (* { rb } or { (e) with rb } *)
(* do { e } *)
(* e#s *)
(* e.[e] *)
(* s *)
(* "foo" *)
- (* try e with [ a ] *)
+ (* try e with [ mc ] *)
(* (e) *)
(* e, e *)
(* (e : t) *)
(* A.B.C *)
(* functor (s : mt) -> mt *)
(* 's *)
- (* sig (sg)? end *)
+ (* sig sg end *)
(* mt with wc *)
(* $s$ *)
(* class cict *)
(* module i = i *)
(* wc and wc *)
(* $s$ *)
- (* b and b *)
+ (* bi and bi *)
(* let a = 42 and c = 43 *)
(* p = e *)
(* let patt = expr *)
(* $s$ *)
- (* b ; b *)
+ (* rb ; rb *)
(* i = e *)
(* $s$ *)
(* mb and mb *)
(* i *)
(* me me *)
(* functor (s : mt) -> me *)
- (* struct (st)? end *)
+ (* struct st end *)
(* (me : mt) *)
(* $s$ *)
(* class cice *)
(* module type s = mt *)
(* open i *)
(* type t *)
- (* value b or value rec b *)
+ (* value (rec)? bi *)
(* $s$ *)
(* (virtual)? i ([ t ])? *)
(* [t] -> ct *)
(* ce e *)
(* (virtual)? i ([ t ])? *)
(* fun p -> ce *)
- (* let (rec)? b in ce *)
+ (* let (rec)? bi in ce *)
(* object ((p))? (cst)? end *)
(* ce : ct *)
(* ce and ce *)
(* ce = ce *)
(* $s$ *)
- patt =
- | PaNil of Loc.t | PaId of Loc.t * ident
- | PaAli of Loc.t * patt * patt | PaAnt of Loc.t * string
- | PaAny of Loc.t | PaApp of Loc.t * patt * patt
- | PaArr of Loc.t * patt | PaCom of Loc.t * patt * patt
- | PaSem of Loc.t * patt * patt | PaChr of Loc.t * string
- | PaInt of Loc.t * string | PaInt32 of Loc.t * string
- | PaInt64 of Loc.t * string | PaNativeInt of Loc.t * string
- | PaFlo of Loc.t * string | PaLab of Loc.t * string * patt
- | PaOlb of Loc.t * string * patt
- | PaOlbi of Loc.t * string * patt * expr
- | PaOrp of Loc.t * patt * patt | PaRng of Loc.t * patt * patt
- | PaRec of Loc.t * patt | PaEq of Loc.t * ident * patt
- | PaStr of Loc.t * string | PaTup of Loc.t * patt
- | PaTyc of Loc.t * patt * ctyp | PaTyp of Loc.t * ident
- | PaVrn of Loc.t * string
+ loc =
+ Loc.
+ t
+ and meta_bool =
+ | BTrue | BFalse | BAnt of string
+ and 'a meta_option =
+ | ONone | OSome of 'a | OAnt of string
+ and 'a meta_list =
+ | LNil | LCons of 'a * 'a meta_list | LAnt of string
+ and ident =
+ | IdAcc of loc * ident * ident
+ | IdApp of loc * ident * ident
+ | IdLid of loc * string
+ | IdUid of loc * string
+ | IdAnt of loc * string
+ and ctyp =
+ | TyNil of loc
+ | TyAli of loc * ctyp * ctyp
+ | TyAny of loc
+ | TyApp of loc * ctyp * ctyp
+ | TyArr of loc * ctyp * ctyp
+ | TyCls of loc * ident
+ | TyLab of loc * string * ctyp
+ | TyId of loc * ident
+ | TyMan of loc * ctyp * ctyp
+ | TyDcl of loc * string * ctyp list * ctyp * (ctyp * ctyp) list
+ | TyObj of loc * ctyp * meta_bool
+ | TyOlb of loc * string * ctyp
+ | TyPol of loc * ctyp * ctyp
+ | TyQuo of loc * string
+ | TyQuP of loc * string
+ | TyQuM of loc * string
+ | TyVrn of loc * string
+ | TyRec of loc * ctyp
+ | TyCol of loc * ctyp * ctyp
+ | TySem of loc * ctyp * ctyp
+ | TyCom of loc * ctyp * ctyp
+ | TySum of loc * ctyp
+ | TyOf of loc * ctyp * ctyp
+ | TyAnd of loc * ctyp * ctyp
+ | TyOr of loc * ctyp * ctyp
+ | TyPrv of loc * ctyp
+ | TyMut of loc * ctyp
+ | TyTup of loc * ctyp
+ | TySta of loc * ctyp * ctyp
+ | TyVrnEq of loc * ctyp
+ | TyVrnSup of loc * ctyp
+ | TyVrnInf of loc * ctyp
+ | TyVrnInfSup of loc * ctyp * ctyp
+ | TyAmp of loc * ctyp * ctyp
+ | TyOfAmp of loc * ctyp * ctyp
+ | TyAnt of loc * string
+ and patt =
+ | PaNil of loc
+ | PaId of loc * ident
+ | PaAli of loc * patt * patt
+ | PaAnt of loc * string
+ | PaAny of loc
+ | PaApp of loc * patt * patt
+ | PaArr of loc * patt
+ | PaCom of loc * patt * patt
+ | PaSem of loc * patt * patt
+ | PaChr of loc * string
+ | PaInt of loc * string
+ | PaInt32 of loc * string
+ | PaInt64 of loc * string
+ | PaNativeInt of loc * string
+ | PaFlo of loc * string
+ | PaLab of loc * string * patt
+ | PaOlb of loc * string * patt
+ | PaOlbi of loc * string * patt * expr
+ | PaOrp of loc * patt * patt
+ | PaRng of loc * patt * patt
+ | PaRec of loc * patt
+ | PaEq of loc * ident * patt
+ | PaStr of loc * string
+ | PaTup of loc * patt
+ | PaTyc of loc * patt * ctyp
+ | PaTyp of loc * ident
+ | PaVrn of loc * string
and expr =
- | ExNil of Loc.t | ExId of Loc.t * ident
- | ExAcc of Loc.t * expr * expr | ExAnt of Loc.t * string
- | ExApp of Loc.t * expr * expr | ExAre of Loc.t * expr * expr
- | ExArr of Loc.t * expr | ExSem of Loc.t * expr * expr
- | ExAsf of Loc.t | ExAsr of Loc.t * expr
- | ExAss of Loc.t * expr * expr | ExChr of Loc.t * string
- | ExCoe of Loc.t * expr * ctyp * ctyp | ExFlo of Loc.t * string
- | ExFor of Loc.t * string * expr * expr * meta_bool * expr
- | ExFun of Loc.t * match_case | ExIfe of Loc.t * expr * expr * expr
- | ExInt of Loc.t * string | ExInt32 of Loc.t * string
- | ExInt64 of Loc.t * string | ExNativeInt of Loc.t * string
- | ExLab of Loc.t * string * expr | ExLaz of Loc.t * expr
- | ExLet of Loc.t * meta_bool * binding * expr
- | ExLmd of Loc.t * string * module_expr * expr
- | ExMat of Loc.t * expr * match_case | ExNew of Loc.t * ident
- | ExObj of Loc.t * patt * class_str_item
- | ExOlb of Loc.t * string * expr | ExOvr of Loc.t * rec_binding
- | ExRec of Loc.t * rec_binding * expr | ExSeq of Loc.t * expr
- | ExSnd of Loc.t * expr * string | ExSte of Loc.t * expr * expr
- | ExStr of Loc.t * string | ExTry of Loc.t * expr * match_case
- | ExTup of Loc.t * expr | ExCom of Loc.t * expr * expr
- | ExTyc of Loc.t * expr * ctyp | ExVrn of Loc.t * string
- | ExWhi of Loc.t * expr * expr
+ | ExNil of loc
+ | ExId of loc * ident
+ | ExAcc of loc * expr * expr
+ | ExAnt of loc * string
+ | ExApp of loc * expr * expr
+ | ExAre of loc * expr * expr
+ | ExArr of loc * expr
+ | ExSem of loc * expr * expr
+ | ExAsf of loc
+ | ExAsr of loc * expr
+ | ExAss of loc * expr * expr
+ | ExChr of loc * string
+ | ExCoe of loc * expr * ctyp * ctyp
+ | ExFlo of loc * string
+ | ExFor of loc * string * expr * expr * meta_bool * expr
+ | ExFun of loc * match_case
+ | ExIfe of loc * expr * expr * expr
+ | ExInt of loc * string
+ | ExInt32 of loc * string
+ | ExInt64 of loc * string
+ | ExNativeInt of loc * string
+ | ExLab of loc * string * expr
+ | ExLaz of loc * expr
+ | ExLet of loc * meta_bool * binding * expr
+ | ExLmd of loc * string * module_expr * expr
+ | ExMat of loc * expr * match_case
+ | ExNew of loc * ident
+ | ExObj of loc * patt * class_str_item
+ | ExOlb of loc * string * expr
+ | ExOvr of loc * rec_binding
+ | ExRec of loc * rec_binding * expr
+ | ExSeq of loc * expr
+ | ExSnd of loc * expr * string
+ | ExSte of loc * expr * expr
+ | ExStr of loc * string
+ | ExTry of loc * expr * match_case
+ | ExTup of loc * expr
+ | ExCom of loc * expr * expr
+ | ExTyc of loc * expr * ctyp
+ | ExVrn of loc * string
+ | ExWhi of loc * expr * expr
and module_type =
- | MtNil of Loc.t | MtId of Loc.t * ident
- | MtFun of Loc.t * string * module_type * module_type
- | MtQuo of Loc.t * string | MtSig of Loc.t * sig_item
- | MtWit of Loc.t * module_type * with_constr
- | MtAnt of Loc.t * string
+ | MtNil of loc
+ | MtId of loc * ident
+ | MtFun of loc * string * module_type * module_type
+ | MtQuo of loc * string
+ | MtSig of loc * sig_item
+ | MtWit of loc * module_type * with_constr
+ | MtAnt of loc * string
and sig_item =
- | SgNil of Loc.t | SgCls of Loc.t * class_type
- | SgClt of Loc.t * class_type
- | SgSem of Loc.t * sig_item * sig_item
- | SgDir of Loc.t * string * expr | SgExc of Loc.t * ctyp
- | SgExt of Loc.t * string * ctyp * string meta_list
- | SgInc of Loc.t * module_type
- | SgMod of Loc.t * string * module_type
- | SgRecMod of Loc.t * module_binding
- | SgMty of Loc.t * string * module_type | SgOpn of Loc.t * ident
- | SgTyp of Loc.t * ctyp | SgVal of Loc.t * string * ctyp
- | SgAnt of Loc.t * string
+ | SgNil of loc
+ | SgCls of loc * class_type
+ | SgClt of loc * class_type
+ | SgSem of loc * sig_item * sig_item
+ | SgDir of loc * string * expr
+ | SgExc of loc * ctyp
+ | SgExt of loc * string * ctyp * string meta_list
+ | SgInc of loc * module_type
+ | SgMod of loc * string * module_type
+ | SgRecMod of loc * module_binding
+ | SgMty of loc * string * module_type
+ | SgOpn of loc * ident
+ | SgTyp of loc * ctyp
+ | SgVal of loc * string * ctyp
+ | SgAnt of loc * string
and with_constr =
- | WcNil of Loc.t | WcTyp of Loc.t * ctyp * ctyp
- | WcMod of Loc.t * ident * ident
- | WcAnd of Loc.t * with_constr * with_constr
- | WcAnt of Loc.t * string
+ | WcNil of loc
+ | WcTyp of loc * ctyp * ctyp
+ | WcMod of loc * ident * ident
+ | WcAnd of loc * with_constr * with_constr
+ | WcAnt of loc * string
and binding =
- | BiNil of Loc.t | BiAnd of Loc.t * binding * binding
- | BiEq of Loc.t * patt * expr | BiAnt of Loc.t * string
+ | BiNil of loc
+ | BiAnd of loc * binding * binding
+ | BiEq of loc * patt * expr
+ | BiAnt of loc * string
and rec_binding =
- | RbNil of Loc.t | RbSem of Loc.t * rec_binding * rec_binding
- | RbEq of Loc.t * ident * expr | RbAnt of Loc.t * string
+ | RbNil of loc
+ | RbSem of loc * rec_binding * rec_binding
+ | RbEq of loc * ident * expr
+ | RbAnt of loc * string
and module_binding =
- | MbNil of Loc.t | MbAnd of Loc.t * module_binding * module_binding
- | MbColEq of Loc.t * string * module_type * module_expr
- | MbCol of Loc.t * string * module_type | MbAnt of Loc.t * string
+ | MbNil of loc
+ | MbAnd of loc * module_binding * module_binding
+ | MbColEq of loc * string * module_type * module_expr
+ | MbCol of loc * string * module_type
+ | MbAnt of loc * string
and match_case =
- | McNil of Loc.t | McOr of Loc.t * match_case * match_case
- | McArr of Loc.t * patt * expr * expr | McAnt of Loc.t * string
+ | McNil of loc
+ | McOr of loc * match_case * match_case
+ | McArr of loc * patt * expr * expr
+ | McAnt of loc * string
and module_expr =
- | MeNil of Loc.t | MeId of Loc.t * ident
- | MeApp of Loc.t * module_expr * module_expr
- | MeFun of Loc.t * string * module_type * module_expr
- | MeStr of Loc.t * str_item
- | MeTyc of Loc.t * module_expr * module_type
- | MeAnt of Loc.t * string
+ | MeNil of loc
+ | MeId of loc * ident
+ | MeApp of loc * module_expr * module_expr
+ | MeFun of loc * string * module_type * module_expr
+ | MeStr of loc * str_item
+ | MeTyc of loc * module_expr * module_type
+ | MeAnt of loc * string
and str_item =
- | StNil of Loc.t | StCls of Loc.t * class_expr
- | StClt of Loc.t * class_type
- | StSem of Loc.t * str_item * str_item
- | StDir of Loc.t * string * expr
- | StExc of Loc.t * ctyp * ident meta_option | StExp of Loc.t * expr
- | StExt of Loc.t * string * ctyp * string meta_list
- | StInc of Loc.t * module_expr
- | StMod of Loc.t * string * module_expr
- | StRecMod of Loc.t * module_binding
- | StMty of Loc.t * string * module_type | StOpn of Loc.t * ident
- | StTyp of Loc.t * ctyp | StVal of Loc.t * meta_bool * binding
- | StAnt of Loc.t * string
+ | StNil of loc
+ | StCls of loc * class_expr
+ | StClt of loc * class_type
+ | StSem of loc * str_item * str_item
+ | StDir of loc * string * expr
+ | StExc of loc * ctyp * ident meta_option
+ | StExp of loc * expr
+ | StExt of loc * string * ctyp * string meta_list
+ | StInc of loc * module_expr
+ | StMod of loc * string * module_expr
+ | StRecMod of loc * module_binding
+ | StMty of loc * string * module_type
+ | StOpn of loc * ident
+ | StTyp of loc * ctyp
+ | StVal of loc * meta_bool * binding
+ | StAnt of loc * string
and class_type =
- | CtNil of Loc.t | CtCon of Loc.t * meta_bool * ident * ctyp
- | CtFun of Loc.t * ctyp * class_type
- | CtSig of Loc.t * ctyp * class_sig_item
- | CtAnd of Loc.t * class_type * class_type
- | CtCol of Loc.t * class_type * class_type
- | CtEq of Loc.t * class_type * class_type | CtAnt of Loc.t * string
+ | CtNil of loc
+ | CtCon of loc * meta_bool * ident * ctyp
+ | CtFun of loc * ctyp * class_type
+ | CtSig of loc * ctyp * class_sig_item
+ | CtAnd of loc * class_type * class_type
+ | CtCol of loc * class_type * class_type
+ | CtEq of loc * class_type * class_type
+ | CtAnt of loc * string
and class_sig_item =
- | CgNil of Loc.t | CgCtr of Loc.t * ctyp * ctyp
- | CgSem of Loc.t * class_sig_item * class_sig_item
- | CgInh of Loc.t * class_type
- | CgMth of Loc.t * string * meta_bool * ctyp
- | CgVal of Loc.t * string * meta_bool * meta_bool * ctyp
- | CgVir of Loc.t * string * meta_bool * ctyp
- | CgAnt of Loc.t * string
+ | CgNil of loc
+ | CgCtr of loc * ctyp * ctyp
+ | CgSem of loc * class_sig_item * class_sig_item
+ | CgInh of loc * class_type
+ | CgMth of loc * string * meta_bool * ctyp
+ | CgVal of loc * string * meta_bool * meta_bool * ctyp
+ | CgVir of loc * string * meta_bool * ctyp
+ | CgAnt of loc * string
and class_expr =
- | CeNil of Loc.t | CeApp of Loc.t * class_expr * expr
- | CeCon of Loc.t * meta_bool * ident * ctyp
- | CeFun of Loc.t * patt * class_expr
- | CeLet of Loc.t * meta_bool * binding * class_expr
- | CeStr of Loc.t * patt * class_str_item
- | CeTyc of Loc.t * class_expr * class_type
- | CeAnd of Loc.t * class_expr * class_expr
- | CeEq of Loc.t * class_expr * class_expr | CeAnt of Loc.t * string
+ | CeNil of loc
+ | CeApp of loc * class_expr * expr
+ | CeCon of loc * meta_bool * ident * ctyp
+ | CeFun of loc * patt * class_expr
+ | CeLet of loc * meta_bool * binding * class_expr
+ | CeStr of loc * patt * class_str_item
+ | CeTyc of loc * class_expr * class_type
+ | CeAnd of loc * class_expr * class_expr
+ | CeEq of loc * class_expr * class_expr
+ | CeAnt of loc * string
and class_str_item =
- | (* cst ; cst *) (* type t = t *)
- (* inherit ce or inherit ce as s *) (* initializer e *)
- (* method (private)? s : t = e or method (private)? s = e *)
- (* value (mutable)? s = e *) (* method virtual (private)? s : t *)
- (* value virtual (private)? s : t *) CrNil of Loc.t
- | CrSem of Loc.t * class_str_item * class_str_item
- | CrCtr of Loc.t * ctyp * ctyp
- | CrInh of Loc.t * class_expr * string | CrIni of Loc.t * expr
- | CrMth of Loc.t * string * meta_bool * expr * ctyp
- | CrVal of Loc.t * string * meta_bool * expr
- | CrVir of Loc.t * string * meta_bool * ctyp
- | CrVvr of Loc.t * string * meta_bool * ctyp
- | CrAnt of Loc.t * string
- val loc_of_ctyp : ctyp -> Loc.t
- val loc_of_patt : patt -> Loc.t
- val loc_of_expr : expr -> Loc.t
- val loc_of_module_type : module_type -> Loc.t
- val loc_of_module_expr : module_expr -> Loc.t
- val loc_of_sig_item : sig_item -> Loc.t
- val loc_of_str_item : str_item -> Loc.t
- val loc_of_class_type : class_type -> Loc.t
- val loc_of_class_sig_item : class_sig_item -> Loc.t
- val loc_of_class_expr : class_expr -> Loc.t
- val loc_of_class_str_item : class_str_item -> Loc.t
- val loc_of_with_constr : with_constr -> Loc.t
- val loc_of_binding : binding -> Loc.t
- val loc_of_rec_binding : rec_binding -> Loc.t
- val loc_of_module_binding : module_binding -> Loc.t
- val loc_of_match_case : match_case -> Loc.t
- val loc_of_ident : ident -> Loc.t
+ | CrNil of loc
+ | (* cst ; cst *)
+ CrSem of loc * class_str_item * class_str_item
+ | (* type t = t *)
+ CrCtr of loc * ctyp * ctyp
+ | (* inherit ce or inherit ce as s *)
+ CrInh of loc * class_expr * string
+ | (* initializer e *)
+ CrIni of loc * expr
+ | (* method (private)? s : t = e or method (private)? s = e *)
+ CrMth of loc * string * meta_bool * expr * ctyp
+ | (* value (mutable)? s = e *)
+ CrVal of loc * string * meta_bool * expr
+ | (* method virtual (private)? s : t *)
+ CrVir of loc * string * meta_bool * ctyp
+ | (* value virtual (private)? s : t *)
+ CrVvr of loc * string * meta_bool * ctyp
+ | CrAnt of loc * string
+
+ val loc_of_ctyp : ctyp -> loc
+
+ val loc_of_patt : patt -> loc
+
+ val loc_of_expr : expr -> loc
+
+ val loc_of_module_type : module_type -> loc
+
+ val loc_of_module_expr : module_expr -> loc
+
+ val loc_of_sig_item : sig_item -> loc
+
+ val loc_of_str_item : str_item -> loc
+
+ val loc_of_class_type : class_type -> loc
+
+ val loc_of_class_sig_item : class_sig_item -> loc
+
+ val loc_of_class_expr : class_expr -> loc
+
+ val loc_of_class_str_item : class_str_item -> loc
+
+ val loc_of_with_constr : with_constr -> loc
+
+ val loc_of_binding : binding -> loc
+
+ val loc_of_rec_binding : rec_binding -> loc
+
+ val loc_of_module_binding : module_binding -> loc
+
+ val loc_of_match_case : match_case -> loc
+
+ val loc_of_ident : ident -> loc
+
module Meta :
sig
module type META_LOC =
sig
- val meta_loc_patt : Loc.t -> Loc.t -> patt
- val meta_loc_expr : Loc.t -> Loc.t -> expr
+ val meta_loc_patt : loc -> loc -> patt
+
+ val meta_loc_expr : loc -> loc -> expr
+
end
+
module MetaLoc :
sig
- val meta_loc_patt : Loc.t -> Loc.t -> patt
- val meta_loc_expr : Loc.t -> Loc.t -> expr
+ val meta_loc_patt : loc -> loc -> patt
+
+ val meta_loc_expr : loc -> loc -> expr
+
end
+
module MetaGhostLoc :
sig
- val meta_loc_patt : Loc.t -> 'a -> patt
- val meta_loc_expr : Loc.t -> 'a -> expr
+ val meta_loc_patt : loc -> 'a -> patt
+
+ val meta_loc_expr : loc -> 'a -> expr
+
end
+
module MetaLocVar :
sig
- val meta_loc_patt : Loc.t -> 'a -> patt
- val meta_loc_expr : Loc.t -> 'a -> expr
+ val meta_loc_patt : loc -> 'a -> patt
+
+ val meta_loc_expr : loc -> 'a -> expr
+
end
+
module Make (MetaLoc : META_LOC) :
sig
module Expr :
sig
- val meta_string : Loc.t -> string -> expr
- val meta_int : Loc.t -> string -> expr
- val meta_float : Loc.t -> string -> expr
- val meta_char : Loc.t -> string -> expr
- val meta_bool : Loc.t -> bool -> expr
+ val meta_string : loc -> string -> expr
+
+ val meta_int : loc -> string -> expr
+
+ val meta_float : loc -> string -> expr
+
+ val meta_char : loc -> string -> expr
+
+ val meta_bool : loc -> bool -> expr
+
val meta_list :
- (Loc.t -> 'a -> expr) -> Loc.t -> 'a list -> expr
- val meta_binding : Loc.t -> binding -> expr
- val meta_rec_binding : Loc.t -> rec_binding -> expr
- val meta_class_expr : Loc.t -> class_expr -> expr
- val meta_class_sig_item : Loc.t -> class_sig_item -> expr
- val meta_class_str_item : Loc.t -> class_str_item -> expr
- val meta_class_type : Loc.t -> class_type -> expr
- val meta_ctyp : Loc.t -> ctyp -> expr
- val meta_expr : Loc.t -> expr -> expr
- val meta_ident : Loc.t -> ident -> expr
- val meta_match_case : Loc.t -> match_case -> expr
- val meta_module_binding : Loc.t -> module_binding -> expr
- val meta_module_expr : Loc.t -> module_expr -> expr
- val meta_module_type : Loc.t -> module_type -> expr
- val meta_patt : Loc.t -> patt -> expr
- val meta_sig_item : Loc.t -> sig_item -> expr
- val meta_str_item : Loc.t -> str_item -> expr
- val meta_with_constr : Loc.t -> with_constr -> expr
+ (loc -> 'a -> expr) -> loc -> 'a list -> expr
+
+ val meta_binding : loc -> binding -> expr
+
+ val meta_rec_binding : loc -> rec_binding -> expr
+
+ val meta_class_expr : loc -> class_expr -> expr
+
+ val meta_class_sig_item : loc -> class_sig_item -> expr
+
+ val meta_class_str_item : loc -> class_str_item -> expr
+
+ val meta_class_type : loc -> class_type -> expr
+
+ val meta_ctyp : loc -> ctyp -> expr
+
+ val meta_expr : loc -> expr -> expr
+
+ val meta_ident : loc -> ident -> expr
+
+ val meta_match_case : loc -> match_case -> expr
+
+ val meta_module_binding : loc -> module_binding -> expr
+
+ val meta_module_expr : loc -> module_expr -> expr
+
+ val meta_module_type : loc -> module_type -> expr
+
+ val meta_patt : loc -> patt -> expr
+
+ val meta_sig_item : loc -> sig_item -> expr
+
+ val meta_str_item : loc -> str_item -> expr
+
+ val meta_with_constr : loc -> with_constr -> expr
+
end
+
module Patt :
sig
- val meta_string : Loc.t -> string -> patt
- val meta_int : Loc.t -> string -> patt
- val meta_float : Loc.t -> string -> patt
- val meta_char : Loc.t -> string -> patt
- val meta_bool : Loc.t -> bool -> patt
+ val meta_string : loc -> string -> patt
+
+ val meta_int : loc -> string -> patt
+
+ val meta_float : loc -> string -> patt
+
+ val meta_char : loc -> string -> patt
+
+ val meta_bool : loc -> bool -> patt
+
val meta_list :
- (Loc.t -> 'a -> patt) -> Loc.t -> 'a list -> patt
- val meta_binding : Loc.t -> binding -> patt
- val meta_rec_binding : Loc.t -> rec_binding -> patt
- val meta_class_expr : Loc.t -> class_expr -> patt
- val meta_class_sig_item : Loc.t -> class_sig_item -> patt
- val meta_class_str_item : Loc.t -> class_str_item -> patt
- val meta_class_type : Loc.t -> class_type -> patt
- val meta_ctyp : Loc.t -> ctyp -> patt
- val meta_expr : Loc.t -> expr -> patt
- val meta_ident : Loc.t -> ident -> patt
- val meta_match_case : Loc.t -> match_case -> patt
- val meta_module_binding : Loc.t -> module_binding -> patt
- val meta_module_expr : Loc.t -> module_expr -> patt
- val meta_module_type : Loc.t -> module_type -> patt
- val meta_patt : Loc.t -> patt -> patt
- val meta_sig_item : Loc.t -> sig_item -> patt
- val meta_str_item : Loc.t -> str_item -> patt
- val meta_with_constr : Loc.t -> with_constr -> patt
+ (loc -> 'a -> patt) -> loc -> 'a list -> patt
+
+ val meta_binding : loc -> binding -> patt
+
+ val meta_rec_binding : loc -> rec_binding -> patt
+
+ val meta_class_expr : loc -> class_expr -> patt
+
+ val meta_class_sig_item : loc -> class_sig_item -> patt
+
+ val meta_class_str_item : loc -> class_str_item -> patt
+
+ val meta_class_type : loc -> class_type -> patt
+
+ val meta_ctyp : loc -> ctyp -> patt
+
+ val meta_expr : loc -> expr -> patt
+
+ val meta_ident : loc -> ident -> patt
+
+ val meta_match_case : loc -> match_case -> patt
+
+ val meta_module_binding : loc -> module_binding -> patt
+
+ val meta_module_expr : loc -> module_expr -> patt
+
+ val meta_module_type : loc -> module_type -> patt
+
+ val meta_patt : loc -> patt -> patt
+
+ val meta_sig_item : loc -> sig_item -> patt
+
+ val meta_str_item : loc -> str_item -> patt
+
+ val meta_with_constr : loc -> with_constr -> patt
+
end
+
end
+
end
+
class map :
- object
- inherit mapper
+ object ('self_type)
+ method string : string -> string
+
+ method list :
+ 'a 'b. ('self_type -> 'a -> 'b) -> 'a list -> 'b list
+
method meta_bool : meta_bool -> meta_bool
+
method meta_option :
- 'a 'b. ('a -> 'b) -> 'a meta_option -> 'b meta_option
+ 'a 'b.
+ ('self_type -> 'a -> 'b) -> 'a meta_option -> 'b meta_option
+
method meta_list :
- 'a 'b. ('a -> 'b) -> 'a meta_list -> 'b meta_list
- method _Loc_t : Loc.t -> Loc.t
+ 'a 'b. ('self_type -> 'a -> 'b) -> 'a meta_list -> 'b meta_list
+
+ method loc : loc -> loc
+
method expr : expr -> expr
+
method patt : patt -> patt
+
method ctyp : ctyp -> ctyp
+
method str_item : str_item -> str_item
+
method sig_item : sig_item -> sig_item
+
method module_expr : module_expr -> module_expr
+
method module_type : module_type -> module_type
+
method class_expr : class_expr -> class_expr
+
method class_type : class_type -> class_type
+
method class_sig_item : class_sig_item -> class_sig_item
+
method class_str_item : class_str_item -> class_str_item
+
method with_constr : with_constr -> with_constr
+
method binding : binding -> binding
+
method rec_binding : rec_binding -> rec_binding
+
method module_binding : module_binding -> module_binding
+
method match_case : match_case -> match_case
+
method ident : ident -> ident
+
+ method unknown : 'a. 'a -> 'a
+
end
+
class fold :
object ('self_type)
method string : string -> 'self_type
- method int : int -> 'self_type
- method float : float -> 'self_type
- method bool : bool -> 'self_type
+
method list :
'a. ('self_type -> 'a -> 'self_type) -> 'a list -> 'self_type
- method option :
- 'a. ('self_type -> 'a -> 'self_type) -> 'a option -> 'self_type
- method array :
- 'a. ('self_type -> 'a -> 'self_type) -> 'a array -> 'self_type
- method ref :
- 'a. ('self_type -> 'a -> 'self_type) -> 'a ref -> 'self_type
+
method meta_bool : meta_bool -> 'self_type
+
method meta_option :
'a.
('self_type -> 'a -> 'self_type) ->
'a meta_option -> 'self_type
+
method meta_list :
'a.
('self_type -> 'a -> 'self_type) ->
'a meta_list -> 'self_type
- method _Loc_t : Loc.t -> 'self_type
+
+ method loc : loc -> 'self_type
+
method expr : expr -> 'self_type
+
method patt : patt -> 'self_type
+
method ctyp : ctyp -> 'self_type
+
method str_item : str_item -> 'self_type
+
method sig_item : sig_item -> 'self_type
+
method module_expr : module_expr -> 'self_type
+
method module_type : module_type -> 'self_type
+
method class_expr : class_expr -> 'self_type
+
method class_type : class_type -> 'self_type
+
method class_sig_item : class_sig_item -> 'self_type
+
method class_str_item : class_str_item -> 'self_type
+
method with_constr : with_constr -> 'self_type
+
method binding : binding -> 'self_type
+
method rec_binding : rec_binding -> 'self_type
+
method module_binding : module_binding -> 'self_type
+
method match_case : match_case -> 'self_type
+
method ident : ident -> 'self_type
+
+ method unknown : 'a. 'a -> 'self_type
+
end
+
val map_expr : (expr -> expr) -> map
+
val map_patt : (patt -> patt) -> map
+
val map_ctyp : (ctyp -> ctyp) -> map
+
val map_str_item : (str_item -> str_item) -> map
+
val map_sig_item : (sig_item -> sig_item) -> map
- val map_loc : (Loc.t -> Loc.t) -> map
+
+ val map_loc : (loc -> loc) -> map
+
val ident_of_expr : expr -> ident
+
val ident_of_patt : patt -> ident
+
val ident_of_ctyp : ctyp -> ident
+
val biAnd_of_list : binding list -> binding
+
val rbSem_of_list : rec_binding list -> rec_binding
+
val paSem_of_list : patt list -> patt
+
val paCom_of_list : patt list -> patt
+
val tyOr_of_list : ctyp list -> ctyp
+
val tyAnd_of_list : ctyp list -> ctyp
+
val tyAmp_of_list : ctyp list -> ctyp
+
val tySem_of_list : ctyp list -> ctyp
+
val tyCom_of_list : ctyp list -> ctyp
+
val tySta_of_list : ctyp list -> ctyp
+
val stSem_of_list : str_item list -> str_item
+
val sgSem_of_list : sig_item list -> sig_item
+
val crSem_of_list : class_str_item list -> class_str_item
+
val cgSem_of_list : class_sig_item list -> class_sig_item
+
val ctAnd_of_list : class_type list -> class_type
+
val ceAnd_of_list : class_expr list -> class_expr
+
val wcAnd_of_list : with_constr list -> with_constr
+
val meApp_of_list : module_expr list -> module_expr
+
val mbAnd_of_list : module_binding list -> module_binding
+
val mcOr_of_list : match_case list -> match_case
+
val idAcc_of_list : ident list -> ident
+
val idApp_of_list : ident list -> ident
+
val exSem_of_list : expr list -> expr
+
val exCom_of_list : expr list -> expr
+
val list_of_ctyp : ctyp -> ctyp list -> ctyp list
+
val list_of_binding : binding -> binding list -> binding list
+
val list_of_rec_binding :
rec_binding -> rec_binding list -> rec_binding list
+
val list_of_with_constr :
with_constr -> with_constr list -> with_constr list
+
val list_of_patt : patt -> patt list -> patt list
+
val list_of_expr : expr -> expr list -> expr list
+
val list_of_str_item : str_item -> str_item list -> str_item list
+
val list_of_sig_item : sig_item -> sig_item list -> sig_item list
+
val list_of_class_sig_item :
class_sig_item -> class_sig_item list -> class_sig_item list
+
val list_of_class_str_item :
class_str_item -> class_str_item list -> class_str_item list
+
val list_of_class_type :
class_type -> class_type list -> class_type list
+
val list_of_class_expr :
class_expr -> class_expr list -> class_expr list
+
val list_of_module_expr :
module_expr -> module_expr list -> module_expr list
+
val list_of_module_binding :
module_binding -> module_binding list -> module_binding list
+
val list_of_match_case :
match_case -> match_case list -> match_case list
+
val list_of_ident : ident -> ident list -> ident list
+
val safe_string_escaped : string -> string
+
val is_irrefut_patt : patt -> bool
+
val is_constructor : ident -> bool
+
val is_patt_constructor : patt -> bool
+
val is_expr_constructor : expr -> bool
+
val ty_of_stl : (Loc.t * string * (ctyp list)) -> ctyp
+
val ty_of_sbt : (Loc.t * string * bool * ctyp) -> ctyp
+
val bi_of_pe : (patt * expr) -> binding
+
val pel_of_binding : binding -> (patt * expr) list
+
val binding_of_pel : (patt * expr) list -> binding
+
val sum_type_of_list : (Loc.t * string * (ctyp list)) list -> ctyp
+
val record_type_of_list : (Loc.t * string * bool * ctyp) list -> ctyp
+
end
- module Camlp4AstToAst (M : Camlp4Ast) : Ast with module Loc = M.Loc
+
+ module Camlp4AstToAst (M : Camlp4Ast) : Ast with type loc = M.loc
and type meta_bool = M.meta_bool
and type 'a meta_option = 'a M.meta_option
and type 'a meta_list = 'a M.meta_list and type ctyp = M.ctyp
and type rec_binding = M.rec_binding
and type module_binding = M.module_binding
and type match_case = M.match_case and type ident = M.ident = M
+
module MakeCamlp4Ast (Loc : Type) =
struct
- type meta_bool = | BTrue | BFalse | BAnt of string
- type 'a meta_option = | ONone | OSome of 'a | OAnt of string
- type 'a meta_list =
+ type loc =
+ Loc.
+ t
+ and meta_bool =
+ | BTrue | BFalse | BAnt of string
+ and 'a meta_option =
+ | ONone | OSome of 'a | OAnt of string
+ and 'a meta_list =
| LNil | LCons of 'a * 'a meta_list | LAnt of string
- type ident =
- | IdAcc of Loc.t * ident * ident | IdApp of Loc.t * ident * ident
- | IdLid of Loc.t * string | IdUid of Loc.t * string
- | IdAnt of Loc.t * string
- type ctyp =
- | TyNil of Loc.t | TyAli of Loc.t * ctyp * ctyp | TyAny of Loc.t
- | TyApp of Loc.t * ctyp * ctyp | TyArr of Loc.t * ctyp * ctyp
- | TyCls of Loc.t * ident | TyLab of Loc.t * string * ctyp
- | TyId of Loc.t * ident | TyMan of Loc.t * ctyp * ctyp
- | TyDcl of Loc.t * string * ctyp list * ctyp * (ctyp * ctyp) list
- | TyObj of Loc.t * ctyp * meta_bool
- | TyOlb of Loc.t * string * ctyp | TyPol of Loc.t * ctyp * ctyp
- | TyQuo of Loc.t * string | TyQuP of Loc.t * string
- | TyQuM of Loc.t * string | TyVrn of Loc.t * string
- | TyRec of Loc.t * ctyp | TyCol of Loc.t * ctyp * ctyp
- | TySem of Loc.t * ctyp * ctyp | TyCom of Loc.t * ctyp * ctyp
- | TySum of Loc.t * ctyp | TyOf of Loc.t * ctyp * ctyp
- | TyAnd of Loc.t * ctyp * ctyp | TyOr of Loc.t * ctyp * ctyp
- | TyPrv of Loc.t * ctyp | TyMut of Loc.t * ctyp
- | TyTup of Loc.t * ctyp | TySta of Loc.t * ctyp * ctyp
- | TyVrnEq of Loc.t * ctyp | TyVrnSup of Loc.t * ctyp
- | TyVrnInf of Loc.t * ctyp | TyVrnInfSup of Loc.t * ctyp * ctyp
- | TyAmp of Loc.t * ctyp * ctyp | TyOfAmp of Loc.t * ctyp * ctyp
- | TyAnt of Loc.t * string
- type patt =
- | PaNil of Loc.t | PaId of Loc.t * ident
- | PaAli of Loc.t * patt * patt | PaAnt of Loc.t * string
- | PaAny of Loc.t | PaApp of Loc.t * patt * patt
- | PaArr of Loc.t * patt | PaCom of Loc.t * patt * patt
- | PaSem of Loc.t * patt * patt | PaChr of Loc.t * string
- | PaInt of Loc.t * string | PaInt32 of Loc.t * string
- | PaInt64 of Loc.t * string | PaNativeInt of Loc.t * string
- | PaFlo of Loc.t * string | PaLab of Loc.t * string * patt
- | PaOlb of Loc.t * string * patt
- | PaOlbi of Loc.t * string * patt * expr
- | PaOrp of Loc.t * patt * patt | PaRng of Loc.t * patt * patt
- | PaRec of Loc.t * patt | PaEq of Loc.t * ident * patt
- | PaStr of Loc.t * string | PaTup of Loc.t * patt
- | PaTyc of Loc.t * patt * ctyp | PaTyp of Loc.t * ident
- | PaVrn of Loc.t * string
+ and ident =
+ | IdAcc of loc * ident * ident
+ | IdApp of loc * ident * ident
+ | IdLid of loc * string
+ | IdUid of loc * string
+ | IdAnt of loc * string
+ and ctyp =
+ | TyNil of loc
+ | TyAli of loc * ctyp * ctyp
+ | TyAny of loc
+ | TyApp of loc * ctyp * ctyp
+ | TyArr of loc * ctyp * ctyp
+ | TyCls of loc * ident
+ | TyLab of loc * string * ctyp
+ | TyId of loc * ident
+ | TyMan of loc * ctyp * ctyp
+ | TyDcl of loc * string * ctyp list * ctyp * (ctyp * ctyp) list
+ | TyObj of loc * ctyp * meta_bool
+ | TyOlb of loc * string * ctyp
+ | TyPol of loc * ctyp * ctyp
+ | TyQuo of loc * string
+ | TyQuP of loc * string
+ | TyQuM of loc * string
+ | TyVrn of loc * string
+ | TyRec of loc * ctyp
+ | TyCol of loc * ctyp * ctyp
+ | TySem of loc * ctyp * ctyp
+ | TyCom of loc * ctyp * ctyp
+ | TySum of loc * ctyp
+ | TyOf of loc * ctyp * ctyp
+ | TyAnd of loc * ctyp * ctyp
+ | TyOr of loc * ctyp * ctyp
+ | TyPrv of loc * ctyp
+ | TyMut of loc * ctyp
+ | TyTup of loc * ctyp
+ | TySta of loc * ctyp * ctyp
+ | TyVrnEq of loc * ctyp
+ | TyVrnSup of loc * ctyp
+ | TyVrnInf of loc * ctyp
+ | TyVrnInfSup of loc * ctyp * ctyp
+ | TyAmp of loc * ctyp * ctyp
+ | TyOfAmp of loc * ctyp * ctyp
+ | TyAnt of loc * string
+ and patt =
+ | PaNil of loc
+ | PaId of loc * ident
+ | PaAli of loc * patt * patt
+ | PaAnt of loc * string
+ | PaAny of loc
+ | PaApp of loc * patt * patt
+ | PaArr of loc * patt
+ | PaCom of loc * patt * patt
+ | PaSem of loc * patt * patt
+ | PaChr of loc * string
+ | PaInt of loc * string
+ | PaInt32 of loc * string
+ | PaInt64 of loc * string
+ | PaNativeInt of loc * string
+ | PaFlo of loc * string
+ | PaLab of loc * string * patt
+ | PaOlb of loc * string * patt
+ | PaOlbi of loc * string * patt * expr
+ | PaOrp of loc * patt * patt
+ | PaRng of loc * patt * patt
+ | PaRec of loc * patt
+ | PaEq of loc * ident * patt
+ | PaStr of loc * string
+ | PaTup of loc * patt
+ | PaTyc of loc * patt * ctyp
+ | PaTyp of loc * ident
+ | PaVrn of loc * string
and expr =
- | ExNil of Loc.t | ExId of Loc.t * ident
- | ExAcc of Loc.t * expr * expr | ExAnt of Loc.t * string
- | ExApp of Loc.t * expr * expr | ExAre of Loc.t * expr * expr
- | ExArr of Loc.t * expr | ExSem of Loc.t * expr * expr
- | ExAsf of Loc.t | ExAsr of Loc.t * expr
- | ExAss of Loc.t * expr * expr | ExChr of Loc.t * string
- | ExCoe of Loc.t * expr * ctyp * ctyp | ExFlo of Loc.t * string
- | ExFor of Loc.t * string * expr * expr * meta_bool * expr
- | ExFun of Loc.t * match_case | ExIfe of Loc.t * expr * expr * expr
- | ExInt of Loc.t * string | ExInt32 of Loc.t * string
- | ExInt64 of Loc.t * string | ExNativeInt of Loc.t * string
- | ExLab of Loc.t * string * expr | ExLaz of Loc.t * expr
- | ExLet of Loc.t * meta_bool * binding * expr
- | ExLmd of Loc.t * string * module_expr * expr
- | ExMat of Loc.t * expr * match_case | ExNew of Loc.t * ident
- | ExObj of Loc.t * patt * class_str_item
- | ExOlb of Loc.t * string * expr | ExOvr of Loc.t * rec_binding
- | ExRec of Loc.t * rec_binding * expr | ExSeq of Loc.t * expr
- | ExSnd of Loc.t * expr * string | ExSte of Loc.t * expr * expr
- | ExStr of Loc.t * string | ExTry of Loc.t * expr * match_case
- | ExTup of Loc.t * expr | ExCom of Loc.t * expr * expr
- | ExTyc of Loc.t * expr * ctyp | ExVrn of Loc.t * string
- | ExWhi of Loc.t * expr * expr
+ | ExNil of loc
+ | ExId of loc * ident
+ | ExAcc of loc * expr * expr
+ | ExAnt of loc * string
+ | ExApp of loc * expr * expr
+ | ExAre of loc * expr * expr
+ | ExArr of loc * expr
+ | ExSem of loc * expr * expr
+ | ExAsf of loc
+ | ExAsr of loc * expr
+ | ExAss of loc * expr * expr
+ | ExChr of loc * string
+ | ExCoe of loc * expr * ctyp * ctyp
+ | ExFlo of loc * string
+ | ExFor of loc * string * expr * expr * meta_bool * expr
+ | ExFun of loc * match_case
+ | ExIfe of loc * expr * expr * expr
+ | ExInt of loc * string
+ | ExInt32 of loc * string
+ | ExInt64 of loc * string
+ | ExNativeInt of loc * string
+ | ExLab of loc * string * expr
+ | ExLaz of loc * expr
+ | ExLet of loc * meta_bool * binding * expr
+ | ExLmd of loc * string * module_expr * expr
+ | ExMat of loc * expr * match_case
+ | ExNew of loc * ident
+ | ExObj of loc * patt * class_str_item
+ | ExOlb of loc * string * expr
+ | ExOvr of loc * rec_binding
+ | ExRec of loc * rec_binding * expr
+ | ExSeq of loc * expr
+ | ExSnd of loc * expr * string
+ | ExSte of loc * expr * expr
+ | ExStr of loc * string
+ | ExTry of loc * expr * match_case
+ | ExTup of loc * expr
+ | ExCom of loc * expr * expr
+ | ExTyc of loc * expr * ctyp
+ | ExVrn of loc * string
+ | ExWhi of loc * expr * expr
and module_type =
- | MtNil of Loc.t | MtId of Loc.t * ident
- | MtFun of Loc.t * string * module_type * module_type
- | MtQuo of Loc.t * string | MtSig of Loc.t * sig_item
- | MtWit of Loc.t * module_type * with_constr
- | MtAnt of Loc.t * string
+ | MtNil of loc
+ | MtId of loc * ident
+ | MtFun of loc * string * module_type * module_type
+ | MtQuo of loc * string
+ | MtSig of loc * sig_item
+ | MtWit of loc * module_type * with_constr
+ | MtAnt of loc * string
and sig_item =
- | SgNil of Loc.t | SgCls of Loc.t * class_type
- | SgClt of Loc.t * class_type
- | SgSem of Loc.t * sig_item * sig_item
- | SgDir of Loc.t * string * expr | SgExc of Loc.t * ctyp
- | SgExt of Loc.t * string * ctyp * string meta_list
- | SgInc of Loc.t * module_type
- | SgMod of Loc.t * string * module_type
- | SgRecMod of Loc.t * module_binding
- | SgMty of Loc.t * string * module_type | SgOpn of Loc.t * ident
- | SgTyp of Loc.t * ctyp | SgVal of Loc.t * string * ctyp
- | SgAnt of Loc.t * string
+ | SgNil of loc
+ | SgCls of loc * class_type
+ | SgClt of loc * class_type
+ | SgSem of loc * sig_item * sig_item
+ | SgDir of loc * string * expr
+ | SgExc of loc * ctyp
+ | SgExt of loc * string * ctyp * string meta_list
+ | SgInc of loc * module_type
+ | SgMod of loc * string * module_type
+ | SgRecMod of loc * module_binding
+ | SgMty of loc * string * module_type
+ | SgOpn of loc * ident
+ | SgTyp of loc * ctyp
+ | SgVal of loc * string * ctyp
+ | SgAnt of loc * string
and with_constr =
- | WcNil of Loc.t | WcTyp of Loc.t * ctyp * ctyp
- | WcMod of Loc.t * ident * ident
- | WcAnd of Loc.t * with_constr * with_constr
- | WcAnt of Loc.t * string
+ | WcNil of loc
+ | WcTyp of loc * ctyp * ctyp
+ | WcMod of loc * ident * ident
+ | WcAnd of loc * with_constr * with_constr
+ | WcAnt of loc * string
and binding =
- | BiNil of Loc.t | BiAnd of Loc.t * binding * binding
- | BiEq of Loc.t * patt * expr | BiAnt of Loc.t * string
+ | BiNil of loc
+ | BiAnd of loc * binding * binding
+ | BiEq of loc * patt * expr
+ | BiAnt of loc * string
and rec_binding =
- | RbNil of Loc.t | RbSem of Loc.t * rec_binding * rec_binding
- | RbEq of Loc.t * ident * expr | RbAnt of Loc.t * string
+ | RbNil of loc
+ | RbSem of loc * rec_binding * rec_binding
+ | RbEq of loc * ident * expr
+ | RbAnt of loc * string
and module_binding =
- | MbNil of Loc.t | MbAnd of Loc.t * module_binding * module_binding
- | MbColEq of Loc.t * string * module_type * module_expr
- | MbCol of Loc.t * string * module_type | MbAnt of Loc.t * string
+ | MbNil of loc
+ | MbAnd of loc * module_binding * module_binding
+ | MbColEq of loc * string * module_type * module_expr
+ | MbCol of loc * string * module_type
+ | MbAnt of loc * string
and match_case =
- | McNil of Loc.t | McOr of Loc.t * match_case * match_case
- | McArr of Loc.t * patt * expr * expr | McAnt of Loc.t * string
+ | McNil of loc
+ | McOr of loc * match_case * match_case
+ | McArr of loc * patt * expr * expr
+ | McAnt of loc * string
and module_expr =
- | MeNil of Loc.t | MeId of Loc.t * ident
- | MeApp of Loc.t * module_expr * module_expr
- | MeFun of Loc.t * string * module_type * module_expr
- | MeStr of Loc.t * str_item
- | MeTyc of Loc.t * module_expr * module_type
- | MeAnt of Loc.t * string
+ | MeNil of loc
+ | MeId of loc * ident
+ | MeApp of loc * module_expr * module_expr
+ | MeFun of loc * string * module_type * module_expr
+ | MeStr of loc * str_item
+ | MeTyc of loc * module_expr * module_type
+ | MeAnt of loc * string
and str_item =
- | StNil of Loc.t | StCls of Loc.t * class_expr
- | StClt of Loc.t * class_type
- | StSem of Loc.t * str_item * str_item
- | StDir of Loc.t * string * expr
- | StExc of Loc.t * ctyp * ident meta_option | StExp of Loc.t * expr
- | StExt of Loc.t * string * ctyp * string meta_list
- | StInc of Loc.t * module_expr
- | StMod of Loc.t * string * module_expr
- | StRecMod of Loc.t * module_binding
- | StMty of Loc.t * string * module_type | StOpn of Loc.t * ident
- | StTyp of Loc.t * ctyp | StVal of Loc.t * meta_bool * binding
- | StAnt of Loc.t * string
+ | StNil of loc
+ | StCls of loc * class_expr
+ | StClt of loc * class_type
+ | StSem of loc * str_item * str_item
+ | StDir of loc * string * expr
+ | StExc of loc * ctyp * ident meta_option
+ | StExp of loc * expr
+ | StExt of loc * string * ctyp * string meta_list
+ | StInc of loc * module_expr
+ | StMod of loc * string * module_expr
+ | StRecMod of loc * module_binding
+ | StMty of loc * string * module_type
+ | StOpn of loc * ident
+ | StTyp of loc * ctyp
+ | StVal of loc * meta_bool * binding
+ | StAnt of loc * string
and class_type =
- | CtNil of Loc.t | CtCon of Loc.t * meta_bool * ident * ctyp
- | CtFun of Loc.t * ctyp * class_type
- | CtSig of Loc.t * ctyp * class_sig_item
- | CtAnd of Loc.t * class_type * class_type
- | CtCol of Loc.t * class_type * class_type
- | CtEq of Loc.t * class_type * class_type | CtAnt of Loc.t * string
+ | CtNil of loc
+ | CtCon of loc * meta_bool * ident * ctyp
+ | CtFun of loc * ctyp * class_type
+ | CtSig of loc * ctyp * class_sig_item
+ | CtAnd of loc * class_type * class_type
+ | CtCol of loc * class_type * class_type
+ | CtEq of loc * class_type * class_type
+ | CtAnt of loc * string
and class_sig_item =
- | CgNil of Loc.t | CgCtr of Loc.t * ctyp * ctyp
- | CgSem of Loc.t * class_sig_item * class_sig_item
- | CgInh of Loc.t * class_type
- | CgMth of Loc.t * string * meta_bool * ctyp
- | CgVal of Loc.t * string * meta_bool * meta_bool * ctyp
- | CgVir of Loc.t * string * meta_bool * ctyp
- | CgAnt of Loc.t * string
+ | CgNil of loc
+ | CgCtr of loc * ctyp * ctyp
+ | CgSem of loc * class_sig_item * class_sig_item
+ | CgInh of loc * class_type
+ | CgMth of loc * string * meta_bool * ctyp
+ | CgVal of loc * string * meta_bool * meta_bool * ctyp
+ | CgVir of loc * string * meta_bool * ctyp
+ | CgAnt of loc * string
and class_expr =
- | CeNil of Loc.t | CeApp of Loc.t * class_expr * expr
- | CeCon of Loc.t * meta_bool * ident * ctyp
- | CeFun of Loc.t * patt * class_expr
- | CeLet of Loc.t * meta_bool * binding * class_expr
- | CeStr of Loc.t * patt * class_str_item
- | CeTyc of Loc.t * class_expr * class_type
- | CeAnd of Loc.t * class_expr * class_expr
- | CeEq of Loc.t * class_expr * class_expr | CeAnt of Loc.t * string
+ | CeNil of loc
+ | CeApp of loc * class_expr * expr
+ | CeCon of loc * meta_bool * ident * ctyp
+ | CeFun of loc * patt * class_expr
+ | CeLet of loc * meta_bool * binding * class_expr
+ | CeStr of loc * patt * class_str_item
+ | CeTyc of loc * class_expr * class_type
+ | CeAnd of loc * class_expr * class_expr
+ | CeEq of loc * class_expr * class_expr
+ | CeAnt of loc * string
and class_str_item =
- | CrNil of Loc.t | CrSem of Loc.t * class_str_item * class_str_item
- | CrCtr of Loc.t * ctyp * ctyp
- | CrInh of Loc.t * class_expr * string | CrIni of Loc.t * expr
- | CrMth of Loc.t * string * meta_bool * expr * ctyp
- | CrVal of Loc.t * string * meta_bool * expr
- | CrVir of Loc.t * string * meta_bool * ctyp
- | CrVvr of Loc.t * string * meta_bool * ctyp
- | CrAnt of Loc.t * string
+ | CrNil of loc
+ | CrSem of loc * class_str_item * class_str_item
+ | CrCtr of loc * ctyp * ctyp
+ | CrInh of loc * class_expr * string
+ | CrIni of loc * expr
+ | CrMth of loc * string * meta_bool * expr * ctyp
+ | CrVal of loc * string * meta_bool * expr
+ | CrVir of loc * string * meta_bool * ctyp
+ | CrVvr of loc * string * meta_bool * ctyp
+ | CrAnt of loc * string
+
end
+
+ type ('a, 'loc) stream_filter =
+ ('a * 'loc) Stream.t -> ('a * 'loc) Stream.t
+
module type AstFilters =
sig
module Ast : Camlp4Ast
+
type 'a filter = 'a -> 'a
+
val register_sig_item_filter : Ast.sig_item filter -> unit
+
val register_str_item_filter : Ast.str_item filter -> unit
+
val fold_interf_filters :
('a -> Ast.sig_item filter -> 'a) -> 'a -> 'a
+
val fold_implem_filters :
('a -> Ast.str_item filter -> 'a) -> 'a -> 'a
+
end
+
module type DynAst =
sig
module Ast : Ast
+
type 'a tag
+
val ctyp_tag : Ast.ctyp tag
+
val patt_tag : Ast.patt tag
+
val expr_tag : Ast.expr tag
+
val module_type_tag : Ast.module_type tag
+
val sig_item_tag : Ast.sig_item tag
+
val with_constr_tag : Ast.with_constr tag
+
val module_expr_tag : Ast.module_expr tag
+
val str_item_tag : Ast.str_item tag
+
val class_type_tag : Ast.class_type tag
+
val class_sig_item_tag : Ast.class_sig_item tag
+
val class_expr_tag : Ast.class_expr tag
+
val class_str_item_tag : Ast.class_str_item tag
+
val match_case_tag : Ast.match_case tag
+
val ident_tag : Ast.ident tag
+
val binding_tag : Ast.binding tag
+
val rec_binding_tag : Ast.rec_binding tag
+
val module_binding_tag : Ast.module_binding tag
+
val string_of_tag : 'a tag -> string
- module Pack (X : sig type 'a t end) :
+
+ module Pack (X : sig type 'a t
+ end) :
sig
type pack
+
val pack : 'a tag -> 'a X.t -> pack
+
val unpack : 'a tag -> pack -> 'a X.t
+
val print_tag : Format.formatter -> pack -> unit
+
end
+
end
+
type quotation =
{ q_name : string; q_loc : string; q_shift : int; q_contents : string
}
+
module type Quotation =
sig
module Ast : Ast
+
module DynAst : DynAst with module Ast = Ast
+
open Ast
- type 'a expand_fun = Loc.t -> string option -> string -> 'a
+
+ type 'a expand_fun = loc -> string option -> string -> 'a
+
val add : string -> 'a DynAst.tag -> 'a expand_fun -> unit
+
val find : string -> 'a DynAst.tag -> 'a expand_fun
+
val default : string ref
+
val parse_quotation_result :
- (Loc.t -> string -> 'a) ->
- Loc.t -> quotation -> string -> string -> 'a
+ (loc -> string -> 'a) -> loc -> quotation -> string -> string -> 'a
+
val translate : (string -> string) ref
- val expand : Loc.t -> quotation -> 'a DynAst.tag -> 'a
+
+ val expand : loc -> quotation -> 'a DynAst.tag -> 'a
+
val dump_file : (string option) ref
+
module Error : Error
+
end
- type ('a, 'loc) stream_filter =
- ('a * 'loc) Stream.t -> ('a * 'loc) Stream.t
+
module type Token =
sig
module Loc : Loc
+
type t
+
val to_string : t -> string
+
val print : Format.formatter -> t -> unit
+
val match_keyword : string -> t -> bool
+
val extract_string : t -> string
+
module Filter :
sig
type token_filter = (t, Loc.t) stream_filter
+
type t
+
val mk : (string -> bool) -> t
+
val define_filter : t -> (token_filter -> token_filter) -> unit
+
val filter : t -> token_filter
+
val keyword_added : t -> string -> bool -> unit
+
val keyword_removed : t -> string -> unit
+
end
+
module Error : Error
+
end
+
type camlp4_token =
- | KEYWORD of string | SYMBOL of string | LIDENT of string
- | UIDENT of string | ESCAPED_IDENT of string | INT of int * string
- | INT32 of int32 * string | INT64 of int64 * string
- | NATIVEINT of nativeint * string | FLOAT of float * string
- | CHAR of char * string | STRING of string * string | LABEL of string
- | OPTLABEL of string | QUOTATION of quotation
- | ANTIQUOT of string * string | COMMENT of string | BLANKS of string
- | NEWLINE | LINE_DIRECTIVE of int * string option | EOI
+ | KEYWORD of string
+ | SYMBOL of string
+ | LIDENT of string
+ | UIDENT of string
+ | ESCAPED_IDENT of string
+ | INT of int * string
+ | INT32 of int32 * string
+ | INT64 of int64 * string
+ | NATIVEINT of nativeint * string
+ | FLOAT of float * string
+ | CHAR of char * string
+ | STRING of string * string
+ | LABEL of string
+ | OPTLABEL of string
+ | QUOTATION of quotation
+ | ANTIQUOT of string * string
+ | COMMENT of string
+ | BLANKS of string
+ | NEWLINE
+ | LINE_DIRECTIVE of int * string option
+ | EOI
+
module type Camlp4Token = Token with type t = camlp4_token
+
module type DynLoader =
sig
type t
+
exception Error of string * string
+
val mk : ?ocaml_stdlib: bool -> ?camlp4_stdlib: bool -> unit -> t
+
val fold_load_path : t -> (string -> 'a -> 'a) -> 'a -> 'a
+
val load : t -> string -> unit
+
val include_dir : t -> string -> unit
+
val find_in_path : t -> string -> string
+
end
+
module Grammar =
struct
module type Action =
sig
type t
+
val mk : 'a -> t
+
val get : t -> 'a
+
val getf : t -> 'a -> 'b
+
val getf2 : t -> 'a -> 'b -> 'c
+
end
+
type assoc = | NonA | RightA | LeftA
+
type position =
- | First | Last | Before of string | After of string
+ | First
+ | Last
+ | Before of string
+ | After of string
| Level of string
+
module type Structure =
sig
module Loc : Loc
+
module Action : Action
+
module Token : Token with module Loc = Loc
+
type gram
+
type internal_entry
+
type tree
+
type token_pattern = ((Token.t -> bool) * string)
+
type symbol =
| Smeta of string * symbol list * Action.t
- | Snterm of internal_entry | Snterml of internal_entry * string
- | Slist0 of symbol | Slist0sep of symbol * symbol
- | Slist1 of symbol | Slist1sep of symbol * symbol
- | Sopt of symbol | Sself | Snext | Stoken of token_pattern
- | Skeyword of string | Stree of tree
+ | Snterm of internal_entry
+ | Snterml of internal_entry * string
+ | Slist0 of symbol
+ | Slist0sep of symbol * symbol
+ | Slist1 of symbol
+ | Slist1sep of symbol * symbol
+ | Sopt of symbol
+ | Sself
+ | Snext
+ | Stoken of token_pattern
+ | Skeyword of string
+ | Stree of tree
+
type production_rule = ((symbol list) * Action.t)
+
type single_extend_statment =
((string option) * (assoc option) * (production_rule list))
+
type extend_statment =
((position option) * (single_extend_statment list))
+
type delete_statment = symbol list
+
type ('a, 'b, 'c) fold =
internal_entry ->
symbol list -> ('a Stream.t -> 'b) -> 'a Stream.t -> 'c
+
type ('a, 'b, 'c) foldsep =
internal_entry ->
symbol list ->
('a Stream.t -> 'b) ->
('a Stream.t -> unit) -> 'a Stream.t -> 'c
+
end
+
module type Dynamic =
sig
include Structure
+
val mk : unit -> gram
+
module Entry :
sig
type 'a t
+
val mk : gram -> string -> 'a t
+
val of_parser :
gram ->
string -> ((Token.t * Loc.t) Stream.t -> 'a) -> 'a t
+
val setup_parser :
'a t -> ((Token.t * Loc.t) Stream.t -> 'a) -> unit
+
val name : 'a t -> string
+
val print : Format.formatter -> 'a t -> unit
+
val dump : Format.formatter -> 'a t -> unit
+
val obj : 'a t -> internal_entry
+
val clear : 'a t -> unit
+
end
+
val get_filter : gram -> Token.Filter.t
+
type 'a not_filtered
+
val extend : 'a Entry.t -> extend_statment -> unit
+
val delete_rule : 'a Entry.t -> delete_statment -> unit
+
val srules :
'a Entry.t -> ((symbol list) * Action.t) list -> symbol
+
val sfold0 : ('a -> 'b -> 'b) -> 'b -> (_, 'a, 'b) fold
+
val sfold1 : ('a -> 'b -> 'b) -> 'b -> (_, 'a, 'b) fold
+
val sfold0sep : ('a -> 'b -> 'b) -> 'b -> (_, 'a, 'b) foldsep
+
val lex :
gram ->
Loc.t ->
char Stream.t -> ((Token.t * Loc.t) Stream.t) not_filtered
+
val lex_string :
gram ->
Loc.t -> string -> ((Token.t * Loc.t) Stream.t) not_filtered
+
val filter :
gram ->
((Token.t * Loc.t) Stream.t) not_filtered ->
(Token.t * Loc.t) Stream.t
+
val parse : 'a Entry.t -> Loc.t -> char Stream.t -> 'a
+
val parse_string : 'a Entry.t -> Loc.t -> string -> 'a
+
val parse_tokens_before_filter :
'a Entry.t -> ((Token.t * Loc.t) Stream.t) not_filtered -> 'a
+
val parse_tokens_after_filter :
'a Entry.t -> (Token.t * Loc.t) Stream.t -> 'a
+
end
+
module type Static =
sig
include Structure
+
module Entry :
sig
type 'a t
+
val mk : string -> 'a t
+
val of_parser :
string -> ((Token.t * Loc.t) Stream.t -> 'a) -> 'a t
+
val setup_parser :
'a t -> ((Token.t * Loc.t) Stream.t -> 'a) -> unit
+
val name : 'a t -> string
+
val print : Format.formatter -> 'a t -> unit
+
val dump : Format.formatter -> 'a t -> unit
+
val obj : 'a t -> internal_entry
+
val clear : 'a t -> unit
+
end
+
val get_filter : unit -> Token.Filter.t
+
type 'a not_filtered
+
val extend : 'a Entry.t -> extend_statment -> unit
+
val delete_rule : 'a Entry.t -> delete_statment -> unit
+
val srules :
'a Entry.t -> ((symbol list) * Action.t) list -> symbol
+
val sfold0 : ('a -> 'b -> 'b) -> 'b -> (_, 'a, 'b) fold
+
val sfold1 : ('a -> 'b -> 'b) -> 'b -> (_, 'a, 'b) fold
+
val sfold0sep : ('a -> 'b -> 'b) -> 'b -> (_, 'a, 'b) foldsep
+
val lex :
Loc.t ->
char Stream.t -> ((Token.t * Loc.t) Stream.t) not_filtered
+
val lex_string :
Loc.t -> string -> ((Token.t * Loc.t) Stream.t) not_filtered
+
val filter :
((Token.t * Loc.t) Stream.t) not_filtered ->
(Token.t * Loc.t) Stream.t
+
val parse : 'a Entry.t -> Loc.t -> char Stream.t -> 'a
+
val parse_string : 'a Entry.t -> Loc.t -> string -> 'a
+
val parse_tokens_before_filter :
'a Entry.t -> ((Token.t * Loc.t) Stream.t) not_filtered -> 'a
+
val parse_tokens_after_filter :
'a Entry.t -> (Token.t * Loc.t) Stream.t -> 'a
+
end
+
end
+
module type Lexer =
sig
module Loc : Loc
+
module Token : Token with module Loc = Loc
+
module Error : Error
+
val mk : unit -> Loc.t -> char Stream.t -> (Token.t * Loc.t) Stream.t
+
end
+
module Parser (Ast : Ast) =
struct
+ module type SIMPLE =
+ sig
+ val parse_expr : Ast.loc -> string -> Ast.expr
+
+ val parse_patt : Ast.loc -> string -> Ast.patt
+
+ end
+
module type S =
sig
val parse_implem :
?directive_handler: (Ast.str_item -> Ast.str_item option) ->
- Ast.Loc.t -> char Stream.t -> Ast.str_item
+ Ast.loc -> char Stream.t -> Ast.str_item
+
val parse_interf :
?directive_handler: (Ast.sig_item -> Ast.sig_item option) ->
- Ast.Loc.t -> char Stream.t -> Ast.sig_item
+ Ast.loc -> char Stream.t -> Ast.sig_item
+
end
+
end
+
module Printer (Ast : Ast) =
struct
module type S =
val print_interf :
?input_file: string ->
?output_file: string -> Ast.sig_item -> unit
+
val print_implem :
?input_file: string ->
?output_file: string -> Ast.str_item -> unit
+
end
+
end
+
module type Syntax =
sig
module Loc : Loc
- module Ast : Ast with module Loc = Loc
+
+ module Ast : Ast with type loc = Loc.t
+
module Token : Token with module Loc = Loc
+
module Gram : Grammar.Static with module Loc = Loc
and module Token = Token
- module AntiquotSyntax : AntiquotSyntax with module Ast = Ast
+
module Quotation : Quotation with module Ast = Ast
+
+ module AntiquotSyntax : Parser(Ast).SIMPLE
+
include Warning(Loc).S
+
include Parser(Ast).S
+
include Printer(Ast).S
+
end
+
module type Camlp4Syntax =
sig
module Loc : Loc
+
module Ast : Camlp4Ast with module Loc = Loc
+
module Token : Camlp4Token with module Loc = Loc
+
module Gram : Grammar.Static with module Loc = Loc
and module Token = Token
- module AntiquotSyntax :
- AntiquotSyntax with module Ast = Camlp4AstToAst(Ast)
+
module Quotation : Quotation with module Ast = Camlp4AstToAst(Ast)
+
+ module AntiquotSyntax : Parser(Ast).SIMPLE
+
include Warning(Loc).S
+
include Parser(Ast).S
+
include Printer(Ast).S
+
val interf : ((Ast.sig_item list) * (Loc.t option)) Gram.Entry.t
+
val implem : ((Ast.str_item list) * (Loc.t option)) Gram.Entry.t
+
val top_phrase : (Ast.str_item option) Gram.Entry.t
+
val use_file : ((Ast.str_item list) * (Loc.t option)) Gram.Entry.t
+
val a_CHAR : string Gram.Entry.t
+
val a_FLOAT : string Gram.Entry.t
+
val a_INT : string Gram.Entry.t
+
val a_INT32 : string Gram.Entry.t
+
val a_INT64 : string Gram.Entry.t
+
val a_LABEL : string Gram.Entry.t
+
val a_LIDENT : string Gram.Entry.t
+
val a_NATIVEINT : string Gram.Entry.t
+
val a_OPTLABEL : string Gram.Entry.t
+
val a_STRING : string Gram.Entry.t
+
val a_UIDENT : string Gram.Entry.t
+
val a_ident : string Gram.Entry.t
+
val amp_ctyp : Ast.ctyp Gram.Entry.t
+
val and_ctyp : Ast.ctyp Gram.Entry.t
+
val match_case : Ast.match_case Gram.Entry.t
+
val match_case0 : Ast.match_case Gram.Entry.t
+
val match_case_quot : Ast.match_case Gram.Entry.t
+
val binding : Ast.binding Gram.Entry.t
+
val binding_quot : Ast.binding Gram.Entry.t
+
val rec_binding_quot : Ast.rec_binding Gram.Entry.t
+
val class_declaration : Ast.class_expr Gram.Entry.t
+
val class_description : Ast.class_type Gram.Entry.t
+
val class_expr : Ast.class_expr Gram.Entry.t
+
val class_expr_quot : Ast.class_expr Gram.Entry.t
+
val class_fun_binding : Ast.class_expr Gram.Entry.t
+
val class_fun_def : Ast.class_expr Gram.Entry.t
+
val class_info_for_class_expr : Ast.class_expr Gram.Entry.t
+
val class_info_for_class_type : Ast.class_type Gram.Entry.t
+
val class_longident : Ast.ident Gram.Entry.t
+
val class_longident_and_param : Ast.class_expr Gram.Entry.t
+
val class_name_and_param : (string * Ast.ctyp) Gram.Entry.t
+
val class_sig_item : Ast.class_sig_item Gram.Entry.t
+
val class_sig_item_quot : Ast.class_sig_item Gram.Entry.t
+
val class_signature : Ast.class_sig_item Gram.Entry.t
+
val class_str_item : Ast.class_str_item Gram.Entry.t
+
val class_str_item_quot : Ast.class_str_item Gram.Entry.t
+
val class_structure : Ast.class_str_item Gram.Entry.t
+
val class_type : Ast.class_type Gram.Entry.t
+
val class_type_declaration : Ast.class_type Gram.Entry.t
+
val class_type_longident : Ast.ident Gram.Entry.t
+
val class_type_longident_and_param : Ast.class_type Gram.Entry.t
+
val class_type_plus : Ast.class_type Gram.Entry.t
+
val class_type_quot : Ast.class_type Gram.Entry.t
+
val comma_ctyp : Ast.ctyp Gram.Entry.t
+
val comma_expr : Ast.expr Gram.Entry.t
+
val comma_ipatt : Ast.patt Gram.Entry.t
+
val comma_patt : Ast.patt Gram.Entry.t
+
val comma_type_parameter : Ast.ctyp Gram.Entry.t
+
val constrain : (Ast.ctyp * Ast.ctyp) Gram.Entry.t
+
val constructor_arg_list : Ast.ctyp Gram.Entry.t
+
val constructor_declaration : Ast.ctyp Gram.Entry.t
+
val constructor_declarations : Ast.ctyp Gram.Entry.t
+
val ctyp : Ast.ctyp Gram.Entry.t
+
val ctyp_quot : Ast.ctyp Gram.Entry.t
+
val cvalue_binding : Ast.expr Gram.Entry.t
+
val direction_flag : Ast.meta_bool Gram.Entry.t
+
val dummy : unit Gram.Entry.t
+
val eq_expr : (string -> Ast.patt -> Ast.patt) Gram.Entry.t
+
val expr : Ast.expr Gram.Entry.t
+
val expr_eoi : Ast.expr Gram.Entry.t
+
val expr_quot : Ast.expr Gram.Entry.t
+
val field_expr : Ast.rec_binding Gram.Entry.t
+
val fun_binding : Ast.expr Gram.Entry.t
+
val fun_def : Ast.expr Gram.Entry.t
+
val ident : Ast.ident Gram.Entry.t
+
val ident_quot : Ast.ident Gram.Entry.t
+
val ipatt : Ast.patt Gram.Entry.t
+
val ipatt_tcon : Ast.patt Gram.Entry.t
+
val label : string Gram.Entry.t
+
val label_declaration : Ast.ctyp Gram.Entry.t
+
val label_expr : Ast.rec_binding Gram.Entry.t
+
val label_ipatt : Ast.patt Gram.Entry.t
+
val label_longident : Ast.ident Gram.Entry.t
+
val label_patt : Ast.patt Gram.Entry.t
+
val labeled_ipatt : Ast.patt Gram.Entry.t
+
val let_binding : Ast.binding Gram.Entry.t
+
val meth_list : Ast.ctyp Gram.Entry.t
+
val module_binding : Ast.module_binding Gram.Entry.t
+
val module_binding0 : Ast.module_expr Gram.Entry.t
+
val module_binding_quot : Ast.module_binding Gram.Entry.t
+
val module_declaration : Ast.module_type Gram.Entry.t
+
val module_expr : Ast.module_expr Gram.Entry.t
+
val module_expr_quot : Ast.module_expr Gram.Entry.t
+
val module_longident : Ast.ident Gram.Entry.t
+
val module_longident_with_app : Ast.ident Gram.Entry.t
+
val module_rec_declaration : Ast.module_binding Gram.Entry.t
+
val module_type : Ast.module_type Gram.Entry.t
+
val module_type_quot : Ast.module_type Gram.Entry.t
+
val more_ctyp : Ast.ctyp Gram.Entry.t
+
val name_tags : Ast.ctyp Gram.Entry.t
+
val opt_as_lident : string Gram.Entry.t
+
val opt_class_self_patt : Ast.patt Gram.Entry.t
+
val opt_class_self_type : Ast.ctyp Gram.Entry.t
+
val opt_comma_ctyp : Ast.ctyp Gram.Entry.t
+
val opt_dot_dot : Ast.meta_bool Gram.Entry.t
+
val opt_eq_ctyp : Ast.ctyp Gram.Entry.t
+
val opt_expr : Ast.expr Gram.Entry.t
+
val opt_meth_list : Ast.ctyp Gram.Entry.t
+
val opt_mutable : Ast.meta_bool Gram.Entry.t
+
val opt_polyt : Ast.ctyp Gram.Entry.t
+
val opt_private : Ast.meta_bool Gram.Entry.t
+
val opt_rec : Ast.meta_bool Gram.Entry.t
+
val opt_virtual : Ast.meta_bool Gram.Entry.t
+
val opt_when_expr : Ast.expr Gram.Entry.t
+
val patt : Ast.patt Gram.Entry.t
+
val patt_as_patt_opt : Ast.patt Gram.Entry.t
+
val patt_eoi : Ast.patt Gram.Entry.t
+
val patt_quot : Ast.patt Gram.Entry.t
+
val patt_tcon : Ast.patt Gram.Entry.t
+
val phrase : Ast.str_item Gram.Entry.t
+
val poly_type : Ast.ctyp Gram.Entry.t
+
val row_field : Ast.ctyp Gram.Entry.t
+
val sem_expr : Ast.expr Gram.Entry.t
+
val sem_expr_for_list : (Ast.expr -> Ast.expr) Gram.Entry.t
+
val sem_patt : Ast.patt Gram.Entry.t
+
val sem_patt_for_list : (Ast.patt -> Ast.patt) Gram.Entry.t
+
val semi : unit Gram.Entry.t
+
val sequence : Ast.expr Gram.Entry.t
+
val do_sequence : Ast.expr Gram.Entry.t
+
val sig_item : Ast.sig_item Gram.Entry.t
+
val sig_item_quot : Ast.sig_item Gram.Entry.t
+
val sig_items : Ast.sig_item Gram.Entry.t
+
val star_ctyp : Ast.ctyp Gram.Entry.t
+
val str_item : Ast.str_item Gram.Entry.t
+
val str_item_quot : Ast.str_item Gram.Entry.t
+
val str_items : Ast.str_item Gram.Entry.t
+
val type_constraint : unit Gram.Entry.t
+
val type_declaration : Ast.ctyp Gram.Entry.t
+
val type_ident_and_parameters :
(string * (Ast.ctyp list)) Gram.Entry.t
+
val type_kind : Ast.ctyp Gram.Entry.t
+
val type_longident : Ast.ident Gram.Entry.t
+
val type_longident_and_parameters : Ast.ctyp Gram.Entry.t
+
val type_parameter : Ast.ctyp Gram.Entry.t
+
val type_parameters : (Ast.ctyp -> Ast.ctyp) Gram.Entry.t
+
val typevars : Ast.ctyp Gram.Entry.t
+
val val_longident : Ast.ident Gram.Entry.t
+
val value_let : unit Gram.Entry.t
+
val value_val : unit Gram.Entry.t
+
val with_constr : Ast.with_constr Gram.Entry.t
+
val with_constr_quot : Ast.with_constr Gram.Entry.t
+
val prefixop : Ast.expr Gram.Entry.t
+
val infixop0 : Ast.expr Gram.Entry.t
+
val infixop1 : Ast.expr Gram.Entry.t
+
val infixop2 : Ast.expr Gram.Entry.t
+
val infixop3 : Ast.expr Gram.Entry.t
+
val infixop4 : Ast.expr Gram.Entry.t
+
end
+
module type SyntaxExtension =
functor (Syn : Syntax) -> Syntax with module Loc = Syn.Loc
and module Ast = Syn.Ast and module Token = Syn.Token
- and module Gram = Syn.Gram
- and module AntiquotSyntax = Syn.AntiquotSyntax
- and module Quotation = Syn.Quotation
+ and module Gram = Syn.Gram and module Quotation = Syn.Quotation
+
end
+
module ErrorHandler :
sig
val print : Format.formatter -> exn -> unit
+
val try_print : Format.formatter -> exn -> unit
+
val to_string : exn -> string
+
val try_to_string : exn -> string
+
val register : (Format.formatter -> exn -> unit) -> unit
+
module Register (Error : Sig.Error) : sig end
+
module ObjTools :
sig
val print : Format.formatter -> Obj.t -> unit
+
val print_desc : Format.formatter -> Obj.t -> unit
+
val to_string : Obj.t -> string
+
val desc : Obj.t -> string
+
end
+
end =
struct
open Format
+
module ObjTools =
struct
let desc obj =
if Obj.is_block obj
then "tag = " ^ (string_of_int (Obj.tag obj))
else "int_val = " ^ (string_of_int (Obj.obj obj))
+
let rec to_string r =
if Obj.is_int r
then
failwith
("ObjTools.to_string: unknown tag (" ^
((string_of_int t) ^ ")")))
+
let print ppf x = fprintf ppf "%s" (to_string x)
+
let print_desc ppf x = fprintf ppf "%s" (desc x)
+
end
+
let default_handler ppf x =
let x = Obj.repr x
in
pp_print_char ppf ')')
else ();
fprintf ppf "@.")
+
let handler =
ref (fun ppf default_handler exn -> default_handler ppf exn)
+
let register f =
let current_handler = !handler
in
fun ppf default_handler exn ->
try f ppf exn
with | exn -> current_handler ppf default_handler exn
+
module Register (Error : Sig.Error) =
struct
let _ =
function
| Error.E x -> Error.print ppf x
| x -> current_handler ppf default_handler x
+
end
+
let gen_print ppf default_handler =
function
| Out_of_memory -> fprintf ppf "Out of memory"
| Stream.Failure -> fprintf ppf "Parse failure"
| Stream.Error str -> fprintf ppf "Parse error: %s" str
| x -> !handler ppf default_handler x
+
let print ppf = gen_print ppf default_handler
+
let try_print ppf = gen_print ppf (fun _ -> raise)
+
let to_string exn =
let buf = Buffer.create 128 in
let () = bprintf buf "%a" print exn in Buffer.contents buf
+
let try_to_string exn =
let buf = Buffer.create 128 in
let () = bprintf buf "%a" try_print exn in Buffer.contents buf
+
end
+
module Struct =
struct
- module Loc : sig include Sig.Loc end =
+ module Loc : sig include Sig.Loc
+ end =
struct
open Format
+
type pos = { line : int; bol : int; off : int }
+
type t =
{ file_name : string; start : pos; stop : pos; ghost : bool
}
+
let dump_sel f x =
let s =
match x with
| `both -> "`both"
| _ -> "<not-printable>"
in pp_print_string f s
+
let dump_pos f x =
fprintf f "@[<hov 2>{ line = %d ;@ bol = %d ;@ off = %d } : pos@]"
x.line x.bol x.off
+
let dump_long f x =
fprintf f
"@[<hov 2>{ file_name = %s ;@ start = %a (%d-%d);@ stop = %a (%d);@ ghost = %b@ } : Loc.t@]"
x.file_name dump_pos x.start (x.start.off - x.start.bol)
(x.stop.off - x.start.bol) dump_pos x.stop
(x.stop.off - x.stop.bol) x.ghost
+
let dump f x =
fprintf f "[%S: %d:%d-%d %d:%d%t]" x.file_name x.start.line
(x.start.off - x.start.bol) (x.stop.off - x.start.bol)
x.stop.line (x.stop.off - x.stop.bol)
(fun o -> if x.ghost then fprintf o " (ghost)" else ())
+
let start_pos = { line = 1; bol = 0; off = 0; }
+
let ghost =
{
file_name = "ghost-location";
stop = start_pos;
ghost = true;
}
+
let mk file_name =
{
file_name = file_name;
stop = start_pos;
ghost = false;
}
+
let of_tuple (file_name, start_line, start_bol, start_off, stop_line,
stop_bol, stop_off, ghost)
=
stop = { line = stop_line; bol = stop_bol; off = stop_off; };
ghost = ghost;
}
+
let to_tuple {
file_name = file_name;
start =
} =
(file_name, start_line, start_bol, start_off, stop_line, stop_bol,
stop_off, ghost)
+
let pos_of_lexing_position p =
let pos =
{
off = p.Lexing.pos_cnum;
}
in pos
+
let pos_to_lexing_position p file_name =
{
Lexing.pos_fname = file_name;
pos_bol = p.bol;
pos_cnum = p.off;
}
+
let better_file_name a b =
match (a, b) with
| ("", "") -> a
| ("-", x) -> x
| (x, "-") -> x
| (x, _) -> x
+
let of_lexbuf lb =
let start = Lexing.lexeme_start_p lb
and stop = Lexing.lexeme_end_p lb in
ghost = false;
}
in loc
+
let of_lexing_position pos =
let loc =
{
ghost = false;
}
in loc
+
let to_ocaml_location x =
{
- Location.loc_start = pos_to_lexing_position x.start x.file_name;
+ Camlp4_import.Location.loc_start =
+ pos_to_lexing_position x.start x.file_name;
loc_end = pos_to_lexing_position x.stop x.file_name;
loc_ghost = x.ghost;
}
- let of_ocaml_location x =
- let (a, b) = ((x.Location.loc_start), (x.Location.loc_end)) in
+
+ let of_ocaml_location {
+ Camlp4_import.Location.loc_start = a;
+ loc_end = b;
+ loc_ghost = g
+ } =
let res =
{
file_name =
better_file_name a.Lexing.pos_fname b.Lexing.pos_fname;
start = pos_of_lexing_position a;
stop = pos_of_lexing_position b;
- ghost = x.Location.loc_ghost;
+ ghost = g;
}
in res
+
let start_pos x = pos_to_lexing_position x.start x.file_name
+
let stop_pos x = pos_to_lexing_position x.stop x.file_name
+
let merge a b =
if a == b
then a
| (true, _) -> { (a) with stop = b.stop; }
| (_, true) -> { (b) with start = a.start; }
in r)
+
let join x = { (x) with stop = x.start; }
+
let map f start_stop_both x =
match start_stop_both with
| `start -> { (x) with start = f x.start; }
| `stop -> { (x) with stop = f x.stop; }
| `both -> { (x) with start = f x.start; stop = f x.stop; }
+
let move_pos chars x = { (x) with off = x.off + chars; }
+
let move s chars x = map (move_pos chars) s x
+
let move_line lines x =
let move_line_pos x =
{ (x) with line = x.line + lines; bol = x.off; }
in map move_line_pos `both x
+
let shift width x =
{ (x) with start = x.stop; stop = move_pos width x.stop; }
+
let file_name x = x.file_name
+
let start_line x = x.start.line
+
let stop_line x = x.stop.line
+
let start_bol x = x.start.bol
+
let stop_bol x = x.stop.bol
+
let start_off x = x.start.off
+
let stop_off x = x.stop.off
+
let is_ghost x = x.ghost
+
let set_file_name s x = { (x) with file_name = s; }
+
let ghostify x = { (x) with ghost = true; }
+
let make_absolute x =
let pwd = Sys.getcwd ()
in
if Filename.is_relative x.file_name
then { (x) with file_name = Filename.concat pwd x.file_name; }
else x
+
let strictly_before x y =
let b = (x.stop.off < y.start.off) && (x.file_name = y.file_name)
in b
+
let to_string x =
let (a, b) = ((x.start), (x.stop)) in
let res =
sprintf "%s (end at line %d, character %d)" res x.stop.line
(b.off - b.bol)
else res
+
let print out x = pp_print_string out (to_string x)
+
let check x msg =
if
((start_line x) > (stop_line x)) ||
print x;
false)
else true
+
exception Exc_located of t * exn
+
let _ =
ErrorHandler.register
(fun ppf ->
| Exc_located (loc, exn) ->
fprintf ppf "%a:@\n%a" print loc ErrorHandler.print exn
| exn -> raise exn)
+
let name = ref "_loc"
+
let raise loc exc =
match exc with
| Exc_located (_, _) -> raise exc
| _ -> raise (Exc_located (loc, exc))
+
end
+
module Token :
sig
module Make (Loc : Sig.Loc) : Sig.Camlp4Token with module Loc = Loc
+
module Eval :
sig
val char : string -> char
+
val string : ?strict: unit -> string -> string
+
end
+
end =
struct
open Format
+
module Make (Loc : Sig.Loc) : Sig.Camlp4Token with module Loc = Loc =
struct
module Loc = Loc
+
open Sig
+
type t = camlp4_token
+
type token = t
+
let to_string =
function
| KEYWORD s -> sprintf "KEYWORD %S" s
| LINE_DIRECTIVE (i, None) -> sprintf "LINE_DIRECTIVE %d" i
| LINE_DIRECTIVE (i, (Some s)) ->
sprintf "LINE_DIRECTIVE %d %S" i s
+
let print ppf x = pp_print_string ppf (to_string x)
+
let match_keyword kwd =
function | KEYWORD kwd' when kwd = kwd' -> true | _ -> false
+
let extract_string =
function
| KEYWORD s | SYMBOL s | LIDENT s | UIDENT s | INT (_, s) |
invalid_arg
("Cannot extract a string from this token: " ^
(to_string tok))
+
module Error =
struct
type t =
- | Illegal_token of string | Keyword_as_label of string
+ | Illegal_token of string
+ | Keyword_as_label of string
| Illegal_token_pattern of string * string
| Illegal_constructor of string
+
exception E of t
+
let print ppf =
function
| Illegal_token s -> fprintf ppf "Illegal token (%s)" s
fprintf ppf "Illegal token pattern: %s %S" p_con p_prm
| Illegal_constructor con ->
fprintf ppf "Illegal constructor %S" con
+
let to_string x =
let b = Buffer.create 50 in
let () = bprintf b "%a" print x in Buffer.contents b
+
end
+
let _ = let module M = ErrorHandler.Register(Error) in ()
+
module Filter =
struct
type token_filter = (t, Loc.t) stream_filter
+
type t =
{ is_kwd : string -> bool; mutable filter : token_filter
}
+
let err error loc =
raise (Loc.Exc_located (loc, Error.E error))
+
let keyword_conversion tok is_kwd =
match tok with
| SYMBOL s | LIDENT s | UIDENT s when is_kwd s -> KEYWORD s
| ESCAPED_IDENT s -> LIDENT s
| _ -> tok
+
let check_keyword_as_label tok loc is_kwd =
let s =
match tok with | LABEL s -> s | OPTLABEL s -> s | _ -> ""
if (s <> "") && (is_kwd s)
then err (Error.Keyword_as_label s) loc
else ()
+
let check_unknown_keywords tok loc =
match tok with
| SYMBOL s -> err (Error.Illegal_token s) loc
| _ -> ()
+
let error_no_respect_rules p_con p_prm =
raise
(Error.E (Error.Illegal_token_pattern (p_con, p_prm)))
+
let check_keyword _ = true
+
let error_on_unknown_keywords = ref false
+
let rec ignore_layout (__strm : _ Stream.t) =
match Stream.peek __strm with
| Some
Stream.icons x
(Stream.slazy (fun _ -> ignore_layout s)))
| _ -> Stream.sempty
+
let mk is_kwd = { is_kwd = is_kwd; filter = ignore_layout; }
+
let filter x =
let f tok loc =
let tok = keyword_conversion tok x.is_kwd
Stream.icons x (Stream.slazy (fun _ -> tracer xs)))
| _ -> Stream.sempty
in fun strm -> tracer (x.filter (filter strm))
+
let define_filter x f = x.filter <- f x.filter
+
let keyword_added _ _ _ = ()
+
let keyword_removed _ _ = ()
+
end
+
end
+
module Eval =
struct
let valch x = (Char.code x) - (Char.code '0')
+
let valch_hex x =
let d = Char.code x
in
if d >= 97
then d - 87
else if d >= 65 then d - 55 else d - 48
+
let rec skip_indent (__strm : _ Stream.t) =
match Stream.peek __strm with
| Some (' ' | '\t') -> (Stream.junk __strm; skip_indent __strm)
| _ -> ()
+
let skip_opt_linefeed (__strm : _ Stream.t) =
match Stream.peek __strm with
| Some '\010' -> (Stream.junk __strm; ())
| _ -> ()
+
+ let chr c =
+ if (c < 0) || (c > 255)
+ then failwith "invalid char token"
+ else Char.chr c
+
let rec backslash (__strm : _ Stream.t) =
match Stream.peek __strm with
| Some '\010' -> (Stream.junk __strm; '\010')
(match Stream.peek __strm with
| Some (('0' .. '9' as c3)) ->
(Stream.junk __strm;
- Char.chr
+ chr
(((100 * (valch c1)) + (10 * (valch c2))) +
(valch c3)))
| _ -> raise (Stream.Error "")))
(('0' .. '9' | 'a' .. 'f' | 'A' .. 'F' as c2))
->
(Stream.junk __strm;
- Char.chr
- ((16 * (valch_hex c1)) + (valch_hex c2)))
+ chr ((16 * (valch_hex c1)) + (valch_hex c2)))
| _ -> raise (Stream.Error "")))
| _ -> raise (Stream.Error "")))
| _ -> raise Stream.Failure
+
let rec backslash_in_string strict store (__strm : _ Stream.t) =
match Stream.peek __strm with
| Some '\010' -> (Stream.junk __strm; skip_indent __strm)
| Some c when not strict ->
(Stream.junk __strm; store '\\'; store c)
| _ -> failwith "invalid string token"))
+
let char s =
if (String.length s) = 1
then s.[0]
(try backslash __strm
with | Stream.Failure -> raise (Stream.Error "")))
| _ -> failwith "invalid char token")
+
let string ?strict s =
let buf = Buffer.create 23 in
let store = Buffer.add_char buf in
let s = __strm in (store c; parse s))
| _ -> Buffer.contents buf
in parse (Stream.of_string s)
+
end
+
end
+
module Lexer =
struct
module TokenEval = Token.Eval
+
module Make (Token : Sig.Camlp4Token) =
struct
module Loc = Token.Loc
+
module Token = Token
+
open Lexing
+
open Sig
+
module Error =
struct
type t =
- | Illegal_character of char | Illegal_escape of string
- | Unterminated_comment | Unterminated_string
- | Unterminated_quotation | Unterminated_antiquot
- | Unterminated_string_in_comment | Comment_start
- | Comment_not_end | Literal_overflow of string
+ | Illegal_character of char
+ | Illegal_escape of string
+ | Unterminated_comment
+ | Unterminated_string
+ | Unterminated_quotation
+ | Unterminated_antiquot
+ | Unterminated_string_in_comment
+ | Comment_start
+ | Comment_not_end
+ | Literal_overflow of string
+
exception E of t
+
open Format
+
let print ppf =
function
| Illegal_character c ->
fprintf ppf "this is the start of a comment"
| Comment_not_end ->
fprintf ppf "this is not the end of a comment"
+
let to_string x =
let b = Buffer.create 50 in
let () = bprintf b "%a" print x in Buffer.contents b
+
end
+
let _ = let module M = ErrorHandler.Register(Error) in ()
+
open Error
+
type context =
{ loc : Loc.t; in_comment : bool; quotations : bool;
antiquots : bool; lexbuf : lexbuf; buffer : Buffer.t
}
+
let default_context lb =
{
loc = Loc.ghost;
lexbuf = lb;
buffer = Buffer.create 256;
}
+
let store c = Buffer.add_string c.buffer (Lexing.lexeme c.lexbuf)
+
let istore_char c i =
Buffer.add_char c.buffer (Lexing.lexeme_char c.lexbuf i)
+
let buff_contents c =
let contents = Buffer.contents c.buffer
in (Buffer.reset c.buffer; contents)
+
let loc c = Loc.merge c.loc (Loc.of_lexbuf c.lexbuf)
+
let quotations c = c.quotations
+
let antiquots c = c.antiquots
+
let is_in_comment c = c.in_comment
+
let in_comment c = { (c) with in_comment = true; }
+
let set_start_p c = c.lexbuf.lex_start_p <- Loc.start_pos c.loc
+
let move_start_p shift c =
let p = c.lexbuf.lex_start_p
in
c.lexbuf.lex_start_p <-
{ (p) with pos_cnum = p.pos_cnum + shift; }
+
let update_loc c = { (c) with loc = Loc.of_lexbuf c.lexbuf; }
+
let with_curr_loc f c = f (update_loc c) c.lexbuf
+
let parse_nested f c =
(with_curr_loc f c; set_start_p c; buff_contents c)
+
let shift n c = { (c) with loc = Loc.move `both n c.loc; }
+
let store_parse f c = (store c; f c c.lexbuf)
+
let parse f c = f c c.lexbuf
+
let mk_quotation quotation c name loc shift =
let s = parse_nested quotation (update_loc c) in
let contents = String.sub s 0 ((String.length s) - 2)
q_shift = shift;
q_contents = contents;
}
+
let update_loc c file line absolute chars =
let lexbuf = c.lexbuf in
let pos = lexbuf.lex_curr_p in
pos_lnum = if absolute then line else pos.pos_lnum + line;
pos_bol = pos.pos_cnum - chars;
}
+
let err error loc = raise (Loc.Exc_located (loc, Error.E error))
+
let warn error loc =
Format.eprintf "Warning: %a: %a@." Loc.print loc Error.print
error
+
let __ocaml_lex_tables =
{
Lexing.lex_base =
"\000\000\223\255\224\255\224\000\226\255\253\000\035\001\072\001\
- \109\001\146\001\183\001\218\001\068\000\190\001\002\002\227\255\
- \119\000\046\002\087\002\154\002\123\000\244\255\173\002\206\002\
- \023\003\231\003\198\004\034\005\120\000\001\000\255\255\242\005\
- \253\255\194\006\252\255\245\255\246\255\247\255\092\000\224\000\
- \082\000\105\000\098\003\050\004\061\006\213\001\020\002\129\000\
- \162\007\095\000\151\000\099\000\243\255\242\255\241\255\150\005\
- \253\000\100\000\104\002\075\006\162\007\255\007\039\008\106\008\
- \145\008\212\008\109\000\239\255\249\008\024\001\060\009\099\009\
- \166\009\232\255\231\255\230\255\205\009\016\010\055\010\122\010\
- \161\010\075\001\228\255\229\255\238\255\201\007\196\010\233\010\
- \014\011\051\011\088\011\125\011\162\011\199\011\236\011\052\007\
- \153\003\004\000\233\255\007\000\153\000\175\002\008\000\005\000\
- \233\255\243\011\024\012\061\012\098\012\105\012\142\012\179\012\
- \216\012\251\012\030\013\035\013\070\013\105\013\142\013\179\013\
- \241\013\006\000\192\002\251\255\203\014\006\001\121\000\122\000\
- \254\255\011\015\202\015\154\016\106\017\074\018\126\000\002\001\
- \149\000\150\000\249\255\248\255\022\007\184\002\152\000\079\004\
- \208\000\060\014\219\000\165\001\009\000\101\018\250\255\021\016\
- \198\004\079\001\070\001\215\004\229\016\140\018\207\018\174\019\
- \204\019\171\020\138\021\171\021\235\021\187\022\254\255\164\001\
- \012\000\197\000\079\001\251\022\186\023\138\024\090\025\054\026\
- \237\000\016\027\233\027\028\001\185\028\206\001\080\001\013\000\
- \249\028\184\029\136\030\088\031";
+ \109\001\146\001\091\000\183\001\068\000\190\001\218\001\227\255\
+ \122\000\002\002\071\002\110\002\176\000\244\255\129\002\162\002\
+ \235\002\187\003\154\004\246\004\124\000\001\000\255\255\198\005\
+ \253\255\150\006\252\255\245\255\246\255\247\255\253\000\224\000\
+ \086\000\091\000\054\003\006\004\029\002\237\001\182\004\109\000\
+ \118\007\091\000\253\000\093\000\243\255\242\255\241\255\106\005\
+ \077\003\108\000\087\003\017\006\151\007\218\007\001\008\068\008\
+ \107\008\107\000\239\255\126\008\075\001\210\008\249\008\060\009\
+ \232\255\231\255\230\255\099\009\166\009\205\009\016\010\055\010\
+ \249\001\228\255\229\255\238\255\090\010\127\010\164\010\201\010\
+ \238\010\019\011\056\011\091\011\128\011\165\011\202\011\239\011\
+ \020\012\057\012\094\012\011\007\136\005\004\000\233\255\008\000\
+ \054\001\245\002\009\000\005\000\233\255\131\012\138\012\175\012\
+ \212\012\249\012\000\013\037\013\068\013\096\013\133\013\138\013\
+ \205\013\242\013\023\014\085\014\006\000\148\002\251\255\047\015\
+ \123\000\109\000\125\000\254\255\111\015\046\016\254\016\206\017\
+ \174\018\129\000\017\001\130\000\141\000\249\255\248\255\237\006\
+ \109\003\143\000\035\004\145\000\160\014\149\000\086\004\007\000\
+ \201\018\250\255\121\016\154\004\091\001\057\001\171\004\073\017\
+ \240\018\051\019\018\020\048\020\015\021\238\021\015\022\079\022\
+ \031\023\254\255\164\001\010\000\128\000\079\001\095\023\030\024\
+ \238\024\190\025\154\026\201\000\116\027\077\028\028\001\029\029\
+ \206\001\080\001\013\000\093\029\028\030\236\030\188\031";
Lexing.lex_backtrk =
"\255\255\255\255\255\255\030\000\255\255\028\000\030\000\030\000\
\030\000\030\000\028\000\028\000\028\000\028\000\028\000\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\007\000\
\255\255\255\255\255\255\006\000\006\000\006\000\007\000\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\014\000\
- \014\000\014\000\255\255\255\255\255\255\255\255\255\255\255\255\
- \028\000\028\000\015\000\255\255\028\000\255\255\255\255\028\000\
- \255\255\255\255\255\255\255\255\028\000\028\000\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\030\000\021\000\
- \020\000\018\000\030\000\019\000\028\000\030\000\255\255\255\255\
- \255\255\022\000\255\255\255\255\255\255\255\255\255\255\022\000\
- \255\255\255\255\255\255\028\000\255\255\255\255\028\000\028\000\
- \255\255\028\000\028\000\028\000\028\000\030\000\030\000\030\000\
- \255\255\013\000\014\000\255\255\003\000\014\000\014\000\014\000\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\005\000\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\006\000\008\000\255\255\005\000\
- \005\000\001\000\001\000\255\255\255\255\000\000\001\000\001\000\
- \255\255\002\000\002\000\255\255\255\255\255\255\255\255\255\255\
- \003\000\004\000\004\000\255\255\255\255\255\255\255\255\255\255\
- \002\000\002\000\002\000\255\255\255\255\255\255\004\000\002\000\
- \255\255\255\255\255\255\255\255";
+ \014\000\014\000\255\255\255\255\255\255\255\255\255\255\028\000\
+ \028\000\015\000\255\255\028\000\255\255\255\255\028\000\255\255\
+ \255\255\255\255\255\255\028\000\028\000\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\030\000\021\000\020\000\
+ \018\000\030\000\018\000\018\000\018\000\018\000\028\000\018\000\
+ \255\255\019\000\030\000\255\255\255\255\022\000\255\255\255\255\
+ \255\255\255\255\255\255\022\000\255\255\255\255\255\255\255\255\
+ \028\000\255\255\028\000\255\255\028\000\028\000\028\000\028\000\
+ \030\000\030\000\030\000\255\255\013\000\014\000\255\255\003\000\
+ \014\000\014\000\014\000\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\005\000\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\006\000\
+ \008\000\255\255\005\000\005\000\001\000\001\000\255\255\255\255\
+ \000\000\001\000\001\000\255\255\002\000\002\000\255\255\255\255\
+ \255\255\255\255\255\255\003\000\004\000\004\000\255\255\255\255\
+ \255\255\255\255\255\255\002\000\002\000\002\000\255\255\255\255\
+ \255\255\004\000\002\000\255\255\255\255\255\255\255\255";
Lexing.lex_default =
"\001\000\000\000\000\000\255\255\000\000\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\000\000\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\054\000\255\255\255\255\255\255\000\000\000\000\000\000\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\000\000\255\255\255\255\255\255\255\255\
+ \255\255\255\255\000\000\255\255\255\255\255\255\255\255\255\255\
+ \000\000\000\000\000\000\255\255\255\255\255\255\255\255\255\255\
\255\255\000\000\000\000\000\000\255\255\255\255\255\255\255\255\
- \255\255\255\255\000\000\000\000\000\000\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\099\000\
- \255\255\255\255\000\000\099\000\100\000\099\000\102\000\255\255\
- \000\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \054\000\255\255\134\000\000\000\255\255\255\255\255\255\255\255\
- \000\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\000\000\000\000\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\037\000\255\255\150\000\000\000\255\255\
+ \255\255\255\255\255\255\103\000\255\255\255\255\000\000\103\000\
+ \104\000\103\000\106\000\255\255\000\000\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\000\000\123\000\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\032\000\
- \255\255\255\255\255\255\255\255\255\255\123\000\255\255\255\255\
- \255\255\255\255\255\255\255\255";
+ \255\255\255\255\255\255\054\000\255\255\137\000\000\000\255\255\
+ \255\255\255\255\255\255\000\000\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\000\000\000\000\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\037\000\255\255\
+ \153\000\000\000\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\000\000\126\000\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\032\000\255\255\255\255\255\255\255\255\255\255\
+ \126\000\255\255\255\255\255\255\255\255\255\255\255\255";
Lexing.lex_trans =
"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\028\000\030\000\030\000\028\000\029\000\098\000\104\000\
- \053\000\098\000\104\000\138\000\097\000\103\000\034\000\032\000\
+ \000\000\028\000\030\000\030\000\028\000\029\000\102\000\108\000\
+ \053\000\141\000\102\000\108\000\034\000\101\000\107\000\032\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\028\000\003\000\021\000\016\000\004\000\009\000\009\000\020\000\
\019\000\005\000\018\000\003\000\015\000\003\000\014\000\009\000\
\025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
\025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
\025\000\025\000\025\000\010\000\008\000\005\000\027\000\015\000\
- \096\000\028\000\045\000\045\000\028\000\051\000\053\000\047\000\
- \050\000\047\000\052\000\053\000\046\000\046\000\046\000\046\000\
- \046\000\046\000\046\000\046\000\046\000\046\000\067\000\096\000\
- \028\000\044\000\044\000\044\000\044\000\044\000\044\000\044\000\
- \044\000\051\000\128\000\098\000\030\000\037\000\097\000\095\000\
- \095\000\095\000\095\000\095\000\095\000\095\000\095\000\095\000\
- \095\000\046\000\046\000\046\000\046\000\046\000\046\000\046\000\
- \046\000\046\000\046\000\102\000\139\000\138\000\052\000\036\000\
+ \117\000\117\000\053\000\100\000\052\000\028\000\045\000\045\000\
+ \028\000\115\000\117\000\044\000\044\000\044\000\044\000\044\000\
+ \044\000\044\000\044\000\053\000\066\000\118\000\131\000\116\000\
+ \115\000\115\000\100\000\117\000\028\000\046\000\046\000\046\000\
+ \046\000\046\000\046\000\046\000\046\000\046\000\046\000\030\000\
+ \037\000\142\000\099\000\099\000\099\000\099\000\099\000\099\000\
+ \099\000\099\000\099\000\099\000\141\000\133\000\036\000\032\000\
+ \035\000\117\000\051\000\132\000\021\000\050\000\131\000\000\000\
\024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
\024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
- \024\000\024\000\024\000\024\000\024\000\024\000\024\000\048\000\
+ \024\000\024\000\024\000\024\000\024\000\024\000\024\000\118\000\
\024\000\024\000\024\000\024\000\024\000\024\000\024\000\025\000\
\025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
\025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
- \025\000\025\000\025\000\025\000\025\000\025\000\025\000\035\000\
+ \025\000\025\000\025\000\025\000\025\000\025\000\025\000\182\000\
\025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
- \002\000\003\000\021\000\128\000\003\000\003\000\003\000\255\255\
- \255\255\000\000\003\000\003\000\136\000\003\000\003\000\003\000\
+ \002\000\003\000\000\000\131\000\003\000\003\000\003\000\051\000\
+ \255\255\255\255\003\000\003\000\048\000\003\000\003\000\003\000\
\039\000\039\000\039\000\039\000\039\000\039\000\039\000\039\000\
- \039\000\039\000\003\000\179\000\003\000\003\000\003\000\003\000\
- \003\000\069\000\094\000\094\000\069\000\038\000\085\000\128\000\
- \000\000\139\000\000\000\094\000\094\000\058\000\058\000\058\000\
- \058\000\058\000\058\000\058\000\058\000\058\000\058\000\085\000\
- \069\000\085\000\085\000\085\000\003\000\094\000\003\000\039\000\
- \130\000\075\000\032\000\000\000\003\000\038\000\129\000\003\000\
- \009\000\009\000\179\000\000\000\085\000\003\000\003\000\154\000\
- \003\000\009\000\009\000\000\000\081\000\000\000\128\000\081\000\
- \154\000\154\000\085\000\094\000\003\000\086\000\003\000\006\000\
- \006\000\006\000\003\000\009\000\000\000\000\000\154\000\000\000\
- \000\000\003\000\000\000\081\000\003\000\118\000\118\000\154\000\
- \000\000\085\000\003\000\003\000\082\000\003\000\118\000\118\000\
- \000\000\085\000\085\000\255\255\000\000\000\000\000\000\003\000\
- \085\000\009\000\117\000\000\000\007\000\007\000\007\000\003\000\
- \118\000\172\000\185\000\030\000\034\000\000\000\003\000\171\000\
- \184\000\003\000\009\000\009\000\000\000\000\000\005\000\003\000\
- \003\000\255\255\003\000\009\000\009\000\000\000\000\000\086\000\
- \085\000\003\000\000\000\000\000\003\000\005\000\118\000\086\000\
- \000\000\006\000\006\000\006\000\003\000\009\000\034\000\138\000\
- \000\000\168\000\148\000\003\000\000\000\000\000\003\000\009\000\
- \009\000\000\000\000\000\092\000\003\000\003\000\000\000\003\000\
- \009\000\009\000\000\000\000\000\117\000\005\000\003\000\030\000\
- \000\000\003\000\005\000\009\000\093\000\000\000\009\000\009\000\
+ \039\000\039\000\003\000\139\000\003\000\003\000\003\000\003\000\
+ \003\000\000\000\096\000\096\000\052\000\038\000\084\000\000\000\
+ \047\000\000\000\047\000\084\000\096\000\046\000\046\000\046\000\
+ \046\000\046\000\046\000\046\000\046\000\046\000\046\000\084\000\
+ \142\000\084\000\084\000\084\000\003\000\096\000\003\000\039\000\
+ \102\000\000\000\157\000\101\000\003\000\038\000\000\000\003\000\
+ \009\000\009\000\182\000\000\000\084\000\003\000\003\000\000\000\
+ \003\000\006\000\009\000\000\000\068\000\000\000\131\000\068\000\
+ \106\000\157\000\084\000\096\000\003\000\085\000\003\000\006\000\
+ \006\000\006\000\003\000\009\000\157\000\157\000\000\000\000\000\
+ \000\000\003\000\000\000\068\000\003\000\121\000\121\000\000\000\
+ \000\000\084\000\003\000\003\000\074\000\003\000\007\000\121\000\
+ \000\000\084\000\084\000\157\000\000\000\000\000\000\000\003\000\
+ \084\000\009\000\120\000\000\000\007\000\007\000\007\000\003\000\
+ \121\000\175\000\188\000\030\000\034\000\000\000\003\000\174\000\
+ \187\000\003\000\009\000\009\000\000\000\000\000\005\000\003\000\
+ \003\000\000\000\003\000\006\000\009\000\000\000\000\000\085\000\
+ \084\000\003\000\000\000\000\000\003\000\005\000\121\000\085\000\
+ \000\000\006\000\006\000\006\000\003\000\009\000\034\000\000\000\
+ \255\255\171\000\000\000\003\000\000\000\000\000\003\000\009\000\
+ \009\000\000\000\000\000\094\000\003\000\003\000\000\000\003\000\
+ \009\000\009\000\000\000\000\000\120\000\005\000\003\000\000\000\
+ \000\000\003\000\005\000\009\000\098\000\000\000\009\000\009\000\
\009\000\003\000\009\000\000\000\000\000\000\000\000\000\000\000\
- \032\000\000\000\000\000\183\000\114\000\114\000\000\000\060\000\
- \170\000\000\000\169\000\105\000\105\000\114\000\114\000\005\000\
- \000\000\086\000\005\000\003\000\105\000\105\000\003\000\092\000\
- \009\000\115\000\030\000\113\000\112\000\112\000\000\000\114\000\
- \111\000\000\000\108\000\110\000\110\000\000\000\105\000\114\000\
- \114\000\149\000\060\000\000\000\000\000\045\000\045\000\000\000\
- \114\000\114\000\182\000\000\000\000\000\000\000\093\000\092\000\
- \003\000\000\000\060\000\000\000\113\000\114\000\113\000\112\000\
- \112\000\000\000\114\000\005\000\105\000\000\000\000\000\000\000\
- \000\000\036\000\000\000\000\000\000\000\000\000\000\000\105\000\
- \105\000\000\000\000\000\092\000\000\000\000\000\000\000\000\000\
- \107\000\105\000\060\000\115\000\045\000\060\000\000\000\000\000\
- \114\000\000\000\109\000\005\000\106\000\000\000\105\000\105\000\
- \105\000\037\000\105\000\035\000\046\000\046\000\046\000\046\000\
- \046\000\046\000\046\000\046\000\046\000\046\000\000\000\003\000\
- \000\000\000\000\003\000\009\000\009\000\060\000\113\000\085\000\
- \003\000\003\000\000\000\003\000\009\000\009\000\000\000\092\000\
- \105\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \087\000\000\000\089\000\006\000\006\000\003\000\088\000\000\000\
- \000\000\000\000\000\000\046\000\000\000\000\000\000\000\000\000\
- \003\000\000\000\000\000\003\000\003\000\003\000\106\000\092\000\
- \084\000\003\000\003\000\000\000\003\000\003\000\003\000\000\000\
- \000\000\000\000\003\000\085\000\009\000\000\000\000\000\000\000\
- \000\000\003\000\000\000\003\000\003\000\003\000\003\000\003\000\
- \049\000\049\000\049\000\049\000\049\000\049\000\049\000\049\000\
- \049\000\049\000\000\000\061\000\032\000\139\000\061\000\000\000\
- \000\000\000\000\086\000\085\000\003\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\003\000\000\000\003\000\000\000\000\000\
- \101\000\098\000\061\000\062\000\097\000\000\000\062\000\065\000\
- \065\000\000\000\060\000\000\000\066\000\062\000\000\000\062\000\
- \065\000\065\000\136\000\000\000\000\000\135\000\128\000\101\000\
- \000\000\100\000\000\000\003\000\064\000\003\000\063\000\063\000\
- \063\000\062\000\065\000\039\000\000\000\022\000\022\000\022\000\
- \022\000\022\000\022\000\022\000\022\000\022\000\022\000\137\000\
- \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
- \143\000\143\000\038\000\000\000\000\000\060\000\062\000\000\000\
- \065\000\036\000\000\000\000\000\039\000\000\000\022\000\022\000\
- \022\000\022\000\022\000\022\000\022\000\022\000\022\000\022\000\
- \000\000\000\000\000\000\000\000\022\000\000\000\000\000\000\000\
- \040\000\000\000\038\000\038\000\000\000\060\000\064\000\000\000\
- \062\000\037\000\036\000\035\000\133\000\041\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\042\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\022\000\000\000\000\000\
- \040\000\000\000\000\000\038\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\037\000\000\000\035\000\041\000\024\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\042\000\024\000\
- \024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
- \024\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \032\000\000\000\000\000\186\000\117\000\117\000\000\000\000\000\
+ \173\000\000\000\172\000\111\000\111\000\115\000\117\000\005\000\
+ \000\000\085\000\005\000\003\000\109\000\111\000\003\000\094\000\
+ \009\000\116\000\030\000\116\000\115\000\115\000\000\000\117\000\
+ \114\000\000\000\109\000\112\000\112\000\000\000\111\000\111\000\
+ \111\000\000\000\080\000\084\000\000\000\080\000\000\000\000\000\
+ \112\000\111\000\185\000\000\000\000\000\000\000\098\000\094\000\
+ \003\000\000\000\000\000\000\000\110\000\117\000\109\000\109\000\
+ \109\000\080\000\111\000\005\000\111\000\045\000\045\000\000\000\
+ \000\000\000\000\081\000\003\000\000\000\000\000\003\000\009\000\
+ \009\000\000\000\000\000\084\000\003\000\003\000\000\000\003\000\
+ \006\000\009\000\000\000\116\000\000\000\000\000\255\255\084\000\
+ \111\000\036\000\110\000\005\000\086\000\000\000\088\000\006\000\
+ \006\000\003\000\087\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\045\000\044\000\044\000\044\000\
+ \044\000\044\000\044\000\044\000\044\000\000\000\110\000\084\000\
+ \000\000\037\000\000\000\035\000\000\000\000\000\003\000\084\000\
+ \009\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \003\000\036\000\000\000\003\000\003\000\003\000\000\000\000\000\
+ \083\000\003\000\003\000\000\000\003\000\003\000\003\000\060\000\
+ \000\000\000\000\060\000\000\000\044\000\000\000\085\000\084\000\
+ \003\000\003\000\000\000\003\000\003\000\003\000\003\000\003\000\
+ \000\000\037\000\000\000\035\000\000\000\000\000\060\000\061\000\
+ \000\000\000\000\061\000\064\000\064\000\000\000\000\000\000\000\
+ \065\000\061\000\000\000\061\000\062\000\064\000\139\000\000\000\
+ \000\000\138\000\000\000\003\000\032\000\003\000\000\000\000\000\
+ \063\000\000\000\062\000\062\000\062\000\061\000\064\000\039\000\
+ \000\000\022\000\022\000\022\000\022\000\022\000\022\000\022\000\
+ \022\000\022\000\022\000\140\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\003\000\000\000\003\000\038\000\000\000\
+ \000\000\000\000\061\000\000\000\064\000\036\000\131\000\000\000\
+ \039\000\000\000\022\000\022\000\022\000\022\000\022\000\022\000\
+ \022\000\022\000\022\000\022\000\000\000\000\000\000\000\000\000\
+ \022\000\000\000\000\000\000\000\040\000\000\000\038\000\038\000\
+ \000\000\000\000\063\000\000\000\061\000\037\000\036\000\035\000\
+ \136\000\041\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\042\000\000\000\000\000\000\000\105\000\102\000\
+ \000\000\022\000\101\000\000\000\040\000\000\000\000\000\038\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\037\000\000\000\
+ \035\000\041\000\024\000\000\000\000\000\105\000\000\000\104\000\
+ \000\000\000\000\042\000\024\000\024\000\024\000\024\000\024\000\
+ \024\000\024\000\024\000\024\000\024\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\024\000\024\000\024\000\024\000\
\024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
\024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
+ \024\000\024\000\024\000\024\000\024\000\024\000\000\000\000\000\
+ \000\000\000\000\024\000\000\000\024\000\024\000\024\000\024\000\
\024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
- \024\000\024\000\000\000\000\000\000\000\000\000\024\000\000\000\
\024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
+ \024\000\024\000\024\000\024\000\024\000\024\000\043\000\043\000\
+ \043\000\043\000\043\000\043\000\043\000\043\000\043\000\043\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\043\000\
+ \043\000\043\000\043\000\043\000\043\000\058\000\058\000\058\000\
+ \058\000\058\000\058\000\058\000\058\000\058\000\058\000\049\000\
+ \049\000\049\000\049\000\049\000\049\000\049\000\049\000\049\000\
+ \049\000\000\000\000\000\000\000\255\255\000\000\000\000\043\000\
+ \043\000\043\000\043\000\043\000\043\000\146\000\146\000\146\000\
+ \146\000\146\000\146\000\146\000\146\000\146\000\146\000\000\000\
+ \000\000\000\000\000\000\024\000\024\000\024\000\024\000\024\000\
\024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
\024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
- \024\000\024\000\043\000\043\000\043\000\043\000\043\000\043\000\
- \043\000\043\000\043\000\043\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\096\000\043\000\043\000\043\000\043\000\043\000\
- \043\000\000\000\000\000\000\000\000\000\000\000\000\000\255\255\
- \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\096\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \255\255\000\000\000\000\043\000\043\000\043\000\043\000\043\000\
- \043\000\095\000\095\000\095\000\095\000\095\000\095\000\095\000\
- \095\000\095\000\095\000\000\000\000\000\000\000\000\000\024\000\
- \024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
- \024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
- \024\000\024\000\024\000\024\000\024\000\024\000\000\000\024\000\
+ \024\000\024\000\000\000\024\000\024\000\024\000\024\000\024\000\
\024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
\024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
\024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
- \024\000\024\000\024\000\024\000\024\000\024\000\025\000\024\000\
- \024\000\024\000\024\000\024\000\024\000\024\000\024\000\025\000\
- \025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
- \025\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \024\000\024\000\025\000\024\000\024\000\024\000\024\000\024\000\
+ \024\000\024\000\024\000\025\000\025\000\025\000\025\000\025\000\
+ \025\000\025\000\025\000\025\000\025\000\255\255\000\000\000\000\
+ \000\000\000\000\000\000\000\000\025\000\025\000\025\000\025\000\
\025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
\025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
+ \025\000\025\000\025\000\025\000\025\000\025\000\000\000\000\000\
+ \000\000\000\000\025\000\000\000\025\000\025\000\025\000\025\000\
\025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
- \025\000\025\000\000\000\000\000\000\000\000\000\025\000\000\000\
\025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
+ \025\000\025\000\025\000\025\000\025\000\025\000\043\000\043\000\
+ \043\000\043\000\043\000\043\000\043\000\043\000\043\000\043\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\043\000\
+ \043\000\043\000\043\000\043\000\043\000\000\000\000\000\000\000\
+ \000\000\000\000\036\000\147\000\147\000\147\000\147\000\147\000\
+ \147\000\147\000\147\000\147\000\147\000\000\000\000\000\000\000\
+ \141\000\000\000\000\000\151\000\000\000\043\000\000\000\043\000\
+ \043\000\043\000\043\000\043\000\043\000\000\000\000\000\000\000\
+ \000\000\000\000\037\000\000\000\035\000\000\000\000\000\000\000\
+ \030\000\000\000\000\000\025\000\025\000\025\000\025\000\025\000\
\025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
\025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
- \025\000\025\000\043\000\043\000\043\000\043\000\043\000\043\000\
- \043\000\043\000\043\000\043\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\043\000\043\000\043\000\043\000\043\000\
- \043\000\000\000\000\000\000\000\000\000\000\000\036\000\144\000\
- \144\000\144\000\144\000\144\000\144\000\144\000\144\000\144\000\
- \144\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\043\000\000\000\043\000\043\000\043\000\043\000\043\000\
- \043\000\000\000\000\000\000\000\000\000\000\000\037\000\000\000\
- \035\000\000\000\000\000\000\000\000\000\000\000\000\000\025\000\
+ \025\000\025\000\000\000\025\000\025\000\025\000\025\000\025\000\
\025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
\025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
- \025\000\025\000\025\000\025\000\025\000\025\000\000\000\025\000\
\025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
- \025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
- \025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
- \025\000\025\000\025\000\025\000\025\000\025\000\000\000\025\000\
- \025\000\025\000\025\000\025\000\025\000\025\000\025\000\003\000\
- \000\000\000\000\003\000\003\000\003\000\000\000\000\000\000\000\
- \003\000\003\000\000\000\003\000\003\000\003\000\155\000\155\000\
- \155\000\155\000\155\000\155\000\155\000\155\000\155\000\155\000\
- \003\000\000\000\003\000\003\000\003\000\003\000\003\000\034\000\
- \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
- \034\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\003\000\000\000\003\000\033\000\000\000\033\000\
- \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
+ \025\000\025\000\152\000\025\000\025\000\025\000\025\000\025\000\
+ \025\000\025\000\025\000\003\000\000\000\000\000\003\000\003\000\
+ \003\000\000\000\000\000\000\000\003\000\003\000\000\000\003\000\
+ \003\000\003\000\158\000\158\000\158\000\158\000\158\000\158\000\
+ \158\000\158\000\158\000\158\000\003\000\000\000\003\000\003\000\
+ \003\000\003\000\003\000\034\000\034\000\034\000\034\000\034\000\
+ \034\000\034\000\034\000\034\000\034\000\000\000\046\000\046\000\
+ \046\000\046\000\046\000\046\000\046\000\046\000\046\000\046\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\003\000\000\000\
+ \003\000\033\000\000\000\033\000\033\000\033\000\033\000\033\000\
\033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
\033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
- \033\000\000\000\003\000\003\000\003\000\000\000\003\000\003\000\
- \003\000\000\000\000\000\000\000\003\000\003\000\000\000\003\000\
- \003\000\003\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\003\000\000\000\003\000\003\000\
- \003\000\003\000\003\000\000\000\000\000\000\000\000\000\000\000\
+ \033\000\033\000\033\000\033\000\033\000\046\000\003\000\003\000\
+ \003\000\000\000\003\000\003\000\003\000\000\000\000\000\000\000\
+ \003\000\003\000\000\000\003\000\003\000\003\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \003\000\000\000\003\000\003\000\003\000\003\000\003\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\003\000\000\000\
- \003\000\031\000\000\000\031\000\031\000\031\000\031\000\031\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\003\000\000\000\003\000\031\000\142\000\031\000\
\031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
\031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
- \031\000\031\000\031\000\031\000\031\000\000\000\003\000\000\000\
- \003\000\000\000\000\000\000\000\000\000\033\000\033\000\033\000\
+ \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
+ \031\000\000\000\003\000\000\000\003\000\000\000\000\000\000\000\
+ \000\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
\033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
\033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
- \033\000\033\000\033\000\033\000\033\000\000\000\033\000\033\000\
- \033\000\033\000\033\000\033\000\033\000\033\000\059\000\059\000\
- \059\000\059\000\059\000\059\000\059\000\059\000\059\000\059\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\000\000\059\000\
- \059\000\059\000\059\000\059\000\059\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\000\000\059\000\
- \059\000\059\000\059\000\059\000\059\000\000\000\000\000\000\000\
- \000\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
+ \033\000\100\000\033\000\033\000\033\000\033\000\033\000\033\000\
+ \033\000\033\000\059\000\059\000\059\000\059\000\059\000\059\000\
+ \059\000\059\000\059\000\059\000\000\000\000\000\000\000\000\000\
+ \100\000\000\000\000\000\059\000\059\000\059\000\059\000\059\000\
+ \059\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \099\000\099\000\099\000\099\000\099\000\099\000\099\000\099\000\
+ \099\000\099\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\059\000\059\000\059\000\059\000\059\000\
+ \059\000\000\000\000\000\000\000\000\000\031\000\031\000\031\000\
+ \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
+ \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
\031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
\031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
\031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
+ \032\000\000\000\000\000\000\000\000\000\000\000\000\000\031\000\
\031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
- \031\000\031\000\031\000\031\000\032\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\031\000\031\000\031\000\031\000\031\000\
\031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
\031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
- \031\000\031\000\031\000\031\000\031\000\000\000\000\000\000\000\
- \000\000\031\000\000\000\031\000\031\000\031\000\031\000\031\000\
+ \031\000\000\000\000\000\000\000\000\000\031\000\000\000\031\000\
\031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
\031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
- \031\000\031\000\031\000\031\000\031\000\044\000\044\000\044\000\
- \044\000\044\000\044\000\044\000\044\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\049\000\049\000\049\000\049\000\049\000\
- \049\000\049\000\049\000\049\000\049\000\000\000\000\000\000\000\
- \000\000\036\000\000\000\000\000\049\000\049\000\049\000\049\000\
- \049\000\049\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\044\000\000\000\000\000\000\000\
+ \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
+ \031\000\049\000\049\000\049\000\049\000\049\000\049\000\049\000\
+ \049\000\049\000\049\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\049\000\049\000\049\000\049\000\049\000\049\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\037\000\000\000\035\000\049\000\049\000\049\000\049\000\
- \049\000\049\000\031\000\031\000\031\000\031\000\031\000\031\000\
+ \000\000\000\000\049\000\049\000\049\000\049\000\049\000\049\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\031\000\031\000\
\031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
\031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
- \031\000\000\000\031\000\031\000\031\000\031\000\031\000\031\000\
+ \031\000\031\000\031\000\031\000\031\000\000\000\031\000\031\000\
\031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
\031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
\031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
- \031\000\033\000\031\000\031\000\031\000\031\000\031\000\031\000\
- \031\000\031\000\033\000\033\000\033\000\033\000\033\000\033\000\
- \033\000\033\000\033\000\033\000\034\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\033\000\033\000\033\000\033\000\033\000\
+ \031\000\031\000\031\000\031\000\031\000\033\000\031\000\031\000\
+ \031\000\031\000\031\000\031\000\031\000\031\000\033\000\033\000\
+ \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
+ \034\000\000\000\000\000\000\000\000\000\000\000\000\000\033\000\
\033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
\033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
- \033\000\033\000\033\000\033\000\033\000\000\000\000\000\000\000\
- \000\000\033\000\000\000\033\000\033\000\033\000\033\000\033\000\
\033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
+ \033\000\000\000\000\000\000\000\000\000\033\000\000\000\033\000\
\033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
- \033\000\033\000\033\000\033\000\033\000\101\000\098\000\000\000\
- \000\000\097\000\000\000\000\000\000\000\000\000\145\000\145\000\
- \145\000\145\000\145\000\145\000\145\000\145\000\145\000\145\000\
- \000\000\000\000\000\000\000\000\101\000\000\000\100\000\145\000\
- \145\000\145\000\145\000\145\000\145\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\095\000\095\000\095\000\095\000\
- \095\000\095\000\095\000\095\000\095\000\095\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\000\000\145\000\
- \145\000\145\000\145\000\145\000\145\000\000\000\000\000\000\000\
- \000\000\000\000\033\000\033\000\033\000\033\000\033\000\033\000\
\033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
\033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
- \033\000\000\000\033\000\033\000\033\000\033\000\033\000\033\000\
+ \033\000\000\000\000\000\000\000\105\000\102\000\000\000\000\000\
+ \101\000\000\000\000\000\000\000\000\000\148\000\148\000\148\000\
+ \148\000\148\000\148\000\148\000\148\000\148\000\148\000\000\000\
+ \000\000\000\000\000\000\105\000\000\000\104\000\148\000\148\000\
+ \148\000\148\000\148\000\148\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\099\000\099\000\099\000\099\000\099\000\
+ \099\000\099\000\099\000\099\000\099\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\148\000\148\000\
+ \148\000\148\000\148\000\148\000\000\000\000\000\033\000\033\000\
\033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
\033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
+ \033\000\033\000\033\000\033\000\033\000\000\000\033\000\033\000\
+ \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
\033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
- \033\000\000\000\033\000\033\000\033\000\033\000\033\000\033\000\
- \033\000\033\000\057\000\000\000\057\000\000\000\000\000\068\000\
- \068\000\057\000\060\000\000\000\000\000\000\000\000\000\000\000\
- \068\000\068\000\056\000\056\000\056\000\056\000\056\000\056\000\
- \056\000\056\000\056\000\056\000\060\000\000\000\060\000\060\000\
- \060\000\000\000\068\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\094\000\094\000\
- \000\000\000\000\085\000\000\000\000\000\000\000\000\000\094\000\
- \094\000\000\000\000\000\000\000\000\000\060\000\057\000\000\000\
- \068\000\000\000\000\000\085\000\057\000\085\000\085\000\085\000\
- \061\000\094\000\000\000\061\000\000\000\000\000\000\000\000\000\
- \057\000\000\000\000\000\000\000\057\000\000\000\057\000\000\000\
- \000\000\000\000\055\000\000\000\000\000\060\000\060\000\061\000\
- \079\000\000\000\000\000\079\000\079\000\079\000\085\000\094\000\
- \000\000\080\000\079\000\000\000\079\000\079\000\079\000\000\000\
- \069\000\000\000\000\000\069\000\255\255\000\000\000\000\000\000\
- \000\000\079\000\000\000\079\000\079\000\079\000\079\000\079\000\
- \000\000\000\000\000\000\000\000\000\000\085\000\085\000\069\000\
- \070\000\000\000\000\000\070\000\070\000\070\000\000\000\000\000\
- \073\000\072\000\070\000\000\000\070\000\070\000\070\000\000\000\
- \000\000\000\000\000\000\079\000\000\000\079\000\000\000\000\000\
- \000\000\070\000\000\000\070\000\070\000\070\000\070\000\070\000\
+ \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
+ \033\000\033\000\033\000\033\000\033\000\000\000\033\000\033\000\
+ \033\000\033\000\033\000\033\000\033\000\033\000\057\000\000\000\
+ \057\000\000\000\000\000\000\000\000\000\057\000\000\000\000\000\
+ \060\000\000\000\000\000\060\000\000\000\000\000\056\000\056\000\
+ \056\000\056\000\056\000\056\000\056\000\056\000\056\000\056\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\060\000\
+ \078\000\000\000\000\000\078\000\078\000\078\000\000\000\000\000\
+ \000\000\079\000\078\000\000\000\078\000\078\000\078\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\078\000\057\000\078\000\078\000\078\000\078\000\078\000\
+ \057\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\068\000\057\000\000\000\068\000\000\000\
+ \057\000\000\000\057\000\000\000\000\000\000\000\055\000\000\000\
+ \000\000\000\000\000\000\078\000\000\000\078\000\000\000\000\000\
+ \000\000\000\000\068\000\069\000\000\000\000\000\069\000\069\000\
+ \069\000\000\000\000\000\072\000\071\000\069\000\000\000\069\000\
+ \069\000\069\000\068\000\255\255\000\000\068\000\000\000\000\000\
+ \000\000\000\000\000\000\078\000\069\000\078\000\069\000\069\000\
+ \069\000\069\000\069\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\068\000\069\000\000\000\000\000\069\000\070\000\070\000\
+ \000\000\000\000\072\000\071\000\069\000\000\000\069\000\077\000\
+ \070\000\000\000\000\000\000\000\000\000\000\000\069\000\000\000\
+ \069\000\000\000\000\000\077\000\000\000\077\000\077\000\077\000\
+ \069\000\070\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\068\000\000\000\000\000\
+ \068\000\000\000\000\000\000\000\000\000\000\000\069\000\000\000\
+ \069\000\000\000\000\000\000\000\000\000\069\000\000\000\070\000\
+ \000\000\000\000\000\000\000\000\068\000\069\000\000\000\000\000\
+ \069\000\076\000\076\000\000\000\000\000\072\000\071\000\069\000\
+ \000\000\069\000\075\000\076\000\068\000\000\000\255\255\068\000\
+ \000\000\000\000\000\000\000\000\000\000\077\000\075\000\069\000\
+ \075\000\075\000\075\000\069\000\076\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\068\000\069\000\000\000\000\000\069\000\
+ \070\000\070\000\000\000\067\000\072\000\071\000\069\000\000\000\
+ \069\000\070\000\070\000\000\000\000\000\000\000\000\000\000\000\
+ \069\000\000\000\076\000\067\000\067\000\070\000\067\000\070\000\
+ \070\000\070\000\069\000\070\000\067\000\067\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\069\000\000\000\000\000\069\000\000\000\
- \000\000\000\000\000\000\079\000\000\000\079\000\000\000\000\000\
- \000\000\000\000\000\000\070\000\000\000\070\000\000\000\000\000\
- \000\000\000\000\069\000\070\000\000\000\000\000\070\000\071\000\
- \071\000\000\000\060\000\073\000\072\000\070\000\000\000\070\000\
- \071\000\071\000\069\000\000\000\000\000\069\000\000\000\000\000\
- \000\000\000\000\255\255\070\000\078\000\070\000\078\000\078\000\
- \078\000\070\000\071\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\069\000\070\000\000\000\000\000\070\000\077\000\077\000\
- \000\000\060\000\073\000\072\000\070\000\000\000\070\000\077\000\
- \077\000\000\000\000\000\000\000\000\000\060\000\070\000\000\000\
- \071\000\000\000\000\000\076\000\000\000\076\000\076\000\076\000\
- \070\000\077\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\069\000\000\000\000\000\
- \069\000\000\000\000\000\000\000\000\000\060\000\078\000\000\000\
- \070\000\000\000\000\000\000\000\060\000\070\000\000\000\077\000\
- \000\000\000\000\000\000\000\000\069\000\070\000\000\000\000\000\
- \070\000\071\000\071\000\000\000\068\000\073\000\072\000\070\000\
- \000\000\070\000\071\000\071\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\060\000\076\000\071\000\070\000\
- \071\000\071\000\071\000\070\000\071\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\068\000\068\000\
- \000\000\068\000\000\000\000\000\000\000\000\000\000\000\068\000\
- \068\000\000\000\000\000\000\000\000\000\000\000\000\000\068\000\
- \070\000\000\000\071\000\068\000\000\000\068\000\068\000\068\000\
- \000\000\068\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\069\000\000\000\000\000\
- \069\000\000\000\000\000\000\000\000\000\000\000\000\000\068\000\
- \071\000\000\000\070\000\000\000\068\000\000\000\000\000\068\000\
- \000\000\000\000\000\000\000\000\069\000\070\000\000\000\000\000\
- \070\000\070\000\070\000\000\000\000\000\074\000\072\000\070\000\
- \000\000\070\000\070\000\070\000\069\000\000\000\000\000\069\000\
- \000\000\000\000\000\000\000\000\068\000\068\000\070\000\000\000\
- \070\000\070\000\070\000\070\000\070\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\069\000\070\000\000\000\000\000\070\000\
- \071\000\071\000\000\000\068\000\074\000\072\000\070\000\000\000\
- \070\000\071\000\071\000\000\000\000\000\000\000\000\000\000\000\
- \070\000\000\000\070\000\000\000\000\000\071\000\000\000\071\000\
- \071\000\071\000\070\000\071\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\000\000\069\000\
- \000\000\000\000\069\000\000\000\000\000\000\000\000\000\000\000\
- \070\000\000\000\070\000\000\000\000\000\000\000\068\000\070\000\
- \000\000\071\000\000\000\000\000\000\000\000\000\069\000\070\000\
- \000\000\000\000\070\000\070\000\070\000\000\000\000\000\000\000\
- \072\000\070\000\000\000\070\000\070\000\070\000\069\000\000\000\
- \000\000\069\000\000\000\000\000\000\000\000\000\068\000\071\000\
- \070\000\070\000\070\000\070\000\070\000\070\000\070\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\069\000\070\000\000\000\
- \000\000\070\000\077\000\077\000\000\000\060\000\074\000\072\000\
- \070\000\000\000\070\000\077\000\077\000\000\000\000\000\000\000\
- \000\000\000\000\070\000\000\000\070\000\000\000\000\000\076\000\
- \000\000\076\000\076\000\076\000\070\000\077\000\000\000\000\000\
+ \067\000\000\000\067\000\067\000\067\000\000\000\067\000\000\000\
+ \075\000\000\000\069\000\000\000\000\000\000\000\067\000\069\000\
+ \000\000\070\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\069\000\000\000\000\000\069\000\000\000\000\000\000\000\
- \000\000\000\000\070\000\000\000\070\000\000\000\000\000\000\000\
- \060\000\070\000\000\000\077\000\000\000\000\000\000\000\000\000\
- \069\000\070\000\000\000\000\000\070\000\077\000\077\000\000\000\
- \068\000\074\000\072\000\070\000\000\000\070\000\077\000\077\000\
- \069\000\000\000\000\000\069\000\000\000\000\000\000\000\000\000\
- \060\000\076\000\077\000\070\000\077\000\077\000\077\000\070\000\
- \077\000\000\000\000\000\000\000\000\000\000\000\000\000\069\000\
- \070\000\000\000\000\000\070\000\071\000\071\000\000\000\060\000\
- \074\000\072\000\070\000\000\000\070\000\071\000\071\000\000\000\
- \000\000\000\000\000\000\068\000\070\000\000\000\077\000\000\000\
- \000\000\078\000\000\000\078\000\078\000\078\000\070\000\071\000\
+ \000\000\067\000\000\000\068\000\067\000\000\000\068\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\067\000\070\000\
+ \000\000\069\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\068\000\069\000\000\000\000\000\069\000\069\000\
+ \069\000\067\000\067\000\073\000\071\000\069\000\000\000\069\000\
+ \069\000\069\000\068\000\000\000\000\000\068\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\069\000\000\000\069\000\069\000\
+ \069\000\069\000\069\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\068\000\069\000\000\000\000\000\069\000\070\000\070\000\
+ \000\000\067\000\073\000\071\000\069\000\000\000\069\000\070\000\
+ \070\000\000\000\000\000\000\000\000\000\000\000\069\000\000\000\
+ \069\000\000\000\000\000\070\000\000\000\070\000\070\000\070\000\
+ \069\000\070\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\068\000\000\000\000\000\
+ \068\000\000\000\000\000\000\000\000\000\000\000\069\000\000\000\
+ \069\000\000\000\000\000\000\000\067\000\069\000\000\000\070\000\
+ \000\000\000\000\000\000\000\000\068\000\069\000\000\000\000\000\
+ \069\000\069\000\069\000\000\000\000\000\000\000\071\000\069\000\
+ \000\000\069\000\069\000\069\000\068\000\000\000\000\000\068\000\
+ \000\000\000\000\000\000\000\000\067\000\070\000\069\000\069\000\
+ \069\000\069\000\069\000\069\000\069\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\068\000\069\000\000\000\000\000\069\000\
+ \076\000\076\000\000\000\000\000\073\000\071\000\069\000\000\000\
+ \069\000\075\000\076\000\000\000\000\000\000\000\000\000\000\000\
+ \069\000\000\000\069\000\000\000\000\000\075\000\000\000\075\000\
+ \075\000\075\000\069\000\076\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\068\000\
+ \000\000\000\000\068\000\000\000\000\000\000\000\000\000\000\000\
+ \069\000\000\000\069\000\000\000\000\000\000\000\000\000\069\000\
+ \000\000\076\000\000\000\000\000\000\000\000\000\068\000\069\000\
+ \000\000\000\000\069\000\076\000\076\000\000\000\067\000\073\000\
+ \071\000\069\000\000\000\069\000\076\000\076\000\068\000\000\000\
+ \000\000\068\000\000\000\000\000\000\000\000\000\000\000\075\000\
+ \076\000\069\000\076\000\076\000\076\000\069\000\076\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\068\000\069\000\000\000\
+ \000\000\069\000\070\000\070\000\000\000\000\000\073\000\071\000\
+ \069\000\000\000\069\000\077\000\070\000\000\000\000\000\000\000\
+ \000\000\067\000\069\000\000\000\076\000\000\000\000\000\077\000\
+ \000\000\077\000\077\000\077\000\069\000\070\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\081\000\000\000\000\000\081\000\000\000\
- \000\000\000\000\000\000\068\000\077\000\000\000\070\000\000\000\
- \000\000\000\000\060\000\070\000\000\000\071\000\000\000\000\000\
- \000\000\000\000\081\000\079\000\000\000\000\000\079\000\079\000\
- \079\000\000\000\000\000\083\000\080\000\079\000\000\000\079\000\
- \079\000\079\000\081\000\000\000\000\000\081\000\000\000\000\000\
- \000\000\000\000\060\000\078\000\079\000\070\000\079\000\079\000\
- \079\000\079\000\079\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\081\000\079\000\000\000\000\000\079\000\079\000\079\000\
- \000\000\000\000\000\000\080\000\079\000\000\000\079\000\079\000\
- \079\000\000\000\000\000\000\000\000\000\000\000\079\000\000\000\
- \079\000\000\000\000\000\079\000\000\000\079\000\079\000\079\000\
- \079\000\079\000\000\000\000\000\000\000\003\000\000\000\000\000\
+ \000\000\080\000\000\000\000\000\080\000\000\000\000\000\000\000\
+ \000\000\067\000\076\000\000\000\069\000\000\000\000\000\000\000\
+ \000\000\069\000\000\000\070\000\000\000\000\000\000\000\000\000\
+ \080\000\078\000\000\000\000\000\078\000\078\000\078\000\000\000\
+ \000\000\082\000\079\000\078\000\000\000\078\000\078\000\078\000\
+ \080\000\000\000\000\000\080\000\000\000\000\000\000\000\000\000\
+ \000\000\077\000\078\000\069\000\078\000\078\000\078\000\078\000\
+ \078\000\000\000\000\000\000\000\000\000\000\000\000\000\080\000\
+ \078\000\000\000\000\000\078\000\078\000\078\000\000\000\000\000\
+ \000\000\079\000\078\000\000\000\078\000\078\000\078\000\000\000\
+ \000\000\000\000\000\000\000\000\078\000\000\000\078\000\000\000\
+ \000\000\078\000\000\000\078\000\078\000\078\000\078\000\078\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\096\000\
+ \096\000\000\000\000\000\084\000\000\000\000\000\000\000\000\000\
+ \084\000\096\000\000\000\000\000\078\000\000\000\078\000\000\000\
+ \000\000\000\000\000\000\078\000\084\000\078\000\084\000\084\000\
+ \084\000\000\000\096\000\000\000\000\000\000\000\000\000\000\000\
+ \003\000\000\000\000\000\003\000\009\000\009\000\000\000\000\000\
+ \005\000\003\000\003\000\000\000\003\000\006\000\009\000\000\000\
+ \000\000\000\000\000\000\078\000\000\000\078\000\000\000\084\000\
+ \096\000\085\000\000\000\006\000\006\000\006\000\003\000\009\000\
+ \000\000\000\000\000\000\000\000\000\000\003\000\000\000\000\000\
\003\000\009\000\009\000\000\000\000\000\005\000\003\000\003\000\
- \000\000\003\000\009\000\009\000\000\000\000\000\079\000\000\000\
- \079\000\000\000\000\000\000\000\000\000\079\000\086\000\079\000\
+ \000\000\003\000\006\000\009\000\000\000\000\000\084\000\084\000\
+ \000\000\000\000\000\000\003\000\084\000\009\000\085\000\000\000\
\006\000\006\000\006\000\003\000\009\000\000\000\000\000\000\000\
\000\000\000\000\003\000\000\000\000\000\003\000\009\000\009\000\
- \000\000\000\000\005\000\003\000\003\000\000\000\003\000\009\000\
- \009\000\000\000\000\000\000\000\000\000\079\000\000\000\079\000\
- \003\000\085\000\009\000\086\000\000\000\006\000\006\000\006\000\
- \003\000\009\000\000\000\000\000\000\000\000\000\000\000\003\000\
- \000\000\000\000\003\000\009\000\009\000\000\000\000\000\092\000\
- \003\000\003\000\000\000\003\000\009\000\009\000\000\000\000\000\
- \086\000\005\000\003\000\000\000\000\000\003\000\085\000\009\000\
- \093\000\000\000\009\000\009\000\009\000\003\000\009\000\000\000\
- \000\000\000\000\000\000\000\000\003\000\000\000\000\000\003\000\
- \009\000\009\000\000\000\000\000\085\000\003\000\003\000\000\000\
- \003\000\009\000\009\000\000\000\000\000\086\000\005\000\003\000\
- \000\000\000\000\003\000\092\000\009\000\086\000\000\000\006\000\
- \006\000\090\000\003\000\009\000\000\000\000\000\000\000\000\000\
- \000\000\003\000\000\000\000\000\003\000\009\000\009\000\000\000\
- \000\000\085\000\003\000\003\000\000\000\003\000\009\000\009\000\
- \000\000\000\000\093\000\092\000\003\000\000\000\000\000\003\000\
- \085\000\009\000\086\000\000\000\006\000\006\000\091\000\003\000\
- \009\000\000\000\000\000\000\000\000\000\000\000\003\000\000\000\
- \000\000\003\000\009\000\009\000\000\000\000\000\085\000\003\000\
- \003\000\000\000\003\000\009\000\009\000\000\000\000\000\086\000\
- \085\000\003\000\000\000\000\000\003\000\085\000\009\000\086\000\
- \000\000\006\000\006\000\006\000\003\000\009\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\000\000\094\000\
- \094\000\000\000\000\000\092\000\000\000\000\000\000\000\000\000\
- \094\000\094\000\000\000\000\000\086\000\085\000\003\000\000\000\
- \000\000\003\000\085\000\009\000\094\000\000\000\094\000\094\000\
- \094\000\000\000\094\000\000\000\000\000\000\000\000\000\000\000\
- \003\000\000\000\000\000\003\000\009\000\009\000\000\000\000\000\
- \092\000\003\000\003\000\000\000\003\000\009\000\009\000\000\000\
- \000\000\086\000\085\000\003\000\000\000\000\000\000\000\092\000\
- \094\000\093\000\000\000\009\000\009\000\009\000\003\000\009\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\094\000\094\000\000\000\000\000\092\000\000\000\000\000\
- \105\000\105\000\094\000\094\000\092\000\000\000\094\000\092\000\
- \000\000\105\000\105\000\003\000\092\000\009\000\094\000\000\000\
- \094\000\094\000\094\000\000\000\094\000\106\000\000\000\105\000\
- \105\000\105\000\000\000\105\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\105\000\105\000\000\000\
- \000\000\092\000\000\000\093\000\092\000\003\000\105\000\105\000\
- \000\000\092\000\094\000\000\000\000\000\000\000\000\000\000\000\
- \092\000\105\000\106\000\000\000\105\000\105\000\105\000\000\000\
- \105\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\105\000\105\000\000\000\000\000\092\000\000\000\
- \094\000\092\000\000\000\105\000\105\000\000\000\000\000\106\000\
- \092\000\000\000\000\000\000\000\000\000\092\000\105\000\106\000\
- \000\000\105\000\105\000\105\000\000\000\105\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\000\000\105\000\
- \105\000\000\000\000\000\085\000\000\000\000\000\105\000\105\000\
- \105\000\105\000\005\000\000\000\106\000\092\000\000\000\105\000\
- \105\000\000\000\092\000\105\000\109\000\000\000\108\000\108\000\
- \108\000\000\000\105\000\109\000\000\000\108\000\108\000\108\000\
- \000\000\105\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\105\000\105\000\000\000\000\000\085\000\
- \000\000\106\000\092\000\000\000\105\000\105\000\000\000\085\000\
- \105\000\000\000\000\000\000\000\000\000\000\000\085\000\105\000\
- \109\000\000\000\108\000\108\000\108\000\000\000\105\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \105\000\105\000\000\000\000\000\005\000\000\000\109\000\085\000\
- \000\000\105\000\105\000\000\000\000\000\109\000\005\000\000\000\
- \000\000\000\000\000\000\085\000\105\000\109\000\000\000\108\000\
- \108\000\108\000\000\000\105\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\114\000\114\000\000\000\
- \060\000\000\000\000\000\000\000\000\000\000\000\114\000\114\000\
- \000\000\000\000\109\000\085\000\000\000\000\000\000\000\000\000\
- \085\000\105\000\112\000\000\000\113\000\112\000\112\000\000\000\
- \114\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \114\000\114\000\000\000\060\000\000\000\000\000\000\000\000\000\
- \000\000\114\000\114\000\000\000\000\000\000\000\000\000\109\000\
- \005\000\000\000\000\000\060\000\000\000\112\000\114\000\113\000\
- \112\000\112\000\000\000\114\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\114\000\114\000\000\000\068\000\000\000\
- \116\000\116\000\000\000\060\000\114\000\114\000\000\000\000\000\
- \000\000\116\000\116\000\060\000\112\000\000\000\060\000\000\000\
- \114\000\114\000\114\000\114\000\114\000\115\000\114\000\115\000\
- \115\000\115\000\000\000\116\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\116\000\116\000\000\000\068\000\000\000\
- \000\000\000\000\000\000\000\000\116\000\116\000\060\000\112\000\
- \000\000\068\000\000\000\000\000\114\000\000\000\060\000\000\000\
- \116\000\116\000\116\000\116\000\116\000\000\000\116\000\000\000\
- \000\000\000\000\003\000\000\000\000\000\003\000\118\000\118\000\
- \000\000\000\000\005\000\003\000\003\000\000\000\003\000\118\000\
- \118\000\068\000\114\000\000\000\000\000\000\000\060\000\115\000\
- \000\000\068\000\000\000\117\000\116\000\007\000\007\000\007\000\
- \003\000\118\000\000\000\000\000\000\000\000\000\000\000\003\000\
- \000\000\000\000\003\000\118\000\118\000\000\000\000\000\092\000\
- \003\000\003\000\000\000\003\000\118\000\118\000\000\000\000\000\
- \000\000\068\000\116\000\000\000\000\000\003\000\005\000\118\000\
- \119\000\000\000\118\000\118\000\118\000\003\000\118\000\000\000\
+ \000\000\000\000\094\000\003\000\003\000\000\000\003\000\009\000\
+ \009\000\000\000\000\000\085\000\005\000\003\000\000\000\000\000\
+ \003\000\084\000\009\000\098\000\000\000\009\000\009\000\009\000\
+ \003\000\009\000\000\000\000\000\000\000\000\000\000\000\090\000\
+ \000\000\000\000\003\000\093\000\093\000\000\000\000\000\084\000\
+ \090\000\090\000\000\000\090\000\091\000\093\000\000\000\000\000\
+ \085\000\005\000\003\000\000\000\000\000\003\000\094\000\009\000\
+ \092\000\000\000\006\000\091\000\089\000\090\000\093\000\000\000\
\000\000\000\000\000\000\000\000\003\000\000\000\000\000\003\000\
- \118\000\118\000\000\000\000\000\092\000\003\000\003\000\000\000\
- \003\000\118\000\118\000\000\000\000\000\117\000\005\000\003\000\
- \000\000\000\000\003\000\092\000\118\000\119\000\000\000\118\000\
- \118\000\118\000\003\000\118\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\053\000\000\000\000\000\121\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\119\000\092\000\003\000\000\000\000\000\003\000\
- \092\000\118\000\000\000\123\000\000\000\000\000\000\000\000\000\
- \122\000\127\000\000\000\126\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\125\000\000\000\119\000\
- \092\000\003\000\124\000\124\000\124\000\124\000\124\000\124\000\
- \124\000\124\000\124\000\124\000\124\000\124\000\124\000\124\000\
- \124\000\124\000\124\000\124\000\124\000\124\000\124\000\124\000\
- \124\000\124\000\124\000\124\000\000\000\000\000\000\000\000\000\
- \124\000\000\000\124\000\124\000\124\000\124\000\124\000\124\000\
- \124\000\124\000\124\000\124\000\124\000\124\000\124\000\124\000\
- \124\000\124\000\124\000\124\000\124\000\124\000\124\000\124\000\
- \124\000\124\000\124\000\124\000\146\000\146\000\146\000\146\000\
- \146\000\146\000\146\000\146\000\146\000\146\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\146\000\146\000\146\000\
- \146\000\146\000\146\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \009\000\009\000\000\000\000\000\084\000\003\000\003\000\000\000\
+ \003\000\006\000\009\000\000\000\000\000\098\000\094\000\003\000\
+ \000\000\000\000\090\000\084\000\093\000\085\000\000\000\006\000\
+ \006\000\097\000\003\000\009\000\000\000\000\000\000\000\000\000\
+ \000\000\090\000\000\000\000\000\003\000\090\000\090\000\000\000\
+ \000\000\000\000\090\000\090\000\000\000\090\000\090\000\090\000\
+ \000\000\000\000\092\000\084\000\090\000\000\000\000\000\003\000\
+ \084\000\009\000\090\000\000\000\003\000\090\000\003\000\090\000\
+ \090\000\000\000\000\000\000\000\090\000\000\000\000\000\003\000\
+ \093\000\093\000\000\000\000\000\084\000\090\000\090\000\000\000\
+ \090\000\091\000\093\000\000\000\000\000\000\000\000\000\085\000\
+ \084\000\003\000\000\000\000\000\090\000\092\000\090\000\006\000\
+ \091\000\006\000\090\000\093\000\000\000\000\000\000\000\000\000\
+ \000\000\090\000\000\000\000\000\003\000\093\000\093\000\000\000\
+ \000\000\005\000\090\000\090\000\000\000\090\000\091\000\093\000\
+ \000\000\000\000\000\000\000\000\090\000\000\000\090\000\090\000\
+ \084\000\093\000\092\000\000\000\006\000\091\000\006\000\090\000\
+ \093\000\000\000\000\000\000\000\000\000\000\000\090\000\000\000\
+ \000\000\003\000\093\000\093\000\000\000\000\000\094\000\090\000\
+ \090\000\000\000\090\000\093\000\093\000\000\000\000\000\092\000\
+ \084\000\090\000\000\000\000\000\090\000\084\000\093\000\095\000\
+ \000\000\009\000\093\000\009\000\090\000\093\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\096\000\
+ \096\000\000\000\000\000\094\000\000\000\000\000\000\000\000\000\
+ \096\000\096\000\000\000\000\000\092\000\005\000\090\000\000\000\
+ \000\000\090\000\094\000\093\000\096\000\000\000\096\000\096\000\
+ \096\000\000\000\096\000\000\000\000\000\000\000\000\000\000\000\
+ \090\000\000\000\000\000\003\000\093\000\093\000\000\000\000\000\
+ \094\000\090\000\090\000\000\000\090\000\093\000\093\000\000\000\
+ \000\000\095\000\094\000\090\000\000\000\000\000\000\000\094\000\
+ \096\000\095\000\000\000\009\000\093\000\009\000\090\000\093\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\146\000\146\000\146\000\
- \146\000\146\000\146\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\124\000\124\000\124\000\124\000\124\000\124\000\124\000\
- \124\000\124\000\124\000\124\000\124\000\124\000\124\000\124\000\
- \124\000\124\000\124\000\124\000\124\000\124\000\124\000\124\000\
- \000\000\124\000\124\000\124\000\124\000\124\000\124\000\124\000\
- \124\000\124\000\124\000\124\000\124\000\124\000\124\000\124\000\
- \124\000\124\000\124\000\124\000\124\000\124\000\124\000\124\000\
- \124\000\124\000\124\000\124\000\124\000\124\000\124\000\124\000\
- \000\000\124\000\124\000\124\000\124\000\124\000\124\000\124\000\
- \124\000\052\000\124\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\124\000\124\000\124\000\124\000\124\000\
- \124\000\124\000\124\000\124\000\124\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\124\000\124\000\124\000\124\000\
- \124\000\124\000\124\000\124\000\124\000\124\000\124\000\124\000\
- \124\000\124\000\124\000\124\000\124\000\124\000\124\000\124\000\
- \124\000\124\000\124\000\124\000\124\000\124\000\000\000\000\000\
- \000\000\000\000\124\000\000\000\124\000\124\000\124\000\124\000\
- \124\000\124\000\124\000\124\000\124\000\124\000\124\000\124\000\
- \124\000\124\000\124\000\124\000\124\000\124\000\124\000\124\000\
- \124\000\124\000\124\000\124\000\124\000\124\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\132\000\132\000\132\000\132\000\
- \132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
- \132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
- \132\000\132\000\132\000\132\000\132\000\132\000\000\000\000\000\
- \000\000\000\000\132\000\000\000\132\000\132\000\132\000\132\000\
- \132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
- \132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
- \132\000\132\000\132\000\132\000\132\000\132\000\000\000\000\000\
- \000\000\000\000\000\000\124\000\124\000\124\000\124\000\124\000\
- \124\000\124\000\124\000\124\000\124\000\124\000\124\000\124\000\
- \124\000\124\000\124\000\124\000\124\000\124\000\124\000\124\000\
- \124\000\124\000\000\000\124\000\124\000\124\000\124\000\124\000\
- \124\000\124\000\124\000\124\000\124\000\124\000\124\000\124\000\
- \124\000\124\000\124\000\124\000\124\000\124\000\124\000\124\000\
- \124\000\124\000\124\000\124\000\124\000\124\000\124\000\124\000\
- \124\000\124\000\000\000\124\000\124\000\124\000\124\000\124\000\
- \124\000\124\000\124\000\132\000\132\000\132\000\132\000\132\000\
- \132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
- \132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
- \132\000\132\000\000\000\132\000\132\000\132\000\132\000\132\000\
- \132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
- \132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
- \132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
- \132\000\132\000\000\000\132\000\132\000\132\000\132\000\132\000\
- \132\000\132\000\132\000\131\000\131\000\131\000\131\000\131\000\
- \131\000\131\000\131\000\131\000\131\000\131\000\131\000\131\000\
- \131\000\131\000\131\000\131\000\131\000\131\000\131\000\131\000\
- \131\000\131\000\131\000\131\000\131\000\000\000\000\000\000\000\
- \000\000\131\000\000\000\131\000\131\000\131\000\131\000\131\000\
- \131\000\131\000\131\000\131\000\131\000\131\000\131\000\131\000\
- \131\000\131\000\131\000\131\000\131\000\131\000\131\000\131\000\
- \131\000\131\000\131\000\131\000\131\000\156\000\156\000\156\000\
- \156\000\156\000\156\000\156\000\156\000\156\000\156\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\156\000\156\000\
- \156\000\156\000\156\000\156\000\000\000\000\000\000\000\000\000\
+ \000\000\096\000\096\000\000\000\000\000\094\000\000\000\000\000\
+ \000\000\000\000\096\000\096\000\000\000\000\000\096\000\094\000\
+ \000\000\000\000\000\000\090\000\094\000\093\000\096\000\000\000\
+ \096\000\096\000\096\000\000\000\096\000\000\000\000\000\000\000\
+ \000\000\000\000\003\000\000\000\000\000\003\000\009\000\009\000\
+ \000\000\000\000\084\000\003\000\003\000\000\000\003\000\006\000\
+ \009\000\000\000\000\000\095\000\094\000\090\000\000\000\000\000\
+ \000\000\094\000\096\000\085\000\000\000\006\000\006\000\006\000\
+ \003\000\009\000\000\000\000\000\000\000\000\000\000\000\003\000\
+ \000\000\000\000\003\000\009\000\009\000\000\000\000\000\094\000\
+ \003\000\003\000\000\000\003\000\009\000\009\000\000\000\000\000\
+ \096\000\094\000\000\000\000\000\000\000\003\000\084\000\009\000\
+ \098\000\000\000\009\000\009\000\009\000\003\000\009\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \111\000\111\000\000\000\000\000\084\000\000\000\000\000\111\000\
+ \111\000\109\000\111\000\005\000\000\000\085\000\084\000\003\000\
+ \109\000\111\000\003\000\094\000\009\000\110\000\000\000\109\000\
+ \109\000\109\000\000\000\111\000\110\000\000\000\109\000\109\000\
+ \109\000\000\000\111\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\111\000\111\000\000\000\000\000\
+ \094\000\000\000\098\000\094\000\003\000\111\000\111\000\000\000\
+ \084\000\111\000\000\000\000\000\000\000\000\000\000\000\084\000\
+ \111\000\113\000\000\000\111\000\111\000\111\000\000\000\111\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\156\000\156\000\
- \156\000\156\000\156\000\156\000\000\000\000\000\000\000\000\000\
+ \000\000\111\000\111\000\000\000\000\000\084\000\000\000\110\000\
+ \084\000\000\000\109\000\111\000\000\000\000\000\110\000\005\000\
+ \000\000\000\000\000\000\000\000\094\000\111\000\110\000\000\000\
+ \109\000\109\000\109\000\000\000\111\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\111\000\111\000\
+ \000\000\000\000\094\000\000\000\000\000\111\000\111\000\111\000\
+ \111\000\005\000\000\000\113\000\094\000\000\000\109\000\111\000\
+ \000\000\084\000\111\000\113\000\000\000\111\000\111\000\111\000\
+ \000\000\111\000\110\000\000\000\109\000\109\000\109\000\000\000\
+ \111\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\117\000\117\000\000\000\000\000\000\000\000\000\
+ \110\000\084\000\000\000\115\000\117\000\000\000\094\000\111\000\
+ \000\000\000\000\000\000\000\000\000\000\084\000\111\000\115\000\
+ \000\000\116\000\115\000\115\000\000\000\117\000\000\000\000\000\
+ \000\000\117\000\117\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\115\000\117\000\000\000\113\000\094\000\000\000\
+ \000\000\000\000\000\000\000\000\110\000\005\000\115\000\000\000\
+ \116\000\115\000\115\000\117\000\117\000\117\000\117\000\000\000\
+ \067\000\000\000\000\000\000\000\000\000\000\000\117\000\117\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\131\000\131\000\131\000\131\000\131\000\131\000\
- \131\000\131\000\131\000\131\000\131\000\131\000\131\000\131\000\
- \131\000\131\000\131\000\131\000\131\000\131\000\131\000\131\000\
- \131\000\000\000\131\000\131\000\131\000\131\000\131\000\131\000\
- \131\000\131\000\131\000\131\000\131\000\131\000\131\000\131\000\
- \131\000\131\000\131\000\131\000\131\000\131\000\131\000\131\000\
- \131\000\131\000\131\000\131\000\131\000\131\000\131\000\131\000\
- \131\000\131\000\131\000\131\000\131\000\131\000\131\000\131\000\
- \131\000\131\000\131\000\131\000\131\000\131\000\131\000\131\000\
- \131\000\131\000\131\000\131\000\000\000\000\000\032\000\000\000\
- \000\000\000\000\129\000\131\000\131\000\131\000\131\000\131\000\
- \131\000\131\000\131\000\131\000\131\000\131\000\131\000\131\000\
- \131\000\131\000\131\000\131\000\131\000\131\000\131\000\131\000\
- \131\000\131\000\131\000\131\000\131\000\000\000\000\000\000\000\
- \000\000\131\000\000\000\131\000\131\000\131\000\131\000\131\000\
- \131\000\131\000\131\000\131\000\131\000\131\000\131\000\131\000\
- \131\000\131\000\131\000\131\000\131\000\131\000\131\000\131\000\
- \131\000\131\000\131\000\131\000\131\000\123\000\123\000\123\000\
- \123\000\123\000\123\000\123\000\123\000\123\000\123\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\123\000\123\000\
- \123\000\123\000\123\000\123\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\117\000\000\000\117\000\117\000\117\000\000\000\
+ \117\000\115\000\117\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\119\000\119\000\000\000\000\000\000\000\119\000\
+ \119\000\000\000\067\000\118\000\119\000\000\000\000\000\000\000\
+ \119\000\119\000\000\000\067\000\000\000\000\000\117\000\118\000\
+ \115\000\118\000\118\000\118\000\119\000\119\000\119\000\119\000\
+ \119\000\000\000\119\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\067\000\117\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\119\000\000\000\067\000\000\000\000\000\
+ \119\000\000\000\000\000\000\000\000\000\000\000\003\000\000\000\
+ \000\000\003\000\121\000\121\000\000\000\000\000\005\000\003\000\
+ \003\000\000\000\003\000\007\000\121\000\000\000\000\000\000\000\
+ \000\000\118\000\000\000\000\000\000\000\067\000\119\000\120\000\
+ \000\000\007\000\007\000\007\000\003\000\121\000\000\000\000\000\
+ \000\000\000\000\000\000\003\000\000\000\000\000\003\000\121\000\
+ \121\000\000\000\000\000\094\000\003\000\003\000\000\000\003\000\
+ \121\000\121\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\003\000\005\000\121\000\122\000\000\000\121\000\121\000\
+ \121\000\003\000\121\000\000\000\000\000\000\000\000\000\000\000\
+ \003\000\000\000\000\000\003\000\121\000\121\000\000\000\000\000\
+ \094\000\003\000\003\000\000\000\003\000\121\000\121\000\000\000\
+ \000\000\120\000\005\000\003\000\000\000\000\000\003\000\094\000\
+ \121\000\122\000\000\000\121\000\121\000\121\000\003\000\121\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\053\000\
+ \000\000\000\000\124\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\122\000\094\000\
+ \003\000\000\000\000\000\003\000\094\000\121\000\000\000\126\000\
+ \000\000\000\000\000\000\000\000\125\000\130\000\000\000\129\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\123\000\123\000\
- \123\000\123\000\123\000\123\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\131\000\131\000\131\000\131\000\131\000\131\000\
- \131\000\131\000\131\000\131\000\131\000\131\000\131\000\131\000\
- \131\000\131\000\131\000\131\000\131\000\131\000\131\000\131\000\
- \131\000\000\000\131\000\131\000\131\000\131\000\131\000\131\000\
- \131\000\131\000\131\000\131\000\131\000\131\000\131\000\131\000\
- \131\000\131\000\131\000\131\000\131\000\131\000\131\000\131\000\
- \131\000\131\000\131\000\131\000\131\000\131\000\131\000\131\000\
- \131\000\132\000\131\000\131\000\131\000\131\000\131\000\131\000\
- \131\000\131\000\132\000\132\000\132\000\132\000\132\000\132\000\
- \132\000\132\000\132\000\132\000\000\000\000\000\032\000\000\000\
- \000\000\000\000\000\000\132\000\132\000\132\000\132\000\132\000\
- \132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
- \132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
- \132\000\132\000\132\000\132\000\132\000\000\000\000\000\000\000\
- \000\000\132\000\000\000\132\000\132\000\132\000\132\000\132\000\
- \132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
- \132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
- \132\000\132\000\132\000\132\000\132\000\000\000\000\000\000\000\
+ \000\000\128\000\000\000\122\000\094\000\003\000\127\000\127\000\
+ \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
+ \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
+ \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
+ \000\000\000\000\000\000\000\000\127\000\000\000\127\000\127\000\
+ \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
+ \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
+ \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
+ \149\000\149\000\149\000\149\000\149\000\149\000\149\000\149\000\
+ \149\000\149\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\149\000\149\000\149\000\149\000\149\000\149\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\149\000\149\000\149\000\149\000\149\000\149\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\127\000\127\000\127\000\
+ \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
+ \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
+ \127\000\127\000\127\000\127\000\000\000\127\000\127\000\127\000\
+ \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
+ \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
+ \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
+ \127\000\127\000\127\000\127\000\000\000\127\000\127\000\127\000\
+ \127\000\127\000\127\000\127\000\127\000\052\000\127\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\127\000\
+ \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
+ \127\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
+ \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
+ \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
+ \127\000\127\000\000\000\000\000\000\000\000\000\127\000\000\000\
+ \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
+ \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
+ \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
+ \127\000\127\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
+ \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
+ \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
+ \135\000\135\000\000\000\000\000\000\000\000\000\135\000\000\000\
+ \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
+ \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
+ \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
+ \135\000\135\000\000\000\000\000\000\000\000\000\000\000\127\000\
+ \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
+ \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
+ \127\000\127\000\127\000\127\000\127\000\127\000\000\000\127\000\
+ \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
+ \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
+ \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
+ \127\000\127\000\127\000\127\000\127\000\127\000\000\000\127\000\
+ \127\000\127\000\127\000\127\000\127\000\127\000\127\000\135\000\
+ \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
+ \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
+ \135\000\135\000\135\000\135\000\135\000\135\000\000\000\135\000\
+ \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
+ \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
+ \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
+ \135\000\135\000\135\000\135\000\135\000\135\000\000\000\135\000\
+ \135\000\135\000\135\000\135\000\135\000\135\000\135\000\134\000\
+ \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
+ \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
+ \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
+ \134\000\000\000\000\000\000\000\000\000\134\000\000\000\134\000\
+ \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
+ \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
+ \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
+ \134\000\159\000\159\000\159\000\159\000\159\000\159\000\159\000\
+ \159\000\159\000\159\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\159\000\159\000\159\000\159\000\159\000\159\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\159\000\159\000\159\000\159\000\159\000\159\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\132\000\132\000\132\000\132\000\132\000\132\000\
- \132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
- \132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
- \132\000\000\000\132\000\132\000\132\000\132\000\132\000\132\000\
- \132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
- \132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
- \132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
- \132\000\000\000\132\000\132\000\132\000\132\000\132\000\132\000\
- \132\000\132\000\142\000\000\000\142\000\000\000\000\000\154\000\
- \000\000\142\000\153\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\141\000\141\000\141\000\141\000\141\000\141\000\
- \141\000\141\000\141\000\141\000\000\000\032\000\000\000\032\000\
- \000\000\000\000\000\000\000\000\032\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\152\000\152\000\152\000\
- \152\000\152\000\152\000\152\000\152\000\152\000\152\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\142\000\000\000\
- \000\000\000\000\000\000\000\000\142\000\157\000\000\000\000\000\
- \157\000\157\000\157\000\000\000\000\000\000\000\157\000\157\000\
- \142\000\157\000\157\000\157\000\142\000\000\000\142\000\000\000\
- \000\000\032\000\140\000\000\000\000\000\000\000\157\000\032\000\
- \157\000\157\000\157\000\157\000\157\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\032\000\000\000\000\000\000\000\032\000\
- \000\000\032\000\000\000\000\000\000\000\151\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \157\000\000\000\157\000\000\000\000\000\000\000\000\000\000\000\
- \159\000\000\000\000\000\159\000\159\000\159\000\000\000\000\000\
- \000\000\159\000\159\000\000\000\159\000\159\000\159\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\134\000\134\000\
+ \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
+ \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
+ \134\000\134\000\134\000\134\000\134\000\000\000\134\000\134\000\
+ \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
+ \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
+ \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
+ \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
+ \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
+ \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
+ \000\000\000\000\032\000\000\000\000\000\000\000\132\000\134\000\
+ \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
+ \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
+ \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
+ \134\000\000\000\000\000\000\000\000\000\134\000\000\000\134\000\
+ \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
+ \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
+ \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
+ \134\000\126\000\126\000\126\000\126\000\126\000\126\000\126\000\
+ \126\000\126\000\126\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\126\000\126\000\126\000\126\000\126\000\126\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \157\000\159\000\157\000\159\000\159\000\159\000\159\000\159\000\
- \160\000\160\000\160\000\160\000\160\000\160\000\160\000\160\000\
- \160\000\160\000\160\000\160\000\160\000\160\000\160\000\160\000\
- \160\000\160\000\160\000\160\000\160\000\160\000\160\000\160\000\
- \160\000\160\000\000\000\159\000\000\000\159\000\160\000\000\000\
- \160\000\160\000\160\000\160\000\160\000\160\000\160\000\160\000\
- \160\000\160\000\160\000\160\000\160\000\160\000\160\000\160\000\
- \160\000\160\000\160\000\160\000\160\000\160\000\160\000\160\000\
- \160\000\160\000\000\000\159\000\000\000\159\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\255\255\000\000\000\000\
+ \000\000\000\000\126\000\126\000\126\000\126\000\126\000\126\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\134\000\134\000\
+ \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
+ \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
+ \134\000\134\000\134\000\134\000\134\000\000\000\134\000\134\000\
+ \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
+ \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
+ \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
+ \134\000\134\000\134\000\134\000\134\000\135\000\134\000\134\000\
+ \134\000\134\000\134\000\134\000\134\000\134\000\135\000\135\000\
+ \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
+ \000\000\000\000\032\000\000\000\000\000\000\000\000\000\135\000\
+ \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
+ \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
+ \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
+ \135\000\000\000\000\000\000\000\000\000\135\000\000\000\135\000\
+ \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
+ \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
+ \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
+ \135\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\000\000\160\000\
- \160\000\160\000\160\000\160\000\160\000\160\000\160\000\160\000\
- \160\000\160\000\160\000\160\000\160\000\160\000\160\000\160\000\
- \160\000\160\000\160\000\160\000\160\000\160\000\000\000\160\000\
- \160\000\160\000\160\000\160\000\160\000\160\000\160\000\160\000\
- \160\000\160\000\160\000\160\000\160\000\160\000\160\000\160\000\
- \160\000\160\000\160\000\160\000\160\000\160\000\160\000\160\000\
- \160\000\160\000\160\000\160\000\160\000\160\000\000\000\160\000\
- \160\000\160\000\160\000\160\000\160\000\160\000\160\000\159\000\
- \000\000\000\000\159\000\159\000\159\000\000\000\000\000\000\000\
- \159\000\159\000\000\000\159\000\159\000\159\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \159\000\000\000\159\000\159\000\159\000\159\000\159\000\000\000\
- \000\000\000\000\000\000\160\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\160\000\160\000\160\000\160\000\
- \160\000\160\000\160\000\160\000\160\000\160\000\000\000\000\000\
- \030\000\000\000\159\000\000\000\159\000\160\000\160\000\160\000\
- \160\000\160\000\160\000\160\000\160\000\160\000\160\000\160\000\
- \160\000\160\000\160\000\160\000\160\000\160\000\160\000\160\000\
- \160\000\160\000\160\000\160\000\160\000\160\000\160\000\000\000\
- \000\000\000\000\159\000\160\000\159\000\160\000\160\000\160\000\
- \160\000\160\000\160\000\160\000\160\000\160\000\160\000\160\000\
- \160\000\160\000\160\000\160\000\160\000\160\000\160\000\160\000\
- \160\000\160\000\160\000\160\000\160\000\160\000\160\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\160\000\160\000\160\000\160\000\
- \160\000\160\000\160\000\160\000\160\000\160\000\160\000\160\000\
- \160\000\160\000\160\000\160\000\160\000\160\000\160\000\160\000\
- \160\000\160\000\160\000\000\000\160\000\160\000\160\000\160\000\
- \160\000\160\000\160\000\160\000\160\000\160\000\160\000\160\000\
- \160\000\160\000\160\000\160\000\160\000\160\000\160\000\160\000\
- \160\000\160\000\160\000\160\000\160\000\160\000\160\000\160\000\
- \160\000\160\000\160\000\000\000\160\000\160\000\160\000\160\000\
- \160\000\160\000\160\000\160\000\162\000\000\000\000\000\162\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\135\000\135\000\
+ \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
+ \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
+ \135\000\135\000\135\000\135\000\135\000\000\000\135\000\135\000\
+ \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
+ \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
+ \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
+ \135\000\135\000\135\000\135\000\135\000\000\000\135\000\135\000\
+ \135\000\135\000\135\000\135\000\135\000\135\000\145\000\000\000\
+ \145\000\000\000\000\000\157\000\000\000\145\000\156\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\144\000\144\000\
+ \144\000\144\000\144\000\144\000\144\000\144\000\144\000\144\000\
+ \000\000\032\000\000\000\032\000\000\000\000\000\000\000\000\000\
+ \032\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\155\000\155\000\155\000\155\000\155\000\155\000\155\000\
+ \155\000\155\000\155\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\145\000\000\000\000\000\000\000\000\000\000\000\
+ \145\000\160\000\000\000\000\000\160\000\160\000\160\000\000\000\
+ \000\000\000\000\160\000\160\000\145\000\160\000\160\000\160\000\
+ \145\000\000\000\145\000\000\000\000\000\032\000\143\000\000\000\
+ \000\000\000\000\160\000\032\000\160\000\160\000\160\000\160\000\
+ \160\000\000\000\000\000\000\000\000\000\000\000\000\000\032\000\
+ \000\000\000\000\000\000\032\000\000\000\032\000\000\000\000\000\
+ \000\000\154\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\160\000\000\000\160\000\000\000\
+ \000\000\000\000\000\000\000\000\162\000\000\000\000\000\162\000\
\162\000\162\000\000\000\000\000\000\000\162\000\162\000\000\000\
\162\000\162\000\162\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\162\000\000\000\162\000\
+ \000\000\000\000\000\000\000\000\160\000\162\000\160\000\162\000\
\162\000\162\000\162\000\162\000\163\000\163\000\163\000\163\000\
\163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
\163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
\000\000\162\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\255\255\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\162\000\000\000\000\000\000\000\162\000\162\000\000\000\162\000\
\162\000\162\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\162\000\000\000\162\000\162\000\
- \162\000\162\000\162\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\163\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\163\000\163\000\163\000\163\000\163\000\
- \163\000\163\000\163\000\163\000\163\000\000\000\162\000\030\000\
- \162\000\000\000\000\000\164\000\163\000\163\000\163\000\163\000\
+ \162\000\162\000\162\000\000\000\000\000\000\000\000\000\163\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
+ \163\000\163\000\000\000\000\000\030\000\000\000\162\000\000\000\
+ \162\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
\163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
- \163\000\163\000\163\000\163\000\163\000\163\000\162\000\000\000\
- \162\000\000\000\163\000\000\000\163\000\163\000\163\000\163\000\
\163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
+ \163\000\163\000\163\000\000\000\000\000\000\000\162\000\163\000\
+ \162\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
\163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
- \163\000\163\000\163\000\163\000\163\000\163\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\165\000\165\000\165\000\165\000\
- \165\000\165\000\165\000\165\000\165\000\165\000\165\000\165\000\
- \165\000\165\000\165\000\165\000\165\000\165\000\165\000\165\000\
- \165\000\165\000\165\000\165\000\165\000\165\000\000\000\000\000\
- \000\000\000\000\165\000\000\000\165\000\165\000\165\000\165\000\
- \165\000\165\000\165\000\165\000\165\000\165\000\165\000\165\000\
- \165\000\165\000\165\000\165\000\165\000\165\000\165\000\165\000\
- \165\000\165\000\165\000\165\000\165\000\165\000\000\000\000\000\
- \000\000\000\000\000\000\163\000\163\000\163\000\163\000\163\000\
\163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
+ \163\000\163\000\163\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
- \163\000\163\000\000\000\163\000\163\000\163\000\163\000\163\000\
\163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
+ \163\000\163\000\163\000\163\000\163\000\163\000\163\000\000\000\
\163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
\163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
- \163\000\163\000\000\000\163\000\163\000\163\000\163\000\163\000\
- \163\000\163\000\163\000\165\000\165\000\165\000\165\000\165\000\
- \165\000\165\000\165\000\165\000\165\000\165\000\165\000\165\000\
- \165\000\165\000\165\000\165\000\165\000\165\000\165\000\165\000\
- \165\000\165\000\000\000\165\000\165\000\165\000\165\000\165\000\
- \165\000\165\000\165\000\165\000\165\000\165\000\165\000\165\000\
- \165\000\165\000\165\000\165\000\165\000\165\000\165\000\165\000\
- \165\000\165\000\165\000\165\000\165\000\165\000\165\000\165\000\
- \165\000\165\000\165\000\165\000\165\000\165\000\165\000\165\000\
- \165\000\165\000\165\000\165\000\165\000\165\000\165\000\165\000\
- \165\000\165\000\165\000\165\000\165\000\000\000\000\000\166\000\
- \000\000\000\000\000\000\000\000\165\000\165\000\165\000\165\000\
- \165\000\165\000\165\000\165\000\165\000\165\000\165\000\165\000\
- \165\000\165\000\165\000\165\000\165\000\165\000\165\000\165\000\
- \165\000\165\000\165\000\165\000\165\000\165\000\000\000\000\000\
- \000\000\000\000\165\000\000\000\165\000\165\000\165\000\165\000\
- \165\000\165\000\165\000\165\000\165\000\165\000\165\000\165\000\
- \165\000\165\000\165\000\165\000\165\000\165\000\165\000\165\000\
- \165\000\165\000\165\000\165\000\165\000\165\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\174\000\174\000\174\000\174\000\
- \174\000\174\000\174\000\174\000\174\000\174\000\174\000\174\000\
- \174\000\174\000\174\000\174\000\174\000\174\000\174\000\174\000\
- \174\000\174\000\174\000\174\000\174\000\174\000\000\000\000\000\
- \000\000\000\000\174\000\000\000\174\000\174\000\174\000\174\000\
- \174\000\174\000\174\000\174\000\174\000\174\000\174\000\174\000\
- \174\000\174\000\174\000\174\000\174\000\174\000\174\000\174\000\
- \174\000\174\000\174\000\174\000\174\000\174\000\000\000\000\000\
- \000\000\000\000\000\000\165\000\165\000\165\000\165\000\165\000\
- \165\000\165\000\165\000\165\000\165\000\165\000\165\000\165\000\
- \165\000\165\000\165\000\165\000\165\000\165\000\165\000\165\000\
- \165\000\165\000\000\000\165\000\165\000\165\000\165\000\165\000\
- \165\000\165\000\165\000\165\000\165\000\165\000\165\000\165\000\
- \165\000\165\000\165\000\165\000\165\000\165\000\165\000\165\000\
- \165\000\165\000\165\000\165\000\165\000\165\000\165\000\165\000\
- \165\000\165\000\000\000\165\000\165\000\165\000\165\000\165\000\
- \165\000\165\000\165\000\174\000\174\000\174\000\174\000\174\000\
- \174\000\174\000\174\000\174\000\174\000\174\000\174\000\174\000\
- \174\000\174\000\174\000\174\000\174\000\174\000\174\000\174\000\
- \174\000\174\000\000\000\174\000\174\000\174\000\174\000\174\000\
- \174\000\174\000\174\000\174\000\174\000\174\000\174\000\174\000\
- \174\000\174\000\174\000\174\000\174\000\174\000\174\000\174\000\
- \174\000\174\000\174\000\174\000\174\000\174\000\174\000\174\000\
- \174\000\174\000\000\000\174\000\174\000\174\000\174\000\174\000\
- \174\000\174\000\174\000\173\000\173\000\173\000\173\000\173\000\
- \173\000\173\000\173\000\173\000\173\000\173\000\173\000\173\000\
- \173\000\173\000\173\000\173\000\173\000\173\000\173\000\173\000\
- \173\000\173\000\173\000\173\000\173\000\000\000\000\000\000\000\
- \000\000\173\000\000\000\173\000\173\000\173\000\173\000\173\000\
- \173\000\173\000\173\000\173\000\173\000\173\000\173\000\173\000\
- \173\000\173\000\173\000\173\000\173\000\173\000\173\000\173\000\
- \173\000\173\000\173\000\173\000\173\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
+ \163\000\163\000\163\000\163\000\163\000\163\000\163\000\000\000\
+ \163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
+ \165\000\000\000\000\000\165\000\165\000\165\000\000\000\000\000\
+ \000\000\165\000\165\000\000\000\165\000\165\000\165\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\165\000\000\000\165\000\165\000\165\000\165\000\165\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
+ \166\000\166\000\000\000\165\000\000\000\165\000\166\000\000\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
+ \166\000\166\000\000\000\165\000\000\000\165\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\173\000\173\000\173\000\173\000\173\000\173\000\
- \173\000\173\000\173\000\173\000\173\000\173\000\173\000\173\000\
- \173\000\173\000\173\000\173\000\173\000\173\000\173\000\173\000\
- \173\000\000\000\173\000\173\000\173\000\173\000\173\000\173\000\
- \173\000\173\000\173\000\173\000\173\000\173\000\173\000\173\000\
- \173\000\173\000\173\000\173\000\173\000\173\000\173\000\173\000\
- \173\000\173\000\173\000\173\000\173\000\173\000\173\000\173\000\
- \173\000\173\000\173\000\173\000\173\000\173\000\173\000\173\000\
- \173\000\173\000\173\000\173\000\173\000\173\000\173\000\173\000\
- \173\000\173\000\173\000\173\000\000\000\000\000\030\000\000\000\
- \000\000\000\000\171\000\173\000\173\000\173\000\173\000\173\000\
- \173\000\173\000\173\000\173\000\173\000\173\000\173\000\173\000\
- \173\000\173\000\173\000\173\000\173\000\173\000\173\000\173\000\
- \173\000\173\000\173\000\173\000\173\000\000\000\000\000\000\000\
- \000\000\173\000\000\000\173\000\173\000\173\000\173\000\173\000\
- \173\000\173\000\173\000\173\000\173\000\173\000\173\000\173\000\
- \173\000\173\000\173\000\173\000\173\000\173\000\173\000\173\000\
- \173\000\173\000\173\000\173\000\173\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\000\000\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\000\000\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\165\000\
+ \000\000\000\000\165\000\165\000\165\000\000\000\000\000\000\000\
+ \165\000\165\000\000\000\165\000\165\000\165\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \165\000\000\000\165\000\165\000\165\000\165\000\165\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\166\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
+ \166\000\000\000\165\000\030\000\165\000\000\000\000\000\167\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
+ \166\000\166\000\165\000\000\000\165\000\000\000\166\000\000\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
+ \166\000\166\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
+ \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
+ \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
+ \168\000\168\000\000\000\000\000\000\000\000\000\168\000\000\000\
+ \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
+ \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
+ \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
+ \168\000\168\000\000\000\000\000\000\000\000\000\000\000\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\000\000\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\000\000\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\168\000\
+ \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
+ \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
+ \168\000\168\000\168\000\168\000\168\000\168\000\000\000\168\000\
+ \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
+ \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
+ \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
+ \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
+ \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
+ \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
+ \168\000\000\000\000\000\169\000\000\000\000\000\000\000\000\000\
+ \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
+ \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
+ \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
+ \168\000\168\000\000\000\000\000\000\000\000\000\168\000\000\000\
+ \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
+ \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
+ \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
+ \168\000\168\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
+ \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
+ \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
+ \177\000\177\000\000\000\000\000\000\000\000\000\177\000\000\000\
+ \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
+ \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
+ \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
+ \177\000\177\000\000\000\000\000\000\000\000\000\000\000\168\000\
+ \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
+ \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
+ \168\000\168\000\168\000\168\000\168\000\168\000\000\000\168\000\
+ \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
+ \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
+ \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
+ \168\000\168\000\168\000\168\000\168\000\168\000\000\000\168\000\
+ \168\000\168\000\168\000\168\000\168\000\168\000\168\000\177\000\
+ \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
+ \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
+ \177\000\177\000\177\000\177\000\177\000\177\000\000\000\177\000\
+ \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
+ \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
+ \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
+ \177\000\177\000\177\000\177\000\177\000\177\000\000\000\177\000\
+ \177\000\177\000\177\000\177\000\177\000\177\000\177\000\176\000\
+ \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
+ \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
+ \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
+ \176\000\000\000\000\000\000\000\000\000\176\000\000\000\176\000\
+ \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
+ \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
+ \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
+ \176\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\173\000\173\000\173\000\173\000\173\000\173\000\
- \173\000\173\000\173\000\173\000\173\000\173\000\173\000\173\000\
- \173\000\173\000\173\000\173\000\173\000\173\000\173\000\173\000\
- \173\000\000\000\173\000\173\000\173\000\173\000\173\000\173\000\
- \173\000\173\000\173\000\173\000\173\000\173\000\173\000\173\000\
- \173\000\173\000\173\000\173\000\173\000\173\000\173\000\173\000\
- \173\000\173\000\173\000\173\000\173\000\173\000\173\000\173\000\
- \173\000\174\000\173\000\173\000\173\000\173\000\173\000\173\000\
- \173\000\173\000\174\000\174\000\174\000\174\000\174\000\174\000\
- \174\000\174\000\174\000\174\000\000\000\000\000\030\000\000\000\
- \000\000\000\000\000\000\174\000\174\000\174\000\174\000\174\000\
- \174\000\174\000\174\000\174\000\174\000\174\000\174\000\174\000\
- \174\000\174\000\174\000\174\000\174\000\174\000\174\000\174\000\
- \174\000\174\000\174\000\174\000\174\000\000\000\000\000\000\000\
- \000\000\174\000\000\000\174\000\174\000\174\000\174\000\174\000\
- \174\000\174\000\174\000\174\000\174\000\174\000\174\000\174\000\
- \174\000\174\000\174\000\174\000\174\000\174\000\174\000\174\000\
- \174\000\174\000\174\000\174\000\174\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\176\000\176\000\
+ \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
+ \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
+ \176\000\176\000\176\000\176\000\176\000\000\000\176\000\176\000\
+ \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
+ \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
+ \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
+ \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
+ \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
+ \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
+ \000\000\000\000\030\000\000\000\000\000\000\000\174\000\176\000\
+ \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
+ \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
+ \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
+ \176\000\000\000\000\000\000\000\000\000\176\000\000\000\176\000\
+ \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
+ \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
+ \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
+ \176\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\174\000\174\000\174\000\174\000\174\000\174\000\
- \174\000\174\000\174\000\174\000\174\000\174\000\174\000\174\000\
- \174\000\174\000\174\000\174\000\174\000\174\000\174\000\174\000\
- \174\000\000\000\174\000\174\000\174\000\174\000\174\000\174\000\
- \174\000\174\000\174\000\174\000\174\000\174\000\174\000\174\000\
- \174\000\174\000\174\000\174\000\174\000\174\000\174\000\174\000\
- \174\000\174\000\174\000\174\000\174\000\174\000\174\000\174\000\
- \174\000\000\000\174\000\174\000\174\000\174\000\174\000\174\000\
- \174\000\174\000\030\000\000\000\000\000\177\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\176\000\000\000\177\000\177\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\176\000\176\000\
+ \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
+ \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
+ \176\000\176\000\176\000\176\000\176\000\000\000\176\000\176\000\
+ \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
+ \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
+ \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
+ \176\000\176\000\176\000\176\000\176\000\177\000\176\000\176\000\
+ \176\000\176\000\176\000\176\000\176\000\176\000\177\000\177\000\
\177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
- \128\000\000\000\000\000\000\000\000\000\000\000\000\000\177\000\
+ \000\000\000\000\030\000\000\000\000\000\000\000\000\000\177\000\
\177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
\177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
\177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
- \177\000\000\000\000\000\000\000\000\000\177\000\178\000\177\000\
+ \177\000\000\000\000\000\000\000\000\000\177\000\000\000\177\000\
\177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
\177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
\177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
\177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
\177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
\177\000\177\000\177\000\177\000\177\000\000\000\177\000\177\000\
- \177\000\177\000\177\000\177\000\177\000\177\000\255\255\180\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
- \180\000\180\000\128\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
+ \177\000\177\000\177\000\177\000\177\000\177\000\030\000\000\000\
+ \000\000\180\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \179\000\000\000\180\000\180\000\180\000\180\000\180\000\180\000\
+ \180\000\180\000\180\000\180\000\131\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\180\000\180\000\180\000\180\000\180\000\
\180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
\180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
- \180\000\180\000\180\000\000\000\000\000\000\000\000\000\180\000\
- \000\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
+ \180\000\180\000\180\000\180\000\180\000\000\000\000\000\000\000\
+ \000\000\180\000\181\000\180\000\180\000\180\000\180\000\180\000\
\180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
\180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
- \180\000\180\000\180\000\000\000\000\000\000\000\000\000\000\000\
+ \180\000\180\000\180\000\180\000\180\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
- \180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
- \180\000\180\000\180\000\180\000\180\000\180\000\180\000\000\000\
- \180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
- \180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
- \180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
- \180\000\180\000\180\000\180\000\180\000\180\000\180\000\000\000\
- \180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
- \180\000\000\000\000\000\000\000\000\000\000\000\000\000\179\000\
- \000\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
- \180\000\180\000\180\000\128\000\000\000\000\000\000\000\000\000\
\000\000\000\000\180\000\180\000\180\000\180\000\180\000\180\000\
\180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
\180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
- \180\000\180\000\180\000\180\000\000\000\000\000\000\000\000\000\
\180\000\000\000\180\000\180\000\180\000\180\000\180\000\180\000\
\180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
\180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
- \180\000\180\000\180\000\180\000\000\000\000\000\000\000\000\000\
+ \180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
+ \180\000\000\000\180\000\180\000\180\000\180\000\180\000\180\000\
+ \180\000\180\000\255\255\183\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\183\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\131\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\000\000\
+ \000\000\000\000\000\000\183\000\000\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
- \180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
- \180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
- \000\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
- \180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
- \180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
- \180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
- \180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
- \180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
- \180\000\180\000\180\000\128\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\180\000\180\000\180\000\180\000\180\000\180\000\
- \180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
- \180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
- \180\000\180\000\180\000\180\000\000\000\000\000\000\000\000\000\
- \180\000\000\000\180\000\180\000\180\000\180\000\180\000\180\000\
- \180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
- \180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
- \180\000\180\000\180\000\180\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\187\000\187\000\187\000\187\000\187\000\187\000\
- \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
- \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
- \187\000\187\000\187\000\187\000\000\000\000\000\000\000\000\000\
- \187\000\000\000\187\000\187\000\187\000\187\000\187\000\187\000\
- \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
- \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
- \187\000\187\000\187\000\187\000\000\000\000\000\000\000\000\000\
- \000\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
- \180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
- \180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
- \000\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
- \180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
- \180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
- \180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
- \000\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
- \180\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
- \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
- \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
- \000\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
- \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
- \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
- \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
- \000\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
- \187\000\186\000\186\000\186\000\186\000\186\000\186\000\186\000\
- \186\000\186\000\186\000\186\000\186\000\186\000\186\000\186\000\
- \186\000\186\000\186\000\186\000\186\000\186\000\186\000\186\000\
- \186\000\186\000\186\000\000\000\000\000\000\000\000\000\186\000\
- \000\000\186\000\186\000\186\000\186\000\186\000\186\000\186\000\
- \186\000\186\000\186\000\186\000\186\000\186\000\186\000\186\000\
- \186\000\186\000\186\000\186\000\186\000\186\000\186\000\186\000\
- \186\000\186\000\186\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\183\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\000\000\183\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\000\000\183\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\182\000\000\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\131\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
+ \000\000\000\000\000\000\000\000\183\000\000\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \186\000\186\000\186\000\186\000\186\000\186\000\186\000\186\000\
- \186\000\186\000\186\000\186\000\186\000\186\000\186\000\186\000\
- \186\000\186\000\186\000\186\000\186\000\186\000\186\000\000\000\
- \186\000\186\000\186\000\186\000\186\000\186\000\186\000\186\000\
- \186\000\186\000\186\000\186\000\186\000\186\000\186\000\186\000\
- \186\000\186\000\186\000\186\000\186\000\186\000\186\000\186\000\
- \186\000\186\000\186\000\186\000\186\000\186\000\186\000\186\000\
- \186\000\186\000\186\000\186\000\186\000\186\000\186\000\186\000\
- \186\000\186\000\186\000\186\000\186\000\186\000\186\000\186\000\
- \186\000\186\000\000\000\000\000\034\000\000\000\000\000\000\000\
- \184\000\186\000\186\000\186\000\186\000\186\000\186\000\186\000\
- \186\000\186\000\186\000\186\000\186\000\186\000\186\000\186\000\
- \186\000\186\000\186\000\186\000\186\000\186\000\186\000\186\000\
- \186\000\186\000\186\000\000\000\000\000\000\000\000\000\186\000\
- \000\000\186\000\186\000\186\000\186\000\186\000\186\000\186\000\
- \186\000\186\000\186\000\186\000\186\000\186\000\186\000\186\000\
- \186\000\186\000\186\000\186\000\186\000\186\000\186\000\186\000\
- \186\000\186\000\186\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\000\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\131\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
+ \000\000\000\000\000\000\000\000\183\000\000\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\190\000\190\000\
+ \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
+ \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
+ \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
+ \000\000\000\000\000\000\000\000\190\000\000\000\190\000\190\000\
+ \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
+ \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
+ \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
+ \000\000\000\000\000\000\000\000\000\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\000\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\000\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\190\000\190\000\190\000\
+ \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
+ \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
+ \190\000\190\000\190\000\190\000\000\000\190\000\190\000\190\000\
+ \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
+ \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
+ \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
+ \190\000\190\000\190\000\190\000\000\000\190\000\190\000\190\000\
+ \190\000\190\000\190\000\190\000\190\000\189\000\189\000\189\000\
+ \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
+ \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
+ \189\000\189\000\189\000\189\000\189\000\189\000\189\000\000\000\
+ \000\000\000\000\000\000\189\000\000\000\189\000\189\000\189\000\
+ \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
+ \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
+ \189\000\189\000\189\000\189\000\189\000\189\000\189\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \186\000\186\000\186\000\186\000\186\000\186\000\186\000\186\000\
- \186\000\186\000\186\000\186\000\186\000\186\000\186\000\186\000\
- \186\000\186\000\186\000\186\000\186\000\186\000\186\000\000\000\
- \186\000\186\000\186\000\186\000\186\000\186\000\186\000\186\000\
- \186\000\186\000\186\000\186\000\186\000\186\000\186\000\186\000\
- \186\000\186\000\186\000\186\000\186\000\186\000\186\000\186\000\
- \186\000\186\000\186\000\186\000\186\000\186\000\186\000\187\000\
- \186\000\186\000\186\000\186\000\186\000\186\000\186\000\186\000\
- \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
- \187\000\187\000\000\000\000\000\034\000\000\000\000\000\000\000\
- \000\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
- \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
- \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
- \187\000\187\000\187\000\000\000\000\000\000\000\000\000\187\000\
- \000\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
- \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
- \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
- \187\000\187\000\187\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\189\000\189\000\189\000\189\000\
+ \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
+ \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
+ \189\000\189\000\189\000\000\000\189\000\189\000\189\000\189\000\
+ \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
+ \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
+ \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
+ \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
+ \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
+ \189\000\189\000\189\000\189\000\189\000\189\000\000\000\000\000\
+ \034\000\000\000\000\000\000\000\187\000\189\000\189\000\189\000\
+ \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
+ \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
+ \189\000\189\000\189\000\189\000\189\000\189\000\189\000\000\000\
+ \000\000\000\000\000\000\189\000\000\000\189\000\189\000\189\000\
+ \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
+ \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
+ \189\000\189\000\189\000\189\000\189\000\189\000\189\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
- \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
- \187\000\187\000\187\000\187\000\187\000\187\000\187\000\000\000\
- \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
- \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
- \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
- \187\000\187\000\187\000\187\000\187\000\187\000\187\000\000\000\
- \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
- \000\000";
+ \000\000\000\000\000\000\000\000\189\000\189\000\189\000\189\000\
+ \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
+ \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
+ \189\000\189\000\189\000\000\000\189\000\189\000\189\000\189\000\
+ \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
+ \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
+ \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
+ \189\000\189\000\189\000\190\000\189\000\189\000\189\000\189\000\
+ \189\000\189\000\189\000\189\000\190\000\190\000\190\000\190\000\
+ \190\000\190\000\190\000\190\000\190\000\190\000\000\000\000\000\
+ \034\000\000\000\000\000\000\000\000\000\190\000\190\000\190\000\
+ \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
+ \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
+ \190\000\190\000\190\000\190\000\190\000\190\000\190\000\000\000\
+ \000\000\000\000\000\000\190\000\000\000\190\000\190\000\190\000\
+ \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
+ \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
+ \190\000\190\000\190\000\190\000\190\000\190\000\190\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\190\000\190\000\190\000\190\000\
+ \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
+ \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
+ \190\000\190\000\190\000\000\000\190\000\190\000\190\000\190\000\
+ \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
+ \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
+ \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
+ \190\000\190\000\190\000\000\000\190\000\190\000\190\000\190\000\
+ \190\000\190\000\190\000\190\000\000\000";
Lexing.lex_check =
"\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\000\000\000\000\029\000\000\000\000\000\097\000\103\000\
- \121\000\099\000\102\000\148\000\099\000\102\000\168\000\183\000\
+ \255\255\000\000\000\000\029\000\000\000\000\000\101\000\107\000\
+ \124\000\151\000\103\000\106\000\171\000\103\000\106\000\186\000\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\012\000\
- \016\000\028\000\040\000\040\000\028\000\020\000\049\000\038\000\
- \020\000\038\000\051\000\057\000\038\000\038\000\038\000\038\000\
- \038\000\038\000\038\000\038\000\038\000\038\000\066\000\016\000\
- \028\000\041\000\041\000\041\000\041\000\041\000\041\000\041\000\
- \041\000\050\000\126\000\100\000\127\000\134\000\100\000\016\000\
- \016\000\016\000\016\000\016\000\016\000\016\000\016\000\016\000\
- \016\000\047\000\047\000\047\000\047\000\047\000\047\000\047\000\
- \047\000\047\000\047\000\100\000\136\000\137\000\050\000\142\000\
+ \010\000\010\000\049\000\016\000\051\000\028\000\040\000\040\000\
+ \028\000\010\000\010\000\041\000\041\000\041\000\041\000\041\000\
+ \041\000\041\000\041\000\057\000\065\000\010\000\129\000\010\000\
+ \010\000\010\000\016\000\010\000\028\000\047\000\047\000\047\000\
+ \047\000\047\000\047\000\047\000\047\000\047\000\047\000\130\000\
+ \137\000\139\000\016\000\016\000\016\000\016\000\016\000\016\000\
+ \016\000\016\000\016\000\016\000\140\000\128\000\145\000\128\000\
+ \147\000\010\000\020\000\128\000\149\000\020\000\172\000\255\255\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\000\000\020\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\010\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\000\000\144\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\179\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\003\000\146\000\169\000\003\000\003\000\003\000\099\000\
- \102\000\255\255\003\000\003\000\135\000\003\000\003\000\003\000\
+ \000\000\003\000\255\255\179\000\003\000\003\000\003\000\050\000\
+ \103\000\106\000\003\000\003\000\020\000\003\000\003\000\003\000\
\039\000\039\000\039\000\039\000\039\000\039\000\039\000\039\000\
- \039\000\039\000\003\000\176\000\003\000\003\000\003\000\003\000\
- \003\000\069\000\005\000\005\000\069\000\039\000\005\000\176\000\
- \255\255\135\000\255\255\005\000\005\000\056\000\056\000\056\000\
- \056\000\056\000\056\000\056\000\056\000\056\000\056\000\005\000\
- \069\000\005\000\005\000\005\000\003\000\005\000\003\000\039\000\
- \125\000\069\000\125\000\255\255\006\000\039\000\125\000\006\000\
- \006\000\006\000\179\000\255\255\006\000\006\000\006\000\154\000\
- \006\000\006\000\006\000\255\255\081\000\255\255\179\000\081\000\
- \153\000\153\000\005\000\005\000\003\000\006\000\003\000\006\000\
- \006\000\006\000\006\000\006\000\255\255\255\255\154\000\255\255\
- \255\255\007\000\255\255\081\000\007\000\007\000\007\000\153\000\
- \255\255\007\000\007\000\007\000\081\000\007\000\007\000\007\000\
- \255\255\005\000\005\000\020\000\255\255\255\255\255\255\006\000\
+ \039\000\039\000\003\000\138\000\003\000\003\000\003\000\003\000\
+ \003\000\255\255\005\000\005\000\050\000\039\000\005\000\255\255\
+ \038\000\255\255\038\000\005\000\005\000\038\000\038\000\038\000\
+ \038\000\038\000\038\000\038\000\038\000\038\000\038\000\005\000\
+ \138\000\005\000\005\000\005\000\003\000\005\000\003\000\039\000\
+ \104\000\255\255\157\000\104\000\006\000\039\000\255\255\006\000\
+ \006\000\006\000\182\000\255\255\006\000\006\000\006\000\255\255\
+ \006\000\006\000\006\000\255\255\068\000\255\255\182\000\068\000\
+ \104\000\157\000\005\000\005\000\003\000\006\000\003\000\006\000\
+ \006\000\006\000\006\000\006\000\156\000\156\000\255\255\255\255\
+ \255\255\007\000\255\255\068\000\007\000\007\000\007\000\255\255\
+ \255\255\007\000\007\000\007\000\068\000\007\000\007\000\007\000\
+ \255\255\005\000\005\000\156\000\255\255\255\255\255\255\006\000\
\006\000\006\000\007\000\255\255\007\000\007\000\007\000\007\000\
- \007\000\170\000\182\000\170\000\182\000\255\255\008\000\170\000\
- \182\000\008\000\008\000\008\000\255\255\255\255\008\000\008\000\
- \008\000\100\000\008\000\008\000\008\000\255\255\255\255\006\000\
+ \007\000\173\000\185\000\173\000\185\000\255\255\008\000\173\000\
+ \185\000\008\000\008\000\008\000\255\255\255\255\008\000\008\000\
+ \008\000\255\255\008\000\008\000\008\000\255\255\255\255\006\000\
\006\000\006\000\255\255\255\255\007\000\007\000\007\000\008\000\
- \255\255\008\000\008\000\008\000\008\000\008\000\167\000\147\000\
- \255\255\167\000\147\000\009\000\255\255\255\255\009\000\009\000\
+ \255\255\008\000\008\000\008\000\008\000\008\000\170\000\255\255\
+ \020\000\170\000\255\255\009\000\255\255\255\255\009\000\009\000\
\009\000\255\255\255\255\009\000\009\000\009\000\255\255\009\000\
- \009\000\009\000\255\255\255\255\007\000\007\000\007\000\147\000\
+ \009\000\009\000\255\255\255\255\007\000\007\000\007\000\255\255\
\255\255\008\000\008\000\008\000\009\000\255\255\009\000\009\000\
\009\000\009\000\009\000\255\255\255\255\255\255\255\255\255\255\
- \181\000\255\255\255\255\181\000\010\000\010\000\255\255\010\000\
- \167\000\255\255\167\000\013\000\013\000\010\000\010\000\013\000\
+ \184\000\255\255\255\255\184\000\011\000\011\000\255\255\255\255\
+ \170\000\255\255\170\000\013\000\013\000\011\000\011\000\013\000\
\255\255\008\000\008\000\008\000\013\000\013\000\009\000\009\000\
- \009\000\010\000\181\000\010\000\010\000\010\000\255\255\010\000\
- \013\000\255\255\013\000\013\000\013\000\255\255\013\000\011\000\
- \011\000\147\000\011\000\255\255\255\255\045\000\045\000\255\255\
- \011\000\011\000\181\000\255\255\255\255\255\255\009\000\009\000\
- \009\000\255\255\010\000\255\255\011\000\010\000\011\000\011\000\
- \011\000\255\255\011\000\013\000\013\000\255\255\255\255\255\255\
- \255\255\045\000\255\255\255\255\255\255\255\255\255\255\014\000\
- \014\000\255\255\255\255\014\000\255\255\255\255\255\255\255\255\
- \014\000\014\000\010\000\010\000\045\000\011\000\255\255\255\255\
- \011\000\255\255\013\000\013\000\014\000\255\255\014\000\014\000\
- \014\000\045\000\014\000\045\000\046\000\046\000\046\000\046\000\
- \046\000\046\000\046\000\046\000\046\000\046\000\255\255\017\000\
- \255\255\255\255\017\000\017\000\017\000\011\000\011\000\017\000\
- \017\000\017\000\255\255\017\000\017\000\017\000\255\255\014\000\
- \014\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \017\000\255\255\017\000\017\000\017\000\017\000\017\000\255\255\
- \255\255\255\255\255\255\046\000\255\255\255\255\255\255\255\255\
- \018\000\255\255\255\255\018\000\018\000\018\000\014\000\014\000\
- \018\000\018\000\018\000\255\255\018\000\018\000\018\000\255\255\
- \255\255\255\255\017\000\017\000\017\000\255\255\255\255\255\255\
- \255\255\018\000\255\255\018\000\018\000\018\000\018\000\018\000\
- \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\
- \058\000\058\000\255\255\019\000\167\000\147\000\019\000\255\255\
- \255\255\255\255\017\000\017\000\017\000\255\255\255\255\255\255\
- \255\255\255\255\255\255\018\000\255\255\018\000\255\255\255\255\
- \101\000\101\000\019\000\019\000\101\000\255\255\019\000\019\000\
- \019\000\255\255\019\000\255\255\019\000\019\000\255\255\019\000\
- \019\000\019\000\122\000\255\255\255\255\122\000\181\000\101\000\
- \255\255\101\000\255\255\018\000\019\000\018\000\019\000\019\000\
- \019\000\019\000\019\000\022\000\255\255\022\000\022\000\022\000\
- \022\000\022\000\022\000\022\000\022\000\022\000\022\000\122\000\
- \141\000\141\000\141\000\141\000\141\000\141\000\141\000\141\000\
- \141\000\141\000\022\000\255\255\255\255\019\000\019\000\255\255\
- \019\000\022\000\255\255\255\255\023\000\255\255\023\000\023\000\
- \023\000\023\000\023\000\023\000\023\000\023\000\023\000\023\000\
- \255\255\255\255\255\255\255\255\022\000\255\255\255\255\255\255\
- \023\000\255\255\022\000\023\000\255\255\019\000\019\000\255\255\
- \019\000\022\000\023\000\022\000\122\000\023\000\255\255\255\255\
+ \009\000\011\000\184\000\011\000\011\000\011\000\255\255\011\000\
+ \013\000\255\255\013\000\013\000\013\000\255\255\013\000\014\000\
+ \014\000\255\255\080\000\014\000\255\255\080\000\255\255\255\255\
+ \014\000\014\000\184\000\255\255\255\255\255\255\009\000\009\000\
+ \009\000\255\255\255\255\255\255\014\000\011\000\014\000\014\000\
+ \014\000\080\000\014\000\013\000\013\000\045\000\045\000\255\255\
+ \255\255\255\255\080\000\017\000\255\255\255\255\017\000\017\000\
+ \017\000\255\255\255\255\017\000\017\000\017\000\255\255\017\000\
+ \017\000\017\000\255\255\011\000\255\255\255\255\104\000\014\000\
+ \014\000\045\000\013\000\013\000\017\000\255\255\017\000\017\000\
+ \017\000\017\000\017\000\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\045\000\044\000\044\000\044\000\
+ \044\000\044\000\044\000\044\000\044\000\255\255\014\000\014\000\
+ \255\255\045\000\255\255\045\000\255\255\255\255\017\000\017\000\
+ \017\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \018\000\044\000\255\255\018\000\018\000\018\000\255\255\255\255\
+ \018\000\018\000\018\000\255\255\018\000\018\000\018\000\019\000\
+ \255\255\255\255\019\000\255\255\044\000\255\255\017\000\017\000\
+ \017\000\018\000\255\255\018\000\018\000\018\000\018\000\018\000\
+ \255\255\044\000\255\255\044\000\255\255\255\255\019\000\019\000\
+ \255\255\255\255\019\000\019\000\019\000\255\255\255\255\255\255\
+ \019\000\019\000\255\255\019\000\019\000\019\000\125\000\255\255\
+ \255\255\125\000\255\255\018\000\170\000\018\000\255\255\255\255\
+ \019\000\255\255\019\000\019\000\019\000\019\000\019\000\022\000\
+ \255\255\022\000\022\000\022\000\022\000\022\000\022\000\022\000\
+ \022\000\022\000\022\000\125\000\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\018\000\255\255\018\000\022\000\255\255\
+ \255\255\255\255\019\000\255\255\019\000\022\000\184\000\255\255\
+ \023\000\255\255\023\000\023\000\023\000\023\000\023\000\023\000\
+ \023\000\023\000\023\000\023\000\255\255\255\255\255\255\255\255\
+ \022\000\255\255\255\255\255\255\023\000\255\255\022\000\023\000\
+ \255\255\255\255\019\000\255\255\019\000\022\000\023\000\022\000\
+ \125\000\023\000\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\023\000\255\255\255\255\255\255\105\000\105\000\
+ \255\255\023\000\105\000\255\255\023\000\255\255\255\255\023\000\
\255\255\255\255\255\255\255\255\255\255\255\255\023\000\255\255\
- \255\255\255\255\255\255\255\255\255\255\023\000\255\255\255\255\
- \023\000\255\255\255\255\023\000\255\255\255\255\255\255\255\255\
- \255\255\255\255\023\000\255\255\023\000\023\000\024\000\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\023\000\024\000\
- \024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
- \024\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
+ \023\000\023\000\024\000\255\255\255\255\105\000\255\255\105\000\
+ \255\255\255\255\023\000\024\000\024\000\024\000\024\000\024\000\
+ \024\000\024\000\024\000\024\000\024\000\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\024\000\024\000\024\000\024\000\
\024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
\024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
- \024\000\024\000\255\255\255\255\255\255\255\255\024\000\255\255\
+ \024\000\024\000\024\000\024\000\024\000\024\000\255\255\255\255\
+ \255\255\255\255\024\000\255\255\024\000\024\000\024\000\024\000\
\024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
\024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
- \024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
- \024\000\024\000\042\000\042\000\042\000\042\000\042\000\042\000\
- \042\000\042\000\042\000\042\000\255\255\255\255\255\255\255\255\
- \255\255\255\255\096\000\042\000\042\000\042\000\042\000\042\000\
- \042\000\255\255\255\255\255\255\255\255\255\255\255\255\101\000\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\096\000\255\255\255\255\255\255\255\255\255\255\255\255\
- \122\000\255\255\255\255\042\000\042\000\042\000\042\000\042\000\
- \042\000\096\000\096\000\096\000\096\000\096\000\096\000\096\000\
- \096\000\096\000\096\000\255\255\255\255\255\255\255\255\024\000\
+ \024\000\024\000\024\000\024\000\024\000\024\000\042\000\042\000\
+ \042\000\042\000\042\000\042\000\042\000\042\000\042\000\042\000\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\042\000\
+ \042\000\042\000\042\000\042\000\042\000\056\000\056\000\056\000\
+ \056\000\056\000\056\000\056\000\056\000\056\000\056\000\058\000\
+ \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\
+ \058\000\255\255\255\255\255\255\125\000\255\255\255\255\042\000\
+ \042\000\042\000\042\000\042\000\042\000\144\000\144\000\144\000\
+ \144\000\144\000\144\000\144\000\144\000\144\000\144\000\255\255\
+ \255\255\255\255\255\255\024\000\024\000\024\000\024\000\024\000\
\024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
\024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
- \024\000\024\000\024\000\024\000\024\000\024\000\255\255\024\000\
+ \024\000\024\000\255\255\024\000\024\000\024\000\024\000\024\000\
\024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
\024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
\024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
- \024\000\024\000\024\000\024\000\024\000\024\000\025\000\024\000\
- \024\000\024\000\024\000\024\000\024\000\024\000\024\000\025\000\
- \025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
- \025\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
+ \024\000\024\000\025\000\024\000\024\000\024\000\024\000\024\000\
+ \024\000\024\000\024\000\025\000\025\000\025\000\025\000\025\000\
+ \025\000\025\000\025\000\025\000\025\000\105\000\255\255\255\255\
+ \255\255\255\255\255\255\255\255\025\000\025\000\025\000\025\000\
\025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
\025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
- \025\000\025\000\255\255\255\255\255\255\255\255\025\000\255\255\
+ \025\000\025\000\025\000\025\000\025\000\025\000\255\255\255\255\
+ \255\255\255\255\025\000\255\255\025\000\025\000\025\000\025\000\
\025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
\025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
+ \025\000\025\000\025\000\025\000\025\000\025\000\043\000\043\000\
+ \043\000\043\000\043\000\043\000\043\000\043\000\043\000\043\000\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\043\000\
+ \043\000\043\000\043\000\043\000\043\000\255\255\255\255\255\255\
+ \255\255\255\255\043\000\146\000\146\000\146\000\146\000\146\000\
+ \146\000\146\000\146\000\146\000\146\000\255\255\255\255\255\255\
+ \150\000\255\255\255\255\150\000\255\255\043\000\255\255\043\000\
+ \043\000\043\000\043\000\043\000\043\000\255\255\255\255\255\255\
+ \255\255\255\255\043\000\255\255\043\000\255\255\255\255\255\255\
+ \150\000\255\255\255\255\025\000\025\000\025\000\025\000\025\000\
\025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
- \025\000\025\000\043\000\043\000\043\000\043\000\043\000\043\000\
- \043\000\043\000\043\000\043\000\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\043\000\043\000\043\000\043\000\043\000\
- \043\000\255\255\255\255\255\255\255\255\255\255\043\000\143\000\
- \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
- \143\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\043\000\255\255\043\000\043\000\043\000\043\000\043\000\
- \043\000\255\255\255\255\255\255\255\255\255\255\043\000\255\255\
- \043\000\255\255\255\255\255\255\255\255\255\255\255\255\025\000\
\025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
+ \025\000\025\000\255\255\025\000\025\000\025\000\025\000\025\000\
\025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
- \025\000\025\000\025\000\025\000\025\000\025\000\255\255\025\000\
\025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
\025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
- \025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
- \025\000\025\000\025\000\025\000\025\000\025\000\255\255\025\000\
- \025\000\025\000\025\000\025\000\025\000\025\000\025\000\026\000\
- \255\255\255\255\026\000\026\000\026\000\255\255\255\255\255\255\
- \026\000\026\000\255\255\026\000\026\000\026\000\152\000\152\000\
- \152\000\152\000\152\000\152\000\152\000\152\000\152\000\152\000\
- \026\000\255\255\026\000\026\000\026\000\026\000\026\000\155\000\
- \155\000\155\000\155\000\155\000\155\000\155\000\155\000\155\000\
- \155\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\026\000\255\255\026\000\026\000\255\255\026\000\
+ \025\000\025\000\150\000\025\000\025\000\025\000\025\000\025\000\
+ \025\000\025\000\025\000\026\000\255\255\255\255\026\000\026\000\
+ \026\000\255\255\255\255\255\255\026\000\026\000\255\255\026\000\
+ \026\000\026\000\155\000\155\000\155\000\155\000\155\000\155\000\
+ \155\000\155\000\155\000\155\000\026\000\255\255\026\000\026\000\
+ \026\000\026\000\026\000\158\000\158\000\158\000\158\000\158\000\
+ \158\000\158\000\158\000\158\000\158\000\255\255\046\000\046\000\
+ \046\000\046\000\046\000\046\000\046\000\046\000\046\000\046\000\
+ \255\255\255\255\255\255\255\255\255\255\255\255\026\000\255\255\
+ \026\000\026\000\255\255\026\000\026\000\026\000\026\000\026\000\
\026\000\026\000\026\000\026\000\026\000\026\000\026\000\026\000\
\026\000\026\000\026\000\026\000\026\000\026\000\026\000\026\000\
- \026\000\026\000\026\000\026\000\026\000\026\000\026\000\026\000\
- \026\000\255\255\026\000\027\000\026\000\255\255\027\000\027\000\
- \027\000\255\255\255\255\255\255\027\000\027\000\255\255\027\000\
- \027\000\027\000\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\027\000\255\255\027\000\027\000\
- \027\000\027\000\027\000\255\255\255\255\255\255\255\255\255\255\
+ \026\000\026\000\026\000\026\000\026\000\046\000\026\000\027\000\
+ \026\000\255\255\027\000\027\000\027\000\255\255\255\255\255\255\
+ \027\000\027\000\255\255\027\000\027\000\027\000\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \027\000\255\255\027\000\027\000\027\000\027\000\027\000\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\027\000\255\255\
- \027\000\027\000\255\255\027\000\027\000\027\000\027\000\027\000\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\027\000\255\255\027\000\027\000\150\000\027\000\
+ \027\000\027\000\027\000\027\000\027\000\027\000\027\000\027\000\
\027\000\027\000\027\000\027\000\027\000\027\000\027\000\027\000\
\027\000\027\000\027\000\027\000\027\000\027\000\027\000\027\000\
- \027\000\027\000\027\000\027\000\027\000\255\255\027\000\255\255\
- \027\000\255\255\255\255\255\255\255\255\026\000\026\000\026\000\
+ \027\000\255\255\027\000\255\255\027\000\255\255\255\255\255\255\
+ \255\255\026\000\026\000\026\000\026\000\026\000\026\000\026\000\
\026\000\026\000\026\000\026\000\026\000\026\000\026\000\026\000\
\026\000\026\000\026\000\026\000\026\000\026\000\026\000\026\000\
- \026\000\026\000\026\000\026\000\026\000\255\255\026\000\026\000\
- \026\000\026\000\026\000\026\000\026\000\026\000\055\000\055\000\
- \055\000\055\000\055\000\055\000\055\000\055\000\055\000\055\000\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\055\000\
- \055\000\055\000\055\000\055\000\055\000\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\055\000\
- \055\000\055\000\055\000\055\000\055\000\255\255\255\255\255\255\
- \255\255\027\000\027\000\027\000\027\000\027\000\027\000\027\000\
+ \026\000\100\000\026\000\026\000\026\000\026\000\026\000\026\000\
+ \026\000\026\000\055\000\055\000\055\000\055\000\055\000\055\000\
+ \055\000\055\000\055\000\055\000\255\255\255\255\255\255\255\255\
+ \100\000\255\255\255\255\055\000\055\000\055\000\055\000\055\000\
+ \055\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \100\000\100\000\100\000\100\000\100\000\100\000\100\000\100\000\
+ \100\000\100\000\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\055\000\055\000\055\000\055\000\055\000\
+ \055\000\255\255\255\255\255\255\255\255\027\000\027\000\027\000\
\027\000\027\000\027\000\027\000\027\000\027\000\027\000\027\000\
\027\000\027\000\027\000\027\000\027\000\027\000\027\000\027\000\
- \027\000\031\000\027\000\027\000\027\000\027\000\027\000\027\000\
- \027\000\027\000\031\000\031\000\031\000\031\000\031\000\031\000\
- \031\000\031\000\031\000\031\000\031\000\255\255\255\255\255\255\
- \255\255\255\255\255\255\031\000\031\000\031\000\031\000\031\000\
+ \027\000\027\000\027\000\027\000\027\000\031\000\027\000\027\000\
+ \027\000\027\000\027\000\027\000\027\000\027\000\031\000\031\000\
+ \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
+ \031\000\255\255\255\255\255\255\255\255\255\255\255\255\031\000\
+ \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
\031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
\031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
- \031\000\031\000\031\000\031\000\031\000\255\255\255\255\255\255\
- \255\255\031\000\255\255\031\000\031\000\031\000\031\000\031\000\
+ \031\000\255\255\255\255\255\255\255\255\031\000\255\255\031\000\
\031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
\031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
- \031\000\031\000\031\000\031\000\031\000\044\000\044\000\044\000\
- \044\000\044\000\044\000\044\000\044\000\255\255\255\255\255\255\
- \255\255\255\255\255\255\059\000\059\000\059\000\059\000\059\000\
- \059\000\059\000\059\000\059\000\059\000\255\255\255\255\255\255\
- \255\255\044\000\255\255\255\255\059\000\059\000\059\000\059\000\
- \059\000\059\000\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\044\000\255\255\255\255\255\255\
+ \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
+ \031\000\059\000\059\000\059\000\059\000\059\000\059\000\059\000\
+ \059\000\059\000\059\000\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\059\000\059\000\059\000\059\000\059\000\059\000\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\044\000\255\255\044\000\059\000\059\000\059\000\059\000\
- \059\000\059\000\031\000\031\000\031\000\031\000\031\000\031\000\
+ \255\255\255\255\059\000\059\000\059\000\059\000\059\000\059\000\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\031\000\031\000\
\031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
\031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
- \031\000\255\255\031\000\031\000\031\000\031\000\031\000\031\000\
+ \031\000\031\000\031\000\031\000\031\000\255\255\031\000\031\000\
\031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
\031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
\031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
- \031\000\033\000\031\000\031\000\031\000\031\000\031\000\031\000\
- \031\000\031\000\033\000\033\000\033\000\033\000\033\000\033\000\
- \033\000\033\000\033\000\033\000\033\000\255\255\255\255\255\255\
- \255\255\255\255\255\255\033\000\033\000\033\000\033\000\033\000\
+ \031\000\031\000\031\000\031\000\031\000\033\000\031\000\031\000\
+ \031\000\031\000\031\000\031\000\031\000\031\000\033\000\033\000\
+ \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
+ \033\000\255\255\255\255\255\255\255\255\255\255\255\255\033\000\
+ \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
+ \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
\033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
+ \033\000\255\255\255\255\255\255\255\255\033\000\255\255\033\000\
\033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
- \033\000\033\000\033\000\033\000\033\000\255\255\255\255\255\255\
- \255\255\033\000\255\255\033\000\033\000\033\000\033\000\033\000\
\033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
\033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
- \033\000\033\000\033\000\033\000\033\000\095\000\095\000\255\255\
- \255\255\095\000\255\255\255\255\255\255\255\255\140\000\140\000\
- \140\000\140\000\140\000\140\000\140\000\140\000\140\000\140\000\
- \255\255\255\255\255\255\255\255\095\000\255\255\095\000\140\000\
- \140\000\140\000\140\000\140\000\140\000\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\095\000\095\000\095\000\095\000\
- \095\000\095\000\095\000\095\000\095\000\095\000\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\140\000\
- \140\000\140\000\140\000\140\000\140\000\255\255\255\255\255\255\
- \255\255\255\255\033\000\033\000\033\000\033\000\033\000\033\000\
+ \033\000\255\255\255\255\255\255\099\000\099\000\255\255\255\255\
+ \099\000\255\255\255\255\255\255\255\255\143\000\143\000\143\000\
+ \143\000\143\000\143\000\143\000\143\000\143\000\143\000\255\255\
+ \255\255\255\255\255\255\099\000\255\255\099\000\143\000\143\000\
+ \143\000\143\000\143\000\143\000\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\099\000\099\000\099\000\099\000\099\000\
+ \099\000\099\000\099\000\099\000\099\000\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\143\000\143\000\
+ \143\000\143\000\143\000\143\000\255\255\255\255\033\000\033\000\
\033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
\033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
- \033\000\255\255\033\000\033\000\033\000\033\000\033\000\033\000\
+ \033\000\033\000\033\000\033\000\033\000\255\255\033\000\033\000\
\033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
\033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
\033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
- \033\000\255\255\033\000\033\000\033\000\033\000\033\000\033\000\
- \033\000\033\000\048\000\255\255\048\000\255\255\255\255\060\000\
- \060\000\048\000\060\000\255\255\255\255\255\255\255\255\255\255\
- \060\000\060\000\048\000\048\000\048\000\048\000\048\000\048\000\
- \048\000\048\000\048\000\048\000\060\000\255\255\060\000\060\000\
- \060\000\255\255\060\000\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\085\000\085\000\
- \255\255\255\255\085\000\255\255\255\255\255\255\255\255\085\000\
- \085\000\255\255\255\255\255\255\255\255\060\000\048\000\255\255\
- \060\000\255\255\255\255\085\000\048\000\085\000\085\000\085\000\
- \061\000\085\000\255\255\061\000\255\255\255\255\255\255\255\255\
- \048\000\255\255\255\255\255\255\048\000\255\255\048\000\255\255\
- \255\255\255\255\048\000\255\255\255\255\060\000\060\000\061\000\
- \061\000\255\255\255\255\061\000\061\000\061\000\085\000\085\000\
- \255\255\061\000\061\000\255\255\061\000\061\000\061\000\255\255\
- \062\000\255\255\255\255\062\000\095\000\255\255\255\255\255\255\
- \255\255\061\000\255\255\061\000\061\000\061\000\061\000\061\000\
- \255\255\255\255\255\255\255\255\255\255\085\000\085\000\062\000\
- \062\000\255\255\255\255\062\000\062\000\062\000\255\255\255\255\
- \062\000\062\000\062\000\255\255\062\000\062\000\062\000\255\255\
- \255\255\255\255\255\255\061\000\255\255\061\000\255\255\255\255\
- \255\255\062\000\255\255\062\000\062\000\062\000\062\000\062\000\
+ \033\000\033\000\033\000\033\000\033\000\255\255\033\000\033\000\
+ \033\000\033\000\033\000\033\000\033\000\033\000\048\000\255\255\
+ \048\000\255\255\255\255\255\255\255\255\048\000\255\255\255\255\
+ \060\000\255\255\255\255\060\000\255\255\255\255\048\000\048\000\
+ \048\000\048\000\048\000\048\000\048\000\048\000\048\000\048\000\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\060\000\
+ \060\000\255\255\255\255\060\000\060\000\060\000\255\255\255\255\
+ \255\255\060\000\060\000\255\255\060\000\060\000\060\000\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\063\000\255\255\255\255\063\000\255\255\
- \255\255\255\255\255\255\061\000\255\255\061\000\255\255\255\255\
- \255\255\255\255\255\255\062\000\255\255\062\000\255\255\255\255\
- \255\255\255\255\063\000\063\000\255\255\255\255\063\000\063\000\
- \063\000\255\255\063\000\063\000\063\000\063\000\255\255\063\000\
- \063\000\063\000\064\000\255\255\255\255\064\000\255\255\255\255\
- \255\255\255\255\048\000\062\000\063\000\062\000\063\000\063\000\
- \063\000\063\000\063\000\255\255\255\255\255\255\255\255\255\255\
- \255\255\064\000\064\000\255\255\255\255\064\000\064\000\064\000\
- \255\255\064\000\064\000\064\000\064\000\255\255\064\000\064\000\
- \064\000\255\255\255\255\255\255\255\255\063\000\063\000\255\255\
- \063\000\255\255\255\255\064\000\255\255\064\000\064\000\064\000\
- \064\000\064\000\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\065\000\255\255\255\255\
- \065\000\255\255\255\255\255\255\255\255\063\000\063\000\255\255\
- \063\000\255\255\255\255\255\255\064\000\064\000\255\255\064\000\
- \255\255\255\255\255\255\255\255\065\000\065\000\255\255\255\255\
- \065\000\065\000\065\000\255\255\065\000\065\000\065\000\065\000\
- \255\255\065\000\065\000\065\000\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\064\000\064\000\065\000\064\000\
- \065\000\065\000\065\000\065\000\065\000\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\068\000\068\000\
- \255\255\068\000\255\255\255\255\255\255\255\255\255\255\068\000\
- \068\000\255\255\255\255\255\255\255\255\255\255\255\255\065\000\
- \065\000\255\255\065\000\068\000\255\255\068\000\068\000\068\000\
- \255\255\068\000\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\070\000\255\255\255\255\
- \070\000\255\255\255\255\255\255\255\255\255\255\255\255\065\000\
- \065\000\255\255\065\000\255\255\068\000\255\255\255\255\068\000\
- \255\255\255\255\255\255\255\255\070\000\070\000\255\255\255\255\
- \070\000\070\000\070\000\255\255\255\255\070\000\070\000\070\000\
- \255\255\070\000\070\000\070\000\071\000\255\255\255\255\071\000\
- \255\255\255\255\255\255\255\255\068\000\068\000\070\000\255\255\
- \070\000\070\000\070\000\070\000\070\000\255\255\255\255\255\255\
- \255\255\255\255\255\255\071\000\071\000\255\255\255\255\071\000\
- \071\000\071\000\255\255\071\000\071\000\071\000\071\000\255\255\
- \071\000\071\000\071\000\255\255\255\255\255\255\255\255\255\255\
- \070\000\255\255\070\000\255\255\255\255\071\000\255\255\071\000\
- \071\000\071\000\071\000\071\000\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\072\000\
- \255\255\255\255\072\000\255\255\255\255\255\255\255\255\255\255\
- \070\000\255\255\070\000\255\255\255\255\255\255\071\000\071\000\
- \255\255\071\000\255\255\255\255\255\255\255\255\072\000\072\000\
- \255\255\255\255\072\000\072\000\072\000\255\255\255\255\255\255\
- \072\000\072\000\255\255\072\000\072\000\072\000\076\000\255\255\
- \255\255\076\000\255\255\255\255\255\255\255\255\071\000\071\000\
- \072\000\071\000\072\000\072\000\072\000\072\000\072\000\255\255\
- \255\255\255\255\255\255\255\255\255\255\076\000\076\000\255\255\
- \255\255\076\000\076\000\076\000\255\255\076\000\076\000\076\000\
- \076\000\255\255\076\000\076\000\076\000\255\255\255\255\255\255\
- \255\255\255\255\072\000\255\255\072\000\255\255\255\255\076\000\
- \255\255\076\000\076\000\076\000\076\000\076\000\255\255\255\255\
+ \255\255\060\000\048\000\060\000\060\000\060\000\060\000\060\000\
+ \048\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\061\000\048\000\255\255\061\000\255\255\
+ \048\000\255\255\048\000\255\255\255\255\255\255\048\000\255\255\
+ \255\255\255\255\255\255\060\000\255\255\060\000\255\255\255\255\
+ \255\255\255\255\061\000\061\000\255\255\255\255\061\000\061\000\
+ \061\000\255\255\255\255\061\000\061\000\061\000\255\255\061\000\
+ \061\000\061\000\062\000\099\000\255\255\062\000\255\255\255\255\
+ \255\255\255\255\255\255\060\000\061\000\060\000\061\000\061\000\
+ \061\000\061\000\061\000\255\255\255\255\255\255\255\255\255\255\
+ \255\255\062\000\062\000\255\255\255\255\062\000\062\000\062\000\
+ \255\255\255\255\062\000\062\000\062\000\255\255\062\000\062\000\
+ \062\000\255\255\255\255\255\255\255\255\255\255\061\000\255\255\
+ \061\000\255\255\255\255\062\000\255\255\062\000\062\000\062\000\
+ \062\000\062\000\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\063\000\255\255\255\255\
+ \063\000\255\255\255\255\255\255\255\255\255\255\061\000\255\255\
+ \061\000\255\255\255\255\255\255\255\255\062\000\255\255\062\000\
+ \255\255\255\255\255\255\255\255\063\000\063\000\255\255\255\255\
+ \063\000\063\000\063\000\255\255\255\255\063\000\063\000\063\000\
+ \255\255\063\000\063\000\063\000\064\000\255\255\048\000\064\000\
+ \255\255\255\255\255\255\255\255\255\255\062\000\063\000\062\000\
+ \063\000\063\000\063\000\063\000\063\000\255\255\255\255\255\255\
+ \255\255\255\255\255\255\064\000\064\000\255\255\255\255\064\000\
+ \064\000\064\000\255\255\064\000\064\000\064\000\064\000\255\255\
+ \064\000\064\000\064\000\255\255\255\255\255\255\255\255\255\255\
+ \063\000\255\255\063\000\067\000\067\000\064\000\067\000\064\000\
+ \064\000\064\000\064\000\064\000\067\000\067\000\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\077\000\255\255\255\255\077\000\255\255\255\255\255\255\
- \255\255\255\255\072\000\255\255\072\000\255\255\255\255\255\255\
- \076\000\076\000\255\255\076\000\255\255\255\255\255\255\255\255\
- \077\000\077\000\255\255\255\255\077\000\077\000\077\000\255\255\
- \077\000\077\000\077\000\077\000\255\255\077\000\077\000\077\000\
- \078\000\255\255\255\255\078\000\255\255\255\255\255\255\255\255\
- \076\000\076\000\077\000\076\000\077\000\077\000\077\000\077\000\
- \077\000\255\255\255\255\255\255\255\255\255\255\255\255\078\000\
- \078\000\255\255\255\255\078\000\078\000\078\000\255\255\078\000\
- \078\000\078\000\078\000\255\255\078\000\078\000\078\000\255\255\
- \255\255\255\255\255\255\077\000\077\000\255\255\077\000\255\255\
- \255\255\078\000\255\255\078\000\078\000\078\000\078\000\078\000\
+ \067\000\255\255\067\000\067\000\067\000\255\255\067\000\255\255\
+ \063\000\255\255\063\000\255\255\255\255\255\255\064\000\064\000\
+ \255\255\064\000\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\079\000\255\255\255\255\079\000\255\255\
- \255\255\255\255\255\255\077\000\077\000\255\255\077\000\255\255\
- \255\255\255\255\078\000\078\000\255\255\078\000\255\255\255\255\
- \255\255\255\255\079\000\079\000\255\255\255\255\079\000\079\000\
- \079\000\255\255\255\255\079\000\079\000\079\000\255\255\079\000\
- \079\000\079\000\080\000\255\255\255\255\080\000\255\255\255\255\
- \255\255\255\255\078\000\078\000\079\000\078\000\079\000\079\000\
- \079\000\079\000\079\000\255\255\255\255\255\255\255\255\255\255\
- \255\255\080\000\080\000\255\255\255\255\080\000\080\000\080\000\
- \255\255\255\255\255\255\080\000\080\000\255\255\080\000\080\000\
- \080\000\255\255\255\255\255\255\255\255\255\255\079\000\255\255\
- \079\000\255\255\255\255\080\000\255\255\080\000\080\000\080\000\
- \080\000\080\000\255\255\255\255\255\255\086\000\255\255\255\255\
+ \255\255\067\000\255\255\069\000\067\000\255\255\069\000\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\064\000\064\000\
+ \255\255\064\000\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\069\000\069\000\255\255\255\255\069\000\069\000\
+ \069\000\067\000\067\000\069\000\069\000\069\000\255\255\069\000\
+ \069\000\069\000\070\000\255\255\255\255\070\000\255\255\255\255\
+ \255\255\255\255\255\255\255\255\069\000\255\255\069\000\069\000\
+ \069\000\069\000\069\000\255\255\255\255\255\255\255\255\255\255\
+ \255\255\070\000\070\000\255\255\255\255\070\000\070\000\070\000\
+ \255\255\070\000\070\000\070\000\070\000\255\255\070\000\070\000\
+ \070\000\255\255\255\255\255\255\255\255\255\255\069\000\255\255\
+ \069\000\255\255\255\255\070\000\255\255\070\000\070\000\070\000\
+ \070\000\070\000\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\071\000\255\255\255\255\
+ \071\000\255\255\255\255\255\255\255\255\255\255\069\000\255\255\
+ \069\000\255\255\255\255\255\255\070\000\070\000\255\255\070\000\
+ \255\255\255\255\255\255\255\255\071\000\071\000\255\255\255\255\
+ \071\000\071\000\071\000\255\255\255\255\255\255\071\000\071\000\
+ \255\255\071\000\071\000\071\000\075\000\255\255\255\255\075\000\
+ \255\255\255\255\255\255\255\255\070\000\070\000\071\000\070\000\
+ \071\000\071\000\071\000\071\000\071\000\255\255\255\255\255\255\
+ \255\255\255\255\255\255\075\000\075\000\255\255\255\255\075\000\
+ \075\000\075\000\255\255\255\255\075\000\075\000\075\000\255\255\
+ \075\000\075\000\075\000\255\255\255\255\255\255\255\255\255\255\
+ \071\000\255\255\071\000\255\255\255\255\075\000\255\255\075\000\
+ \075\000\075\000\075\000\075\000\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\076\000\
+ \255\255\255\255\076\000\255\255\255\255\255\255\255\255\255\255\
+ \071\000\255\255\071\000\255\255\255\255\255\255\255\255\075\000\
+ \255\255\075\000\255\255\255\255\255\255\255\255\076\000\076\000\
+ \255\255\255\255\076\000\076\000\076\000\255\255\076\000\076\000\
+ \076\000\076\000\255\255\076\000\076\000\076\000\077\000\255\255\
+ \255\255\077\000\255\255\255\255\255\255\255\255\255\255\075\000\
+ \076\000\075\000\076\000\076\000\076\000\076\000\076\000\255\255\
+ \255\255\255\255\255\255\255\255\255\255\077\000\077\000\255\255\
+ \255\255\077\000\077\000\077\000\255\255\255\255\077\000\077\000\
+ \077\000\255\255\077\000\077\000\077\000\255\255\255\255\255\255\
+ \255\255\076\000\076\000\255\255\076\000\255\255\255\255\077\000\
+ \255\255\077\000\077\000\077\000\077\000\077\000\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\078\000\255\255\255\255\078\000\255\255\255\255\255\255\
+ \255\255\076\000\076\000\255\255\076\000\255\255\255\255\255\255\
+ \255\255\077\000\255\255\077\000\255\255\255\255\255\255\255\255\
+ \078\000\078\000\255\255\255\255\078\000\078\000\078\000\255\255\
+ \255\255\078\000\078\000\078\000\255\255\078\000\078\000\078\000\
+ \079\000\255\255\255\255\079\000\255\255\255\255\255\255\255\255\
+ \255\255\077\000\078\000\077\000\078\000\078\000\078\000\078\000\
+ \078\000\255\255\255\255\255\255\255\255\255\255\255\255\079\000\
+ \079\000\255\255\255\255\079\000\079\000\079\000\255\255\255\255\
+ \255\255\079\000\079\000\255\255\079\000\079\000\079\000\255\255\
+ \255\255\255\255\255\255\255\255\078\000\255\255\078\000\255\255\
+ \255\255\079\000\255\255\079\000\079\000\079\000\079\000\079\000\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\084\000\
+ \084\000\255\255\255\255\084\000\255\255\255\255\255\255\255\255\
+ \084\000\084\000\255\255\255\255\078\000\255\255\078\000\255\255\
+ \255\255\255\255\255\255\079\000\084\000\079\000\084\000\084\000\
+ \084\000\255\255\084\000\255\255\255\255\255\255\255\255\255\255\
+ \085\000\255\255\255\255\085\000\085\000\085\000\255\255\255\255\
+ \085\000\085\000\085\000\255\255\085\000\085\000\085\000\255\255\
+ \255\255\255\255\255\255\079\000\255\255\079\000\255\255\084\000\
+ \084\000\085\000\255\255\085\000\085\000\085\000\085\000\085\000\
+ \255\255\255\255\255\255\255\255\255\255\086\000\255\255\255\255\
\086\000\086\000\086\000\255\255\255\255\086\000\086\000\086\000\
- \255\255\086\000\086\000\086\000\255\255\255\255\079\000\255\255\
- \079\000\255\255\255\255\255\255\255\255\080\000\086\000\080\000\
+ \255\255\086\000\086\000\086\000\255\255\255\255\084\000\084\000\
+ \255\255\255\255\255\255\085\000\085\000\085\000\086\000\255\255\
\086\000\086\000\086\000\086\000\086\000\255\255\255\255\255\255\
\255\255\255\255\087\000\255\255\255\255\087\000\087\000\087\000\
\255\255\255\255\087\000\087\000\087\000\255\255\087\000\087\000\
- \087\000\255\255\255\255\255\255\255\255\080\000\255\255\080\000\
+ \087\000\255\255\255\255\085\000\085\000\085\000\255\255\255\255\
\086\000\086\000\086\000\087\000\255\255\087\000\087\000\087\000\
\087\000\087\000\255\255\255\255\255\255\255\255\255\255\088\000\
\255\255\255\255\088\000\088\000\088\000\255\255\255\255\088\000\
\255\255\255\255\088\000\088\000\088\000\089\000\255\255\089\000\
\089\000\089\000\089\000\089\000\255\255\255\255\255\255\255\255\
\255\255\090\000\255\255\255\255\090\000\090\000\090\000\255\255\
- \255\255\090\000\090\000\090\000\255\255\090\000\090\000\090\000\
+ \255\255\255\255\090\000\090\000\255\255\090\000\090\000\090\000\
\255\255\255\255\088\000\088\000\088\000\255\255\255\255\089\000\
\089\000\089\000\090\000\255\255\090\000\090\000\090\000\090\000\
- \090\000\255\255\255\255\255\255\255\255\255\255\091\000\255\255\
- \255\255\091\000\091\000\091\000\255\255\255\255\091\000\091\000\
- \091\000\255\255\091\000\091\000\091\000\255\255\255\255\089\000\
- \089\000\089\000\255\255\255\255\090\000\090\000\090\000\091\000\
- \255\255\091\000\091\000\091\000\091\000\091\000\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\092\000\
- \092\000\255\255\255\255\092\000\255\255\255\255\255\255\255\255\
- \092\000\092\000\255\255\255\255\090\000\090\000\090\000\255\255\
- \255\255\091\000\091\000\091\000\092\000\255\255\092\000\092\000\
- \092\000\255\255\092\000\255\255\255\255\255\255\255\255\255\255\
- \093\000\255\255\255\255\093\000\093\000\093\000\255\255\255\255\
- \093\000\093\000\093\000\255\255\093\000\093\000\093\000\255\255\
- \255\255\091\000\091\000\091\000\255\255\255\255\255\255\092\000\
- \092\000\093\000\255\255\093\000\093\000\093\000\093\000\093\000\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\094\000\094\000\255\255\255\255\094\000\255\255\255\255\
- \105\000\105\000\094\000\094\000\105\000\255\255\092\000\092\000\
- \255\255\105\000\105\000\093\000\093\000\093\000\094\000\255\255\
- \094\000\094\000\094\000\255\255\094\000\105\000\255\255\105\000\
- \105\000\105\000\255\255\105\000\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\106\000\106\000\255\255\
- \255\255\106\000\255\255\093\000\093\000\093\000\106\000\106\000\
- \255\255\094\000\094\000\255\255\255\255\255\255\255\255\255\255\
- \105\000\105\000\106\000\255\255\106\000\106\000\106\000\255\255\
- \106\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\107\000\107\000\255\255\255\255\107\000\255\255\
- \094\000\094\000\255\255\107\000\107\000\255\255\255\255\105\000\
- \105\000\255\255\255\255\255\255\255\255\106\000\106\000\107\000\
- \255\255\107\000\107\000\107\000\255\255\107\000\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\108\000\
- \108\000\255\255\255\255\108\000\255\255\255\255\109\000\109\000\
- \108\000\108\000\109\000\255\255\106\000\106\000\255\255\109\000\
- \109\000\255\255\107\000\107\000\108\000\255\255\108\000\108\000\
- \108\000\255\255\108\000\109\000\255\255\109\000\109\000\109\000\
- \255\255\109\000\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\110\000\110\000\255\255\255\255\110\000\
- \255\255\107\000\107\000\255\255\110\000\110\000\255\255\108\000\
- \108\000\255\255\255\255\255\255\255\255\255\255\109\000\109\000\
- \110\000\255\255\110\000\110\000\110\000\255\255\110\000\255\255\
+ \090\000\255\255\255\255\255\255\091\000\255\255\255\255\091\000\
+ \091\000\091\000\255\255\255\255\091\000\091\000\091\000\255\255\
+ \091\000\091\000\091\000\255\255\255\255\255\255\255\255\089\000\
+ \089\000\089\000\255\255\255\255\090\000\091\000\090\000\091\000\
+ \091\000\091\000\091\000\091\000\255\255\255\255\255\255\255\255\
+ \255\255\092\000\255\255\255\255\092\000\092\000\092\000\255\255\
+ \255\255\092\000\092\000\092\000\255\255\092\000\092\000\092\000\
+ \255\255\255\255\255\255\255\255\090\000\255\255\090\000\091\000\
+ \091\000\091\000\092\000\255\255\092\000\092\000\092\000\092\000\
+ \092\000\255\255\255\255\255\255\255\255\255\255\093\000\255\255\
+ \255\255\093\000\093\000\093\000\255\255\255\255\093\000\093\000\
+ \093\000\255\255\093\000\093\000\093\000\255\255\255\255\091\000\
+ \091\000\091\000\255\255\255\255\092\000\092\000\092\000\093\000\
+ \255\255\093\000\093\000\093\000\093\000\093\000\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\094\000\
+ \094\000\255\255\255\255\094\000\255\255\255\255\255\255\255\255\
+ \094\000\094\000\255\255\255\255\092\000\092\000\092\000\255\255\
+ \255\255\093\000\093\000\093\000\094\000\255\255\094\000\094\000\
+ \094\000\255\255\094\000\255\255\255\255\255\255\255\255\255\255\
+ \095\000\255\255\255\255\095\000\095\000\095\000\255\255\255\255\
+ \095\000\095\000\095\000\255\255\095\000\095\000\095\000\255\255\
+ \255\255\093\000\093\000\093\000\255\255\255\255\255\255\094\000\
+ \094\000\095\000\255\255\095\000\095\000\095\000\095\000\095\000\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \111\000\111\000\255\255\255\255\111\000\255\255\108\000\108\000\
- \255\255\111\000\111\000\255\255\255\255\109\000\109\000\255\255\
- \255\255\255\255\255\255\110\000\110\000\111\000\255\255\111\000\
- \111\000\111\000\255\255\111\000\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\112\000\112\000\255\255\
- \112\000\255\255\255\255\255\255\255\255\255\255\112\000\112\000\
- \255\255\255\255\110\000\110\000\255\255\255\255\255\255\255\255\
- \111\000\111\000\112\000\255\255\112\000\112\000\112\000\255\255\
- \112\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \113\000\113\000\255\255\113\000\255\255\255\255\255\255\255\255\
- \255\255\113\000\113\000\255\255\255\255\255\255\255\255\111\000\
- \111\000\255\255\255\255\112\000\255\255\113\000\112\000\113\000\
- \113\000\113\000\255\255\113\000\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\114\000\114\000\255\255\114\000\255\255\
- \115\000\115\000\255\255\115\000\114\000\114\000\255\255\255\255\
- \255\255\115\000\115\000\112\000\112\000\255\255\113\000\255\255\
- \114\000\113\000\114\000\114\000\114\000\115\000\114\000\115\000\
- \115\000\115\000\255\255\115\000\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\116\000\116\000\255\255\116\000\255\255\
- \255\255\255\255\255\255\255\255\116\000\116\000\113\000\113\000\
- \255\255\114\000\255\255\255\255\114\000\255\255\115\000\255\255\
- \116\000\115\000\116\000\116\000\116\000\255\255\116\000\255\255\
- \255\255\255\255\117\000\255\255\255\255\117\000\117\000\117\000\
- \255\255\255\255\117\000\117\000\117\000\255\255\117\000\117\000\
- \117\000\114\000\114\000\255\255\255\255\255\255\115\000\115\000\
- \255\255\116\000\255\255\117\000\116\000\117\000\117\000\117\000\
- \117\000\117\000\255\255\255\255\255\255\255\255\255\255\118\000\
- \255\255\255\255\118\000\118\000\118\000\255\255\255\255\118\000\
- \118\000\118\000\255\255\118\000\118\000\118\000\255\255\255\255\
- \255\255\116\000\116\000\255\255\255\255\117\000\117\000\117\000\
- \118\000\255\255\118\000\118\000\118\000\118\000\118\000\255\255\
- \255\255\255\255\255\255\255\255\119\000\255\255\255\255\119\000\
- \119\000\119\000\255\255\255\255\119\000\119\000\119\000\255\255\
- \119\000\119\000\119\000\255\255\255\255\117\000\117\000\117\000\
- \255\255\255\255\118\000\118\000\118\000\119\000\255\255\119\000\
- \119\000\119\000\119\000\119\000\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\120\000\255\255\255\255\120\000\255\255\
+ \255\255\096\000\096\000\255\255\255\255\096\000\255\255\255\255\
+ \255\255\255\255\096\000\096\000\255\255\255\255\094\000\094\000\
+ \255\255\255\255\255\255\095\000\095\000\095\000\096\000\255\255\
+ \096\000\096\000\096\000\255\255\096\000\255\255\255\255\255\255\
+ \255\255\255\255\097\000\255\255\255\255\097\000\097\000\097\000\
+ \255\255\255\255\097\000\097\000\097\000\255\255\097\000\097\000\
+ \097\000\255\255\255\255\095\000\095\000\095\000\255\255\255\255\
+ \255\255\096\000\096\000\097\000\255\255\097\000\097\000\097\000\
+ \097\000\097\000\255\255\255\255\255\255\255\255\255\255\098\000\
+ \255\255\255\255\098\000\098\000\098\000\255\255\255\255\098\000\
+ \098\000\098\000\255\255\098\000\098\000\098\000\255\255\255\255\
+ \096\000\096\000\255\255\255\255\255\255\097\000\097\000\097\000\
+ \098\000\255\255\098\000\098\000\098\000\098\000\098\000\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\118\000\118\000\118\000\255\255\255\255\119\000\
- \119\000\119\000\255\255\120\000\255\255\255\255\255\255\255\255\
- \120\000\120\000\255\255\120\000\255\255\255\255\255\255\255\255\
+ \109\000\109\000\255\255\255\255\109\000\255\255\255\255\110\000\
+ \110\000\109\000\109\000\110\000\255\255\097\000\097\000\097\000\
+ \110\000\110\000\098\000\098\000\098\000\109\000\255\255\109\000\
+ \109\000\109\000\255\255\109\000\110\000\255\255\110\000\110\000\
+ \110\000\255\255\110\000\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\111\000\111\000\255\255\255\255\
+ \111\000\255\255\098\000\098\000\098\000\111\000\111\000\255\255\
+ \109\000\109\000\255\255\255\255\255\255\255\255\255\255\110\000\
+ \110\000\111\000\255\255\111\000\111\000\111\000\255\255\111\000\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\120\000\255\255\119\000\
- \119\000\119\000\120\000\120\000\120\000\120\000\120\000\120\000\
- \120\000\120\000\120\000\120\000\120\000\120\000\120\000\120\000\
- \120\000\120\000\120\000\120\000\120\000\120\000\120\000\120\000\
- \120\000\120\000\120\000\120\000\255\255\255\255\255\255\255\255\
- \120\000\255\255\120\000\120\000\120\000\120\000\120\000\120\000\
- \120\000\120\000\120\000\120\000\120\000\120\000\120\000\120\000\
- \120\000\120\000\120\000\120\000\120\000\120\000\120\000\120\000\
- \120\000\120\000\120\000\120\000\145\000\145\000\145\000\145\000\
- \145\000\145\000\145\000\145\000\145\000\145\000\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\145\000\145\000\145\000\
- \145\000\145\000\145\000\255\255\255\255\255\255\255\255\255\255\
+ \255\255\112\000\112\000\255\255\255\255\112\000\255\255\109\000\
+ \109\000\255\255\112\000\112\000\255\255\255\255\110\000\110\000\
+ \255\255\255\255\255\255\255\255\111\000\111\000\112\000\255\255\
+ \112\000\112\000\112\000\255\255\112\000\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\113\000\113\000\
+ \255\255\255\255\113\000\255\255\255\255\114\000\114\000\113\000\
+ \113\000\114\000\255\255\111\000\111\000\255\255\114\000\114\000\
+ \255\255\112\000\112\000\113\000\255\255\113\000\113\000\113\000\
+ \255\255\113\000\114\000\255\255\114\000\114\000\114\000\255\255\
+ \114\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\115\000\115\000\255\255\255\255\255\255\255\255\
+ \112\000\112\000\255\255\115\000\115\000\255\255\113\000\113\000\
+ \255\255\255\255\255\255\255\255\255\255\114\000\114\000\115\000\
+ \255\255\115\000\115\000\115\000\255\255\115\000\255\255\255\255\
+ \255\255\116\000\116\000\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\116\000\116\000\255\255\113\000\113\000\255\255\
+ \255\255\255\255\255\255\255\255\114\000\114\000\116\000\255\255\
+ \116\000\116\000\116\000\115\000\116\000\117\000\117\000\255\255\
+ \117\000\255\255\255\255\255\255\255\255\255\255\117\000\117\000\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\117\000\255\255\117\000\117\000\117\000\255\255\
+ \117\000\115\000\116\000\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\118\000\118\000\255\255\255\255\255\255\119\000\
+ \119\000\255\255\119\000\118\000\118\000\255\255\255\255\255\255\
+ \119\000\119\000\255\255\117\000\255\255\255\255\117\000\118\000\
+ \116\000\118\000\118\000\118\000\119\000\118\000\119\000\119\000\
+ \119\000\255\255\119\000\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\145\000\145\000\145\000\
- \145\000\145\000\145\000\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\117\000\117\000\255\255\255\255\255\255\
+ \255\255\255\255\255\255\118\000\255\255\119\000\255\255\255\255\
+ \119\000\255\255\255\255\255\255\255\255\255\255\120\000\255\255\
+ \255\255\120\000\120\000\120\000\255\255\255\255\120\000\120\000\
+ \120\000\255\255\120\000\120\000\120\000\255\255\255\255\255\255\
+ \255\255\118\000\255\255\255\255\255\255\119\000\119\000\120\000\
+ \255\255\120\000\120\000\120\000\120\000\120\000\255\255\255\255\
+ \255\255\255\255\255\255\121\000\255\255\255\255\121\000\121\000\
+ \121\000\255\255\255\255\121\000\121\000\121\000\255\255\121\000\
+ \121\000\121\000\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\120\000\120\000\120\000\121\000\255\255\121\000\121\000\
+ \121\000\121\000\121\000\255\255\255\255\255\255\255\255\255\255\
+ \122\000\255\255\255\255\122\000\122\000\122\000\255\255\255\255\
+ \122\000\122\000\122\000\255\255\122\000\122\000\122\000\255\255\
+ \255\255\120\000\120\000\120\000\255\255\255\255\121\000\121\000\
+ \121\000\122\000\255\255\122\000\122\000\122\000\122\000\122\000\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\123\000\
+ \255\255\255\255\123\000\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\121\000\121\000\
+ \121\000\255\255\255\255\122\000\122\000\122\000\255\255\123\000\
+ \255\255\255\255\255\255\255\255\123\000\123\000\255\255\123\000\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\120\000\120\000\120\000\120\000\120\000\120\000\120\000\
- \120\000\120\000\120\000\120\000\120\000\120\000\120\000\120\000\
- \120\000\120\000\120\000\120\000\120\000\120\000\120\000\120\000\
- \255\255\120\000\120\000\120\000\120\000\120\000\120\000\120\000\
- \120\000\120\000\120\000\120\000\120\000\120\000\120\000\120\000\
- \120\000\120\000\120\000\120\000\120\000\120\000\120\000\120\000\
- \120\000\120\000\120\000\120\000\120\000\120\000\120\000\120\000\
- \255\255\120\000\120\000\120\000\120\000\120\000\120\000\120\000\
- \120\000\120\000\124\000\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\124\000\124\000\124\000\124\000\124\000\
- \124\000\124\000\124\000\124\000\124\000\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\124\000\124\000\124\000\124\000\
- \124\000\124\000\124\000\124\000\124\000\124\000\124\000\124\000\
- \124\000\124\000\124\000\124\000\124\000\124\000\124\000\124\000\
- \124\000\124\000\124\000\124\000\124\000\124\000\255\255\255\255\
- \255\255\255\255\124\000\255\255\124\000\124\000\124\000\124\000\
- \124\000\124\000\124\000\124\000\124\000\124\000\124\000\124\000\
- \124\000\124\000\124\000\124\000\124\000\124\000\124\000\124\000\
- \124\000\124\000\124\000\124\000\124\000\124\000\255\255\255\255\
- \255\255\255\255\255\255\255\255\129\000\129\000\129\000\129\000\
- \129\000\129\000\129\000\129\000\129\000\129\000\129\000\129\000\
- \129\000\129\000\129\000\129\000\129\000\129\000\129\000\129\000\
- \129\000\129\000\129\000\129\000\129\000\129\000\255\255\255\255\
- \255\255\255\255\129\000\255\255\129\000\129\000\129\000\129\000\
- \129\000\129\000\129\000\129\000\129\000\129\000\129\000\129\000\
- \129\000\129\000\129\000\129\000\129\000\129\000\129\000\129\000\
- \129\000\129\000\129\000\129\000\129\000\129\000\255\255\255\255\
- \255\255\255\255\255\255\124\000\124\000\124\000\124\000\124\000\
- \124\000\124\000\124\000\124\000\124\000\124\000\124\000\124\000\
- \124\000\124\000\124\000\124\000\124\000\124\000\124\000\124\000\
- \124\000\124\000\255\255\124\000\124\000\124\000\124\000\124\000\
- \124\000\124\000\124\000\124\000\124\000\124\000\124\000\124\000\
- \124\000\124\000\124\000\124\000\124\000\124\000\124\000\124\000\
- \124\000\124\000\124\000\124\000\124\000\124\000\124\000\124\000\
- \124\000\124\000\255\255\124\000\124\000\124\000\124\000\124\000\
- \124\000\124\000\124\000\129\000\129\000\129\000\129\000\129\000\
- \129\000\129\000\129\000\129\000\129\000\129\000\129\000\129\000\
- \129\000\129\000\129\000\129\000\129\000\129\000\129\000\129\000\
- \129\000\129\000\255\255\129\000\129\000\129\000\129\000\129\000\
- \129\000\129\000\129\000\129\000\129\000\129\000\129\000\129\000\
- \129\000\129\000\129\000\129\000\129\000\129\000\129\000\129\000\
- \129\000\129\000\129\000\129\000\129\000\129\000\129\000\129\000\
- \129\000\129\000\255\255\129\000\129\000\129\000\129\000\129\000\
- \129\000\129\000\129\000\130\000\130\000\130\000\130\000\130\000\
- \130\000\130\000\130\000\130\000\130\000\130\000\130\000\130\000\
- \130\000\130\000\130\000\130\000\130\000\130\000\130\000\130\000\
- \130\000\130\000\130\000\130\000\130\000\255\255\255\255\255\255\
- \255\255\130\000\255\255\130\000\130\000\130\000\130\000\130\000\
- \130\000\130\000\130\000\130\000\130\000\130\000\130\000\130\000\
- \130\000\130\000\130\000\130\000\130\000\130\000\130\000\130\000\
- \130\000\130\000\130\000\130\000\130\000\151\000\151\000\151\000\
- \151\000\151\000\151\000\151\000\151\000\151\000\151\000\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\151\000\151\000\
- \151\000\151\000\151\000\151\000\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\123\000\255\255\122\000\122\000\122\000\123\000\123\000\
+ \123\000\123\000\123\000\123\000\123\000\123\000\123\000\123\000\
+ \123\000\123\000\123\000\123\000\123\000\123\000\123\000\123\000\
+ \123\000\123\000\123\000\123\000\123\000\123\000\123\000\123\000\
+ \255\255\255\255\255\255\255\255\123\000\255\255\123\000\123\000\
+ \123\000\123\000\123\000\123\000\123\000\123\000\123\000\123\000\
+ \123\000\123\000\123\000\123\000\123\000\123\000\123\000\123\000\
+ \123\000\123\000\123\000\123\000\123\000\123\000\123\000\123\000\
+ \148\000\148\000\148\000\148\000\148\000\148\000\148\000\148\000\
+ \148\000\148\000\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\148\000\148\000\148\000\148\000\148\000\148\000\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\151\000\151\000\
- \151\000\151\000\151\000\151\000\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\130\000\130\000\130\000\130\000\130\000\130\000\
- \130\000\130\000\130\000\130\000\130\000\130\000\130\000\130\000\
- \130\000\130\000\130\000\130\000\130\000\130\000\130\000\130\000\
- \130\000\255\255\130\000\130\000\130\000\130\000\130\000\130\000\
- \130\000\130\000\130\000\130\000\130\000\130\000\130\000\130\000\
- \130\000\130\000\130\000\130\000\130\000\130\000\130\000\130\000\
- \130\000\130\000\130\000\130\000\130\000\130\000\130\000\130\000\
- \130\000\131\000\130\000\130\000\130\000\130\000\130\000\130\000\
- \130\000\130\000\131\000\131\000\131\000\131\000\131\000\131\000\
- \131\000\131\000\131\000\131\000\255\255\255\255\131\000\255\255\
- \255\255\255\255\131\000\131\000\131\000\131\000\131\000\131\000\
- \131\000\131\000\131\000\131\000\131\000\131\000\131\000\131\000\
- \131\000\131\000\131\000\131\000\131\000\131\000\131\000\131\000\
- \131\000\131\000\131\000\131\000\131\000\255\255\255\255\255\255\
- \255\255\131\000\255\255\131\000\131\000\131\000\131\000\131\000\
- \131\000\131\000\131\000\131\000\131\000\131\000\131\000\131\000\
- \131\000\131\000\131\000\131\000\131\000\131\000\131\000\131\000\
- \131\000\131\000\131\000\131\000\131\000\156\000\156\000\156\000\
- \156\000\156\000\156\000\156\000\156\000\156\000\156\000\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\156\000\156\000\
- \156\000\156\000\156\000\156\000\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\148\000\148\000\148\000\148\000\148\000\148\000\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\156\000\156\000\
- \156\000\156\000\156\000\156\000\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\131\000\131\000\131\000\131\000\131\000\131\000\
- \131\000\131\000\131\000\131\000\131\000\131\000\131\000\131\000\
- \131\000\131\000\131\000\131\000\131\000\131\000\131\000\131\000\
- \131\000\255\255\131\000\131\000\131\000\131\000\131\000\131\000\
- \131\000\131\000\131\000\131\000\131\000\131\000\131\000\131\000\
- \131\000\131\000\131\000\131\000\131\000\131\000\131\000\131\000\
- \131\000\131\000\131\000\131\000\131\000\131\000\131\000\131\000\
- \131\000\132\000\131\000\131\000\131\000\131\000\131\000\131\000\
- \131\000\131\000\132\000\132\000\132\000\132\000\132\000\132\000\
- \132\000\132\000\132\000\132\000\255\255\255\255\132\000\255\255\
- \255\255\255\255\255\255\132\000\132\000\132\000\132\000\132\000\
+ \255\255\255\255\255\255\255\255\255\255\123\000\123\000\123\000\
+ \123\000\123\000\123\000\123\000\123\000\123\000\123\000\123\000\
+ \123\000\123\000\123\000\123\000\123\000\123\000\123\000\123\000\
+ \123\000\123\000\123\000\123\000\255\255\123\000\123\000\123\000\
+ \123\000\123\000\123\000\123\000\123\000\123\000\123\000\123\000\
+ \123\000\123\000\123\000\123\000\123\000\123\000\123\000\123\000\
+ \123\000\123\000\123\000\123\000\123\000\123\000\123\000\123\000\
+ \123\000\123\000\123\000\123\000\255\255\123\000\123\000\123\000\
+ \123\000\123\000\123\000\123\000\123\000\123\000\127\000\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\127\000\
+ \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
+ \127\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
+ \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
+ \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
+ \127\000\127\000\255\255\255\255\255\255\255\255\127\000\255\255\
+ \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
+ \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
+ \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
+ \127\000\127\000\255\255\255\255\255\255\255\255\255\255\255\255\
\132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
\132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
- \132\000\132\000\132\000\132\000\132\000\255\255\255\255\255\255\
- \255\255\132\000\255\255\132\000\132\000\132\000\132\000\132\000\
\132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
+ \132\000\132\000\255\255\255\255\255\255\255\255\132\000\255\255\
\132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
- \132\000\132\000\132\000\132\000\132\000\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\132\000\132\000\132\000\132\000\132\000\132\000\
\132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
\132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
- \132\000\255\255\132\000\132\000\132\000\132\000\132\000\132\000\
+ \132\000\132\000\255\255\255\255\255\255\255\255\255\255\127\000\
+ \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
+ \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
+ \127\000\127\000\127\000\127\000\127\000\127\000\255\255\127\000\
+ \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
+ \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
+ \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
+ \127\000\127\000\127\000\127\000\127\000\127\000\255\255\127\000\
+ \127\000\127\000\127\000\127\000\127\000\127\000\127\000\132\000\
\132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
\132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
+ \132\000\132\000\132\000\132\000\132\000\132\000\255\255\132\000\
\132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
- \132\000\255\255\132\000\132\000\132\000\132\000\132\000\132\000\
- \132\000\132\000\133\000\255\255\133\000\255\255\255\255\149\000\
- \255\255\133\000\149\000\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\133\000\133\000\133\000\133\000\133\000\133\000\
- \133\000\133\000\133\000\133\000\255\255\149\000\255\255\149\000\
- \255\255\255\255\255\255\255\255\149\000\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\149\000\149\000\149\000\
- \149\000\149\000\149\000\149\000\149\000\149\000\149\000\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\133\000\255\255\
- \255\255\255\255\255\255\255\255\133\000\157\000\255\255\255\255\
- \157\000\157\000\157\000\255\255\255\255\255\255\157\000\157\000\
- \133\000\157\000\157\000\157\000\133\000\255\255\133\000\255\255\
- \255\255\149\000\133\000\255\255\255\255\255\255\157\000\149\000\
- \157\000\157\000\157\000\157\000\157\000\255\255\255\255\255\255\
- \255\255\255\255\255\255\149\000\255\255\255\255\255\255\149\000\
- \255\255\149\000\255\255\255\255\255\255\149\000\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \157\000\255\255\157\000\255\255\255\255\255\255\255\255\255\255\
- \158\000\255\255\255\255\158\000\158\000\158\000\255\255\255\255\
- \255\255\158\000\158\000\255\255\158\000\158\000\158\000\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \157\000\158\000\157\000\158\000\158\000\158\000\158\000\158\000\
- \158\000\158\000\158\000\158\000\158\000\158\000\158\000\158\000\
- \158\000\158\000\158\000\158\000\158\000\158\000\158\000\158\000\
- \158\000\158\000\158\000\158\000\158\000\158\000\158\000\158\000\
- \158\000\158\000\255\255\158\000\255\255\158\000\158\000\255\255\
- \158\000\158\000\158\000\158\000\158\000\158\000\158\000\158\000\
- \158\000\158\000\158\000\158\000\158\000\158\000\158\000\158\000\
- \158\000\158\000\158\000\158\000\158\000\158\000\158\000\158\000\
- \158\000\158\000\255\255\158\000\255\255\158\000\255\255\255\255\
+ \132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
+ \132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
+ \132\000\132\000\132\000\132\000\132\000\132\000\255\255\132\000\
+ \132\000\132\000\132\000\132\000\132\000\132\000\132\000\133\000\
+ \133\000\133\000\133\000\133\000\133\000\133\000\133\000\133\000\
+ \133\000\133\000\133\000\133\000\133\000\133\000\133\000\133\000\
+ \133\000\133\000\133\000\133\000\133\000\133\000\133\000\133\000\
+ \133\000\255\255\255\255\255\255\255\255\133\000\255\255\133\000\
+ \133\000\133\000\133\000\133\000\133\000\133\000\133\000\133\000\
+ \133\000\133\000\133\000\133\000\133\000\133\000\133\000\133\000\
+ \133\000\133\000\133\000\133\000\133\000\133\000\133\000\133\000\
+ \133\000\154\000\154\000\154\000\154\000\154\000\154\000\154\000\
+ \154\000\154\000\154\000\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\154\000\154\000\154\000\154\000\154\000\154\000\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\149\000\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\154\000\154\000\154\000\154\000\154\000\154\000\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\133\000\133\000\
+ \133\000\133\000\133\000\133\000\133\000\133\000\133\000\133\000\
+ \133\000\133\000\133\000\133\000\133\000\133\000\133\000\133\000\
+ \133\000\133\000\133\000\133\000\133\000\255\255\133\000\133\000\
+ \133\000\133\000\133\000\133\000\133\000\133\000\133\000\133\000\
+ \133\000\133\000\133\000\133\000\133\000\133\000\133\000\133\000\
+ \133\000\133\000\133\000\133\000\133\000\133\000\133\000\133\000\
+ \133\000\133\000\133\000\133\000\133\000\134\000\133\000\133\000\
+ \133\000\133\000\133\000\133\000\133\000\133\000\134\000\134\000\
+ \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
+ \255\255\255\255\134\000\255\255\255\255\255\255\134\000\134\000\
+ \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
+ \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
+ \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
+ \134\000\255\255\255\255\255\255\255\255\134\000\255\255\134\000\
+ \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
+ \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
+ \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
+ \134\000\159\000\159\000\159\000\159\000\159\000\159\000\159\000\
+ \159\000\159\000\159\000\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\159\000\159\000\159\000\159\000\159\000\159\000\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\158\000\
- \158\000\158\000\158\000\158\000\158\000\158\000\158\000\158\000\
- \158\000\158\000\158\000\158\000\158\000\158\000\158\000\158\000\
- \158\000\158\000\158\000\158\000\158\000\158\000\255\255\158\000\
- \158\000\158\000\158\000\158\000\158\000\158\000\158\000\158\000\
- \158\000\158\000\158\000\158\000\158\000\158\000\158\000\158\000\
- \158\000\158\000\158\000\158\000\158\000\158\000\158\000\158\000\
- \158\000\158\000\158\000\158\000\158\000\158\000\255\255\158\000\
- \158\000\158\000\158\000\158\000\158\000\158\000\158\000\159\000\
- \255\255\255\255\159\000\159\000\159\000\255\255\255\255\255\255\
- \159\000\159\000\255\255\159\000\159\000\159\000\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \159\000\255\255\159\000\159\000\159\000\159\000\159\000\255\255\
- \255\255\255\255\255\255\160\000\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\160\000\160\000\160\000\160\000\
- \160\000\160\000\160\000\160\000\160\000\160\000\255\255\255\255\
- \160\000\255\255\159\000\255\255\159\000\160\000\160\000\160\000\
- \160\000\160\000\160\000\160\000\160\000\160\000\160\000\160\000\
- \160\000\160\000\160\000\160\000\160\000\160\000\160\000\160\000\
- \160\000\160\000\160\000\160\000\160\000\160\000\160\000\255\255\
- \255\255\255\255\159\000\160\000\159\000\160\000\160\000\160\000\
- \160\000\160\000\160\000\160\000\160\000\160\000\160\000\160\000\
- \160\000\160\000\160\000\160\000\160\000\160\000\160\000\160\000\
- \160\000\160\000\160\000\160\000\160\000\160\000\160\000\255\255\
+ \255\255\255\255\159\000\159\000\159\000\159\000\159\000\159\000\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\134\000\134\000\
+ \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
+ \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
+ \134\000\134\000\134\000\134\000\134\000\255\255\134\000\134\000\
+ \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
+ \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
+ \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
+ \134\000\134\000\134\000\134\000\134\000\135\000\134\000\134\000\
+ \134\000\134\000\134\000\134\000\134\000\134\000\135\000\135\000\
+ \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
+ \255\255\255\255\135\000\255\255\255\255\255\255\255\255\135\000\
+ \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
+ \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
+ \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
+ \135\000\255\255\255\255\255\255\255\255\135\000\255\255\135\000\
+ \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
+ \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
+ \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
+ \135\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\160\000\160\000\160\000\160\000\
- \160\000\160\000\160\000\160\000\160\000\160\000\160\000\160\000\
- \160\000\160\000\160\000\160\000\160\000\160\000\160\000\160\000\
- \160\000\160\000\160\000\255\255\160\000\160\000\160\000\160\000\
- \160\000\160\000\160\000\160\000\160\000\160\000\160\000\160\000\
- \160\000\160\000\160\000\160\000\160\000\160\000\160\000\160\000\
- \160\000\160\000\160\000\160\000\160\000\160\000\160\000\160\000\
- \160\000\160\000\160\000\255\255\160\000\160\000\160\000\160\000\
- \160\000\160\000\160\000\160\000\161\000\255\255\255\255\161\000\
+ \255\255\255\255\255\255\255\255\255\255\255\255\135\000\135\000\
+ \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
+ \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
+ \135\000\135\000\135\000\135\000\135\000\255\255\135\000\135\000\
+ \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
+ \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
+ \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
+ \135\000\135\000\135\000\135\000\135\000\255\255\135\000\135\000\
+ \135\000\135\000\135\000\135\000\135\000\135\000\136\000\255\255\
+ \136\000\255\255\255\255\152\000\255\255\136\000\152\000\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\136\000\136\000\
+ \136\000\136\000\136\000\136\000\136\000\136\000\136\000\136\000\
+ \255\255\152\000\255\255\152\000\255\255\255\255\255\255\255\255\
+ \152\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\152\000\152\000\152\000\152\000\152\000\152\000\152\000\
+ \152\000\152\000\152\000\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\136\000\255\255\255\255\255\255\255\255\255\255\
+ \136\000\160\000\255\255\255\255\160\000\160\000\160\000\255\255\
+ \255\255\255\255\160\000\160\000\136\000\160\000\160\000\160\000\
+ \136\000\255\255\136\000\255\255\255\255\152\000\136\000\255\255\
+ \255\255\255\255\160\000\152\000\160\000\160\000\160\000\160\000\
+ \160\000\255\255\255\255\255\255\255\255\255\255\255\255\152\000\
+ \255\255\255\255\255\255\152\000\255\255\152\000\255\255\255\255\
+ \255\255\152\000\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\160\000\255\255\160\000\255\255\
+ \255\255\255\255\255\255\255\255\161\000\255\255\255\255\161\000\
\161\000\161\000\255\255\255\255\255\255\161\000\161\000\255\255\
\161\000\161\000\161\000\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\161\000\255\255\161\000\
+ \255\255\255\255\255\255\255\255\160\000\161\000\160\000\161\000\
\161\000\161\000\161\000\161\000\161\000\161\000\161\000\161\000\
\161\000\161\000\161\000\161\000\161\000\161\000\161\000\161\000\
\161\000\161\000\161\000\161\000\161\000\161\000\161\000\161\000\
\255\255\161\000\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\152\000\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\162\000\255\255\255\255\255\255\162\000\162\000\255\255\162\000\
\162\000\162\000\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\162\000\255\255\162\000\162\000\
- \162\000\162\000\162\000\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\163\000\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\163\000\163\000\163\000\163\000\163\000\
- \163\000\163\000\163\000\163\000\163\000\255\255\162\000\163\000\
- \162\000\255\255\255\255\163\000\163\000\163\000\163\000\163\000\
+ \162\000\162\000\162\000\255\255\255\255\255\255\255\255\163\000\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
+ \163\000\163\000\255\255\255\255\163\000\255\255\162\000\255\255\
+ \162\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
\163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
- \163\000\163\000\163\000\163\000\163\000\163\000\162\000\255\255\
- \162\000\255\255\163\000\255\255\163\000\163\000\163\000\163\000\
\163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
+ \163\000\163\000\163\000\255\255\255\255\255\255\162\000\163\000\
+ \162\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
\163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
- \163\000\163\000\163\000\163\000\163\000\163\000\255\255\255\255\
- \255\255\255\255\255\255\255\255\164\000\164\000\164\000\164\000\
- \164\000\164\000\164\000\164\000\164\000\164\000\164\000\164\000\
- \164\000\164\000\164\000\164\000\164\000\164\000\164\000\164\000\
- \164\000\164\000\164\000\164\000\164\000\164\000\255\255\255\255\
- \255\255\255\255\164\000\255\255\164\000\164\000\164\000\164\000\
- \164\000\164\000\164\000\164\000\164\000\164\000\164\000\164\000\
- \164\000\164\000\164\000\164\000\164\000\164\000\164\000\164\000\
- \164\000\164\000\164\000\164\000\164\000\164\000\255\255\255\255\
- \255\255\255\255\255\255\163\000\163\000\163\000\163\000\163\000\
+ \163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
+ \163\000\163\000\163\000\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
\163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
- \163\000\163\000\255\255\163\000\163\000\163\000\163\000\163\000\
+ \163\000\163\000\163\000\163\000\163\000\163\000\163\000\255\255\
\163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
\163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
\163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
- \163\000\163\000\255\255\163\000\163\000\163\000\163\000\163\000\
- \163\000\163\000\163\000\164\000\164\000\164\000\164\000\164\000\
+ \163\000\163\000\163\000\163\000\163\000\163\000\163\000\255\255\
+ \163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
+ \164\000\255\255\255\255\164\000\164\000\164\000\255\255\255\255\
+ \255\255\164\000\164\000\255\255\164\000\164\000\164\000\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\164\000\255\255\164\000\164\000\164\000\164\000\164\000\
\164\000\164\000\164\000\164\000\164\000\164\000\164\000\164\000\
\164\000\164\000\164\000\164\000\164\000\164\000\164\000\164\000\
- \164\000\164\000\255\255\164\000\164\000\164\000\164\000\164\000\
\164\000\164\000\164\000\164\000\164\000\164\000\164\000\164\000\
+ \164\000\164\000\255\255\164\000\255\255\164\000\164\000\255\255\
\164\000\164\000\164\000\164\000\164\000\164\000\164\000\164\000\
\164\000\164\000\164\000\164\000\164\000\164\000\164\000\164\000\
- \164\000\164\000\165\000\164\000\164\000\164\000\164\000\164\000\
- \164\000\164\000\164\000\165\000\165\000\165\000\165\000\165\000\
- \165\000\165\000\165\000\165\000\165\000\255\255\255\255\165\000\
- \255\255\255\255\255\255\255\255\165\000\165\000\165\000\165\000\
- \165\000\165\000\165\000\165\000\165\000\165\000\165\000\165\000\
- \165\000\165\000\165\000\165\000\165\000\165\000\165\000\165\000\
- \165\000\165\000\165\000\165\000\165\000\165\000\255\255\255\255\
- \255\255\255\255\165\000\255\255\165\000\165\000\165\000\165\000\
- \165\000\165\000\165\000\165\000\165\000\165\000\165\000\165\000\
- \165\000\165\000\165\000\165\000\165\000\165\000\165\000\165\000\
- \165\000\165\000\165\000\165\000\165\000\165\000\255\255\255\255\
- \255\255\255\255\255\255\255\255\171\000\171\000\171\000\171\000\
- \171\000\171\000\171\000\171\000\171\000\171\000\171\000\171\000\
- \171\000\171\000\171\000\171\000\171\000\171\000\171\000\171\000\
- \171\000\171\000\171\000\171\000\171\000\171\000\255\255\255\255\
- \255\255\255\255\171\000\255\255\171\000\171\000\171\000\171\000\
- \171\000\171\000\171\000\171\000\171\000\171\000\171\000\171\000\
- \171\000\171\000\171\000\171\000\171\000\171\000\171\000\171\000\
- \171\000\171\000\171\000\171\000\171\000\171\000\255\255\255\255\
- \255\255\255\255\255\255\165\000\165\000\165\000\165\000\165\000\
- \165\000\165\000\165\000\165\000\165\000\165\000\165\000\165\000\
- \165\000\165\000\165\000\165\000\165\000\165\000\165\000\165\000\
- \165\000\165\000\255\255\165\000\165\000\165\000\165\000\165\000\
- \165\000\165\000\165\000\165\000\165\000\165\000\165\000\165\000\
- \165\000\165\000\165\000\165\000\165\000\165\000\165\000\165\000\
- \165\000\165\000\165\000\165\000\165\000\165\000\165\000\165\000\
- \165\000\165\000\255\255\165\000\165\000\165\000\165\000\165\000\
- \165\000\165\000\165\000\171\000\171\000\171\000\171\000\171\000\
- \171\000\171\000\171\000\171\000\171\000\171\000\171\000\171\000\
- \171\000\171\000\171\000\171\000\171\000\171\000\171\000\171\000\
- \171\000\171\000\255\255\171\000\171\000\171\000\171\000\171\000\
- \171\000\171\000\171\000\171\000\171\000\171\000\171\000\171\000\
- \171\000\171\000\171\000\171\000\171\000\171\000\171\000\171\000\
- \171\000\171\000\171\000\171\000\171\000\171\000\171\000\171\000\
- \171\000\171\000\255\255\171\000\171\000\171\000\171\000\171\000\
- \171\000\171\000\171\000\172\000\172\000\172\000\172\000\172\000\
- \172\000\172\000\172\000\172\000\172\000\172\000\172\000\172\000\
- \172\000\172\000\172\000\172\000\172\000\172\000\172\000\172\000\
- \172\000\172\000\172\000\172\000\172\000\255\255\255\255\255\255\
- \255\255\172\000\255\255\172\000\172\000\172\000\172\000\172\000\
- \172\000\172\000\172\000\172\000\172\000\172\000\172\000\172\000\
- \172\000\172\000\172\000\172\000\172\000\172\000\172\000\172\000\
- \172\000\172\000\172\000\172\000\172\000\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\172\000\172\000\172\000\172\000\172\000\172\000\
- \172\000\172\000\172\000\172\000\172\000\172\000\172\000\172\000\
- \172\000\172\000\172\000\172\000\172\000\172\000\172\000\172\000\
- \172\000\255\255\172\000\172\000\172\000\172\000\172\000\172\000\
- \172\000\172\000\172\000\172\000\172\000\172\000\172\000\172\000\
- \172\000\172\000\172\000\172\000\172\000\172\000\172\000\172\000\
- \172\000\172\000\172\000\172\000\172\000\172\000\172\000\172\000\
- \172\000\173\000\172\000\172\000\172\000\172\000\172\000\172\000\
- \172\000\172\000\173\000\173\000\173\000\173\000\173\000\173\000\
- \173\000\173\000\173\000\173\000\255\255\255\255\173\000\255\255\
- \255\255\255\255\173\000\173\000\173\000\173\000\173\000\173\000\
- \173\000\173\000\173\000\173\000\173\000\173\000\173\000\173\000\
- \173\000\173\000\173\000\173\000\173\000\173\000\173\000\173\000\
- \173\000\173\000\173\000\173\000\173\000\255\255\255\255\255\255\
- \255\255\173\000\255\255\173\000\173\000\173\000\173\000\173\000\
- \173\000\173\000\173\000\173\000\173\000\173\000\173\000\173\000\
- \173\000\173\000\173\000\173\000\173\000\173\000\173\000\173\000\
- \173\000\173\000\173\000\173\000\173\000\255\255\255\255\255\255\
+ \164\000\164\000\164\000\164\000\164\000\164\000\164\000\164\000\
+ \164\000\164\000\255\255\164\000\255\255\164\000\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\164\000\
+ \164\000\164\000\164\000\164\000\164\000\164\000\164\000\164\000\
+ \164\000\164\000\164\000\164\000\164\000\164\000\164\000\164\000\
+ \164\000\164\000\164\000\164\000\164\000\164\000\255\255\164\000\
+ \164\000\164\000\164\000\164\000\164\000\164\000\164\000\164\000\
+ \164\000\164\000\164\000\164\000\164\000\164\000\164\000\164\000\
+ \164\000\164\000\164\000\164\000\164\000\164\000\164\000\164\000\
+ \164\000\164\000\164\000\164\000\164\000\164\000\255\255\164\000\
+ \164\000\164\000\164\000\164\000\164\000\164\000\164\000\165\000\
+ \255\255\255\255\165\000\165\000\165\000\255\255\255\255\255\255\
+ \165\000\165\000\255\255\165\000\165\000\165\000\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\173\000\173\000\173\000\173\000\173\000\173\000\
- \173\000\173\000\173\000\173\000\173\000\173\000\173\000\173\000\
- \173\000\173\000\173\000\173\000\173\000\173\000\173\000\173\000\
- \173\000\255\255\173\000\173\000\173\000\173\000\173\000\173\000\
- \173\000\173\000\173\000\173\000\173\000\173\000\173\000\173\000\
- \173\000\173\000\173\000\173\000\173\000\173\000\173\000\173\000\
- \173\000\173\000\173\000\173\000\173\000\173\000\173\000\173\000\
- \173\000\174\000\173\000\173\000\173\000\173\000\173\000\173\000\
- \173\000\173\000\174\000\174\000\174\000\174\000\174\000\174\000\
- \174\000\174\000\174\000\174\000\255\255\255\255\174\000\255\255\
- \255\255\255\255\255\255\174\000\174\000\174\000\174\000\174\000\
+ \165\000\255\255\165\000\165\000\165\000\165\000\165\000\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\166\000\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
+ \166\000\255\255\165\000\166\000\165\000\255\255\255\255\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
+ \166\000\166\000\165\000\255\255\165\000\255\255\166\000\255\255\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
+ \166\000\166\000\255\255\255\255\255\255\255\255\255\255\255\255\
+ \167\000\167\000\167\000\167\000\167\000\167\000\167\000\167\000\
+ \167\000\167\000\167\000\167\000\167\000\167\000\167\000\167\000\
+ \167\000\167\000\167\000\167\000\167\000\167\000\167\000\167\000\
+ \167\000\167\000\255\255\255\255\255\255\255\255\167\000\255\255\
+ \167\000\167\000\167\000\167\000\167\000\167\000\167\000\167\000\
+ \167\000\167\000\167\000\167\000\167\000\167\000\167\000\167\000\
+ \167\000\167\000\167\000\167\000\167\000\167\000\167\000\167\000\
+ \167\000\167\000\255\255\255\255\255\255\255\255\255\255\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\255\255\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\255\255\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\167\000\
+ \167\000\167\000\167\000\167\000\167\000\167\000\167\000\167\000\
+ \167\000\167\000\167\000\167\000\167\000\167\000\167\000\167\000\
+ \167\000\167\000\167\000\167\000\167\000\167\000\255\255\167\000\
+ \167\000\167\000\167\000\167\000\167\000\167\000\167\000\167\000\
+ \167\000\167\000\167\000\167\000\167\000\167\000\167\000\167\000\
+ \167\000\167\000\167\000\167\000\167\000\167\000\167\000\167\000\
+ \167\000\167\000\167\000\167\000\167\000\167\000\168\000\167\000\
+ \167\000\167\000\167\000\167\000\167\000\167\000\167\000\168\000\
+ \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
+ \168\000\255\255\255\255\168\000\255\255\255\255\255\255\255\255\
+ \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
+ \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
+ \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
+ \168\000\168\000\255\255\255\255\255\255\255\255\168\000\255\255\
+ \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
+ \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
+ \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
+ \168\000\168\000\255\255\255\255\255\255\255\255\255\255\255\255\
\174\000\174\000\174\000\174\000\174\000\174\000\174\000\174\000\
\174\000\174\000\174\000\174\000\174\000\174\000\174\000\174\000\
- \174\000\174\000\174\000\174\000\174\000\255\255\255\255\255\255\
- \255\255\174\000\255\255\174\000\174\000\174\000\174\000\174\000\
\174\000\174\000\174\000\174\000\174\000\174\000\174\000\174\000\
+ \174\000\174\000\255\255\255\255\255\255\255\255\174\000\255\255\
\174\000\174\000\174\000\174\000\174\000\174\000\174\000\174\000\
- \174\000\174\000\174\000\174\000\174\000\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\174\000\174\000\174\000\174\000\174\000\174\000\
\174\000\174\000\174\000\174\000\174\000\174\000\174\000\174\000\
\174\000\174\000\174\000\174\000\174\000\174\000\174\000\174\000\
- \174\000\255\255\174\000\174\000\174\000\174\000\174\000\174\000\
+ \174\000\174\000\255\255\255\255\255\255\255\255\255\255\168\000\
+ \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
+ \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
+ \168\000\168\000\168\000\168\000\168\000\168\000\255\255\168\000\
+ \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
+ \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
+ \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
+ \168\000\168\000\168\000\168\000\168\000\168\000\255\255\168\000\
+ \168\000\168\000\168\000\168\000\168\000\168\000\168\000\174\000\
\174\000\174\000\174\000\174\000\174\000\174\000\174\000\174\000\
\174\000\174\000\174\000\174\000\174\000\174\000\174\000\174\000\
+ \174\000\174\000\174\000\174\000\174\000\174\000\255\255\174\000\
\174\000\174\000\174\000\174\000\174\000\174\000\174\000\174\000\
- \174\000\255\255\174\000\174\000\174\000\174\000\174\000\174\000\
- \174\000\174\000\175\000\255\255\255\255\175\000\255\255\255\255\
- \255\255\255\255\255\255\255\255\175\000\255\255\175\000\175\000\
- \175\000\175\000\175\000\175\000\175\000\175\000\175\000\175\000\
- \175\000\255\255\255\255\255\255\255\255\255\255\255\255\175\000\
+ \174\000\174\000\174\000\174\000\174\000\174\000\174\000\174\000\
+ \174\000\174\000\174\000\174\000\174\000\174\000\174\000\174\000\
+ \174\000\174\000\174\000\174\000\174\000\174\000\255\255\174\000\
+ \174\000\174\000\174\000\174\000\174\000\174\000\174\000\175\000\
\175\000\175\000\175\000\175\000\175\000\175\000\175\000\175\000\
\175\000\175\000\175\000\175\000\175\000\175\000\175\000\175\000\
\175\000\175\000\175\000\175\000\175\000\175\000\175\000\175\000\
- \175\000\255\255\255\255\255\255\255\255\175\000\175\000\175\000\
+ \175\000\255\255\255\255\255\255\255\255\175\000\255\255\175\000\
\175\000\175\000\175\000\175\000\175\000\175\000\175\000\175\000\
\175\000\175\000\175\000\175\000\175\000\175\000\175\000\175\000\
\175\000\175\000\175\000\175\000\175\000\175\000\175\000\175\000\
\175\000\175\000\175\000\175\000\175\000\175\000\175\000\175\000\
\175\000\175\000\175\000\175\000\175\000\175\000\175\000\175\000\
\175\000\175\000\175\000\175\000\175\000\175\000\175\000\175\000\
- \175\000\175\000\175\000\175\000\175\000\255\255\175\000\175\000\
- \175\000\175\000\175\000\175\000\175\000\175\000\175\000\177\000\
+ \175\000\175\000\175\000\175\000\175\000\176\000\175\000\175\000\
+ \175\000\175\000\175\000\175\000\175\000\175\000\176\000\176\000\
+ \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
+ \255\255\255\255\176\000\255\255\255\255\255\255\176\000\176\000\
+ \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
+ \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
+ \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
+ \176\000\255\255\255\255\255\255\255\255\176\000\255\255\176\000\
+ \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
+ \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
+ \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
+ \176\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\176\000\176\000\
+ \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
+ \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
+ \176\000\176\000\176\000\176\000\176\000\255\255\176\000\176\000\
+ \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
+ \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
+ \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
+ \176\000\176\000\176\000\176\000\176\000\177\000\176\000\176\000\
+ \176\000\176\000\176\000\176\000\176\000\176\000\177\000\177\000\
\177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
- \177\000\177\000\177\000\255\255\255\255\255\255\255\255\255\255\
- \255\255\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
+ \255\255\255\255\177\000\255\255\255\255\255\255\255\255\177\000\
\177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
\177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
- \177\000\177\000\177\000\255\255\255\255\255\255\255\255\177\000\
- \255\255\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
\177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
+ \177\000\255\255\255\255\255\255\255\255\177\000\255\255\177\000\
\177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
- \177\000\177\000\177\000\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
+ \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
+ \177\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\177\000\177\000\
\177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
\177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
- \177\000\177\000\177\000\177\000\177\000\177\000\177\000\255\255\
+ \177\000\177\000\177\000\177\000\177\000\255\255\177\000\177\000\
\177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
\177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
\177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
- \177\000\177\000\177\000\177\000\177\000\177\000\177\000\255\255\
- \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
- \178\000\255\255\255\255\255\255\255\255\255\255\255\255\178\000\
- \255\255\178\000\178\000\178\000\178\000\178\000\178\000\178\000\
- \178\000\178\000\178\000\178\000\255\255\255\255\255\255\255\255\
- \255\255\255\255\178\000\178\000\178\000\178\000\178\000\178\000\
+ \177\000\177\000\177\000\177\000\177\000\255\255\177\000\177\000\
+ \177\000\177\000\177\000\177\000\177\000\177\000\178\000\255\255\
+ \255\255\178\000\255\255\255\255\255\255\255\255\255\255\255\255\
+ \178\000\255\255\178\000\178\000\178\000\178\000\178\000\178\000\
+ \178\000\178\000\178\000\178\000\178\000\255\255\255\255\255\255\
+ \255\255\255\255\255\255\178\000\178\000\178\000\178\000\178\000\
\178\000\178\000\178\000\178\000\178\000\178\000\178\000\178\000\
\178\000\178\000\178\000\178\000\178\000\178\000\178\000\178\000\
- \178\000\178\000\178\000\178\000\255\255\255\255\255\255\255\255\
- \178\000\255\255\178\000\178\000\178\000\178\000\178\000\178\000\
+ \178\000\178\000\178\000\178\000\178\000\255\255\255\255\255\255\
+ \255\255\178\000\178\000\178\000\178\000\178\000\178\000\178\000\
\178\000\178\000\178\000\178\000\178\000\178\000\178\000\178\000\
\178\000\178\000\178\000\178\000\178\000\178\000\178\000\178\000\
- \178\000\178\000\178\000\178\000\255\255\255\255\255\255\255\255\
+ \178\000\178\000\178\000\178\000\178\000\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\178\000\178\000\178\000\178\000\178\000\178\000\178\000\
+ \255\255\255\255\178\000\178\000\178\000\178\000\178\000\178\000\
\178\000\178\000\178\000\178\000\178\000\178\000\178\000\178\000\
\178\000\178\000\178\000\178\000\178\000\178\000\178\000\178\000\
- \255\255\178\000\178\000\178\000\178\000\178\000\178\000\178\000\
+ \178\000\255\255\178\000\178\000\178\000\178\000\178\000\178\000\
\178\000\178\000\178\000\178\000\178\000\178\000\178\000\178\000\
\178\000\178\000\178\000\178\000\178\000\178\000\178\000\178\000\
\178\000\178\000\178\000\178\000\178\000\178\000\178\000\178\000\
- \180\000\178\000\178\000\178\000\178\000\178\000\178\000\178\000\
- \178\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
- \180\000\180\000\180\000\180\000\255\255\255\255\255\255\255\255\
- \255\255\255\255\180\000\180\000\180\000\180\000\180\000\180\000\
+ \178\000\255\255\178\000\178\000\178\000\178\000\178\000\178\000\
+ \178\000\178\000\178\000\180\000\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\180\000\180\000\180\000\180\000\
+ \180\000\180\000\180\000\180\000\180\000\180\000\180\000\255\255\
+ \255\255\255\255\255\255\255\255\255\255\180\000\180\000\180\000\
\180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
\180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
- \180\000\180\000\180\000\180\000\255\255\255\255\255\255\255\255\
- \180\000\255\255\180\000\180\000\180\000\180\000\180\000\180\000\
+ \180\000\180\000\180\000\180\000\180\000\180\000\180\000\255\255\
+ \255\255\255\255\255\255\180\000\255\255\180\000\180\000\180\000\
\180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
\180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
- \180\000\180\000\180\000\180\000\255\255\255\255\255\255\255\255\
- \255\255\255\255\184\000\184\000\184\000\184\000\184\000\184\000\
- \184\000\184\000\184\000\184\000\184\000\184\000\184\000\184\000\
- \184\000\184\000\184\000\184\000\184\000\184\000\184\000\184\000\
- \184\000\184\000\184\000\184\000\255\255\255\255\255\255\255\255\
- \184\000\255\255\184\000\184\000\184\000\184\000\184\000\184\000\
- \184\000\184\000\184\000\184\000\184\000\184\000\184\000\184\000\
- \184\000\184\000\184\000\184\000\184\000\184\000\184\000\184\000\
- \184\000\184\000\184\000\184\000\255\255\255\255\255\255\255\255\
- \255\255\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
+ \180\000\180\000\180\000\180\000\180\000\180\000\180\000\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\180\000\180\000\180\000\180\000\
\180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
\180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
- \255\255\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
+ \180\000\180\000\180\000\255\255\180\000\180\000\180\000\180\000\
\180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
\180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
\180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
- \255\255\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
- \180\000\184\000\184\000\184\000\184\000\184\000\184\000\184\000\
- \184\000\184\000\184\000\184\000\184\000\184\000\184\000\184\000\
- \184\000\184\000\184\000\184\000\184\000\184\000\184\000\184\000\
- \255\255\184\000\184\000\184\000\184\000\184\000\184\000\184\000\
- \184\000\184\000\184\000\184\000\184\000\184\000\184\000\184\000\
- \184\000\184\000\184\000\184\000\184\000\184\000\184\000\184\000\
- \184\000\184\000\184\000\184\000\184\000\184\000\184\000\184\000\
- \255\255\184\000\184\000\184\000\184\000\184\000\184\000\184\000\
- \184\000\185\000\185\000\185\000\185\000\185\000\185\000\185\000\
- \185\000\185\000\185\000\185\000\185\000\185\000\185\000\185\000\
- \185\000\185\000\185\000\185\000\185\000\185\000\185\000\185\000\
- \185\000\185\000\185\000\255\255\255\255\255\255\255\255\185\000\
- \255\255\185\000\185\000\185\000\185\000\185\000\185\000\185\000\
- \185\000\185\000\185\000\185\000\185\000\185\000\185\000\185\000\
- \185\000\185\000\185\000\185\000\185\000\185\000\185\000\185\000\
- \185\000\185\000\185\000\255\255\255\255\255\255\255\255\255\255\
+ \180\000\180\000\180\000\255\255\180\000\180\000\180\000\180\000\
+ \180\000\180\000\180\000\180\000\181\000\255\255\255\255\255\255\
+ \255\255\255\255\255\255\181\000\255\255\181\000\181\000\181\000\
+ \181\000\181\000\181\000\181\000\181\000\181\000\181\000\181\000\
+ \255\255\255\255\255\255\255\255\255\255\255\255\181\000\181\000\
+ \181\000\181\000\181\000\181\000\181\000\181\000\181\000\181\000\
+ \181\000\181\000\181\000\181\000\181\000\181\000\181\000\181\000\
+ \181\000\181\000\181\000\181\000\181\000\181\000\181\000\181\000\
+ \255\255\255\255\255\255\255\255\181\000\255\255\181\000\181\000\
+ \181\000\181\000\181\000\181\000\181\000\181\000\181\000\181\000\
+ \181\000\181\000\181\000\181\000\181\000\181\000\181\000\181\000\
+ \181\000\181\000\181\000\181\000\181\000\181\000\181\000\181\000\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\181\000\181\000\181\000\
+ \181\000\181\000\181\000\181\000\181\000\181\000\181\000\181\000\
+ \181\000\181\000\181\000\181\000\181\000\181\000\181\000\181\000\
+ \181\000\181\000\181\000\181\000\255\255\181\000\181\000\181\000\
+ \181\000\181\000\181\000\181\000\181\000\181\000\181\000\181\000\
+ \181\000\181\000\181\000\181\000\181\000\181\000\181\000\181\000\
+ \181\000\181\000\181\000\181\000\181\000\181\000\181\000\181\000\
+ \181\000\181\000\181\000\181\000\183\000\181\000\181\000\181\000\
+ \181\000\181\000\181\000\181\000\181\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
+ \255\255\255\255\255\255\255\255\255\255\255\255\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
+ \255\255\255\255\255\255\255\255\183\000\255\255\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
+ \255\255\255\255\255\255\255\255\255\255\255\255\187\000\187\000\
+ \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
+ \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
+ \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
+ \255\255\255\255\255\255\255\255\187\000\255\255\187\000\187\000\
+ \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
+ \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
+ \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
+ \255\255\255\255\255\255\255\255\255\255\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\255\255\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\255\255\183\000\183\000\183\000\
+ \183\000\183\000\183\000\183\000\183\000\187\000\187\000\187\000\
+ \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
+ \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
+ \187\000\187\000\187\000\187\000\255\255\187\000\187\000\187\000\
+ \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
+ \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
+ \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
+ \187\000\187\000\187\000\187\000\255\255\187\000\187\000\187\000\
+ \187\000\187\000\187\000\187\000\187\000\188\000\188\000\188\000\
+ \188\000\188\000\188\000\188\000\188\000\188\000\188\000\188\000\
+ \188\000\188\000\188\000\188\000\188\000\188\000\188\000\188\000\
+ \188\000\188\000\188\000\188\000\188\000\188\000\188\000\255\255\
+ \255\255\255\255\255\255\188\000\255\255\188\000\188\000\188\000\
+ \188\000\188\000\188\000\188\000\188\000\188\000\188\000\188\000\
+ \188\000\188\000\188\000\188\000\188\000\188\000\188\000\188\000\
+ \188\000\188\000\188\000\188\000\188\000\188\000\188\000\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \185\000\185\000\185\000\185\000\185\000\185\000\185\000\185\000\
- \185\000\185\000\185\000\185\000\185\000\185\000\185\000\185\000\
- \185\000\185\000\185\000\185\000\185\000\185\000\185\000\255\255\
- \185\000\185\000\185\000\185\000\185\000\185\000\185\000\185\000\
- \185\000\185\000\185\000\185\000\185\000\185\000\185\000\185\000\
- \185\000\185\000\185\000\185\000\185\000\185\000\185\000\185\000\
- \185\000\185\000\185\000\185\000\185\000\185\000\185\000\186\000\
- \185\000\185\000\185\000\185\000\185\000\185\000\185\000\185\000\
- \186\000\186\000\186\000\186\000\186\000\186\000\186\000\186\000\
- \186\000\186\000\255\255\255\255\186\000\255\255\255\255\255\255\
- \186\000\186\000\186\000\186\000\186\000\186\000\186\000\186\000\
- \186\000\186\000\186\000\186\000\186\000\186\000\186\000\186\000\
- \186\000\186\000\186\000\186\000\186\000\186\000\186\000\186\000\
- \186\000\186\000\186\000\255\255\255\255\255\255\255\255\186\000\
- \255\255\186\000\186\000\186\000\186\000\186\000\186\000\186\000\
- \186\000\186\000\186\000\186\000\186\000\186\000\186\000\186\000\
- \186\000\186\000\186\000\186\000\186\000\186\000\186\000\186\000\
- \186\000\186\000\186\000\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\188\000\188\000\188\000\188\000\
+ \188\000\188\000\188\000\188\000\188\000\188\000\188\000\188\000\
+ \188\000\188\000\188\000\188\000\188\000\188\000\188\000\188\000\
+ \188\000\188\000\188\000\255\255\188\000\188\000\188\000\188\000\
+ \188\000\188\000\188\000\188\000\188\000\188\000\188\000\188\000\
+ \188\000\188\000\188\000\188\000\188\000\188\000\188\000\188\000\
+ \188\000\188\000\188\000\188\000\188\000\188\000\188\000\188\000\
+ \188\000\188\000\188\000\189\000\188\000\188\000\188\000\188\000\
+ \188\000\188\000\188\000\188\000\189\000\189\000\189\000\189\000\
+ \189\000\189\000\189\000\189\000\189\000\189\000\255\255\255\255\
+ \189\000\255\255\255\255\255\255\189\000\189\000\189\000\189\000\
+ \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
+ \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
+ \189\000\189\000\189\000\189\000\189\000\189\000\189\000\255\255\
+ \255\255\255\255\255\255\189\000\255\255\189\000\189\000\189\000\
+ \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
+ \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
+ \189\000\189\000\189\000\189\000\189\000\189\000\189\000\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \186\000\186\000\186\000\186\000\186\000\186\000\186\000\186\000\
- \186\000\186\000\186\000\186\000\186\000\186\000\186\000\186\000\
- \186\000\186\000\186\000\186\000\186\000\186\000\186\000\255\255\
- \186\000\186\000\186\000\186\000\186\000\186\000\186\000\186\000\
- \186\000\186\000\186\000\186\000\186\000\186\000\186\000\186\000\
- \186\000\186\000\186\000\186\000\186\000\186\000\186\000\186\000\
- \186\000\186\000\186\000\186\000\186\000\186\000\186\000\187\000\
- \186\000\186\000\186\000\186\000\186\000\186\000\186\000\186\000\
- \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
- \187\000\187\000\255\255\255\255\187\000\255\255\255\255\255\255\
- \255\255\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
- \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
- \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
- \187\000\187\000\187\000\255\255\255\255\255\255\255\255\187\000\
- \255\255\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
- \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
- \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
- \187\000\187\000\187\000\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\189\000\189\000\189\000\189\000\
+ \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
+ \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
+ \189\000\189\000\189\000\255\255\189\000\189\000\189\000\189\000\
+ \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
+ \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
+ \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
+ \189\000\189\000\189\000\190\000\189\000\189\000\189\000\189\000\
+ \189\000\189\000\189\000\189\000\190\000\190\000\190\000\190\000\
+ \190\000\190\000\190\000\190\000\190\000\190\000\255\255\255\255\
+ \190\000\255\255\255\255\255\255\255\255\190\000\190\000\190\000\
+ \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
+ \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
+ \190\000\190\000\190\000\190\000\190\000\190\000\190\000\255\255\
+ \255\255\255\255\255\255\190\000\255\255\190\000\190\000\190\000\
+ \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
+ \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
+ \190\000\190\000\190\000\190\000\190\000\190\000\190\000\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
- \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
- \187\000\187\000\187\000\187\000\187\000\187\000\187\000\255\255\
- \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
- \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
- \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
- \187\000\187\000\187\000\187\000\187\000\187\000\187\000\255\255\
- \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
- \255\255";
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\190\000\190\000\190\000\190\000\
+ \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
+ \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
+ \190\000\190\000\190\000\255\255\190\000\190\000\190\000\190\000\
+ \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
+ \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
+ \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
+ \190\000\190\000\190\000\255\255\190\000\190\000\190\000\190\000\
+ \190\000\190\000\190\000\190\000\255\255";
Lexing.lex_base_code =
"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\066\000\101\000\136\000\
- \171\000\206\000\000\000\000\000\000\000\000\000\241\000\020\001\
- \055\001\000\000\000\000\018\000\090\001\125\001\160\001\195\001\
- \230\001\000\000\021\000\026\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\000\000\247\001\
- \040\002\000\000\034\000\000\000\000\000\003\000\000\000\000\000\
- \049\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\066\000\101\000\136\000\171\000\
+ \206\000\000\000\000\000\000\000\000\000\241\000\020\001\055\001\
+ \000\000\000\000\018\000\090\001\125\001\160\001\195\001\230\001\
+ \000\000\021\000\026\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\247\001\040\002\000\000\034\000\000\000\
+ \000\000\003\000\000\000\000\000\049\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\
- \000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\036\002\000\000\244\002\000\000\000\000\061\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \001\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\036\002\000\000\244\002\000\000\
+ \000\000\061\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000";
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000";
Lexing.lex_backtrk_code =
"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\034\000\000\000\000\000\000\000\000\000\000\000\049\000\
+ \000\000\000\000\000\000\000\000\000\000\034\000\000\000\000\000\
+ \000\000\000\000\000\000\049\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\061\000\061\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\061\000\061\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000";
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000";
Lexing.lex_default_code =
"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\041\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \041\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000";
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000";
Lexing.lex_trans_code =
"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\001\000\000\000\058\000\058\000\000\000\058\000\000\000\
\058\000\058\000\058\000\058\000\000\000";
Lexing.lex_check_code =
"\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\016\000\100\000\149\000\153\000\100\000\149\000\255\255\
+ \255\255\016\000\104\000\152\000\156\000\104\000\152\000\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \016\000\255\255\100\000\000\000\019\000\101\000\255\255\019\000\
+ \016\000\255\255\104\000\000\000\019\000\105\000\255\255\019\000\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\016\000\016\000\016\000\016\000\016\000\016\000\016\000\016\000\
\016\000\016\000\255\255\019\000\019\000\255\255\255\255\019\000\
\019\000\019\000\255\255\255\255\255\255\255\255\019\000\255\255\
- \019\000\019\000\019\000\061\000\255\255\255\255\061\000\255\255\
+ \019\000\019\000\019\000\060\000\255\255\255\255\060\000\255\255\
\255\255\255\255\255\255\255\255\255\255\019\000\255\255\019\000\
\019\000\019\000\019\000\019\000\255\255\255\255\255\255\255\255\
- \255\255\255\255\061\000\061\000\255\255\255\255\061\000\061\000\
- \061\000\255\255\255\255\255\255\061\000\061\000\255\255\061\000\
- \061\000\061\000\255\255\255\255\255\255\255\255\255\255\019\000\
- \255\255\019\000\255\255\255\255\061\000\255\255\061\000\061\000\
- \061\000\061\000\061\000\255\255\255\255\255\255\062\000\255\255\
- \255\255\062\000\062\000\062\000\255\255\255\255\255\255\062\000\
- \062\000\255\255\062\000\062\000\062\000\255\255\255\255\019\000\
- \255\255\019\000\255\255\255\255\255\255\255\255\061\000\062\000\
- \061\000\062\000\062\000\062\000\062\000\062\000\255\255\255\255\
- \255\255\063\000\255\255\255\255\063\000\063\000\063\000\255\255\
- \255\255\255\255\063\000\063\000\255\255\063\000\063\000\063\000\
- \255\255\255\255\255\255\255\255\255\255\255\255\061\000\255\255\
- \061\000\062\000\063\000\062\000\063\000\063\000\063\000\063\000\
- \063\000\255\255\255\255\255\255\064\000\255\255\255\255\064\000\
- \064\000\064\000\255\255\255\255\255\255\064\000\064\000\255\255\
- \064\000\064\000\064\000\255\255\255\255\255\255\255\255\255\255\
- \255\255\062\000\255\255\062\000\063\000\064\000\063\000\064\000\
- \064\000\064\000\064\000\064\000\255\255\255\255\255\255\065\000\
- \255\255\255\255\065\000\065\000\065\000\255\255\255\255\255\255\
- \065\000\065\000\255\255\065\000\065\000\065\000\255\255\255\255\
- \100\000\255\255\255\255\255\255\063\000\255\255\063\000\064\000\
- \065\000\064\000\065\000\065\000\065\000\065\000\065\000\255\255\
- \255\255\255\255\070\000\255\255\255\255\070\000\070\000\070\000\
- \255\255\255\255\255\255\070\000\070\000\255\255\070\000\070\000\
- \070\000\255\255\255\255\255\255\255\255\255\255\255\255\064\000\
- \255\255\064\000\065\000\070\000\065\000\070\000\070\000\070\000\
- \070\000\070\000\255\255\255\255\255\255\071\000\255\255\255\255\
- \071\000\071\000\071\000\255\255\255\255\255\255\071\000\071\000\
- \255\255\071\000\071\000\071\000\255\255\255\255\255\255\255\255\
- \255\255\255\255\065\000\255\255\065\000\070\000\071\000\070\000\
- \071\000\071\000\071\000\071\000\071\000\255\255\255\255\255\255\
- \072\000\255\255\255\255\072\000\072\000\072\000\255\255\255\255\
- \255\255\072\000\072\000\255\255\072\000\072\000\072\000\255\255\
- \255\255\255\255\255\255\255\255\255\255\070\000\255\255\070\000\
- \071\000\072\000\071\000\072\000\072\000\072\000\072\000\072\000\
- \255\255\255\255\255\255\076\000\255\255\255\255\076\000\076\000\
- \076\000\255\255\255\255\255\255\076\000\076\000\255\255\076\000\
- \076\000\076\000\255\255\255\255\255\255\255\255\255\255\255\255\
- \071\000\255\255\071\000\072\000\076\000\072\000\076\000\076\000\
- \076\000\076\000\076\000\255\255\255\255\255\255\077\000\255\255\
- \255\255\077\000\077\000\077\000\255\255\255\255\255\255\077\000\
- \077\000\255\255\077\000\077\000\077\000\255\255\255\255\255\255\
- \255\255\255\255\255\255\072\000\255\255\072\000\076\000\077\000\
- \076\000\077\000\077\000\077\000\077\000\077\000\255\255\255\255\
- \255\255\078\000\255\255\255\255\078\000\078\000\078\000\255\255\
- \255\255\255\255\078\000\078\000\255\255\078\000\078\000\078\000\
- \255\255\255\255\255\255\255\255\255\255\255\255\076\000\255\255\
- \076\000\077\000\078\000\077\000\078\000\078\000\078\000\078\000\
- \078\000\255\255\255\255\255\255\079\000\255\255\255\255\079\000\
- \079\000\079\000\255\255\255\255\255\255\079\000\079\000\255\255\
- \079\000\079\000\079\000\255\255\255\255\255\255\255\255\255\255\
- \255\255\077\000\255\255\077\000\078\000\079\000\078\000\079\000\
- \079\000\079\000\079\000\079\000\255\255\255\255\255\255\080\000\
- \255\255\255\255\080\000\080\000\080\000\255\255\255\255\255\255\
- \080\000\080\000\255\255\080\000\080\000\080\000\255\255\255\255\
- \255\255\095\000\255\255\255\255\078\000\255\255\078\000\079\000\
- \080\000\079\000\080\000\080\000\080\000\080\000\080\000\095\000\
- \095\000\095\000\095\000\095\000\095\000\095\000\095\000\095\000\
- \095\000\096\000\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\079\000\
- \255\255\079\000\080\000\255\255\080\000\255\255\255\255\255\255\
- \096\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\060\000\060\000\255\255\255\255\060\000\060\000\
+ \060\000\255\255\255\255\255\255\060\000\060\000\255\255\060\000\
+ \060\000\060\000\255\255\255\255\255\255\255\255\255\255\019\000\
+ \255\255\019\000\255\255\255\255\060\000\255\255\060\000\060\000\
+ \060\000\060\000\060\000\255\255\255\255\255\255\061\000\255\255\
+ \255\255\061\000\061\000\061\000\255\255\255\255\255\255\061\000\
+ \061\000\255\255\061\000\061\000\061\000\255\255\255\255\019\000\
+ \255\255\019\000\255\255\255\255\255\255\255\255\060\000\061\000\
+ \060\000\061\000\061\000\061\000\061\000\061\000\255\255\255\255\
+ \255\255\062\000\255\255\255\255\062\000\062\000\062\000\255\255\
+ \255\255\255\255\062\000\062\000\255\255\062\000\062\000\062\000\
+ \255\255\255\255\255\255\255\255\255\255\255\255\060\000\255\255\
+ \060\000\061\000\062\000\061\000\062\000\062\000\062\000\062\000\
+ \062\000\255\255\255\255\255\255\063\000\255\255\255\255\063\000\
+ \063\000\063\000\255\255\255\255\255\255\063\000\063\000\255\255\
+ \063\000\063\000\063\000\255\255\255\255\255\255\255\255\255\255\
+ \255\255\061\000\255\255\061\000\062\000\063\000\062\000\063\000\
+ \063\000\063\000\063\000\063\000\255\255\255\255\255\255\064\000\
+ \255\255\255\255\064\000\064\000\064\000\255\255\255\255\255\255\
+ \064\000\064\000\255\255\064\000\064\000\064\000\255\255\255\255\
+ \104\000\255\255\255\255\255\255\062\000\255\255\062\000\063\000\
+ \064\000\063\000\064\000\064\000\064\000\064\000\064\000\255\255\
+ \255\255\255\255\069\000\255\255\255\255\069\000\069\000\069\000\
+ \255\255\255\255\255\255\069\000\069\000\255\255\069\000\069\000\
+ \069\000\255\255\255\255\255\255\255\255\255\255\255\255\063\000\
+ \255\255\063\000\064\000\069\000\064\000\069\000\069\000\069\000\
+ \069\000\069\000\255\255\255\255\255\255\070\000\255\255\255\255\
+ \070\000\070\000\070\000\255\255\255\255\255\255\070\000\070\000\
+ \255\255\070\000\070\000\070\000\255\255\255\255\255\255\255\255\
+ \255\255\255\255\064\000\255\255\064\000\069\000\070\000\069\000\
+ \070\000\070\000\070\000\070\000\070\000\255\255\255\255\255\255\
+ \071\000\255\255\255\255\071\000\071\000\071\000\255\255\255\255\
+ \255\255\071\000\071\000\255\255\071\000\071\000\071\000\255\255\
+ \255\255\255\255\255\255\255\255\255\255\069\000\255\255\069\000\
+ \070\000\071\000\070\000\071\000\071\000\071\000\071\000\071\000\
+ \255\255\255\255\255\255\075\000\255\255\255\255\075\000\075\000\
+ \075\000\255\255\255\255\255\255\075\000\075\000\255\255\075\000\
+ \075\000\075\000\255\255\255\255\255\255\255\255\255\255\255\255\
+ \070\000\255\255\070\000\071\000\075\000\071\000\075\000\075\000\
+ \075\000\075\000\075\000\255\255\255\255\255\255\076\000\255\255\
+ \255\255\076\000\076\000\076\000\255\255\255\255\255\255\076\000\
+ \076\000\255\255\076\000\076\000\076\000\255\255\255\255\255\255\
+ \255\255\255\255\255\255\071\000\255\255\071\000\075\000\076\000\
+ \075\000\076\000\076\000\076\000\076\000\076\000\255\255\255\255\
+ \255\255\077\000\255\255\255\255\077\000\077\000\077\000\255\255\
+ \255\255\255\255\077\000\077\000\255\255\077\000\077\000\077\000\
+ \255\255\255\255\255\255\255\255\255\255\255\255\075\000\255\255\
+ \075\000\076\000\077\000\076\000\077\000\077\000\077\000\077\000\
+ \077\000\255\255\255\255\255\255\078\000\255\255\255\255\078\000\
+ \078\000\078\000\255\255\255\255\255\255\078\000\078\000\255\255\
+ \078\000\078\000\078\000\255\255\255\255\255\255\255\255\255\255\
+ \255\255\076\000\255\255\076\000\077\000\078\000\077\000\078\000\
+ \078\000\078\000\078\000\078\000\255\255\255\255\255\255\079\000\
+ \255\255\255\255\079\000\079\000\079\000\255\255\255\255\255\255\
+ \079\000\079\000\255\255\079\000\079\000\079\000\255\255\255\255\
+ \255\255\099\000\255\255\255\255\077\000\255\255\077\000\078\000\
+ \079\000\078\000\079\000\079\000\079\000\079\000\079\000\099\000\
+ \099\000\099\000\099\000\099\000\099\000\099\000\099\000\099\000\
+ \099\000\100\000\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\078\000\
+ \255\255\078\000\079\000\255\255\079\000\255\255\255\255\255\255\
+ \100\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \096\000\096\000\096\000\096\000\096\000\096\000\096\000\096\000\
- \096\000\096\000\080\000\255\255\080\000\161\000\161\000\161\000\
- \161\000\161\000\161\000\161\000\161\000\161\000\161\000\161\000\
- \161\000\161\000\161\000\161\000\161\000\161\000\161\000\161\000\
- \161\000\161\000\161\000\161\000\161\000\161\000\161\000\255\255\
- \255\255\255\255\255\255\161\000\255\255\161\000\161\000\161\000\
- \161\000\161\000\161\000\161\000\161\000\161\000\161\000\161\000\
- \161\000\161\000\161\000\161\000\161\000\161\000\161\000\161\000\
- \161\000\161\000\161\000\161\000\161\000\161\000\161\000\255\255\
+ \100\000\100\000\100\000\100\000\100\000\100\000\100\000\100\000\
+ \100\000\100\000\079\000\255\255\079\000\164\000\164\000\164\000\
+ \164\000\164\000\164\000\164\000\164\000\164\000\164\000\164\000\
+ \164\000\164\000\164\000\164\000\164\000\164\000\164\000\164\000\
+ \164\000\164\000\164\000\164\000\164\000\164\000\164\000\255\255\
+ \255\255\255\255\255\255\164\000\255\255\164\000\164\000\164\000\
+ \164\000\164\000\164\000\164\000\164\000\164\000\164\000\164\000\
+ \164\000\164\000\164\000\164\000\164\000\164\000\164\000\164\000\
+ \164\000\164\000\164\000\164\000\164\000\164\000\164\000\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\161\000\161\000\161\000\161\000\
- \161\000\161\000\161\000\161\000\161\000\161\000\161\000\161\000\
- \161\000\161\000\161\000\161\000\161\000\161\000\161\000\161\000\
- \161\000\161\000\161\000\255\255\161\000\161\000\161\000\161\000\
- \161\000\161\000\161\000\161\000\161\000\161\000\161\000\161\000\
- \161\000\161\000\161\000\161\000\161\000\161\000\161\000\161\000\
- \161\000\161\000\161\000\161\000\161\000\161\000\161\000\161\000\
- \161\000\161\000\161\000\163\000\161\000\161\000\161\000\161\000\
- \161\000\161\000\161\000\161\000\163\000\163\000\163\000\163\000\
- \163\000\163\000\163\000\163\000\163\000\163\000\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\163\000\163\000\163\000\
- \163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
- \163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
- \163\000\163\000\163\000\163\000\163\000\163\000\163\000\255\255\
- \255\255\255\255\255\255\163\000\255\255\163\000\163\000\163\000\
- \163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
- \163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
- \163\000\163\000\163\000\163\000\163\000\163\000\163\000\255\255\
+ \255\255\255\255\255\255\255\255\164\000\164\000\164\000\164\000\
+ \164\000\164\000\164\000\164\000\164\000\164\000\164\000\164\000\
+ \164\000\164\000\164\000\164\000\164\000\164\000\164\000\164\000\
+ \164\000\164\000\164\000\255\255\164\000\164\000\164\000\164\000\
+ \164\000\164\000\164\000\164\000\164\000\164\000\164\000\164\000\
+ \164\000\164\000\164\000\164\000\164\000\164\000\164\000\164\000\
+ \164\000\164\000\164\000\164\000\164\000\164\000\164\000\164\000\
+ \164\000\164\000\164\000\166\000\164\000\164\000\164\000\164\000\
+ \164\000\164\000\164\000\164\000\166\000\166\000\166\000\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\166\000\166\000\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\255\255\
+ \255\255\255\255\255\255\166\000\255\255\166\000\166\000\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\163\000\163\000\163\000\163\000\
- \163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
- \163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
- \163\000\163\000\163\000\255\255\163\000\163\000\163\000\163\000\
- \163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
- \163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
- \163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
- \163\000\163\000\163\000\255\255\163\000\163\000\163\000\163\000\
- \163\000\163\000\163\000\163\000\255\255";
+ \255\255\255\255\255\255\255\255\166\000\166\000\166\000\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
+ \166\000\166\000\166\000\255\255\166\000\166\000\166\000\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
+ \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
+ \166\000\166\000\166\000\255\255\166\000\166\000\166\000\166\000\
+ \166\000\166\000\166\000\166\000\255\255";
Lexing.lex_code =
"\255\004\255\255\009\255\255\006\255\005\255\255\007\255\255\008\
\255\255\000\007\255\000\006\001\008\255\000\005\255\011\255\010\
\255\000\004\001\009\003\010\002\011\255\001\255\255\000\001\255\
";
}
+
let rec token c lexbuf =
(lexbuf.Lexing.lex_mem <- Array.create 12 (-1);
__ocaml_lex_token_rec c lexbuf 0)
move_start_p (-1) c;
SYMBOL "*")
| 18 ->
- if quotations c
- then mk_quotation quotation c "" "" 2
- else parse (symbolchar_star "<<") c
+ let beginning =
+ Lexing.sub_lexeme lexbuf
+ (lexbuf.Lexing.lex_start_pos + 2)
+ lexbuf.Lexing.lex_curr_pos
+ in
+ if quotations c
+ then
+ (move_start_p (- (String.length beginning));
+ mk_quotation quotation c "" "" 2)
+ else parse (symbolchar_star ("<<" ^ beginning)) c
| 19 ->
if quotations c
then
| __ocaml_lex_state ->
(lexbuf.Lexing.refill_buff lexbuf;
__ocaml_lex_token_rec c lexbuf __ocaml_lex_state)
- and comment c lexbuf = __ocaml_lex_comment_rec c lexbuf 120
+ and comment c lexbuf = __ocaml_lex_comment_rec c lexbuf 123
and __ocaml_lex_comment_rec c lexbuf __ocaml_lex_state =
match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf
with
__ocaml_lex_comment_rec c lexbuf __ocaml_lex_state)
and string c lexbuf =
(lexbuf.Lexing.lex_mem <- Array.create 2 (-1);
- __ocaml_lex_string_rec c lexbuf 147)
+ __ocaml_lex_string_rec c lexbuf 150)
and __ocaml_lex_string_rec c lexbuf __ocaml_lex_state =
match Lexing.new_engine __ocaml_lex_tables __ocaml_lex_state
lexbuf
(lexbuf.Lexing.refill_buff lexbuf;
__ocaml_lex_string_rec c lexbuf __ocaml_lex_state)
and symbolchar_star beginning c lexbuf =
- __ocaml_lex_symbolchar_star_rec beginning c lexbuf 157
+ __ocaml_lex_symbolchar_star_rec beginning c lexbuf 160
and
__ocaml_lex_symbolchar_star_rec beginning c lexbuf
__ocaml_lex_state =
Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos
lexbuf.Lexing.lex_curr_pos
in
- (move_start_p (-String.length beginning) c;
+ (move_start_p (- (String.length beginning)) c;
SYMBOL (beginning ^ tok))
| __ocaml_lex_state ->
(lexbuf.Lexing.refill_buff lexbuf;
__ocaml_lex_symbolchar_star_rec beginning c lexbuf
__ocaml_lex_state)
and maybe_quotation_at c lexbuf =
- __ocaml_lex_maybe_quotation_at_rec c lexbuf 158
+ __ocaml_lex_maybe_quotation_at_rec c lexbuf 161
and
__ocaml_lex_maybe_quotation_at_rec c lexbuf __ocaml_lex_state =
match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf
Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos
(lexbuf.Lexing.lex_curr_pos + (-1))
in
- mk_quotation quotation c "" loc (3 + (String.length loc))
+ mk_quotation quotation c "" loc (1 + (String.length loc))
| 1 ->
let tok =
Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos
__ocaml_lex_state)
and maybe_quotation_colon c lexbuf =
(lexbuf.Lexing.lex_mem <- Array.create 2 (-1);
- __ocaml_lex_maybe_quotation_colon_rec c lexbuf 161)
+ __ocaml_lex_maybe_quotation_colon_rec c lexbuf 164)
and
__ocaml_lex_maybe_quotation_colon_rec c lexbuf
__ocaml_lex_state =
(lexbuf.Lexing.lex_curr_pos + (-1))
in
mk_quotation quotation c name ""
- (3 + (String.length name))
+ (1 + (String.length name))
| 1 ->
let name =
Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos
(lexbuf.Lexing.lex_curr_pos + (-1))
in
mk_quotation quotation c name loc
- ((4 + (String.length loc)) + (String.length name))
+ ((2 + (String.length loc)) + (String.length name))
| 2 ->
let tok =
Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos
(lexbuf.Lexing.refill_buff lexbuf;
__ocaml_lex_maybe_quotation_colon_rec c lexbuf
__ocaml_lex_state)
- and quotation c lexbuf = __ocaml_lex_quotation_rec c lexbuf 167
+ and quotation c lexbuf = __ocaml_lex_quotation_rec c lexbuf 170
and __ocaml_lex_quotation_rec c lexbuf __ocaml_lex_state =
match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf
with
| __ocaml_lex_state ->
(lexbuf.Lexing.refill_buff lexbuf;
__ocaml_lex_quotation_rec c lexbuf __ocaml_lex_state)
- and dollar c lexbuf = __ocaml_lex_dollar_rec c lexbuf 175
+ and dollar c lexbuf = __ocaml_lex_dollar_rec c lexbuf 178
and __ocaml_lex_dollar_rec c lexbuf __ocaml_lex_state =
match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf
with
(lexbuf.Lexing.refill_buff lexbuf;
__ocaml_lex_dollar_rec c lexbuf __ocaml_lex_state)
and antiquot name c lexbuf =
- __ocaml_lex_antiquot_rec name c lexbuf 181
+ __ocaml_lex_antiquot_rec name c lexbuf 184
and __ocaml_lex_antiquot_rec name c lexbuf __ocaml_lex_state =
match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf
with
| __ocaml_lex_state ->
(lexbuf.Lexing.refill_buff lexbuf;
__ocaml_lex_antiquot_rec name c lexbuf __ocaml_lex_state)
+
let lexing_store s buff max =
let rec self n s =
if n >= max
| Some x -> (Stream.junk s; buff.[n] <- x; succ n)
| _ -> n)
in self 0 s
+
let from_context c =
let next _ =
let tok = with_curr_loc token c in
let loc = Loc.of_lexbuf c.lexbuf in Some (tok, loc)
in Stream.from next
+
let from_lexbuf ?(quotations = true) lb =
let c =
{
quotations = quotations;
}
in from_context c
+
let setup_loc lb loc =
let start_pos = Loc.start_pos loc
in
(lb.lex_abs_pos <- start_pos.pos_cnum;
lb.lex_curr_p <- start_pos)
+
let from_string ?quotations loc str =
let lb = Lexing.from_string str
in (setup_loc lb loc; from_lexbuf ?quotations lb)
+
let from_stream ?quotations loc strm =
let lb = Lexing.from_function (lexing_store strm)
in (setup_loc lb loc; from_lexbuf ?quotations lb)
+
let mk () loc strm =
from_stream ~quotations: !Camlp4_config.quotations loc strm
+
end
+
end
+
module Camlp4Ast =
struct
module Make (Loc : Sig.Loc) : Sig.Camlp4Ast with module Loc = Loc =
struct
module Loc = Loc
+
module Ast =
struct
include Sig.MakeCamlp4Ast(Loc)
+
let safe_string_escaped s =
if
((String.length s) > 2) &&
((s.[0] = '\\') && (s.[1] = '$'))
then s
else String.escaped s
+
end
+
include Ast
+
external loc_of_ctyp : ctyp -> Loc.t = "%field0"
+
external loc_of_patt : patt -> Loc.t = "%field0"
+
external loc_of_expr : expr -> Loc.t = "%field0"
+
external loc_of_module_type : module_type -> Loc.t = "%field0"
+
external loc_of_module_expr : module_expr -> Loc.t = "%field0"
+
external loc_of_sig_item : sig_item -> Loc.t = "%field0"
+
external loc_of_str_item : str_item -> Loc.t = "%field0"
+
external loc_of_class_type : class_type -> Loc.t = "%field0"
+
external loc_of_class_sig_item : class_sig_item -> Loc.t =
"%field0"
+
external loc_of_class_expr : class_expr -> Loc.t = "%field0"
+
external loc_of_class_str_item : class_str_item -> Loc.t =
"%field0"
+
external loc_of_with_constr : with_constr -> Loc.t = "%field0"
+
external loc_of_binding : binding -> Loc.t = "%field0"
+
external loc_of_rec_binding : rec_binding -> Loc.t = "%field0"
+
external loc_of_module_binding : module_binding -> Loc.t =
"%field0"
+
external loc_of_match_case : match_case -> Loc.t = "%field0"
+
external loc_of_ident : ident -> Loc.t = "%field0"
+
let ghost = Loc.ghost
+
let rec is_module_longident =
function
| Ast.IdAcc (_, _, i) -> is_module_longident i
(is_module_longident i1) && (is_module_longident i2)
| Ast.IdUid (_, _) -> true
| _ -> false
+
let ident_of_expr =
let error () =
invalid_arg
| Ast.ExId (_, i) -> i
| Ast.ExApp (_, _, _) -> error ()
| t -> self t
+
let ident_of_ctyp =
let error () =
invalid_arg "ident_of_ctyp: this type is not an identifier" in
if is_module_longident i then i else error ()
| _ -> error ()
in function | Ast.TyId (_, i) -> i | t -> self t
+
let ident_of_patt =
let error () =
invalid_arg
if is_module_longident i then i else error ()
| _ -> error ()
in function | Ast.PaId (_, i) -> i | p -> self p
+
let rec is_irrefut_patt =
function
| Ast.PaId (_, (Ast.IdLid (_, _))) -> true
| Ast.PaAli (_, x, y) ->
(is_irrefut_patt x) && (is_irrefut_patt y)
| Ast.PaRec (_, p) -> is_irrefut_patt p
- | Ast.PaEq (_, (Ast.IdLid (_, _)), p) -> is_irrefut_patt p
+ | Ast.PaEq (_, _, p) -> is_irrefut_patt p
| Ast.PaSem (_, p1, p2) ->
(is_irrefut_patt p1) && (is_irrefut_patt p2)
| Ast.PaCom (_, p1, p2) ->
| Ast.PaLab (_, _, (Ast.PaNil _)) -> true
| Ast.PaLab (_, _, p) -> is_irrefut_patt p
| _ -> false
+
let rec is_constructor =
function
| Ast.IdAcc (_, _, i) -> is_constructor i
| Ast.IdUid (_, _) -> true
| Ast.IdLid (_, _) | Ast.IdApp (_, _, _) -> false
| Ast.IdAnt (_, _) -> assert false
+
let is_patt_constructor =
function
| Ast.PaId (_, i) -> is_constructor i
| Ast.PaVrn (_, _) -> true
| _ -> false
+
let rec is_expr_constructor =
function
| Ast.ExId (_, i) -> is_constructor i
(is_expr_constructor e1) && (is_expr_constructor e2)
| Ast.ExVrn (_, _) -> true
| _ -> false
+
let rec tyOr_of_list =
function
| [] -> Ast.TyNil ghost
| t :: ts ->
let _loc = loc_of_ctyp t
in Ast.TyOr (_loc, t, tyOr_of_list ts)
+
let rec tyAnd_of_list =
function
| [] -> Ast.TyNil ghost
| t :: ts ->
let _loc = loc_of_ctyp t
in Ast.TyAnd (_loc, t, tyAnd_of_list ts)
+
let rec tySem_of_list =
function
| [] -> Ast.TyNil ghost
| t :: ts ->
let _loc = loc_of_ctyp t
in Ast.TySem (_loc, t, tySem_of_list ts)
+
let rec tyCom_of_list =
function
| [] -> Ast.TyNil ghost
| t :: ts ->
let _loc = loc_of_ctyp t
in Ast.TyCom (_loc, t, tyCom_of_list ts)
+
let rec tyAmp_of_list =
function
| [] -> Ast.TyNil ghost
| t :: ts ->
let _loc = loc_of_ctyp t
in Ast.TyAmp (_loc, t, tyAmp_of_list ts)
+
let rec tySta_of_list =
function
| [] -> Ast.TyNil ghost
| t :: ts ->
let _loc = loc_of_ctyp t
in Ast.TySta (_loc, t, tySta_of_list ts)
+
let rec stSem_of_list =
function
| [] -> Ast.StNil ghost
| t :: ts ->
let _loc = loc_of_str_item t
in Ast.StSem (_loc, t, stSem_of_list ts)
+
let rec sgSem_of_list =
function
| [] -> Ast.SgNil ghost
| t :: ts ->
let _loc = loc_of_sig_item t
in Ast.SgSem (_loc, t, sgSem_of_list ts)
+
let rec biAnd_of_list =
function
| [] -> Ast.BiNil ghost
| b :: bs ->
let _loc = loc_of_binding b
in Ast.BiAnd (_loc, b, biAnd_of_list bs)
+
let rec rbSem_of_list =
function
| [] -> Ast.RbNil ghost
| b :: bs ->
let _loc = loc_of_rec_binding b
in Ast.RbSem (_loc, b, rbSem_of_list bs)
+
let rec wcAnd_of_list =
function
| [] -> Ast.WcNil ghost
| w :: ws ->
let _loc = loc_of_with_constr w
in Ast.WcAnd (_loc, w, wcAnd_of_list ws)
+
let rec idAcc_of_list =
function
| [] -> assert false
| i :: is ->
let _loc = loc_of_ident i
in Ast.IdAcc (_loc, i, idAcc_of_list is)
+
let rec idApp_of_list =
function
| [] -> assert false
| i :: is ->
let _loc = loc_of_ident i
in Ast.IdApp (_loc, i, idApp_of_list is)
+
let rec mcOr_of_list =
function
| [] -> Ast.McNil ghost
| x :: xs ->
let _loc = loc_of_match_case x
in Ast.McOr (_loc, x, mcOr_of_list xs)
+
let rec mbAnd_of_list =
function
| [] -> Ast.MbNil ghost
| x :: xs ->
let _loc = loc_of_module_binding x
in Ast.MbAnd (_loc, x, mbAnd_of_list xs)
+
let rec meApp_of_list =
function
| [] -> assert false
| x :: xs ->
let _loc = loc_of_module_expr x
in Ast.MeApp (_loc, x, meApp_of_list xs)
+
let rec ceAnd_of_list =
function
| [] -> Ast.CeNil ghost
| x :: xs ->
let _loc = loc_of_class_expr x
in Ast.CeAnd (_loc, x, ceAnd_of_list xs)
+
let rec ctAnd_of_list =
function
| [] -> Ast.CtNil ghost
| x :: xs ->
let _loc = loc_of_class_type x
in Ast.CtAnd (_loc, x, ctAnd_of_list xs)
+
let rec cgSem_of_list =
function
| [] -> Ast.CgNil ghost
| x :: xs ->
let _loc = loc_of_class_sig_item x
in Ast.CgSem (_loc, x, cgSem_of_list xs)
+
let rec crSem_of_list =
function
| [] -> Ast.CrNil ghost
| x :: xs ->
let _loc = loc_of_class_str_item x
in Ast.CrSem (_loc, x, crSem_of_list xs)
+
let rec paSem_of_list =
function
| [] -> Ast.PaNil ghost
| x :: xs ->
let _loc = loc_of_patt x
in Ast.PaSem (_loc, x, paSem_of_list xs)
+
let rec paCom_of_list =
function
| [] -> Ast.PaNil ghost
| x :: xs ->
let _loc = loc_of_patt x
in Ast.PaCom (_loc, x, paCom_of_list xs)
+
let rec exSem_of_list =
function
| [] -> Ast.ExNil ghost
| x :: xs ->
let _loc = loc_of_expr x
in Ast.ExSem (_loc, x, exSem_of_list xs)
+
let rec exCom_of_list =
function
| [] -> Ast.ExNil ghost
| x :: xs ->
let _loc = loc_of_expr x
in Ast.ExCom (_loc, x, exCom_of_list xs)
+
let ty_of_stl =
function
| (_loc, s, []) -> Ast.TyId (_loc, Ast.IdUid (_loc, s))
| (_loc, s, tl) ->
Ast.TyOf (_loc, Ast.TyId (_loc, Ast.IdUid (_loc, s)),
tyAnd_of_list tl)
+
let ty_of_sbt =
function
| (_loc, s, true, t) ->
Ast.TyMut (_loc, t))
| (_loc, s, false, t) ->
Ast.TyCol (_loc, Ast.TyId (_loc, Ast.IdLid (_loc, s)), t)
+
let bi_of_pe (p, e) =
let _loc = loc_of_patt p in Ast.BiEq (_loc, p, e)
+
let sum_type_of_list l = tyOr_of_list (List.map ty_of_stl l)
+
let record_type_of_list l = tySem_of_list (List.map ty_of_sbt l)
+
let binding_of_pel l = biAnd_of_list (List.map bi_of_pe l)
+
let rec pel_of_binding =
function
| Ast.BiAnd (_, b1, b2) ->
(pel_of_binding b1) @ (pel_of_binding b2)
| Ast.BiEq (_, p, e) -> [ (p, e) ]
| _ -> assert false
+
let rec list_of_binding x acc =
match x with
| Ast.BiAnd (_, b1, b2) ->
list_of_binding b1 (list_of_binding b2 acc)
| t -> t :: acc
+
let rec list_of_rec_binding x acc =
match x with
| Ast.RbSem (_, b1, b2) ->
list_of_rec_binding b1 (list_of_rec_binding b2 acc)
| t -> t :: acc
+
let rec list_of_with_constr x acc =
match x with
| Ast.WcAnd (_, w1, w2) ->
list_of_with_constr w1 (list_of_with_constr w2 acc)
| t -> t :: acc
+
let rec list_of_ctyp x acc =
match x with
| Ast.TyNil _ -> acc
Ast.TyAnd (_, x, y) | Ast.TyOr (_, x, y) ->
list_of_ctyp x (list_of_ctyp y acc)
| x -> x :: acc
+
let rec list_of_patt x acc =
match x with
| Ast.PaNil _ -> acc
| Ast.PaCom (_, x, y) | Ast.PaSem (_, x, y) ->
list_of_patt x (list_of_patt y acc)
| x -> x :: acc
+
let rec list_of_expr x acc =
match x with
| Ast.ExNil _ -> acc
| Ast.ExCom (_, x, y) | Ast.ExSem (_, x, y) ->
list_of_expr x (list_of_expr y acc)
| x -> x :: acc
+
let rec list_of_str_item x acc =
match x with
| Ast.StNil _ -> acc
| Ast.StSem (_, x, y) ->
list_of_str_item x (list_of_str_item y acc)
| x -> x :: acc
+
let rec list_of_sig_item x acc =
match x with
| Ast.SgNil _ -> acc
| Ast.SgSem (_, x, y) ->
list_of_sig_item x (list_of_sig_item y acc)
| x -> x :: acc
+
let rec list_of_class_sig_item x acc =
match x with
| Ast.CgNil _ -> acc
| Ast.CgSem (_, x, y) ->
list_of_class_sig_item x (list_of_class_sig_item y acc)
| x -> x :: acc
+
let rec list_of_class_str_item x acc =
match x with
| Ast.CrNil _ -> acc
| Ast.CrSem (_, x, y) ->
list_of_class_str_item x (list_of_class_str_item y acc)
| x -> x :: acc
+
let rec list_of_class_type x acc =
match x with
| Ast.CtAnd (_, x, y) ->
list_of_class_type x (list_of_class_type y acc)
| x -> x :: acc
+
let rec list_of_class_expr x acc =
match x with
| Ast.CeAnd (_, x, y) ->
list_of_class_expr x (list_of_class_expr y acc)
| x -> x :: acc
+
let rec list_of_module_expr x acc =
match x with
| Ast.MeApp (_, x, y) ->
list_of_module_expr x (list_of_module_expr y acc)
| x -> x :: acc
+
let rec list_of_match_case x acc =
match x with
| Ast.McNil _ -> acc
| Ast.McOr (_, x, y) ->
list_of_match_case x (list_of_match_case y acc)
| x -> x :: acc
+
let rec list_of_ident x acc =
match x with
| Ast.IdAcc (_, x, y) | Ast.IdApp (_, x, y) ->
list_of_ident x (list_of_ident y acc)
| x -> x :: acc
+
let rec list_of_module_binding x acc =
match x with
| Ast.MbAnd (_, x, y) ->
list_of_module_binding x (list_of_module_binding y acc)
| x -> x :: acc
+
module Meta =
struct
module type META_LOC =
sig
val meta_loc_patt : Loc.t -> Loc.t -> Ast.patt
+
val meta_loc_expr : Loc.t -> Loc.t -> Ast.expr
+
end
+
module MetaLoc =
struct
let meta_loc_patt _loc location =
Ast.PaId (_loc, Ast.IdUid (_loc, "True"))
else
Ast.PaId (_loc, Ast.IdUid (_loc, "False"))))))
+
let meta_loc_expr _loc location =
let (a, b, c, d, e, f, g, h) = Loc.to_tuple location
in
Ast.ExId (_loc, Ast.IdUid (_loc, "True"))
else
Ast.ExId (_loc, Ast.IdUid (_loc, "False"))))))
+
end
+
module MetaGhostLoc =
struct
let meta_loc_patt _loc _ =
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Loc"),
Ast.IdLid (_loc, "ghost")))
+
let meta_loc_expr _loc _ =
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Loc"),
Ast.IdLid (_loc, "ghost")))
+
end
+
module MetaLocVar =
struct
let meta_loc_patt _loc _ =
Ast.PaId (_loc, Ast.IdLid (_loc, !Loc.name))
+
let meta_loc_expr _loc _ =
Ast.ExId (_loc, Ast.IdLid (_loc, !Loc.name))
+
end
+
module Make (MetaLoc : META_LOC) =
struct
open MetaLoc
- let meta_acc_Loc_t = meta_loc_expr
+
+ let meta_loc = meta_loc_expr
+
module Expr =
struct
let meta_string _loc s = Ast.ExStr (_loc, s)
+
let meta_int _loc s = Ast.ExInt (_loc, s)
+
let meta_float _loc s = Ast.ExFlo (_loc, s)
+
let meta_char _loc s = Ast.ExChr (_loc, s)
+
let meta_bool _loc =
function
| false ->
Ast.ExId (_loc, Ast.IdUid (_loc, "False"))
| true -> Ast.ExId (_loc, Ast.IdUid (_loc, "True"))
+
let rec meta_list mf_a _loc =
function
| [] -> Ast.ExId (_loc, Ast.IdUid (_loc, "[]"))
Ast.ExId (_loc, Ast.IdUid (_loc, "::")),
mf_a _loc x),
meta_list mf_a _loc xs)
+
let rec meta_binding _loc =
function
| Ast.BiAnt (x0, x1) -> Ast.ExAnt (x0, x1)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "BiEq"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_patt _loc x1),
meta_expr _loc x2)
| Ast.BiAnd (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "BiAnd"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_binding _loc x1),
meta_binding _loc x2)
| Ast.BiNil x0 ->
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "BiNil"))),
- meta_acc_Loc_t _loc x0)
+ meta_loc _loc x0)
and meta_class_expr _loc =
function
| Ast.CeAnt (x0, x1) -> Ast.ExAnt (x0, x1)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CeEq"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_class_expr _loc x1),
meta_class_expr _loc x2)
| Ast.CeAnd (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CeAnd"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_class_expr _loc x1),
meta_class_expr _loc x2)
| Ast.CeTyc (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CeTyc"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_class_expr _loc x1),
meta_class_type _loc x2)
| Ast.CeStr (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CeStr"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_patt _loc x1),
meta_class_str_item _loc x2)
| Ast.CeLet (x0, x1, x2, x3) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CeLet"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_meta_bool _loc x1),
meta_binding _loc x2),
meta_class_expr _loc x3)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CeFun"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_patt _loc x1),
meta_class_expr _loc x2)
| Ast.CeCon (x0, x1, x2, x3) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CeCon"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_meta_bool _loc x1),
meta_ident _loc x2),
meta_ctyp _loc x3)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CeApp"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_class_expr _loc x1),
meta_expr _loc x2)
| Ast.CeNil x0 ->
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CeNil"))),
- meta_acc_Loc_t _loc x0)
+ meta_loc _loc x0)
and meta_class_sig_item _loc =
function
| Ast.CgAnt (x0, x1) -> Ast.ExAnt (x0, x1)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CgVir"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_meta_bool _loc x2),
meta_ctyp _loc x3)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CgVal"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_meta_bool _loc x2),
meta_meta_bool _loc x3),
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CgMth"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_meta_bool _loc x2),
meta_ctyp _loc x3)
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CgInh"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_class_type _loc x1)
| Ast.CgSem (x0, x1, x2) ->
Ast.ExApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CgSem"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_class_sig_item _loc x1),
meta_class_sig_item _loc x2)
| Ast.CgCtr (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CgCtr"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1),
meta_ctyp _loc x2)
| Ast.CgNil x0 ->
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CgNil"))),
- meta_acc_Loc_t _loc x0)
+ meta_loc _loc x0)
and meta_class_str_item _loc =
function
| Ast.CrAnt (x0, x1) -> Ast.ExAnt (x0, x1)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CrVvr"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_meta_bool _loc x2),
meta_ctyp _loc x3)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CrVir"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_meta_bool _loc x2),
meta_ctyp _loc x3)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CrVal"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_meta_bool _loc x2),
meta_expr _loc x3)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CrMth"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_meta_bool _loc x2),
meta_expr _loc x3),
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CrIni"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_expr _loc x1)
| Ast.CrInh (x0, x1, x2) ->
Ast.ExApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CrInh"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_class_expr _loc x1),
meta_string _loc x2)
| Ast.CrCtr (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CrCtr"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1),
meta_ctyp _loc x2)
| Ast.CrSem (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CrSem"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_class_str_item _loc x1),
meta_class_str_item _loc x2)
| Ast.CrNil x0 ->
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CrNil"))),
- meta_acc_Loc_t _loc x0)
+ meta_loc _loc x0)
and meta_class_type _loc =
function
| Ast.CtAnt (x0, x1) -> Ast.ExAnt (x0, x1)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CtEq"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_class_type _loc x1),
meta_class_type _loc x2)
| Ast.CtCol (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CtCol"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_class_type _loc x1),
meta_class_type _loc x2)
| Ast.CtAnd (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CtAnd"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_class_type _loc x1),
meta_class_type _loc x2)
| Ast.CtSig (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CtSig"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1),
meta_class_sig_item _loc x2)
| Ast.CtFun (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CtFun"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1),
meta_class_type _loc x2)
| Ast.CtCon (x0, x1, x2, x3) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CtCon"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_meta_bool _loc x1),
meta_ident _loc x2),
meta_ctyp _loc x3)
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CtNil"))),
- meta_acc_Loc_t _loc x0)
+ meta_loc _loc x0)
and meta_ctyp _loc =
function
| Ast.TyAnt (x0, x1) -> Ast.ExAnt (x0, x1)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyOfAmp"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1),
meta_ctyp _loc x2)
| Ast.TyAmp (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyAmp"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1),
meta_ctyp _loc x2)
| Ast.TyVrnInfSup (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyVrnInfSup"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1),
meta_ctyp _loc x2)
| Ast.TyVrnInf (x0, x1) ->
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyVrnInf"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1)
| Ast.TyVrnSup (x0, x1) ->
Ast.ExApp (_loc,
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyVrnSup"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1)
| Ast.TyVrnEq (x0, x1) ->
Ast.ExApp (_loc,
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyVrnEq"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1)
| Ast.TySta (x0, x1, x2) ->
Ast.ExApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TySta"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1),
meta_ctyp _loc x2)
| Ast.TyTup (x0, x1) ->
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyTup"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1)
| Ast.TyMut (x0, x1) ->
Ast.ExApp (_loc,
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyMut"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1)
| Ast.TyPrv (x0, x1) ->
Ast.ExApp (_loc,
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyPrv"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1)
| Ast.TyOr (x0, x1, x2) ->
Ast.ExApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyOr"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1),
meta_ctyp _loc x2)
| Ast.TyAnd (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyAnd"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1),
meta_ctyp _loc x2)
| Ast.TyOf (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyOf"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1),
meta_ctyp _loc x2)
| Ast.TySum (x0, x1) ->
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TySum"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1)
| Ast.TyCom (x0, x1, x2) ->
Ast.ExApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyCom"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1),
meta_ctyp _loc x2)
| Ast.TySem (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TySem"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1),
meta_ctyp _loc x2)
| Ast.TyCol (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyCol"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1),
meta_ctyp _loc x2)
| Ast.TyRec (x0, x1) ->
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyRec"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1)
| Ast.TyVrn (x0, x1) ->
Ast.ExApp (_loc,
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyVrn"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1)
| Ast.TyQuM (x0, x1) ->
Ast.ExApp (_loc,
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyQuM"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1)
| Ast.TyQuP (x0, x1) ->
Ast.ExApp (_loc,
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyQuP"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1)
| Ast.TyQuo (x0, x1) ->
Ast.ExApp (_loc,
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyQuo"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1)
| Ast.TyPol (x0, x1, x2) ->
Ast.ExApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyPol"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1),
meta_ctyp _loc x2)
| Ast.TyOlb (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyOlb"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_ctyp _loc x2)
| Ast.TyObj (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyObj"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1),
meta_meta_bool _loc x2)
| Ast.TyDcl (x0, x1, x2, x3, x4) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyDcl"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_list meta_ctyp _loc x2),
meta_ctyp _loc x3),
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyMan"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1),
meta_ctyp _loc x2)
| Ast.TyId (x0, x1) ->
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyId"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ident _loc x1)
| Ast.TyLab (x0, x1, x2) ->
Ast.ExApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyLab"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_ctyp _loc x2)
| Ast.TyCls (x0, x1) ->
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyCls"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ident _loc x1)
| Ast.TyArr (x0, x1, x2) ->
Ast.ExApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyArr"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1),
meta_ctyp _loc x2)
| Ast.TyApp (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyApp"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1),
meta_ctyp _loc x2)
| Ast.TyAny x0 ->
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyAny"))),
- meta_acc_Loc_t _loc x0)
+ meta_loc _loc x0)
| Ast.TyAli (x0, x1, x2) ->
Ast.ExApp (_loc,
Ast.ExApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyAli"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1),
meta_ctyp _loc x2)
| Ast.TyNil x0 ->
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyNil"))),
- meta_acc_Loc_t _loc x0)
+ meta_loc _loc x0)
and meta_expr _loc =
function
| Ast.ExWhi (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExWhi"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_expr _loc x1),
meta_expr _loc x2)
| Ast.ExVrn (x0, x1) ->
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExVrn"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1)
| Ast.ExTyc (x0, x1, x2) ->
Ast.ExApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExTyc"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_expr _loc x1),
meta_ctyp _loc x2)
| Ast.ExCom (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExCom"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_expr _loc x1),
meta_expr _loc x2)
| Ast.ExTup (x0, x1) ->
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExTup"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_expr _loc x1)
| Ast.ExTry (x0, x1, x2) ->
Ast.ExApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExTry"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_expr _loc x1),
meta_match_case _loc x2)
| Ast.ExStr (x0, x1) ->
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExStr"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1)
| Ast.ExSte (x0, x1, x2) ->
Ast.ExApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExSte"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_expr _loc x1),
meta_expr _loc x2)
| Ast.ExSnd (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExSnd"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_expr _loc x1),
meta_string _loc x2)
| Ast.ExSeq (x0, x1) ->
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExSeq"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_expr _loc x1)
| Ast.ExRec (x0, x1, x2) ->
Ast.ExApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExRec"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_rec_binding _loc x1),
meta_expr _loc x2)
| Ast.ExOvr (x0, x1) ->
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExOvr"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_rec_binding _loc x1)
| Ast.ExOlb (x0, x1, x2) ->
Ast.ExApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExOlb"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_expr _loc x2)
| Ast.ExObj (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExObj"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_patt _loc x1),
meta_class_str_item _loc x2)
| Ast.ExNew (x0, x1) ->
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExNew"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ident _loc x1)
| Ast.ExMat (x0, x1, x2) ->
Ast.ExApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExMat"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_expr _loc x1),
meta_match_case _loc x2)
| Ast.ExLmd (x0, x1, x2, x3) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExLmd"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_module_expr _loc x2),
meta_expr _loc x3)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExLet"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_meta_bool _loc x1),
meta_binding _loc x2),
meta_expr _loc x3)
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExLaz"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_expr _loc x1)
| Ast.ExLab (x0, x1, x2) ->
Ast.ExApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExLab"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_expr _loc x2)
| Ast.ExNativeInt (x0, x1) ->
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExNativeInt"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1)
| Ast.ExInt64 (x0, x1) ->
Ast.ExApp (_loc,
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExInt64"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1)
| Ast.ExInt32 (x0, x1) ->
Ast.ExApp (_loc,
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExInt32"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1)
| Ast.ExInt (x0, x1) ->
Ast.ExApp (_loc,
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExInt"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1)
| Ast.ExIfe (x0, x1, x2, x3) ->
Ast.ExApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExIfe"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_expr _loc x1),
meta_expr _loc x2),
meta_expr _loc x3)
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExFun"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_match_case _loc x1)
| Ast.ExFor (x0, x1, x2, x3, x4, x5) ->
Ast.ExApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExFor"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_expr _loc x2),
meta_expr _loc x3),
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExFlo"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1)
| Ast.ExCoe (x0, x1, x2, x3) ->
Ast.ExApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExCoe"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_expr _loc x1),
meta_ctyp _loc x2),
meta_ctyp _loc x3)
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExChr"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1)
| Ast.ExAss (x0, x1, x2) ->
Ast.ExApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExAss"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_expr _loc x1),
meta_expr _loc x2)
| Ast.ExAsr (x0, x1) ->
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExAsr"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_expr _loc x1)
| Ast.ExAsf x0 ->
Ast.ExApp (_loc,
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExAsf"))),
- meta_acc_Loc_t _loc x0)
+ meta_loc _loc x0)
| Ast.ExSem (x0, x1, x2) ->
Ast.ExApp (_loc,
Ast.ExApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExSem"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_expr _loc x1),
meta_expr _loc x2)
| Ast.ExArr (x0, x1) ->
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExArr"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_expr _loc x1)
| Ast.ExAre (x0, x1, x2) ->
Ast.ExApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExAre"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_expr _loc x1),
meta_expr _loc x2)
| Ast.ExApp (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExApp"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_expr _loc x1),
meta_expr _loc x2)
| Ast.ExAnt (x0, x1) -> Ast.ExAnt (x0, x1)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExAcc"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_expr _loc x1),
meta_expr _loc x2)
| Ast.ExId (x0, x1) ->
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExId"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ident _loc x1)
| Ast.ExNil x0 ->
Ast.ExApp (_loc,
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExNil"))),
- meta_acc_Loc_t _loc x0)
+ meta_loc _loc x0)
and meta_ident _loc =
function
| Ast.IdAnt (x0, x1) -> Ast.ExAnt (x0, x1)
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "IdUid"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1)
| Ast.IdLid (x0, x1) ->
Ast.ExApp (_loc,
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "IdLid"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1)
| Ast.IdApp (x0, x1, x2) ->
Ast.ExApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "IdApp"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ident _loc x1),
meta_ident _loc x2)
| Ast.IdAcc (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "IdAcc"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ident _loc x1),
meta_ident _loc x2)
and meta_match_case _loc =
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "McArr"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_patt _loc x1),
meta_expr _loc x2),
meta_expr _loc x3)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "McOr"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_match_case _loc x1),
meta_match_case _loc x2)
| Ast.McNil x0 ->
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "McNil"))),
- meta_acc_Loc_t _loc x0)
+ meta_loc _loc x0)
and meta_meta_bool _loc =
function
| Ast.BAnt x0 -> Ast.ExAnt (_loc, x0)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "MbCol"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_module_type _loc x2)
| Ast.MbColEq (x0, x1, x2, x3) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "MbColEq"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_module_type _loc x2),
meta_module_expr _loc x3)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "MbAnd"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_module_binding _loc x1),
meta_module_binding _loc x2)
| Ast.MbNil x0 ->
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "MbNil"))),
- meta_acc_Loc_t _loc x0)
+ meta_loc _loc x0)
and meta_module_expr _loc =
function
| Ast.MeAnt (x0, x1) -> Ast.ExAnt (x0, x1)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "MeTyc"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_module_expr _loc x1),
meta_module_type _loc x2)
| Ast.MeStr (x0, x1) ->
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "MeStr"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_str_item _loc x1)
| Ast.MeFun (x0, x1, x2, x3) ->
Ast.ExApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "MeFun"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_module_type _loc x2),
meta_module_expr _loc x3)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "MeApp"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_module_expr _loc x1),
meta_module_expr _loc x2)
| Ast.MeId (x0, x1) ->
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "MeId"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ident _loc x1)
| Ast.MeNil x0 ->
Ast.ExApp (_loc,
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "MeNil"))),
- meta_acc_Loc_t _loc x0)
+ meta_loc _loc x0)
and meta_module_type _loc =
function
| Ast.MtAnt (x0, x1) -> Ast.ExAnt (x0, x1)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "MtWit"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_module_type _loc x1),
meta_with_constr _loc x2)
| Ast.MtSig (x0, x1) ->
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "MtSig"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_sig_item _loc x1)
| Ast.MtQuo (x0, x1) ->
Ast.ExApp (_loc,
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "MtQuo"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1)
| Ast.MtFun (x0, x1, x2, x3) ->
Ast.ExApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "MtFun"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_module_type _loc x2),
meta_module_type _loc x3)
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "MtId"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ident _loc x1)
| Ast.MtNil x0 ->
Ast.ExApp (_loc,
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "MtNil"))),
- meta_acc_Loc_t _loc x0)
+ meta_loc _loc x0)
and meta_patt _loc =
function
| Ast.PaVrn (x0, x1) ->
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaVrn"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1)
| Ast.PaTyp (x0, x1) ->
Ast.ExApp (_loc,
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaTyp"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ident _loc x1)
| Ast.PaTyc (x0, x1, x2) ->
Ast.ExApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaTyc"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_patt _loc x1),
meta_ctyp _loc x2)
| Ast.PaTup (x0, x1) ->
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaTup"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_patt _loc x1)
| Ast.PaStr (x0, x1) ->
Ast.ExApp (_loc,
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaStr"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1)
| Ast.PaEq (x0, x1, x2) ->
Ast.ExApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaEq"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ident _loc x1),
meta_patt _loc x2)
| Ast.PaRec (x0, x1) ->
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaRec"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_patt _loc x1)
| Ast.PaRng (x0, x1, x2) ->
Ast.ExApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaRng"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_patt _loc x1),
meta_patt _loc x2)
| Ast.PaOrp (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaOrp"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_patt _loc x1),
meta_patt _loc x2)
| Ast.PaOlbi (x0, x1, x2, x3) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaOlbi"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_patt _loc x2),
meta_expr _loc x3)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaOlb"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_patt _loc x2)
| Ast.PaLab (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaLab"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_patt _loc x2)
| Ast.PaFlo (x0, x1) ->
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaFlo"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1)
| Ast.PaNativeInt (x0, x1) ->
Ast.ExApp (_loc,
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaNativeInt"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1)
| Ast.PaInt64 (x0, x1) ->
Ast.ExApp (_loc,
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaInt64"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1)
| Ast.PaInt32 (x0, x1) ->
Ast.ExApp (_loc,
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaInt32"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1)
| Ast.PaInt (x0, x1) ->
Ast.ExApp (_loc,
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaInt"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1)
| Ast.PaChr (x0, x1) ->
Ast.ExApp (_loc,
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaChr"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1)
| Ast.PaSem (x0, x1, x2) ->
Ast.ExApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaSem"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_patt _loc x1),
meta_patt _loc x2)
| Ast.PaCom (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaCom"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_patt _loc x1),
meta_patt _loc x2)
| Ast.PaArr (x0, x1) ->
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaArr"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_patt _loc x1)
| Ast.PaApp (x0, x1, x2) ->
Ast.ExApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaApp"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_patt _loc x1),
meta_patt _loc x2)
| Ast.PaAny x0 ->
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaAny"))),
- meta_acc_Loc_t _loc x0)
+ meta_loc _loc x0)
| Ast.PaAnt (x0, x1) -> Ast.ExAnt (x0, x1)
| Ast.PaAli (x0, x1, x2) ->
Ast.ExApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaAli"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_patt _loc x1),
meta_patt _loc x2)
| Ast.PaId (x0, x1) ->
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaId"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ident _loc x1)
| Ast.PaNil x0 ->
Ast.ExApp (_loc,
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaNil"))),
- meta_acc_Loc_t _loc x0)
+ meta_loc _loc x0)
and meta_rec_binding _loc =
function
| Ast.RbAnt (x0, x1) -> Ast.ExAnt (x0, x1)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "RbEq"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ident _loc x1),
meta_expr _loc x2)
| Ast.RbSem (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "RbSem"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_rec_binding _loc x1),
meta_rec_binding _loc x2)
| Ast.RbNil x0 ->
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "RbNil"))),
- meta_acc_Loc_t _loc x0)
+ meta_loc _loc x0)
and meta_sig_item _loc =
function
| Ast.SgAnt (x0, x1) -> Ast.ExAnt (x0, x1)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "SgVal"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_ctyp _loc x2)
| Ast.SgTyp (x0, x1) ->
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "SgTyp"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1)
| Ast.SgOpn (x0, x1) ->
Ast.ExApp (_loc,
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "SgOpn"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ident _loc x1)
| Ast.SgMty (x0, x1, x2) ->
Ast.ExApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "SgMty"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_module_type _loc x2)
| Ast.SgRecMod (x0, x1) ->
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "SgRecMod"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_module_binding _loc x1)
| Ast.SgMod (x0, x1, x2) ->
Ast.ExApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "SgMod"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_module_type _loc x2)
| Ast.SgInc (x0, x1) ->
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "SgInc"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_module_type _loc x1)
| Ast.SgExt (x0, x1, x2, x3) ->
Ast.ExApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "SgExt"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_ctyp _loc x2),
meta_meta_list meta_string _loc x3)
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "SgExc"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1)
| Ast.SgDir (x0, x1, x2) ->
Ast.ExApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "SgDir"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_expr _loc x2)
| Ast.SgSem (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "SgSem"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_sig_item _loc x1),
meta_sig_item _loc x2)
| Ast.SgClt (x0, x1) ->
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "SgClt"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_class_type _loc x1)
| Ast.SgCls (x0, x1) ->
Ast.ExApp (_loc,
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "SgCls"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_class_type _loc x1)
| Ast.SgNil x0 ->
Ast.ExApp (_loc,
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "SgNil"))),
- meta_acc_Loc_t _loc x0)
+ meta_loc _loc x0)
and meta_str_item _loc =
function
| Ast.StAnt (x0, x1) -> Ast.ExAnt (x0, x1)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "StVal"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_meta_bool _loc x1),
meta_binding _loc x2)
| Ast.StTyp (x0, x1) ->
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "StTyp"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1)
| Ast.StOpn (x0, x1) ->
Ast.ExApp (_loc,
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "StOpn"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ident _loc x1)
| Ast.StMty (x0, x1, x2) ->
Ast.ExApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "StMty"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_module_type _loc x2)
| Ast.StRecMod (x0, x1) ->
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "StRecMod"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_module_binding _loc x1)
| Ast.StMod (x0, x1, x2) ->
Ast.ExApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "StMod"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_module_expr _loc x2)
| Ast.StInc (x0, x1) ->
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "StInc"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_module_expr _loc x1)
| Ast.StExt (x0, x1, x2, x3) ->
Ast.ExApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "StExt"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_ctyp _loc x2),
meta_meta_list meta_string _loc x3)
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "StExp"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_expr _loc x1)
| Ast.StExc (x0, x1, x2) ->
Ast.ExApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "StExc"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1),
meta_meta_option meta_ident _loc x2)
| Ast.StDir (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "StDir"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_expr _loc x2)
| Ast.StSem (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "StSem"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_str_item _loc x1),
meta_str_item _loc x2)
| Ast.StClt (x0, x1) ->
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "StClt"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_class_type _loc x1)
| Ast.StCls (x0, x1) ->
Ast.ExApp (_loc,
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "StCls"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_class_expr _loc x1)
| Ast.StNil x0 ->
Ast.ExApp (_loc,
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "StNil"))),
- meta_acc_Loc_t _loc x0)
+ meta_loc _loc x0)
and meta_with_constr _loc =
function
| Ast.WcAnt (x0, x1) -> Ast.ExAnt (x0, x1)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "WcAnd"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_with_constr _loc x1),
meta_with_constr _loc x2)
| Ast.WcMod (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "WcMod"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ident _loc x1),
meta_ident _loc x2)
| Ast.WcTyp (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "WcTyp"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1),
meta_ctyp _loc x2)
| Ast.WcNil x0 ->
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "WcNil"))),
- meta_acc_Loc_t _loc x0)
+ meta_loc _loc x0)
+
end
- let meta_acc_Loc_t = meta_loc_patt
+
+ let meta_loc = meta_loc_patt
+
module Patt =
struct
let meta_string _loc s = Ast.PaStr (_loc, s)
+
let meta_int _loc s = Ast.PaInt (_loc, s)
+
let meta_float _loc s = Ast.PaFlo (_loc, s)
+
let meta_char _loc s = Ast.PaChr (_loc, s)
+
let meta_bool _loc =
function
| false ->
Ast.PaId (_loc, Ast.IdUid (_loc, "False"))
| true -> Ast.PaId (_loc, Ast.IdUid (_loc, "True"))
+
let rec meta_list mf_a _loc =
function
| [] -> Ast.PaId (_loc, Ast.IdUid (_loc, "[]"))
Ast.PaId (_loc, Ast.IdUid (_loc, "::")),
mf_a _loc x),
meta_list mf_a _loc xs)
+
let rec meta_binding _loc =
function
| Ast.BiAnt (x0, x1) -> Ast.PaAnt (x0, x1)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "BiEq"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_patt _loc x1),
meta_expr _loc x2)
| Ast.BiAnd (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "BiAnd"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_binding _loc x1),
meta_binding _loc x2)
| Ast.BiNil x0 ->
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "BiNil"))),
- meta_acc_Loc_t _loc x0)
+ meta_loc _loc x0)
and meta_class_expr _loc =
function
| Ast.CeAnt (x0, x1) -> Ast.PaAnt (x0, x1)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CeEq"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_class_expr _loc x1),
meta_class_expr _loc x2)
| Ast.CeAnd (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CeAnd"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_class_expr _loc x1),
meta_class_expr _loc x2)
| Ast.CeTyc (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CeTyc"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_class_expr _loc x1),
meta_class_type _loc x2)
| Ast.CeStr (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CeStr"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_patt _loc x1),
meta_class_str_item _loc x2)
| Ast.CeLet (x0, x1, x2, x3) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CeLet"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_meta_bool _loc x1),
meta_binding _loc x2),
meta_class_expr _loc x3)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CeFun"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_patt _loc x1),
meta_class_expr _loc x2)
| Ast.CeCon (x0, x1, x2, x3) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CeCon"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_meta_bool _loc x1),
meta_ident _loc x2),
meta_ctyp _loc x3)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CeApp"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_class_expr _loc x1),
meta_expr _loc x2)
| Ast.CeNil x0 ->
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CeNil"))),
- meta_acc_Loc_t _loc x0)
+ meta_loc _loc x0)
and meta_class_sig_item _loc =
function
| Ast.CgAnt (x0, x1) -> Ast.PaAnt (x0, x1)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CgVir"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_meta_bool _loc x2),
meta_ctyp _loc x3)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CgVal"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_meta_bool _loc x2),
meta_meta_bool _loc x3),
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CgMth"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_meta_bool _loc x2),
meta_ctyp _loc x3)
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CgInh"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_class_type _loc x1)
| Ast.CgSem (x0, x1, x2) ->
Ast.PaApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CgSem"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_class_sig_item _loc x1),
meta_class_sig_item _loc x2)
| Ast.CgCtr (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CgCtr"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1),
meta_ctyp _loc x2)
| Ast.CgNil x0 ->
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CgNil"))),
- meta_acc_Loc_t _loc x0)
+ meta_loc _loc x0)
and meta_class_str_item _loc =
function
| Ast.CrAnt (x0, x1) -> Ast.PaAnt (x0, x1)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CrVvr"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_meta_bool _loc x2),
meta_ctyp _loc x3)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CrVir"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_meta_bool _loc x2),
meta_ctyp _loc x3)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CrVal"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_meta_bool _loc x2),
meta_expr _loc x3)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CrMth"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_meta_bool _loc x2),
meta_expr _loc x3),
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CrIni"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_expr _loc x1)
| Ast.CrInh (x0, x1, x2) ->
Ast.PaApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CrInh"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_class_expr _loc x1),
meta_string _loc x2)
| Ast.CrCtr (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CrCtr"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1),
meta_ctyp _loc x2)
| Ast.CrSem (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CrSem"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_class_str_item _loc x1),
meta_class_str_item _loc x2)
| Ast.CrNil x0 ->
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CrNil"))),
- meta_acc_Loc_t _loc x0)
+ meta_loc _loc x0)
and meta_class_type _loc =
function
| Ast.CtAnt (x0, x1) -> Ast.PaAnt (x0, x1)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CtEq"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_class_type _loc x1),
meta_class_type _loc x2)
| Ast.CtCol (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CtCol"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_class_type _loc x1),
meta_class_type _loc x2)
| Ast.CtAnd (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CtAnd"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_class_type _loc x1),
meta_class_type _loc x2)
| Ast.CtSig (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CtSig"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1),
meta_class_sig_item _loc x2)
| Ast.CtFun (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CtFun"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1),
meta_class_type _loc x2)
| Ast.CtCon (x0, x1, x2, x3) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CtCon"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_meta_bool _loc x1),
meta_ident _loc x2),
meta_ctyp _loc x3)
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "CtNil"))),
- meta_acc_Loc_t _loc x0)
+ meta_loc _loc x0)
and meta_ctyp _loc =
function
| Ast.TyAnt (x0, x1) -> Ast.PaAnt (x0, x1)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyOfAmp"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1),
meta_ctyp _loc x2)
| Ast.TyAmp (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyAmp"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1),
meta_ctyp _loc x2)
| Ast.TyVrnInfSup (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyVrnInfSup"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1),
meta_ctyp _loc x2)
| Ast.TyVrnInf (x0, x1) ->
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyVrnInf"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1)
| Ast.TyVrnSup (x0, x1) ->
Ast.PaApp (_loc,
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyVrnSup"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1)
| Ast.TyVrnEq (x0, x1) ->
Ast.PaApp (_loc,
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyVrnEq"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1)
| Ast.TySta (x0, x1, x2) ->
Ast.PaApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TySta"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1),
meta_ctyp _loc x2)
| Ast.TyTup (x0, x1) ->
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyTup"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1)
| Ast.TyMut (x0, x1) ->
Ast.PaApp (_loc,
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyMut"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1)
| Ast.TyPrv (x0, x1) ->
Ast.PaApp (_loc,
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyPrv"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1)
| Ast.TyOr (x0, x1, x2) ->
Ast.PaApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyOr"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1),
meta_ctyp _loc x2)
| Ast.TyAnd (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyAnd"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1),
meta_ctyp _loc x2)
| Ast.TyOf (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyOf"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1),
meta_ctyp _loc x2)
| Ast.TySum (x0, x1) ->
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TySum"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1)
| Ast.TyCom (x0, x1, x2) ->
Ast.PaApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyCom"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1),
meta_ctyp _loc x2)
| Ast.TySem (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TySem"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1),
meta_ctyp _loc x2)
| Ast.TyCol (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyCol"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1),
meta_ctyp _loc x2)
| Ast.TyRec (x0, x1) ->
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyRec"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1)
| Ast.TyVrn (x0, x1) ->
Ast.PaApp (_loc,
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyVrn"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1)
| Ast.TyQuM (x0, x1) ->
Ast.PaApp (_loc,
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyQuM"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1)
| Ast.TyQuP (x0, x1) ->
Ast.PaApp (_loc,
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyQuP"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1)
| Ast.TyQuo (x0, x1) ->
Ast.PaApp (_loc,
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyQuo"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1)
| Ast.TyPol (x0, x1, x2) ->
Ast.PaApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyPol"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1),
meta_ctyp _loc x2)
| Ast.TyOlb (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyOlb"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_ctyp _loc x2)
| Ast.TyObj (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyObj"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1),
meta_meta_bool _loc x2)
| Ast.TyDcl (x0, x1, x2, x3, x4) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyDcl"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_list meta_ctyp _loc x2),
meta_ctyp _loc x3),
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyMan"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1),
meta_ctyp _loc x2)
| Ast.TyId (x0, x1) ->
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyId"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ident _loc x1)
| Ast.TyLab (x0, x1, x2) ->
Ast.PaApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyLab"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_ctyp _loc x2)
| Ast.TyCls (x0, x1) ->
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyCls"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ident _loc x1)
| Ast.TyArr (x0, x1, x2) ->
Ast.PaApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyArr"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1),
meta_ctyp _loc x2)
| Ast.TyApp (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyApp"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1),
meta_ctyp _loc x2)
| Ast.TyAny x0 ->
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyAny"))),
- meta_acc_Loc_t _loc x0)
+ meta_loc _loc x0)
| Ast.TyAli (x0, x1, x2) ->
Ast.PaApp (_loc,
Ast.PaApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyAli"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1),
meta_ctyp _loc x2)
| Ast.TyNil x0 ->
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "TyNil"))),
- meta_acc_Loc_t _loc x0)
+ meta_loc _loc x0)
and meta_expr _loc =
function
| Ast.ExWhi (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExWhi"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_expr _loc x1),
meta_expr _loc x2)
| Ast.ExVrn (x0, x1) ->
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExVrn"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1)
| Ast.ExTyc (x0, x1, x2) ->
Ast.PaApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExTyc"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_expr _loc x1),
meta_ctyp _loc x2)
| Ast.ExCom (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExCom"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_expr _loc x1),
meta_expr _loc x2)
| Ast.ExTup (x0, x1) ->
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExTup"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_expr _loc x1)
| Ast.ExTry (x0, x1, x2) ->
Ast.PaApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExTry"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_expr _loc x1),
meta_match_case _loc x2)
| Ast.ExStr (x0, x1) ->
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExStr"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1)
| Ast.ExSte (x0, x1, x2) ->
Ast.PaApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExSte"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_expr _loc x1),
meta_expr _loc x2)
| Ast.ExSnd (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExSnd"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_expr _loc x1),
meta_string _loc x2)
| Ast.ExSeq (x0, x1) ->
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExSeq"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_expr _loc x1)
| Ast.ExRec (x0, x1, x2) ->
Ast.PaApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExRec"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_rec_binding _loc x1),
meta_expr _loc x2)
| Ast.ExOvr (x0, x1) ->
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExOvr"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_rec_binding _loc x1)
| Ast.ExOlb (x0, x1, x2) ->
Ast.PaApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExOlb"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_expr _loc x2)
| Ast.ExObj (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExObj"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_patt _loc x1),
meta_class_str_item _loc x2)
| Ast.ExNew (x0, x1) ->
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExNew"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ident _loc x1)
| Ast.ExMat (x0, x1, x2) ->
Ast.PaApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExMat"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_expr _loc x1),
meta_match_case _loc x2)
| Ast.ExLmd (x0, x1, x2, x3) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExLmd"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_module_expr _loc x2),
meta_expr _loc x3)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExLet"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_meta_bool _loc x1),
meta_binding _loc x2),
meta_expr _loc x3)
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExLaz"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_expr _loc x1)
| Ast.ExLab (x0, x1, x2) ->
Ast.PaApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExLab"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_expr _loc x2)
| Ast.ExNativeInt (x0, x1) ->
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExNativeInt"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1)
| Ast.ExInt64 (x0, x1) ->
Ast.PaApp (_loc,
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExInt64"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1)
| Ast.ExInt32 (x0, x1) ->
Ast.PaApp (_loc,
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExInt32"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1)
| Ast.ExInt (x0, x1) ->
Ast.PaApp (_loc,
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExInt"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1)
| Ast.ExIfe (x0, x1, x2, x3) ->
Ast.PaApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExIfe"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_expr _loc x1),
meta_expr _loc x2),
meta_expr _loc x3)
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExFun"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_match_case _loc x1)
| Ast.ExFor (x0, x1, x2, x3, x4, x5) ->
Ast.PaApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExFor"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_expr _loc x2),
meta_expr _loc x3),
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExFlo"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1)
| Ast.ExCoe (x0, x1, x2, x3) ->
Ast.PaApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExCoe"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_expr _loc x1),
meta_ctyp _loc x2),
meta_ctyp _loc x3)
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExChr"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1)
| Ast.ExAss (x0, x1, x2) ->
Ast.PaApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExAss"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_expr _loc x1),
meta_expr _loc x2)
| Ast.ExAsr (x0, x1) ->
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExAsr"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_expr _loc x1)
| Ast.ExAsf x0 ->
Ast.PaApp (_loc,
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExAsf"))),
- meta_acc_Loc_t _loc x0)
+ meta_loc _loc x0)
| Ast.ExSem (x0, x1, x2) ->
Ast.PaApp (_loc,
Ast.PaApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExSem"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_expr _loc x1),
meta_expr _loc x2)
| Ast.ExArr (x0, x1) ->
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExArr"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_expr _loc x1)
| Ast.ExAre (x0, x1, x2) ->
Ast.PaApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExAre"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_expr _loc x1),
meta_expr _loc x2)
| Ast.ExApp (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExApp"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_expr _loc x1),
meta_expr _loc x2)
| Ast.ExAnt (x0, x1) -> Ast.PaAnt (x0, x1)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExAcc"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_expr _loc x1),
meta_expr _loc x2)
| Ast.ExId (x0, x1) ->
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExId"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ident _loc x1)
| Ast.ExNil x0 ->
Ast.PaApp (_loc,
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExNil"))),
- meta_acc_Loc_t _loc x0)
+ meta_loc _loc x0)
and meta_ident _loc =
function
| Ast.IdAnt (x0, x1) -> Ast.PaAnt (x0, x1)
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "IdUid"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1)
| Ast.IdLid (x0, x1) ->
Ast.PaApp (_loc,
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "IdLid"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1)
| Ast.IdApp (x0, x1, x2) ->
Ast.PaApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "IdApp"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ident _loc x1),
meta_ident _loc x2)
| Ast.IdAcc (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "IdAcc"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ident _loc x1),
meta_ident _loc x2)
and meta_match_case _loc =
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "McArr"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_patt _loc x1),
meta_expr _loc x2),
meta_expr _loc x3)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "McOr"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_match_case _loc x1),
meta_match_case _loc x2)
| Ast.McNil x0 ->
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "McNil"))),
- meta_acc_Loc_t _loc x0)
+ meta_loc _loc x0)
and meta_meta_bool _loc =
function
| Ast.BAnt x0 -> Ast.PaAnt (_loc, x0)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "MbCol"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_module_type _loc x2)
| Ast.MbColEq (x0, x1, x2, x3) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "MbColEq"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_module_type _loc x2),
meta_module_expr _loc x3)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "MbAnd"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_module_binding _loc x1),
meta_module_binding _loc x2)
| Ast.MbNil x0 ->
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "MbNil"))),
- meta_acc_Loc_t _loc x0)
+ meta_loc _loc x0)
and meta_module_expr _loc =
function
| Ast.MeAnt (x0, x1) -> Ast.PaAnt (x0, x1)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "MeTyc"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_module_expr _loc x1),
meta_module_type _loc x2)
| Ast.MeStr (x0, x1) ->
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "MeStr"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_str_item _loc x1)
| Ast.MeFun (x0, x1, x2, x3) ->
Ast.PaApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "MeFun"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_module_type _loc x2),
meta_module_expr _loc x3)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "MeApp"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_module_expr _loc x1),
meta_module_expr _loc x2)
| Ast.MeId (x0, x1) ->
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "MeId"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ident _loc x1)
| Ast.MeNil x0 ->
Ast.PaApp (_loc,
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "MeNil"))),
- meta_acc_Loc_t _loc x0)
+ meta_loc _loc x0)
and meta_module_type _loc =
function
| Ast.MtAnt (x0, x1) -> Ast.PaAnt (x0, x1)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "MtWit"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_module_type _loc x1),
meta_with_constr _loc x2)
| Ast.MtSig (x0, x1) ->
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "MtSig"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_sig_item _loc x1)
| Ast.MtQuo (x0, x1) ->
Ast.PaApp (_loc,
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "MtQuo"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1)
| Ast.MtFun (x0, x1, x2, x3) ->
Ast.PaApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "MtFun"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_module_type _loc x2),
meta_module_type _loc x3)
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "MtId"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ident _loc x1)
| Ast.MtNil x0 ->
Ast.PaApp (_loc,
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "MtNil"))),
- meta_acc_Loc_t _loc x0)
+ meta_loc _loc x0)
and meta_patt _loc =
function
| Ast.PaVrn (x0, x1) ->
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaVrn"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1)
| Ast.PaTyp (x0, x1) ->
Ast.PaApp (_loc,
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaTyp"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ident _loc x1)
| Ast.PaTyc (x0, x1, x2) ->
Ast.PaApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaTyc"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_patt _loc x1),
meta_ctyp _loc x2)
| Ast.PaTup (x0, x1) ->
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaTup"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_patt _loc x1)
| Ast.PaStr (x0, x1) ->
Ast.PaApp (_loc,
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaStr"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1)
| Ast.PaEq (x0, x1, x2) ->
Ast.PaApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaEq"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ident _loc x1),
meta_patt _loc x2)
| Ast.PaRec (x0, x1) ->
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaRec"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_patt _loc x1)
| Ast.PaRng (x0, x1, x2) ->
Ast.PaApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaRng"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_patt _loc x1),
meta_patt _loc x2)
| Ast.PaOrp (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaOrp"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_patt _loc x1),
meta_patt _loc x2)
| Ast.PaOlbi (x0, x1, x2, x3) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaOlbi"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_patt _loc x2),
meta_expr _loc x3)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaOlb"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_patt _loc x2)
| Ast.PaLab (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaLab"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_patt _loc x2)
| Ast.PaFlo (x0, x1) ->
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaFlo"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1)
| Ast.PaNativeInt (x0, x1) ->
Ast.PaApp (_loc,
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaNativeInt"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1)
| Ast.PaInt64 (x0, x1) ->
Ast.PaApp (_loc,
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaInt64"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1)
| Ast.PaInt32 (x0, x1) ->
Ast.PaApp (_loc,
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaInt32"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1)
| Ast.PaInt (x0, x1) ->
Ast.PaApp (_loc,
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaInt"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1)
| Ast.PaChr (x0, x1) ->
Ast.PaApp (_loc,
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaChr"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1)
| Ast.PaSem (x0, x1, x2) ->
Ast.PaApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaSem"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_patt _loc x1),
meta_patt _loc x2)
| Ast.PaCom (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaCom"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_patt _loc x1),
meta_patt _loc x2)
| Ast.PaArr (x0, x1) ->
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaArr"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_patt _loc x1)
| Ast.PaApp (x0, x1, x2) ->
Ast.PaApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaApp"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_patt _loc x1),
meta_patt _loc x2)
| Ast.PaAny x0 ->
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaAny"))),
- meta_acc_Loc_t _loc x0)
+ meta_loc _loc x0)
| Ast.PaAnt (x0, x1) -> Ast.PaAnt (x0, x1)
| Ast.PaAli (x0, x1, x2) ->
Ast.PaApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaAli"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_patt _loc x1),
meta_patt _loc x2)
| Ast.PaId (x0, x1) ->
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaId"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ident _loc x1)
| Ast.PaNil x0 ->
Ast.PaApp (_loc,
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaNil"))),
- meta_acc_Loc_t _loc x0)
+ meta_loc _loc x0)
and meta_rec_binding _loc =
function
| Ast.RbAnt (x0, x1) -> Ast.PaAnt (x0, x1)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "RbEq"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ident _loc x1),
meta_expr _loc x2)
| Ast.RbSem (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "RbSem"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_rec_binding _loc x1),
meta_rec_binding _loc x2)
| Ast.RbNil x0 ->
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "RbNil"))),
- meta_acc_Loc_t _loc x0)
+ meta_loc _loc x0)
and meta_sig_item _loc =
function
| Ast.SgAnt (x0, x1) -> Ast.PaAnt (x0, x1)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "SgVal"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_ctyp _loc x2)
| Ast.SgTyp (x0, x1) ->
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "SgTyp"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1)
| Ast.SgOpn (x0, x1) ->
Ast.PaApp (_loc,
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "SgOpn"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ident _loc x1)
| Ast.SgMty (x0, x1, x2) ->
Ast.PaApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "SgMty"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_module_type _loc x2)
| Ast.SgRecMod (x0, x1) ->
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "SgRecMod"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_module_binding _loc x1)
| Ast.SgMod (x0, x1, x2) ->
Ast.PaApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "SgMod"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_module_type _loc x2)
| Ast.SgInc (x0, x1) ->
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "SgInc"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_module_type _loc x1)
| Ast.SgExt (x0, x1, x2, x3) ->
Ast.PaApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "SgExt"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_ctyp _loc x2),
meta_meta_list meta_string _loc x3)
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "SgExc"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1)
| Ast.SgDir (x0, x1, x2) ->
Ast.PaApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "SgDir"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_expr _loc x2)
| Ast.SgSem (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "SgSem"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_sig_item _loc x1),
meta_sig_item _loc x2)
| Ast.SgClt (x0, x1) ->
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "SgClt"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_class_type _loc x1)
| Ast.SgCls (x0, x1) ->
Ast.PaApp (_loc,
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "SgCls"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_class_type _loc x1)
| Ast.SgNil x0 ->
Ast.PaApp (_loc,
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "SgNil"))),
- meta_acc_Loc_t _loc x0)
+ meta_loc _loc x0)
and meta_str_item _loc =
function
| Ast.StAnt (x0, x1) -> Ast.PaAnt (x0, x1)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "StVal"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_meta_bool _loc x1),
meta_binding _loc x2)
| Ast.StTyp (x0, x1) ->
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "StTyp"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1)
| Ast.StOpn (x0, x1) ->
Ast.PaApp (_loc,
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "StOpn"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ident _loc x1)
| Ast.StMty (x0, x1, x2) ->
Ast.PaApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "StMty"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_module_type _loc x2)
| Ast.StRecMod (x0, x1) ->
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "StRecMod"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_module_binding _loc x1)
| Ast.StMod (x0, x1, x2) ->
Ast.PaApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "StMod"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_module_expr _loc x2)
| Ast.StInc (x0, x1) ->
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "StInc"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_module_expr _loc x1)
| Ast.StExt (x0, x1, x2, x3) ->
Ast.PaApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "StExt"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_ctyp _loc x2),
meta_meta_list meta_string _loc x3)
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "StExp"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_expr _loc x1)
| Ast.StExc (x0, x1, x2) ->
Ast.PaApp (_loc,
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "StExc"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1),
meta_meta_option meta_ident _loc x2)
| Ast.StDir (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "StDir"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_string _loc x1),
meta_expr _loc x2)
| Ast.StSem (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "StSem"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_str_item _loc x1),
meta_str_item _loc x2)
| Ast.StClt (x0, x1) ->
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "StClt"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_class_type _loc x1)
| Ast.StCls (x0, x1) ->
Ast.PaApp (_loc,
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "StCls"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_class_expr _loc x1)
| Ast.StNil x0 ->
Ast.PaApp (_loc,
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "StNil"))),
- meta_acc_Loc_t _loc x0)
+ meta_loc _loc x0)
and meta_with_constr _loc =
function
| Ast.WcAnt (x0, x1) -> Ast.PaAnt (x0, x1)
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "WcAnd"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_with_constr _loc x1),
meta_with_constr _loc x2)
| Ast.WcMod (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "WcMod"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ident _loc x1),
meta_ident _loc x2)
| Ast.WcTyp (x0, x1, x2) ->
Ast.IdAcc (_loc,
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "WcTyp"))),
- meta_acc_Loc_t _loc x0),
+ meta_loc _loc x0),
meta_ctyp _loc x1),
meta_ctyp _loc x2)
| Ast.WcNil x0 ->
Ast.PaId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "WcNil"))),
- meta_acc_Loc_t _loc x0)
+ meta_loc _loc x0)
+
end
+
end
+
end
+
class map =
- object (o)
- method string = fun x -> (x : string)
- method int = fun x -> (x : int)
- method float = fun x -> (x : float)
- method bool = fun x -> (x : bool)
- method list : 'a 'b. ('a -> 'b) -> 'a list -> 'b list = List.
- map
- method option : 'a 'b. ('a -> 'b) -> 'a option -> 'b option =
- fun f -> function | None -> None | Some x -> Some (f x)
- method array : 'a 'b. ('a -> 'b) -> 'a array -> 'b array =
- Array.map
- method ref : 'a 'b. ('a -> 'b) -> 'a ref -> 'b ref =
- fun f { contents = x } -> { contents = f x; }
- method _Loc_t : Loc.t -> Loc.t = fun x -> x
+ object ((o : 'self_type))
+ method string : string -> string = o#unknown
+
+ method list :
+ 'a 'a_out.
+ ('self_type -> 'a -> 'a_out) -> 'a list -> 'a_out list =
+ fun _f_a ->
+ function
+ | [] -> []
+ | _x :: _x_i1 ->
+ let _x = _f_a o _x in
+ let _x_i1 = o#list _f_a _x_i1 in _x :: _x_i1
+
method with_constr : with_constr -> with_constr =
function
- | WcNil _x0 -> WcNil (o#_Loc_t _x0)
- | WcTyp (_x0, _x1, _x2) ->
- WcTyp (o#_Loc_t _x0, o#ctyp _x1, o#ctyp _x2)
- | WcMod (_x0, _x1, _x2) ->
- WcMod (o#_Loc_t _x0, o#ident _x1, o#ident _x2)
- | WcAnd (_x0, _x1, _x2) ->
- WcAnd (o#_Loc_t _x0, o#with_constr _x1,
- o#with_constr _x2)
- | WcAnt (_x0, _x1) -> WcAnt (o#_Loc_t _x0, o#string _x1)
+ | WcNil _x -> let _x = o#loc _x in WcNil _x
+ | WcTyp (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in WcTyp (_x, _x_i1, _x_i2)
+ | WcMod (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ident _x_i1 in
+ let _x_i2 = o#ident _x_i2 in WcMod (_x, _x_i1, _x_i2)
+ | WcAnd (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#with_constr _x_i1 in
+ let _x_i2 = o#with_constr _x_i2
+ in WcAnd (_x, _x_i1, _x_i2)
+ | WcAnt (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in WcAnt (_x, _x_i1)
+
method str_item : str_item -> str_item =
function
- | StNil _x0 -> StNil (o#_Loc_t _x0)
- | StCls (_x0, _x1) ->
- StCls (o#_Loc_t _x0, o#class_expr _x1)
- | StClt (_x0, _x1) ->
- StClt (o#_Loc_t _x0, o#class_type _x1)
- | StSem (_x0, _x1, _x2) ->
- StSem (o#_Loc_t _x0, o#str_item _x1, o#str_item _x2)
- | StDir (_x0, _x1, _x2) ->
- StDir (o#_Loc_t _x0, o#string _x1, o#expr _x2)
- | StExc (_x0, _x1, _x2) ->
- StExc (o#_Loc_t _x0, o#ctyp _x1,
- o#meta_option o#ident _x2)
- | StExp (_x0, _x1) -> StExp (o#_Loc_t _x0, o#expr _x1)
- | StExt (_x0, _x1, _x2, _x3) ->
- StExt (o#_Loc_t _x0, o#string _x1, o#ctyp _x2,
- o#meta_list o#string _x3)
- | StInc (_x0, _x1) ->
- StInc (o#_Loc_t _x0, o#module_expr _x1)
- | StMod (_x0, _x1, _x2) ->
- StMod (o#_Loc_t _x0, o#string _x1, o#module_expr _x2)
- | StRecMod (_x0, _x1) ->
- StRecMod (o#_Loc_t _x0, o#module_binding _x1)
- | StMty (_x0, _x1, _x2) ->
- StMty (o#_Loc_t _x0, o#string _x1, o#module_type _x2)
- | StOpn (_x0, _x1) -> StOpn (o#_Loc_t _x0, o#ident _x1)
- | StTyp (_x0, _x1) -> StTyp (o#_Loc_t _x0, o#ctyp _x1)
- | StVal (_x0, _x1, _x2) ->
- StVal (o#_Loc_t _x0, o#meta_bool _x1, o#binding _x2)
- | StAnt (_x0, _x1) -> StAnt (o#_Loc_t _x0, o#string _x1)
+ | StNil _x -> let _x = o#loc _x in StNil _x
+ | StCls (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#class_expr _x_i1 in StCls (_x, _x_i1)
+ | StClt (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#class_type _x_i1 in StClt (_x, _x_i1)
+ | StSem (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#str_item _x_i1 in
+ let _x_i2 = o#str_item _x_i2
+ in StSem (_x, _x_i1, _x_i2)
+ | StDir (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#expr _x_i2 in StDir (_x, _x_i1, _x_i2)
+ | StExc (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in
+ let _x_i2 = o#meta_option (fun o -> o#ident) _x_i2
+ in StExc (_x, _x_i1, _x_i2)
+ | StExp (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#expr _x_i1 in StExp (_x, _x_i1)
+ | StExt (_x, _x_i1, _x_i2, _x_i3) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in
+ let _x_i3 = o#meta_list (fun o -> o#string) _x_i3
+ in StExt (_x, _x_i1, _x_i2, _x_i3)
+ | StInc (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#module_expr _x_i1 in StInc (_x, _x_i1)
+ | StMod (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#module_expr _x_i2
+ in StMod (_x, _x_i1, _x_i2)
+ | StRecMod (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#module_binding _x_i1
+ in StRecMod (_x, _x_i1)
+ | StMty (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#module_type _x_i2
+ in StMty (_x, _x_i1, _x_i2)
+ | StOpn (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ident _x_i1 in StOpn (_x, _x_i1)
+ | StTyp (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in StTyp (_x, _x_i1)
+ | StVal (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#meta_bool _x_i1 in
+ let _x_i2 = o#binding _x_i2 in StVal (_x, _x_i1, _x_i2)
+ | StAnt (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in StAnt (_x, _x_i1)
+
method sig_item : sig_item -> sig_item =
function
- | SgNil _x0 -> SgNil (o#_Loc_t _x0)
- | SgCls (_x0, _x1) ->
- SgCls (o#_Loc_t _x0, o#class_type _x1)
- | SgClt (_x0, _x1) ->
- SgClt (o#_Loc_t _x0, o#class_type _x1)
- | SgSem (_x0, _x1, _x2) ->
- SgSem (o#_Loc_t _x0, o#sig_item _x1, o#sig_item _x2)
- | SgDir (_x0, _x1, _x2) ->
- SgDir (o#_Loc_t _x0, o#string _x1, o#expr _x2)
- | SgExc (_x0, _x1) -> SgExc (o#_Loc_t _x0, o#ctyp _x1)
- | SgExt (_x0, _x1, _x2, _x3) ->
- SgExt (o#_Loc_t _x0, o#string _x1, o#ctyp _x2,
- o#meta_list o#string _x3)
- | SgInc (_x0, _x1) ->
- SgInc (o#_Loc_t _x0, o#module_type _x1)
- | SgMod (_x0, _x1, _x2) ->
- SgMod (o#_Loc_t _x0, o#string _x1, o#module_type _x2)
- | SgRecMod (_x0, _x1) ->
- SgRecMod (o#_Loc_t _x0, o#module_binding _x1)
- | SgMty (_x0, _x1, _x2) ->
- SgMty (o#_Loc_t _x0, o#string _x1, o#module_type _x2)
- | SgOpn (_x0, _x1) -> SgOpn (o#_Loc_t _x0, o#ident _x1)
- | SgTyp (_x0, _x1) -> SgTyp (o#_Loc_t _x0, o#ctyp _x1)
- | SgVal (_x0, _x1, _x2) ->
- SgVal (o#_Loc_t _x0, o#string _x1, o#ctyp _x2)
- | SgAnt (_x0, _x1) -> SgAnt (o#_Loc_t _x0, o#string _x1)
+ | SgNil _x -> let _x = o#loc _x in SgNil _x
+ | SgCls (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#class_type _x_i1 in SgCls (_x, _x_i1)
+ | SgClt (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#class_type _x_i1 in SgClt (_x, _x_i1)
+ | SgSem (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#sig_item _x_i1 in
+ let _x_i2 = o#sig_item _x_i2
+ in SgSem (_x, _x_i1, _x_i2)
+ | SgDir (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#expr _x_i2 in SgDir (_x, _x_i1, _x_i2)
+ | SgExc (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in SgExc (_x, _x_i1)
+ | SgExt (_x, _x_i1, _x_i2, _x_i3) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in
+ let _x_i3 = o#meta_list (fun o -> o#string) _x_i3
+ in SgExt (_x, _x_i1, _x_i2, _x_i3)
+ | SgInc (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#module_type _x_i1 in SgInc (_x, _x_i1)
+ | SgMod (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#module_type _x_i2
+ in SgMod (_x, _x_i1, _x_i2)
+ | SgRecMod (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#module_binding _x_i1
+ in SgRecMod (_x, _x_i1)
+ | SgMty (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#module_type _x_i2
+ in SgMty (_x, _x_i1, _x_i2)
+ | SgOpn (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ident _x_i1 in SgOpn (_x, _x_i1)
+ | SgTyp (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in SgTyp (_x, _x_i1)
+ | SgVal (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in SgVal (_x, _x_i1, _x_i2)
+ | SgAnt (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in SgAnt (_x, _x_i1)
+
method rec_binding : rec_binding -> rec_binding =
function
- | RbNil _x0 -> RbNil (o#_Loc_t _x0)
- | RbSem (_x0, _x1, _x2) ->
- RbSem (o#_Loc_t _x0, o#rec_binding _x1,
- o#rec_binding _x2)
- | RbEq (_x0, _x1, _x2) ->
- RbEq (o#_Loc_t _x0, o#ident _x1, o#expr _x2)
- | RbAnt (_x0, _x1) -> RbAnt (o#_Loc_t _x0, o#string _x1)
+ | RbNil _x -> let _x = o#loc _x in RbNil _x
+ | RbSem (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#rec_binding _x_i1 in
+ let _x_i2 = o#rec_binding _x_i2
+ in RbSem (_x, _x_i1, _x_i2)
+ | RbEq (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ident _x_i1 in
+ let _x_i2 = o#expr _x_i2 in RbEq (_x, _x_i1, _x_i2)
+ | RbAnt (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in RbAnt (_x, _x_i1)
+
method patt : patt -> patt =
function
- | PaNil _x0 -> PaNil (o#_Loc_t _x0)
- | PaId (_x0, _x1) -> PaId (o#_Loc_t _x0, o#ident _x1)
- | PaAli (_x0, _x1, _x2) ->
- PaAli (o#_Loc_t _x0, o#patt _x1, o#patt _x2)
- | PaAnt (_x0, _x1) -> PaAnt (o#_Loc_t _x0, o#string _x1)
- | PaAny _x0 -> PaAny (o#_Loc_t _x0)
- | PaApp (_x0, _x1, _x2) ->
- PaApp (o#_Loc_t _x0, o#patt _x1, o#patt _x2)
- | PaArr (_x0, _x1) -> PaArr (o#_Loc_t _x0, o#patt _x1)
- | PaCom (_x0, _x1, _x2) ->
- PaCom (o#_Loc_t _x0, o#patt _x1, o#patt _x2)
- | PaSem (_x0, _x1, _x2) ->
- PaSem (o#_Loc_t _x0, o#patt _x1, o#patt _x2)
- | PaChr (_x0, _x1) -> PaChr (o#_Loc_t _x0, o#string _x1)
- | PaInt (_x0, _x1) -> PaInt (o#_Loc_t _x0, o#string _x1)
- | PaInt32 (_x0, _x1) ->
- PaInt32 (o#_Loc_t _x0, o#string _x1)
- | PaInt64 (_x0, _x1) ->
- PaInt64 (o#_Loc_t _x0, o#string _x1)
- | PaNativeInt (_x0, _x1) ->
- PaNativeInt (o#_Loc_t _x0, o#string _x1)
- | PaFlo (_x0, _x1) -> PaFlo (o#_Loc_t _x0, o#string _x1)
- | PaLab (_x0, _x1, _x2) ->
- PaLab (o#_Loc_t _x0, o#string _x1, o#patt _x2)
- | PaOlb (_x0, _x1, _x2) ->
- PaOlb (o#_Loc_t _x0, o#string _x1, o#patt _x2)
- | PaOlbi (_x0, _x1, _x2, _x3) ->
- PaOlbi (o#_Loc_t _x0, o#string _x1, o#patt _x2,
- o#expr _x3)
- | PaOrp (_x0, _x1, _x2) ->
- PaOrp (o#_Loc_t _x0, o#patt _x1, o#patt _x2)
- | PaRng (_x0, _x1, _x2) ->
- PaRng (o#_Loc_t _x0, o#patt _x1, o#patt _x2)
- | PaRec (_x0, _x1) -> PaRec (o#_Loc_t _x0, o#patt _x1)
- | PaEq (_x0, _x1, _x2) ->
- PaEq (o#_Loc_t _x0, o#ident _x1, o#patt _x2)
- | PaStr (_x0, _x1) -> PaStr (o#_Loc_t _x0, o#string _x1)
- | PaTup (_x0, _x1) -> PaTup (o#_Loc_t _x0, o#patt _x1)
- | PaTyc (_x0, _x1, _x2) ->
- PaTyc (o#_Loc_t _x0, o#patt _x1, o#ctyp _x2)
- | PaTyp (_x0, _x1) -> PaTyp (o#_Loc_t _x0, o#ident _x1)
- | PaVrn (_x0, _x1) -> PaVrn (o#_Loc_t _x0, o#string _x1)
+ | PaNil _x -> let _x = o#loc _x in PaNil _x
+ | PaId (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ident _x_i1 in PaId (_x, _x_i1)
+ | PaAli (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#patt _x_i1 in
+ let _x_i2 = o#patt _x_i2 in PaAli (_x, _x_i1, _x_i2)
+ | PaAnt (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in PaAnt (_x, _x_i1)
+ | PaAny _x -> let _x = o#loc _x in PaAny _x
+ | PaApp (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#patt _x_i1 in
+ let _x_i2 = o#patt _x_i2 in PaApp (_x, _x_i1, _x_i2)
+ | PaArr (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#patt _x_i1 in PaArr (_x, _x_i1)
+ | PaCom (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#patt _x_i1 in
+ let _x_i2 = o#patt _x_i2 in PaCom (_x, _x_i1, _x_i2)
+ | PaSem (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#patt _x_i1 in
+ let _x_i2 = o#patt _x_i2 in PaSem (_x, _x_i1, _x_i2)
+ | PaChr (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in PaChr (_x, _x_i1)
+ | PaInt (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in PaInt (_x, _x_i1)
+ | PaInt32 (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in PaInt32 (_x, _x_i1)
+ | PaInt64 (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in PaInt64 (_x, _x_i1)
+ | PaNativeInt (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in PaNativeInt (_x, _x_i1)
+ | PaFlo (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in PaFlo (_x, _x_i1)
+ | PaLab (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#patt _x_i2 in PaLab (_x, _x_i1, _x_i2)
+ | PaOlb (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#patt _x_i2 in PaOlb (_x, _x_i1, _x_i2)
+ | PaOlbi (_x, _x_i1, _x_i2, _x_i3) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#patt _x_i2 in
+ let _x_i3 = o#expr _x_i3
+ in PaOlbi (_x, _x_i1, _x_i2, _x_i3)
+ | PaOrp (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#patt _x_i1 in
+ let _x_i2 = o#patt _x_i2 in PaOrp (_x, _x_i1, _x_i2)
+ | PaRng (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#patt _x_i1 in
+ let _x_i2 = o#patt _x_i2 in PaRng (_x, _x_i1, _x_i2)
+ | PaRec (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#patt _x_i1 in PaRec (_x, _x_i1)
+ | PaEq (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ident _x_i1 in
+ let _x_i2 = o#patt _x_i2 in PaEq (_x, _x_i1, _x_i2)
+ | PaStr (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in PaStr (_x, _x_i1)
+ | PaTup (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#patt _x_i1 in PaTup (_x, _x_i1)
+ | PaTyc (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#patt _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in PaTyc (_x, _x_i1, _x_i2)
+ | PaTyp (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ident _x_i1 in PaTyp (_x, _x_i1)
+ | PaVrn (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in PaVrn (_x, _x_i1)
+
method module_type : module_type -> module_type =
function
- | MtNil _x0 -> MtNil (o#_Loc_t _x0)
- | MtId (_x0, _x1) -> MtId (o#_Loc_t _x0, o#ident _x1)
- | MtFun (_x0, _x1, _x2, _x3) ->
- MtFun (o#_Loc_t _x0, o#string _x1, o#module_type _x2,
- o#module_type _x3)
- | MtQuo (_x0, _x1) -> MtQuo (o#_Loc_t _x0, o#string _x1)
- | MtSig (_x0, _x1) -> MtSig (o#_Loc_t _x0, o#sig_item _x1)
- | MtWit (_x0, _x1, _x2) ->
- MtWit (o#_Loc_t _x0, o#module_type _x1,
- o#with_constr _x2)
- | MtAnt (_x0, _x1) -> MtAnt (o#_Loc_t _x0, o#string _x1)
+ | MtNil _x -> let _x = o#loc _x in MtNil _x
+ | MtId (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ident _x_i1 in MtId (_x, _x_i1)
+ | MtFun (_x, _x_i1, _x_i2, _x_i3) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#module_type _x_i2 in
+ let _x_i3 = o#module_type _x_i3
+ in MtFun (_x, _x_i1, _x_i2, _x_i3)
+ | MtQuo (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in MtQuo (_x, _x_i1)
+ | MtSig (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#sig_item _x_i1 in MtSig (_x, _x_i1)
+ | MtWit (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#module_type _x_i1 in
+ let _x_i2 = o#with_constr _x_i2
+ in MtWit (_x, _x_i1, _x_i2)
+ | MtAnt (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in MtAnt (_x, _x_i1)
+
method module_expr : module_expr -> module_expr =
function
- | MeNil _x0 -> MeNil (o#_Loc_t _x0)
- | MeId (_x0, _x1) -> MeId (o#_Loc_t _x0, o#ident _x1)
- | MeApp (_x0, _x1, _x2) ->
- MeApp (o#_Loc_t _x0, o#module_expr _x1,
- o#module_expr _x2)
- | MeFun (_x0, _x1, _x2, _x3) ->
- MeFun (o#_Loc_t _x0, o#string _x1, o#module_type _x2,
- o#module_expr _x3)
- | MeStr (_x0, _x1) -> MeStr (o#_Loc_t _x0, o#str_item _x1)
- | MeTyc (_x0, _x1, _x2) ->
- MeTyc (o#_Loc_t _x0, o#module_expr _x1,
- o#module_type _x2)
- | MeAnt (_x0, _x1) -> MeAnt (o#_Loc_t _x0, o#string _x1)
+ | MeNil _x -> let _x = o#loc _x in MeNil _x
+ | MeId (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ident _x_i1 in MeId (_x, _x_i1)
+ | MeApp (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#module_expr _x_i1 in
+ let _x_i2 = o#module_expr _x_i2
+ in MeApp (_x, _x_i1, _x_i2)
+ | MeFun (_x, _x_i1, _x_i2, _x_i3) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#module_type _x_i2 in
+ let _x_i3 = o#module_expr _x_i3
+ in MeFun (_x, _x_i1, _x_i2, _x_i3)
+ | MeStr (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#str_item _x_i1 in MeStr (_x, _x_i1)
+ | MeTyc (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#module_expr _x_i1 in
+ let _x_i2 = o#module_type _x_i2
+ in MeTyc (_x, _x_i1, _x_i2)
+ | MeAnt (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in MeAnt (_x, _x_i1)
+
method module_binding : module_binding -> module_binding =
function
- | MbNil _x0 -> MbNil (o#_Loc_t _x0)
- | MbAnd (_x0, _x1, _x2) ->
- MbAnd (o#_Loc_t _x0, o#module_binding _x1,
- o#module_binding _x2)
- | MbColEq (_x0, _x1, _x2, _x3) ->
- MbColEq (o#_Loc_t _x0, o#string _x1, o#module_type _x2,
- o#module_expr _x3)
- | MbCol (_x0, _x1, _x2) ->
- MbCol (o#_Loc_t _x0, o#string _x1, o#module_type _x2)
- | MbAnt (_x0, _x1) -> MbAnt (o#_Loc_t _x0, o#string _x1)
+ | MbNil _x -> let _x = o#loc _x in MbNil _x
+ | MbAnd (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#module_binding _x_i1 in
+ let _x_i2 = o#module_binding _x_i2
+ in MbAnd (_x, _x_i1, _x_i2)
+ | MbColEq (_x, _x_i1, _x_i2, _x_i3) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#module_type _x_i2 in
+ let _x_i3 = o#module_expr _x_i3
+ in MbColEq (_x, _x_i1, _x_i2, _x_i3)
+ | MbCol (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#module_type _x_i2
+ in MbCol (_x, _x_i1, _x_i2)
+ | MbAnt (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in MbAnt (_x, _x_i1)
+
method meta_option :
- 'a 'b. ('a -> 'b) -> 'a meta_option -> 'b meta_option =
+ 'a 'a_out.
+ ('self_type -> 'a -> 'a_out) ->
+ 'a meta_option -> 'a_out meta_option =
fun _f_a ->
function
| ONone -> ONone
- | OSome _x0 -> OSome (_f_a _x0)
- | OAnt _x0 -> OAnt (o#string _x0)
+ | OSome _x -> let _x = _f_a o _x in OSome _x
+ | OAnt _x -> let _x = o#string _x in OAnt _x
+
method meta_list :
- 'a 'b. ('a -> 'b) -> 'a meta_list -> 'b meta_list =
+ 'a 'a_out.
+ ('self_type -> 'a -> 'a_out) ->
+ 'a meta_list -> 'a_out meta_list =
fun _f_a ->
function
| LNil -> LNil
- | LCons (_x0, _x1) ->
- LCons (_f_a _x0, o#meta_list _f_a _x1)
- | LAnt _x0 -> LAnt (o#string _x0)
+ | LCons (_x, _x_i1) ->
+ let _x = _f_a o _x in
+ let _x_i1 = o#meta_list _f_a _x_i1
+ in LCons (_x, _x_i1)
+ | LAnt _x -> let _x = o#string _x in LAnt _x
+
method meta_bool : meta_bool -> meta_bool =
function
| BTrue -> BTrue
| BFalse -> BFalse
- | BAnt _x0 -> BAnt (o#string _x0)
+ | BAnt _x -> let _x = o#string _x in BAnt _x
+
method match_case : match_case -> match_case =
function
- | McNil _x0 -> McNil (o#_Loc_t _x0)
- | McOr (_x0, _x1, _x2) ->
- McOr (o#_Loc_t _x0, o#match_case _x1, o#match_case _x2)
- | McArr (_x0, _x1, _x2, _x3) ->
- McArr (o#_Loc_t _x0, o#patt _x1, o#expr _x2,
- o#expr _x3)
- | McAnt (_x0, _x1) -> McAnt (o#_Loc_t _x0, o#string _x1)
+ | McNil _x -> let _x = o#loc _x in McNil _x
+ | McOr (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#match_case _x_i1 in
+ let _x_i2 = o#match_case _x_i2
+ in McOr (_x, _x_i1, _x_i2)
+ | McArr (_x, _x_i1, _x_i2, _x_i3) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#patt _x_i1 in
+ let _x_i2 = o#expr _x_i2 in
+ let _x_i3 = o#expr _x_i3
+ in McArr (_x, _x_i1, _x_i2, _x_i3)
+ | McAnt (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in McAnt (_x, _x_i1)
+
+ method loc : loc -> loc = o#unknown
+
method ident : ident -> ident =
function
- | IdAcc (_x0, _x1, _x2) ->
- IdAcc (o#_Loc_t _x0, o#ident _x1, o#ident _x2)
- | IdApp (_x0, _x1, _x2) ->
- IdApp (o#_Loc_t _x0, o#ident _x1, o#ident _x2)
- | IdLid (_x0, _x1) -> IdLid (o#_Loc_t _x0, o#string _x1)
- | IdUid (_x0, _x1) -> IdUid (o#_Loc_t _x0, o#string _x1)
- | IdAnt (_x0, _x1) -> IdAnt (o#_Loc_t _x0, o#string _x1)
+ | IdAcc (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ident _x_i1 in
+ let _x_i2 = o#ident _x_i2 in IdAcc (_x, _x_i1, _x_i2)
+ | IdApp (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ident _x_i1 in
+ let _x_i2 = o#ident _x_i2 in IdApp (_x, _x_i1, _x_i2)
+ | IdLid (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in IdLid (_x, _x_i1)
+ | IdUid (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in IdUid (_x, _x_i1)
+ | IdAnt (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in IdAnt (_x, _x_i1)
+
method expr : expr -> expr =
function
- | ExNil _x0 -> ExNil (o#_Loc_t _x0)
- | ExId (_x0, _x1) -> ExId (o#_Loc_t _x0, o#ident _x1)
- | ExAcc (_x0, _x1, _x2) ->
- ExAcc (o#_Loc_t _x0, o#expr _x1, o#expr _x2)
- | ExAnt (_x0, _x1) -> ExAnt (o#_Loc_t _x0, o#string _x1)
- | ExApp (_x0, _x1, _x2) ->
- ExApp (o#_Loc_t _x0, o#expr _x1, o#expr _x2)
- | ExAre (_x0, _x1, _x2) ->
- ExAre (o#_Loc_t _x0, o#expr _x1, o#expr _x2)
- | ExArr (_x0, _x1) -> ExArr (o#_Loc_t _x0, o#expr _x1)
- | ExSem (_x0, _x1, _x2) ->
- ExSem (o#_Loc_t _x0, o#expr _x1, o#expr _x2)
- | ExAsf _x0 -> ExAsf (o#_Loc_t _x0)
- | ExAsr (_x0, _x1) -> ExAsr (o#_Loc_t _x0, o#expr _x1)
- | ExAss (_x0, _x1, _x2) ->
- ExAss (o#_Loc_t _x0, o#expr _x1, o#expr _x2)
- | ExChr (_x0, _x1) -> ExChr (o#_Loc_t _x0, o#string _x1)
- | ExCoe (_x0, _x1, _x2, _x3) ->
- ExCoe (o#_Loc_t _x0, o#expr _x1, o#ctyp _x2,
- o#ctyp _x3)
- | ExFlo (_x0, _x1) -> ExFlo (o#_Loc_t _x0, o#string _x1)
- | ExFor (_x0, _x1, _x2, _x3, _x4, _x5) ->
- ExFor (o#_Loc_t _x0, o#string _x1, o#expr _x2,
- o#expr _x3, o#meta_bool _x4, o#expr _x5)
- | ExFun (_x0, _x1) ->
- ExFun (o#_Loc_t _x0, o#match_case _x1)
- | ExIfe (_x0, _x1, _x2, _x3) ->
- ExIfe (o#_Loc_t _x0, o#expr _x1, o#expr _x2,
- o#expr _x3)
- | ExInt (_x0, _x1) -> ExInt (o#_Loc_t _x0, o#string _x1)
- | ExInt32 (_x0, _x1) ->
- ExInt32 (o#_Loc_t _x0, o#string _x1)
- | ExInt64 (_x0, _x1) ->
- ExInt64 (o#_Loc_t _x0, o#string _x1)
- | ExNativeInt (_x0, _x1) ->
- ExNativeInt (o#_Loc_t _x0, o#string _x1)
- | ExLab (_x0, _x1, _x2) ->
- ExLab (o#_Loc_t _x0, o#string _x1, o#expr _x2)
- | ExLaz (_x0, _x1) -> ExLaz (o#_Loc_t _x0, o#expr _x1)
- | ExLet (_x0, _x1, _x2, _x3) ->
- ExLet (o#_Loc_t _x0, o#meta_bool _x1, o#binding _x2,
- o#expr _x3)
- | ExLmd (_x0, _x1, _x2, _x3) ->
- ExLmd (o#_Loc_t _x0, o#string _x1, o#module_expr _x2,
- o#expr _x3)
- | ExMat (_x0, _x1, _x2) ->
- ExMat (o#_Loc_t _x0, o#expr _x1, o#match_case _x2)
- | ExNew (_x0, _x1) -> ExNew (o#_Loc_t _x0, o#ident _x1)
- | ExObj (_x0, _x1, _x2) ->
- ExObj (o#_Loc_t _x0, o#patt _x1, o#class_str_item _x2)
- | ExOlb (_x0, _x1, _x2) ->
- ExOlb (o#_Loc_t _x0, o#string _x1, o#expr _x2)
- | ExOvr (_x0, _x1) ->
- ExOvr (o#_Loc_t _x0, o#rec_binding _x1)
- | ExRec (_x0, _x1, _x2) ->
- ExRec (o#_Loc_t _x0, o#rec_binding _x1, o#expr _x2)
- | ExSeq (_x0, _x1) -> ExSeq (o#_Loc_t _x0, o#expr _x1)
- | ExSnd (_x0, _x1, _x2) ->
- ExSnd (o#_Loc_t _x0, o#expr _x1, o#string _x2)
- | ExSte (_x0, _x1, _x2) ->
- ExSte (o#_Loc_t _x0, o#expr _x1, o#expr _x2)
- | ExStr (_x0, _x1) -> ExStr (o#_Loc_t _x0, o#string _x1)
- | ExTry (_x0, _x1, _x2) ->
- ExTry (o#_Loc_t _x0, o#expr _x1, o#match_case _x2)
- | ExTup (_x0, _x1) -> ExTup (o#_Loc_t _x0, o#expr _x1)
- | ExCom (_x0, _x1, _x2) ->
- ExCom (o#_Loc_t _x0, o#expr _x1, o#expr _x2)
- | ExTyc (_x0, _x1, _x2) ->
- ExTyc (o#_Loc_t _x0, o#expr _x1, o#ctyp _x2)
- | ExVrn (_x0, _x1) -> ExVrn (o#_Loc_t _x0, o#string _x1)
- | ExWhi (_x0, _x1, _x2) ->
- ExWhi (o#_Loc_t _x0, o#expr _x1, o#expr _x2)
+ | ExNil _x -> let _x = o#loc _x in ExNil _x
+ | ExId (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ident _x_i1 in ExId (_x, _x_i1)
+ | ExAcc (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#expr _x_i1 in
+ let _x_i2 = o#expr _x_i2 in ExAcc (_x, _x_i1, _x_i2)
+ | ExAnt (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in ExAnt (_x, _x_i1)
+ | ExApp (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#expr _x_i1 in
+ let _x_i2 = o#expr _x_i2 in ExApp (_x, _x_i1, _x_i2)
+ | ExAre (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#expr _x_i1 in
+ let _x_i2 = o#expr _x_i2 in ExAre (_x, _x_i1, _x_i2)
+ | ExArr (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#expr _x_i1 in ExArr (_x, _x_i1)
+ | ExSem (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#expr _x_i1 in
+ let _x_i2 = o#expr _x_i2 in ExSem (_x, _x_i1, _x_i2)
+ | ExAsf _x -> let _x = o#loc _x in ExAsf _x
+ | ExAsr (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#expr _x_i1 in ExAsr (_x, _x_i1)
+ | ExAss (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#expr _x_i1 in
+ let _x_i2 = o#expr _x_i2 in ExAss (_x, _x_i1, _x_i2)
+ | ExChr (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in ExChr (_x, _x_i1)
+ | ExCoe (_x, _x_i1, _x_i2, _x_i3) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#expr _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in
+ let _x_i3 = o#ctyp _x_i3
+ in ExCoe (_x, _x_i1, _x_i2, _x_i3)
+ | ExFlo (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in ExFlo (_x, _x_i1)
+ | ExFor (_x, _x_i1, _x_i2, _x_i3, _x_i4, _x_i5) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#expr _x_i2 in
+ let _x_i3 = o#expr _x_i3 in
+ let _x_i4 = o#meta_bool _x_i4 in
+ let _x_i5 = o#expr _x_i5
+ in ExFor (_x, _x_i1, _x_i2, _x_i3, _x_i4, _x_i5)
+ | ExFun (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#match_case _x_i1 in ExFun (_x, _x_i1)
+ | ExIfe (_x, _x_i1, _x_i2, _x_i3) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#expr _x_i1 in
+ let _x_i2 = o#expr _x_i2 in
+ let _x_i3 = o#expr _x_i3
+ in ExIfe (_x, _x_i1, _x_i2, _x_i3)
+ | ExInt (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in ExInt (_x, _x_i1)
+ | ExInt32 (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in ExInt32 (_x, _x_i1)
+ | ExInt64 (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in ExInt64 (_x, _x_i1)
+ | ExNativeInt (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in ExNativeInt (_x, _x_i1)
+ | ExLab (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#expr _x_i2 in ExLab (_x, _x_i1, _x_i2)
+ | ExLaz (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#expr _x_i1 in ExLaz (_x, _x_i1)
+ | ExLet (_x, _x_i1, _x_i2, _x_i3) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#meta_bool _x_i1 in
+ let _x_i2 = o#binding _x_i2 in
+ let _x_i3 = o#expr _x_i3
+ in ExLet (_x, _x_i1, _x_i2, _x_i3)
+ | ExLmd (_x, _x_i1, _x_i2, _x_i3) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#module_expr _x_i2 in
+ let _x_i3 = o#expr _x_i3
+ in ExLmd (_x, _x_i1, _x_i2, _x_i3)
+ | ExMat (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#expr _x_i1 in
+ let _x_i2 = o#match_case _x_i2
+ in ExMat (_x, _x_i1, _x_i2)
+ | ExNew (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ident _x_i1 in ExNew (_x, _x_i1)
+ | ExObj (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#patt _x_i1 in
+ let _x_i2 = o#class_str_item _x_i2
+ in ExObj (_x, _x_i1, _x_i2)
+ | ExOlb (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#expr _x_i2 in ExOlb (_x, _x_i1, _x_i2)
+ | ExOvr (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#rec_binding _x_i1 in ExOvr (_x, _x_i1)
+ | ExRec (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#rec_binding _x_i1 in
+ let _x_i2 = o#expr _x_i2 in ExRec (_x, _x_i1, _x_i2)
+ | ExSeq (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#expr _x_i1 in ExSeq (_x, _x_i1)
+ | ExSnd (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#expr _x_i1 in
+ let _x_i2 = o#string _x_i2 in ExSnd (_x, _x_i1, _x_i2)
+ | ExSte (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#expr _x_i1 in
+ let _x_i2 = o#expr _x_i2 in ExSte (_x, _x_i1, _x_i2)
+ | ExStr (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in ExStr (_x, _x_i1)
+ | ExTry (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#expr _x_i1 in
+ let _x_i2 = o#match_case _x_i2
+ in ExTry (_x, _x_i1, _x_i2)
+ | ExTup (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#expr _x_i1 in ExTup (_x, _x_i1)
+ | ExCom (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#expr _x_i1 in
+ let _x_i2 = o#expr _x_i2 in ExCom (_x, _x_i1, _x_i2)
+ | ExTyc (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#expr _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in ExTyc (_x, _x_i1, _x_i2)
+ | ExVrn (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in ExVrn (_x, _x_i1)
+ | ExWhi (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#expr _x_i1 in
+ let _x_i2 = o#expr _x_i2 in ExWhi (_x, _x_i1, _x_i2)
+
method ctyp : ctyp -> ctyp =
function
- | TyNil _x0 -> TyNil (o#_Loc_t _x0)
- | TyAli (_x0, _x1, _x2) ->
- TyAli (o#_Loc_t _x0, o#ctyp _x1, o#ctyp _x2)
- | TyAny _x0 -> TyAny (o#_Loc_t _x0)
- | TyApp (_x0, _x1, _x2) ->
- TyApp (o#_Loc_t _x0, o#ctyp _x1, o#ctyp _x2)
- | TyArr (_x0, _x1, _x2) ->
- TyArr (o#_Loc_t _x0, o#ctyp _x1, o#ctyp _x2)
- | TyCls (_x0, _x1) -> TyCls (o#_Loc_t _x0, o#ident _x1)
- | TyLab (_x0, _x1, _x2) ->
- TyLab (o#_Loc_t _x0, o#string _x1, o#ctyp _x2)
- | TyId (_x0, _x1) -> TyId (o#_Loc_t _x0, o#ident _x1)
- | TyMan (_x0, _x1, _x2) ->
- TyMan (o#_Loc_t _x0, o#ctyp _x1, o#ctyp _x2)
- | TyDcl (_x0, _x1, _x2, _x3, _x4) ->
- TyDcl (o#_Loc_t _x0, o#string _x1, o#list o#ctyp _x2,
- o#ctyp _x3,
+ | TyNil _x -> let _x = o#loc _x in TyNil _x
+ | TyAli (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in TyAli (_x, _x_i1, _x_i2)
+ | TyAny _x -> let _x = o#loc _x in TyAny _x
+ | TyApp (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in TyApp (_x, _x_i1, _x_i2)
+ | TyArr (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in TyArr (_x, _x_i1, _x_i2)
+ | TyCls (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ident _x_i1 in TyCls (_x, _x_i1)
+ | TyLab (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in TyLab (_x, _x_i1, _x_i2)
+ | TyId (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ident _x_i1 in TyId (_x, _x_i1)
+ | TyMan (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in TyMan (_x, _x_i1, _x_i2)
+ | TyDcl (_x, _x_i1, _x_i2, _x_i3, _x_i4) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#list (fun o -> o#ctyp) _x_i2 in
+ let _x_i3 = o#ctyp _x_i3 in
+ let _x_i4 =
o#list
- (fun (_x0, _x1) -> ((o#ctyp _x0), (o#ctyp _x1)))
- _x4)
- | TyObj (_x0, _x1, _x2) ->
- TyObj (o#_Loc_t _x0, o#ctyp _x1, o#meta_bool _x2)
- | TyOlb (_x0, _x1, _x2) ->
- TyOlb (o#_Loc_t _x0, o#string _x1, o#ctyp _x2)
- | TyPol (_x0, _x1, _x2) ->
- TyPol (o#_Loc_t _x0, o#ctyp _x1, o#ctyp _x2)
- | TyQuo (_x0, _x1) -> TyQuo (o#_Loc_t _x0, o#string _x1)
- | TyQuP (_x0, _x1) -> TyQuP (o#_Loc_t _x0, o#string _x1)
- | TyQuM (_x0, _x1) -> TyQuM (o#_Loc_t _x0, o#string _x1)
- | TyVrn (_x0, _x1) -> TyVrn (o#_Loc_t _x0, o#string _x1)
- | TyRec (_x0, _x1) -> TyRec (o#_Loc_t _x0, o#ctyp _x1)
- | TyCol (_x0, _x1, _x2) ->
- TyCol (o#_Loc_t _x0, o#ctyp _x1, o#ctyp _x2)
- | TySem (_x0, _x1, _x2) ->
- TySem (o#_Loc_t _x0, o#ctyp _x1, o#ctyp _x2)
- | TyCom (_x0, _x1, _x2) ->
- TyCom (o#_Loc_t _x0, o#ctyp _x1, o#ctyp _x2)
- | TySum (_x0, _x1) -> TySum (o#_Loc_t _x0, o#ctyp _x1)
- | TyOf (_x0, _x1, _x2) ->
- TyOf (o#_Loc_t _x0, o#ctyp _x1, o#ctyp _x2)
- | TyAnd (_x0, _x1, _x2) ->
- TyAnd (o#_Loc_t _x0, o#ctyp _x1, o#ctyp _x2)
- | TyOr (_x0, _x1, _x2) ->
- TyOr (o#_Loc_t _x0, o#ctyp _x1, o#ctyp _x2)
- | TyPrv (_x0, _x1) -> TyPrv (o#_Loc_t _x0, o#ctyp _x1)
- | TyMut (_x0, _x1) -> TyMut (o#_Loc_t _x0, o#ctyp _x1)
- | TyTup (_x0, _x1) -> TyTup (o#_Loc_t _x0, o#ctyp _x1)
- | TySta (_x0, _x1, _x2) ->
- TySta (o#_Loc_t _x0, o#ctyp _x1, o#ctyp _x2)
- | TyVrnEq (_x0, _x1) -> TyVrnEq (o#_Loc_t _x0, o#ctyp _x1)
- | TyVrnSup (_x0, _x1) ->
- TyVrnSup (o#_Loc_t _x0, o#ctyp _x1)
- | TyVrnInf (_x0, _x1) ->
- TyVrnInf (o#_Loc_t _x0, o#ctyp _x1)
- | TyVrnInfSup (_x0, _x1, _x2) ->
- TyVrnInfSup (o#_Loc_t _x0, o#ctyp _x1, o#ctyp _x2)
- | TyAmp (_x0, _x1, _x2) ->
- TyAmp (o#_Loc_t _x0, o#ctyp _x1, o#ctyp _x2)
- | TyOfAmp (_x0, _x1, _x2) ->
- TyOfAmp (o#_Loc_t _x0, o#ctyp _x1, o#ctyp _x2)
- | TyAnt (_x0, _x1) -> TyAnt (o#_Loc_t _x0, o#string _x1)
+ (fun o (_x, _x_i1) ->
+ let _x = o#ctyp _x in
+ let _x_i1 = o#ctyp _x_i1 in (_x, _x_i1))
+ _x_i4
+ in TyDcl (_x, _x_i1, _x_i2, _x_i3, _x_i4)
+ | TyObj (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in
+ let _x_i2 = o#meta_bool _x_i2
+ in TyObj (_x, _x_i1, _x_i2)
+ | TyOlb (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in TyOlb (_x, _x_i1, _x_i2)
+ | TyPol (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in TyPol (_x, _x_i1, _x_i2)
+ | TyQuo (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in TyQuo (_x, _x_i1)
+ | TyQuP (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in TyQuP (_x, _x_i1)
+ | TyQuM (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in TyQuM (_x, _x_i1)
+ | TyVrn (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in TyVrn (_x, _x_i1)
+ | TyRec (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in TyRec (_x, _x_i1)
+ | TyCol (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in TyCol (_x, _x_i1, _x_i2)
+ | TySem (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in TySem (_x, _x_i1, _x_i2)
+ | TyCom (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in TyCom (_x, _x_i1, _x_i2)
+ | TySum (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in TySum (_x, _x_i1)
+ | TyOf (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in TyOf (_x, _x_i1, _x_i2)
+ | TyAnd (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in TyAnd (_x, _x_i1, _x_i2)
+ | TyOr (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in TyOr (_x, _x_i1, _x_i2)
+ | TyPrv (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in TyPrv (_x, _x_i1)
+ | TyMut (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in TyMut (_x, _x_i1)
+ | TyTup (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in TyTup (_x, _x_i1)
+ | TySta (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in TySta (_x, _x_i1, _x_i2)
+ | TyVrnEq (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in TyVrnEq (_x, _x_i1)
+ | TyVrnSup (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in TyVrnSup (_x, _x_i1)
+ | TyVrnInf (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in TyVrnInf (_x, _x_i1)
+ | TyVrnInfSup (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in
+ let _x_i2 = o#ctyp _x_i2
+ in TyVrnInfSup (_x, _x_i1, _x_i2)
+ | TyAmp (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in TyAmp (_x, _x_i1, _x_i2)
+ | TyOfAmp (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in TyOfAmp (_x, _x_i1, _x_i2)
+ | TyAnt (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in TyAnt (_x, _x_i1)
+
method class_type : class_type -> class_type =
function
- | CtNil _x0 -> CtNil (o#_Loc_t _x0)
- | CtCon (_x0, _x1, _x2, _x3) ->
- CtCon (o#_Loc_t _x0, o#meta_bool _x1, o#ident _x2,
- o#ctyp _x3)
- | CtFun (_x0, _x1, _x2) ->
- CtFun (o#_Loc_t _x0, o#ctyp _x1, o#class_type _x2)
- | CtSig (_x0, _x1, _x2) ->
- CtSig (o#_Loc_t _x0, o#ctyp _x1, o#class_sig_item _x2)
- | CtAnd (_x0, _x1, _x2) ->
- CtAnd (o#_Loc_t _x0, o#class_type _x1,
- o#class_type _x2)
- | CtCol (_x0, _x1, _x2) ->
- CtCol (o#_Loc_t _x0, o#class_type _x1,
- o#class_type _x2)
- | CtEq (_x0, _x1, _x2) ->
- CtEq (o#_Loc_t _x0, o#class_type _x1, o#class_type _x2)
- | CtAnt (_x0, _x1) -> CtAnt (o#_Loc_t _x0, o#string _x1)
+ | CtNil _x -> let _x = o#loc _x in CtNil _x
+ | CtCon (_x, _x_i1, _x_i2, _x_i3) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#meta_bool _x_i1 in
+ let _x_i2 = o#ident _x_i2 in
+ let _x_i3 = o#ctyp _x_i3
+ in CtCon (_x, _x_i1, _x_i2, _x_i3)
+ | CtFun (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in
+ let _x_i2 = o#class_type _x_i2
+ in CtFun (_x, _x_i1, _x_i2)
+ | CtSig (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in
+ let _x_i2 = o#class_sig_item _x_i2
+ in CtSig (_x, _x_i1, _x_i2)
+ | CtAnd (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#class_type _x_i1 in
+ let _x_i2 = o#class_type _x_i2
+ in CtAnd (_x, _x_i1, _x_i2)
+ | CtCol (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#class_type _x_i1 in
+ let _x_i2 = o#class_type _x_i2
+ in CtCol (_x, _x_i1, _x_i2)
+ | CtEq (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#class_type _x_i1 in
+ let _x_i2 = o#class_type _x_i2
+ in CtEq (_x, _x_i1, _x_i2)
+ | CtAnt (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in CtAnt (_x, _x_i1)
+
method class_str_item : class_str_item -> class_str_item =
function
- | CrNil _x0 -> CrNil (o#_Loc_t _x0)
- | CrSem (_x0, _x1, _x2) ->
- CrSem (o#_Loc_t _x0, o#class_str_item _x1,
- o#class_str_item _x2)
- | CrCtr (_x0, _x1, _x2) ->
- CrCtr (o#_Loc_t _x0, o#ctyp _x1, o#ctyp _x2)
- | CrInh (_x0, _x1, _x2) ->
- CrInh (o#_Loc_t _x0, o#class_expr _x1, o#string _x2)
- | CrIni (_x0, _x1) -> CrIni (o#_Loc_t _x0, o#expr _x1)
- | CrMth (_x0, _x1, _x2, _x3, _x4) ->
- CrMth (o#_Loc_t _x0, o#string _x1, o#meta_bool _x2,
- o#expr _x3, o#ctyp _x4)
- | CrVal (_x0, _x1, _x2, _x3) ->
- CrVal (o#_Loc_t _x0, o#string _x1, o#meta_bool _x2,
- o#expr _x3)
- | CrVir (_x0, _x1, _x2, _x3) ->
- CrVir (o#_Loc_t _x0, o#string _x1, o#meta_bool _x2,
- o#ctyp _x3)
- | CrVvr (_x0, _x1, _x2, _x3) ->
- CrVvr (o#_Loc_t _x0, o#string _x1, o#meta_bool _x2,
- o#ctyp _x3)
- | CrAnt (_x0, _x1) -> CrAnt (o#_Loc_t _x0, o#string _x1)
+ | CrNil _x -> let _x = o#loc _x in CrNil _x
+ | CrSem (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#class_str_item _x_i1 in
+ let _x_i2 = o#class_str_item _x_i2
+ in CrSem (_x, _x_i1, _x_i2)
+ | CrCtr (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in CrCtr (_x, _x_i1, _x_i2)
+ | CrInh (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#class_expr _x_i1 in
+ let _x_i2 = o#string _x_i2 in CrInh (_x, _x_i1, _x_i2)
+ | CrIni (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#expr _x_i1 in CrIni (_x, _x_i1)
+ | CrMth (_x, _x_i1, _x_i2, _x_i3, _x_i4) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#meta_bool _x_i2 in
+ let _x_i3 = o#expr _x_i3 in
+ let _x_i4 = o#ctyp _x_i4
+ in CrMth (_x, _x_i1, _x_i2, _x_i3, _x_i4)
+ | CrVal (_x, _x_i1, _x_i2, _x_i3) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#meta_bool _x_i2 in
+ let _x_i3 = o#expr _x_i3
+ in CrVal (_x, _x_i1, _x_i2, _x_i3)
+ | CrVir (_x, _x_i1, _x_i2, _x_i3) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#meta_bool _x_i2 in
+ let _x_i3 = o#ctyp _x_i3
+ in CrVir (_x, _x_i1, _x_i2, _x_i3)
+ | CrVvr (_x, _x_i1, _x_i2, _x_i3) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#meta_bool _x_i2 in
+ let _x_i3 = o#ctyp _x_i3
+ in CrVvr (_x, _x_i1, _x_i2, _x_i3)
+ | CrAnt (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in CrAnt (_x, _x_i1)
+
method class_sig_item : class_sig_item -> class_sig_item =
function
- | CgNil _x0 -> CgNil (o#_Loc_t _x0)
- | CgCtr (_x0, _x1, _x2) ->
- CgCtr (o#_Loc_t _x0, o#ctyp _x1, o#ctyp _x2)
- | CgSem (_x0, _x1, _x2) ->
- CgSem (o#_Loc_t _x0, o#class_sig_item _x1,
- o#class_sig_item _x2)
- | CgInh (_x0, _x1) ->
- CgInh (o#_Loc_t _x0, o#class_type _x1)
- | CgMth (_x0, _x1, _x2, _x3) ->
- CgMth (o#_Loc_t _x0, o#string _x1, o#meta_bool _x2,
- o#ctyp _x3)
- | CgVal (_x0, _x1, _x2, _x3, _x4) ->
- CgVal (o#_Loc_t _x0, o#string _x1, o#meta_bool _x2,
- o#meta_bool _x3, o#ctyp _x4)
- | CgVir (_x0, _x1, _x2, _x3) ->
- CgVir (o#_Loc_t _x0, o#string _x1, o#meta_bool _x2,
- o#ctyp _x3)
- | CgAnt (_x0, _x1) -> CgAnt (o#_Loc_t _x0, o#string _x1)
+ | CgNil _x -> let _x = o#loc _x in CgNil _x
+ | CgCtr (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in CgCtr (_x, _x_i1, _x_i2)
+ | CgSem (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#class_sig_item _x_i1 in
+ let _x_i2 = o#class_sig_item _x_i2
+ in CgSem (_x, _x_i1, _x_i2)
+ | CgInh (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#class_type _x_i1 in CgInh (_x, _x_i1)
+ | CgMth (_x, _x_i1, _x_i2, _x_i3) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#meta_bool _x_i2 in
+ let _x_i3 = o#ctyp _x_i3
+ in CgMth (_x, _x_i1, _x_i2, _x_i3)
+ | CgVal (_x, _x_i1, _x_i2, _x_i3, _x_i4) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#meta_bool _x_i2 in
+ let _x_i3 = o#meta_bool _x_i3 in
+ let _x_i4 = o#ctyp _x_i4
+ in CgVal (_x, _x_i1, _x_i2, _x_i3, _x_i4)
+ | CgVir (_x, _x_i1, _x_i2, _x_i3) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#meta_bool _x_i2 in
+ let _x_i3 = o#ctyp _x_i3
+ in CgVir (_x, _x_i1, _x_i2, _x_i3)
+ | CgAnt (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in CgAnt (_x, _x_i1)
+
method class_expr : class_expr -> class_expr =
function
- | CeNil _x0 -> CeNil (o#_Loc_t _x0)
- | CeApp (_x0, _x1, _x2) ->
- CeApp (o#_Loc_t _x0, o#class_expr _x1, o#expr _x2)
- | CeCon (_x0, _x1, _x2, _x3) ->
- CeCon (o#_Loc_t _x0, o#meta_bool _x1, o#ident _x2,
- o#ctyp _x3)
- | CeFun (_x0, _x1, _x2) ->
- CeFun (o#_Loc_t _x0, o#patt _x1, o#class_expr _x2)
- | CeLet (_x0, _x1, _x2, _x3) ->
- CeLet (o#_Loc_t _x0, o#meta_bool _x1, o#binding _x2,
- o#class_expr _x3)
- | CeStr (_x0, _x1, _x2) ->
- CeStr (o#_Loc_t _x0, o#patt _x1, o#class_str_item _x2)
- | CeTyc (_x0, _x1, _x2) ->
- CeTyc (o#_Loc_t _x0, o#class_expr _x1,
- o#class_type _x2)
- | CeAnd (_x0, _x1, _x2) ->
- CeAnd (o#_Loc_t _x0, o#class_expr _x1,
- o#class_expr _x2)
- | CeEq (_x0, _x1, _x2) ->
- CeEq (o#_Loc_t _x0, o#class_expr _x1, o#class_expr _x2)
- | CeAnt (_x0, _x1) -> CeAnt (o#_Loc_t _x0, o#string _x1)
+ | CeNil _x -> let _x = o#loc _x in CeNil _x
+ | CeApp (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#class_expr _x_i1 in
+ let _x_i2 = o#expr _x_i2 in CeApp (_x, _x_i1, _x_i2)
+ | CeCon (_x, _x_i1, _x_i2, _x_i3) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#meta_bool _x_i1 in
+ let _x_i2 = o#ident _x_i2 in
+ let _x_i3 = o#ctyp _x_i3
+ in CeCon (_x, _x_i1, _x_i2, _x_i3)
+ | CeFun (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#patt _x_i1 in
+ let _x_i2 = o#class_expr _x_i2
+ in CeFun (_x, _x_i1, _x_i2)
+ | CeLet (_x, _x_i1, _x_i2, _x_i3) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#meta_bool _x_i1 in
+ let _x_i2 = o#binding _x_i2 in
+ let _x_i3 = o#class_expr _x_i3
+ in CeLet (_x, _x_i1, _x_i2, _x_i3)
+ | CeStr (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#patt _x_i1 in
+ let _x_i2 = o#class_str_item _x_i2
+ in CeStr (_x, _x_i1, _x_i2)
+ | CeTyc (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#class_expr _x_i1 in
+ let _x_i2 = o#class_type _x_i2
+ in CeTyc (_x, _x_i1, _x_i2)
+ | CeAnd (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#class_expr _x_i1 in
+ let _x_i2 = o#class_expr _x_i2
+ in CeAnd (_x, _x_i1, _x_i2)
+ | CeEq (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#class_expr _x_i1 in
+ let _x_i2 = o#class_expr _x_i2
+ in CeEq (_x, _x_i1, _x_i2)
+ | CeAnt (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in CeAnt (_x, _x_i1)
+
method binding : binding -> binding =
function
- | BiNil _x0 -> BiNil (o#_Loc_t _x0)
- | BiAnd (_x0, _x1, _x2) ->
- BiAnd (o#_Loc_t _x0, o#binding _x1, o#binding _x2)
- | BiEq (_x0, _x1, _x2) ->
- BiEq (o#_Loc_t _x0, o#patt _x1, o#expr _x2)
- | BiAnt (_x0, _x1) -> BiAnt (o#_Loc_t _x0, o#string _x1)
+ | BiNil _x -> let _x = o#loc _x in BiNil _x
+ | BiAnd (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#binding _x_i1 in
+ let _x_i2 = o#binding _x_i2 in BiAnd (_x, _x_i1, _x_i2)
+ | BiEq (_x, _x_i1, _x_i2) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#patt _x_i1 in
+ let _x_i2 = o#expr _x_i2 in BiEq (_x, _x_i1, _x_i2)
+ | BiAnt (_x, _x_i1) ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in BiAnt (_x, _x_i1)
+
+ method unknown : 'a. 'a -> 'a = fun x -> x
+
end
+
class fold =
object ((o : 'self_type))
- method string = fun (_ : string) -> (o : 'self_type)
- method int = fun (_ : int) -> (o : 'self_type)
- method float = fun (_ : float) -> (o : 'self_type)
- method bool = fun (_ : bool) -> (o : 'self_type)
+ method string : string -> 'self_type = o#unknown
+
method list :
'a.
('self_type -> 'a -> 'self_type) -> 'a list -> 'self_type =
- fun f -> List.fold_left f o
- method option :
- 'a.
- ('self_type -> 'a -> 'self_type) ->
- 'a option -> 'self_type =
- fun f -> function | None -> o | Some x -> f o x
- method array :
- 'a.
- ('self_type -> 'a -> 'self_type) ->
- 'a array -> 'self_type =
- fun f -> Array.fold_left f o
- method ref :
- 'a.
- ('self_type -> 'a -> 'self_type) -> 'a ref -> 'self_type =
- fun f { contents = x } -> f o x
- method _Loc_t : Loc.t -> 'self_type = fun _ -> o
+ fun _f_a ->
+ function
+ | [] -> o
+ | _x :: _x_i1 ->
+ let o = _f_a o _x in let o = o#list _f_a _x_i1 in o
+
method with_constr : with_constr -> 'self_type =
function
- | WcNil _x0 -> o#_Loc_t _x0
- | WcTyp (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#ctyp _x1)#ctyp _x2
- | WcMod (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#ident _x1)#ident _x2
- | WcAnd (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#with_constr _x1)#with_constr _x2
- | WcAnt (_x0, _x1) -> (o#_Loc_t _x0)#string _x1
+ | WcNil _x -> let o = o#loc _x in o
+ | WcTyp (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
+ | WcMod (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#ident _x_i1 in let o = o#ident _x_i2 in o
+ | WcAnd (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#with_constr _x_i1 in
+ let o = o#with_constr _x_i2 in o
+ | WcAnt (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#string _x_i1 in o
+
method str_item : str_item -> 'self_type =
function
- | StNil _x0 -> o#_Loc_t _x0
- | StCls (_x0, _x1) -> (o#_Loc_t _x0)#class_expr _x1
- | StClt (_x0, _x1) -> (o#_Loc_t _x0)#class_type _x1
- | StSem (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#str_item _x1)#str_item _x2
- | StDir (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#string _x1)#expr _x2
- | StExc (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#ctyp _x1)#meta_option
- (fun o -> o#ident) _x2
- | StExp (_x0, _x1) -> (o#_Loc_t _x0)#expr _x1
- | StExt (_x0, _x1, _x2, _x3) ->
- (((o#_Loc_t _x0)#string _x1)#ctyp _x2)#meta_list
- (fun o -> o#string) _x3
- | StInc (_x0, _x1) -> (o#_Loc_t _x0)#module_expr _x1
- | StMod (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#string _x1)#module_expr _x2
- | StRecMod (_x0, _x1) -> (o#_Loc_t _x0)#module_binding _x1
- | StMty (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#string _x1)#module_type _x2
- | StOpn (_x0, _x1) -> (o#_Loc_t _x0)#ident _x1
- | StTyp (_x0, _x1) -> (o#_Loc_t _x0)#ctyp _x1
- | StVal (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#meta_bool _x1)#binding _x2
- | StAnt (_x0, _x1) -> (o#_Loc_t _x0)#string _x1
+ | StNil _x -> let o = o#loc _x in o
+ | StCls (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#class_expr _x_i1 in o
+ | StClt (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#class_type _x_i1 in o
+ | StSem (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#str_item _x_i1 in
+ let o = o#str_item _x_i2 in o
+ | StDir (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in let o = o#expr _x_i2 in o
+ | StExc (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#ctyp _x_i1 in
+ let o = o#meta_option (fun o -> o#ident) _x_i2 in o
+ | StExp (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#expr _x_i1 in o
+ | StExt (_x, _x_i1, _x_i2, _x_i3) ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in
+ let o = o#ctyp _x_i2 in
+ let o = o#meta_list (fun o -> o#string) _x_i3 in o
+ | StInc (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#module_expr _x_i1 in o
+ | StMod (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in
+ let o = o#module_expr _x_i2 in o
+ | StRecMod (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#module_binding _x_i1 in o
+ | StMty (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in
+ let o = o#module_type _x_i2 in o
+ | StOpn (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#ident _x_i1 in o
+ | StTyp (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#ctyp _x_i1 in o
+ | StVal (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#meta_bool _x_i1 in
+ let o = o#binding _x_i2 in o
+ | StAnt (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#string _x_i1 in o
+
method sig_item : sig_item -> 'self_type =
function
- | SgNil _x0 -> o#_Loc_t _x0
- | SgCls (_x0, _x1) -> (o#_Loc_t _x0)#class_type _x1
- | SgClt (_x0, _x1) -> (o#_Loc_t _x0)#class_type _x1
- | SgSem (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#sig_item _x1)#sig_item _x2
- | SgDir (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#string _x1)#expr _x2
- | SgExc (_x0, _x1) -> (o#_Loc_t _x0)#ctyp _x1
- | SgExt (_x0, _x1, _x2, _x3) ->
- (((o#_Loc_t _x0)#string _x1)#ctyp _x2)#meta_list
- (fun o -> o#string) _x3
- | SgInc (_x0, _x1) -> (o#_Loc_t _x0)#module_type _x1
- | SgMod (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#string _x1)#module_type _x2
- | SgRecMod (_x0, _x1) -> (o#_Loc_t _x0)#module_binding _x1
- | SgMty (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#string _x1)#module_type _x2
- | SgOpn (_x0, _x1) -> (o#_Loc_t _x0)#ident _x1
- | SgTyp (_x0, _x1) -> (o#_Loc_t _x0)#ctyp _x1
- | SgVal (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#string _x1)#ctyp _x2
- | SgAnt (_x0, _x1) -> (o#_Loc_t _x0)#string _x1
+ | SgNil _x -> let o = o#loc _x in o
+ | SgCls (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#class_type _x_i1 in o
+ | SgClt (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#class_type _x_i1 in o
+ | SgSem (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#sig_item _x_i1 in
+ let o = o#sig_item _x_i2 in o
+ | SgDir (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in let o = o#expr _x_i2 in o
+ | SgExc (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#ctyp _x_i1 in o
+ | SgExt (_x, _x_i1, _x_i2, _x_i3) ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in
+ let o = o#ctyp _x_i2 in
+ let o = o#meta_list (fun o -> o#string) _x_i3 in o
+ | SgInc (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#module_type _x_i1 in o
+ | SgMod (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in
+ let o = o#module_type _x_i2 in o
+ | SgRecMod (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#module_binding _x_i1 in o
+ | SgMty (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in
+ let o = o#module_type _x_i2 in o
+ | SgOpn (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#ident _x_i1 in o
+ | SgTyp (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#ctyp _x_i1 in o
+ | SgVal (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in let o = o#ctyp _x_i2 in o
+ | SgAnt (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#string _x_i1 in o
+
method rec_binding : rec_binding -> 'self_type =
function
- | RbNil _x0 -> o#_Loc_t _x0
- | RbSem (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#rec_binding _x1)#rec_binding _x2
- | RbEq (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#ident _x1)#expr _x2
- | RbAnt (_x0, _x1) -> (o#_Loc_t _x0)#string _x1
+ | RbNil _x -> let o = o#loc _x in o
+ | RbSem (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#rec_binding _x_i1 in
+ let o = o#rec_binding _x_i2 in o
+ | RbEq (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#ident _x_i1 in let o = o#expr _x_i2 in o
+ | RbAnt (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#string _x_i1 in o
+
method patt : patt -> 'self_type =
function
- | PaNil _x0 -> o#_Loc_t _x0
- | PaId (_x0, _x1) -> (o#_Loc_t _x0)#ident _x1
- | PaAli (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#patt _x1)#patt _x2
- | PaAnt (_x0, _x1) -> (o#_Loc_t _x0)#string _x1
- | PaAny _x0 -> o#_Loc_t _x0
- | PaApp (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#patt _x1)#patt _x2
- | PaArr (_x0, _x1) -> (o#_Loc_t _x0)#patt _x1
- | PaCom (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#patt _x1)#patt _x2
- | PaSem (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#patt _x1)#patt _x2
- | PaChr (_x0, _x1) -> (o#_Loc_t _x0)#string _x1
- | PaInt (_x0, _x1) -> (o#_Loc_t _x0)#string _x1
- | PaInt32 (_x0, _x1) -> (o#_Loc_t _x0)#string _x1
- | PaInt64 (_x0, _x1) -> (o#_Loc_t _x0)#string _x1
- | PaNativeInt (_x0, _x1) -> (o#_Loc_t _x0)#string _x1
- | PaFlo (_x0, _x1) -> (o#_Loc_t _x0)#string _x1
- | PaLab (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#string _x1)#patt _x2
- | PaOlb (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#string _x1)#patt _x2
- | PaOlbi (_x0, _x1, _x2, _x3) ->
- (((o#_Loc_t _x0)#string _x1)#patt _x2)#expr _x3
- | PaOrp (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#patt _x1)#patt _x2
- | PaRng (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#patt _x1)#patt _x2
- | PaRec (_x0, _x1) -> (o#_Loc_t _x0)#patt _x1
- | PaEq (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#ident _x1)#patt _x2
- | PaStr (_x0, _x1) -> (o#_Loc_t _x0)#string _x1
- | PaTup (_x0, _x1) -> (o#_Loc_t _x0)#patt _x1
- | PaTyc (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#patt _x1)#ctyp _x2
- | PaTyp (_x0, _x1) -> (o#_Loc_t _x0)#ident _x1
- | PaVrn (_x0, _x1) -> (o#_Loc_t _x0)#string _x1
+ | PaNil _x -> let o = o#loc _x in o
+ | PaId (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#ident _x_i1 in o
+ | PaAli (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#patt _x_i1 in let o = o#patt _x_i2 in o
+ | PaAnt (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#string _x_i1 in o
+ | PaAny _x -> let o = o#loc _x in o
+ | PaApp (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#patt _x_i1 in let o = o#patt _x_i2 in o
+ | PaArr (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#patt _x_i1 in o
+ | PaCom (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#patt _x_i1 in let o = o#patt _x_i2 in o
+ | PaSem (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#patt _x_i1 in let o = o#patt _x_i2 in o
+ | PaChr (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#string _x_i1 in o
+ | PaInt (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#string _x_i1 in o
+ | PaInt32 (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#string _x_i1 in o
+ | PaInt64 (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#string _x_i1 in o
+ | PaNativeInt (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#string _x_i1 in o
+ | PaFlo (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#string _x_i1 in o
+ | PaLab (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in let o = o#patt _x_i2 in o
+ | PaOlb (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in let o = o#patt _x_i2 in o
+ | PaOlbi (_x, _x_i1, _x_i2, _x_i3) ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in
+ let o = o#patt _x_i2 in let o = o#expr _x_i3 in o
+ | PaOrp (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#patt _x_i1 in let o = o#patt _x_i2 in o
+ | PaRng (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#patt _x_i1 in let o = o#patt _x_i2 in o
+ | PaRec (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#patt _x_i1 in o
+ | PaEq (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#ident _x_i1 in let o = o#patt _x_i2 in o
+ | PaStr (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#string _x_i1 in o
+ | PaTup (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#patt _x_i1 in o
+ | PaTyc (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#patt _x_i1 in let o = o#ctyp _x_i2 in o
+ | PaTyp (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#ident _x_i1 in o
+ | PaVrn (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#string _x_i1 in o
+
method module_type : module_type -> 'self_type =
function
- | MtNil _x0 -> o#_Loc_t _x0
- | MtId (_x0, _x1) -> (o#_Loc_t _x0)#ident _x1
- | MtFun (_x0, _x1, _x2, _x3) ->
- (((o#_Loc_t _x0)#string _x1)#module_type _x2)#
- module_type _x3
- | MtQuo (_x0, _x1) -> (o#_Loc_t _x0)#string _x1
- | MtSig (_x0, _x1) -> (o#_Loc_t _x0)#sig_item _x1
- | MtWit (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#module_type _x1)#with_constr _x2
- | MtAnt (_x0, _x1) -> (o#_Loc_t _x0)#string _x1
+ | MtNil _x -> let o = o#loc _x in o
+ | MtId (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#ident _x_i1 in o
+ | MtFun (_x, _x_i1, _x_i2, _x_i3) ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in
+ let o = o#module_type _x_i2 in
+ let o = o#module_type _x_i3 in o
+ | MtQuo (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#string _x_i1 in o
+ | MtSig (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#sig_item _x_i1 in o
+ | MtWit (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#module_type _x_i1 in
+ let o = o#with_constr _x_i2 in o
+ | MtAnt (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#string _x_i1 in o
+
method module_expr : module_expr -> 'self_type =
function
- | MeNil _x0 -> o#_Loc_t _x0
- | MeId (_x0, _x1) -> (o#_Loc_t _x0)#ident _x1
- | MeApp (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#module_expr _x1)#module_expr _x2
- | MeFun (_x0, _x1, _x2, _x3) ->
- (((o#_Loc_t _x0)#string _x1)#module_type _x2)#
- module_expr _x3
- | MeStr (_x0, _x1) -> (o#_Loc_t _x0)#str_item _x1
- | MeTyc (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#module_expr _x1)#module_type _x2
- | MeAnt (_x0, _x1) -> (o#_Loc_t _x0)#string _x1
+ | MeNil _x -> let o = o#loc _x in o
+ | MeId (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#ident _x_i1 in o
+ | MeApp (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#module_expr _x_i1 in
+ let o = o#module_expr _x_i2 in o
+ | MeFun (_x, _x_i1, _x_i2, _x_i3) ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in
+ let o = o#module_type _x_i2 in
+ let o = o#module_expr _x_i3 in o
+ | MeStr (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#str_item _x_i1 in o
+ | MeTyc (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#module_expr _x_i1 in
+ let o = o#module_type _x_i2 in o
+ | MeAnt (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#string _x_i1 in o
+
method module_binding : module_binding -> 'self_type =
function
- | MbNil _x0 -> o#_Loc_t _x0
- | MbAnd (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#module_binding _x1)#module_binding _x2
- | MbColEq (_x0, _x1, _x2, _x3) ->
- (((o#_Loc_t _x0)#string _x1)#module_type _x2)#
- module_expr _x3
- | MbCol (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#string _x1)#module_type _x2
- | MbAnt (_x0, _x1) -> (o#_Loc_t _x0)#string _x1
+ | MbNil _x -> let o = o#loc _x in o
+ | MbAnd (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#module_binding _x_i1 in
+ let o = o#module_binding _x_i2 in o
+ | MbColEq (_x, _x_i1, _x_i2, _x_i3) ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in
+ let o = o#module_type _x_i2 in
+ let o = o#module_expr _x_i3 in o
+ | MbCol (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in
+ let o = o#module_type _x_i2 in o
+ | MbAnt (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#string _x_i1 in o
+
method meta_option :
'a.
('self_type -> 'a -> 'self_type) ->
fun _f_a ->
function
| ONone -> o
- | OSome _x0 -> _f_a o _x0
- | OAnt _x0 -> o#string _x0
+ | OSome _x -> let o = _f_a o _x in o
+ | OAnt _x -> let o = o#string _x in o
+
method meta_list :
'a.
('self_type -> 'a -> 'self_type) ->
fun _f_a ->
function
| LNil -> o
- | LCons (_x0, _x1) ->
- (_f_a o _x0)#meta_list (fun o -> _f_a o) _x1
- | LAnt _x0 -> o#string _x0
+ | LCons (_x, _x_i1) ->
+ let o = _f_a o _x in
+ let o = o#meta_list _f_a _x_i1 in o
+ | LAnt _x -> let o = o#string _x in o
+
method meta_bool : meta_bool -> 'self_type =
function
| BTrue -> o
| BFalse -> o
- | BAnt _x0 -> o#string _x0
+ | BAnt _x -> let o = o#string _x in o
+
method match_case : match_case -> 'self_type =
function
- | McNil _x0 -> o#_Loc_t _x0
- | McOr (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#match_case _x1)#match_case _x2
- | McArr (_x0, _x1, _x2, _x3) ->
- (((o#_Loc_t _x0)#patt _x1)#expr _x2)#expr _x3
- | McAnt (_x0, _x1) -> (o#_Loc_t _x0)#string _x1
+ | McNil _x -> let o = o#loc _x in o
+ | McOr (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#match_case _x_i1 in
+ let o = o#match_case _x_i2 in o
+ | McArr (_x, _x_i1, _x_i2, _x_i3) ->
+ let o = o#loc _x in
+ let o = o#patt _x_i1 in
+ let o = o#expr _x_i2 in let o = o#expr _x_i3 in o
+ | McAnt (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#string _x_i1 in o
+
+ method loc : loc -> 'self_type = o#unknown
+
method ident : ident -> 'self_type =
function
- | IdAcc (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#ident _x1)#ident _x2
- | IdApp (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#ident _x1)#ident _x2
- | IdLid (_x0, _x1) -> (o#_Loc_t _x0)#string _x1
- | IdUid (_x0, _x1) -> (o#_Loc_t _x0)#string _x1
- | IdAnt (_x0, _x1) -> (o#_Loc_t _x0)#string _x1
+ | IdAcc (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#ident _x_i1 in let o = o#ident _x_i2 in o
+ | IdApp (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#ident _x_i1 in let o = o#ident _x_i2 in o
+ | IdLid (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#string _x_i1 in o
+ | IdUid (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#string _x_i1 in o
+ | IdAnt (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#string _x_i1 in o
+
method expr : expr -> 'self_type =
function
- | ExNil _x0 -> o#_Loc_t _x0
- | ExId (_x0, _x1) -> (o#_Loc_t _x0)#ident _x1
- | ExAcc (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#expr _x1)#expr _x2
- | ExAnt (_x0, _x1) -> (o#_Loc_t _x0)#string _x1
- | ExApp (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#expr _x1)#expr _x2
- | ExAre (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#expr _x1)#expr _x2
- | ExArr (_x0, _x1) -> (o#_Loc_t _x0)#expr _x1
- | ExSem (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#expr _x1)#expr _x2
- | ExAsf _x0 -> o#_Loc_t _x0
- | ExAsr (_x0, _x1) -> (o#_Loc_t _x0)#expr _x1
- | ExAss (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#expr _x1)#expr _x2
- | ExChr (_x0, _x1) -> (o#_Loc_t _x0)#string _x1
- | ExCoe (_x0, _x1, _x2, _x3) ->
- (((o#_Loc_t _x0)#expr _x1)#ctyp _x2)#ctyp _x3
- | ExFlo (_x0, _x1) -> (o#_Loc_t _x0)#string _x1
- | ExFor (_x0, _x1, _x2, _x3, _x4, _x5) ->
- (((((o#_Loc_t _x0)#string _x1)#expr _x2)#expr _x3)#
- meta_bool _x4)#
- expr _x5
- | ExFun (_x0, _x1) -> (o#_Loc_t _x0)#match_case _x1
- | ExIfe (_x0, _x1, _x2, _x3) ->
- (((o#_Loc_t _x0)#expr _x1)#expr _x2)#expr _x3
- | ExInt (_x0, _x1) -> (o#_Loc_t _x0)#string _x1
- | ExInt32 (_x0, _x1) -> (o#_Loc_t _x0)#string _x1
- | ExInt64 (_x0, _x1) -> (o#_Loc_t _x0)#string _x1
- | ExNativeInt (_x0, _x1) -> (o#_Loc_t _x0)#string _x1
- | ExLab (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#string _x1)#expr _x2
- | ExLaz (_x0, _x1) -> (o#_Loc_t _x0)#expr _x1
- | ExLet (_x0, _x1, _x2, _x3) ->
- (((o#_Loc_t _x0)#meta_bool _x1)#binding _x2)#expr _x3
- | ExLmd (_x0, _x1, _x2, _x3) ->
- (((o#_Loc_t _x0)#string _x1)#module_expr _x2)#expr _x3
- | ExMat (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#expr _x1)#match_case _x2
- | ExNew (_x0, _x1) -> (o#_Loc_t _x0)#ident _x1
- | ExObj (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#patt _x1)#class_str_item _x2
- | ExOlb (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#string _x1)#expr _x2
- | ExOvr (_x0, _x1) -> (o#_Loc_t _x0)#rec_binding _x1
- | ExRec (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#rec_binding _x1)#expr _x2
- | ExSeq (_x0, _x1) -> (o#_Loc_t _x0)#expr _x1
- | ExSnd (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#expr _x1)#string _x2
- | ExSte (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#expr _x1)#expr _x2
- | ExStr (_x0, _x1) -> (o#_Loc_t _x0)#string _x1
- | ExTry (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#expr _x1)#match_case _x2
- | ExTup (_x0, _x1) -> (o#_Loc_t _x0)#expr _x1
- | ExCom (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#expr _x1)#expr _x2
- | ExTyc (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#expr _x1)#ctyp _x2
- | ExVrn (_x0, _x1) -> (o#_Loc_t _x0)#string _x1
- | ExWhi (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#expr _x1)#expr _x2
+ | ExNil _x -> let o = o#loc _x in o
+ | ExId (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#ident _x_i1 in o
+ | ExAcc (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#expr _x_i1 in let o = o#expr _x_i2 in o
+ | ExAnt (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#string _x_i1 in o
+ | ExApp (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#expr _x_i1 in let o = o#expr _x_i2 in o
+ | ExAre (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#expr _x_i1 in let o = o#expr _x_i2 in o
+ | ExArr (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#expr _x_i1 in o
+ | ExSem (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#expr _x_i1 in let o = o#expr _x_i2 in o
+ | ExAsf _x -> let o = o#loc _x in o
+ | ExAsr (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#expr _x_i1 in o
+ | ExAss (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#expr _x_i1 in let o = o#expr _x_i2 in o
+ | ExChr (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#string _x_i1 in o
+ | ExCoe (_x, _x_i1, _x_i2, _x_i3) ->
+ let o = o#loc _x in
+ let o = o#expr _x_i1 in
+ let o = o#ctyp _x_i2 in let o = o#ctyp _x_i3 in o
+ | ExFlo (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#string _x_i1 in o
+ | ExFor (_x, _x_i1, _x_i2, _x_i3, _x_i4, _x_i5) ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in
+ let o = o#expr _x_i2 in
+ let o = o#expr _x_i3 in
+ let o = o#meta_bool _x_i4 in let o = o#expr _x_i5 in o
+ | ExFun (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#match_case _x_i1 in o
+ | ExIfe (_x, _x_i1, _x_i2, _x_i3) ->
+ let o = o#loc _x in
+ let o = o#expr _x_i1 in
+ let o = o#expr _x_i2 in let o = o#expr _x_i3 in o
+ | ExInt (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#string _x_i1 in o
+ | ExInt32 (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#string _x_i1 in o
+ | ExInt64 (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#string _x_i1 in o
+ | ExNativeInt (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#string _x_i1 in o
+ | ExLab (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in let o = o#expr _x_i2 in o
+ | ExLaz (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#expr _x_i1 in o
+ | ExLet (_x, _x_i1, _x_i2, _x_i3) ->
+ let o = o#loc _x in
+ let o = o#meta_bool _x_i1 in
+ let o = o#binding _x_i2 in let o = o#expr _x_i3 in o
+ | ExLmd (_x, _x_i1, _x_i2, _x_i3) ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in
+ let o = o#module_expr _x_i2 in
+ let o = o#expr _x_i3 in o
+ | ExMat (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#expr _x_i1 in let o = o#match_case _x_i2 in o
+ | ExNew (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#ident _x_i1 in o
+ | ExObj (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#patt _x_i1 in
+ let o = o#class_str_item _x_i2 in o
+ | ExOlb (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in let o = o#expr _x_i2 in o
+ | ExOvr (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#rec_binding _x_i1 in o
+ | ExRec (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#rec_binding _x_i1 in
+ let o = o#expr _x_i2 in o
+ | ExSeq (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#expr _x_i1 in o
+ | ExSnd (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#expr _x_i1 in let o = o#string _x_i2 in o
+ | ExSte (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#expr _x_i1 in let o = o#expr _x_i2 in o
+ | ExStr (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#string _x_i1 in o
+ | ExTry (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#expr _x_i1 in let o = o#match_case _x_i2 in o
+ | ExTup (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#expr _x_i1 in o
+ | ExCom (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#expr _x_i1 in let o = o#expr _x_i2 in o
+ | ExTyc (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#expr _x_i1 in let o = o#ctyp _x_i2 in o
+ | ExVrn (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#string _x_i1 in o
+ | ExWhi (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#expr _x_i1 in let o = o#expr _x_i2 in o
+
method ctyp : ctyp -> 'self_type =
function
- | TyNil _x0 -> o#_Loc_t _x0
- | TyAli (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#ctyp _x1)#ctyp _x2
- | TyAny _x0 -> o#_Loc_t _x0
- | TyApp (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#ctyp _x1)#ctyp _x2
- | TyArr (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#ctyp _x1)#ctyp _x2
- | TyCls (_x0, _x1) -> (o#_Loc_t _x0)#ident _x1
- | TyLab (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#string _x1)#ctyp _x2
- | TyId (_x0, _x1) -> (o#_Loc_t _x0)#ident _x1
- | TyMan (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#ctyp _x1)#ctyp _x2
- | TyDcl (_x0, _x1, _x2, _x3, _x4) ->
- ((((o#_Loc_t _x0)#string _x1)#list (fun o -> o#ctyp)
- _x2)#
- ctyp _x3)#
- list (fun o (_x0, _x1) -> (o#ctyp _x0)#ctyp _x1) _x4
- | TyObj (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#ctyp _x1)#meta_bool _x2
- | TyOlb (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#string _x1)#ctyp _x2
- | TyPol (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#ctyp _x1)#ctyp _x2
- | TyQuo (_x0, _x1) -> (o#_Loc_t _x0)#string _x1
- | TyQuP (_x0, _x1) -> (o#_Loc_t _x0)#string _x1
- | TyQuM (_x0, _x1) -> (o#_Loc_t _x0)#string _x1
- | TyVrn (_x0, _x1) -> (o#_Loc_t _x0)#string _x1
- | TyRec (_x0, _x1) -> (o#_Loc_t _x0)#ctyp _x1
- | TyCol (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#ctyp _x1)#ctyp _x2
- | TySem (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#ctyp _x1)#ctyp _x2
- | TyCom (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#ctyp _x1)#ctyp _x2
- | TySum (_x0, _x1) -> (o#_Loc_t _x0)#ctyp _x1
- | TyOf (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#ctyp _x1)#ctyp _x2
- | TyAnd (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#ctyp _x1)#ctyp _x2
- | TyOr (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#ctyp _x1)#ctyp _x2
- | TyPrv (_x0, _x1) -> (o#_Loc_t _x0)#ctyp _x1
- | TyMut (_x0, _x1) -> (o#_Loc_t _x0)#ctyp _x1
- | TyTup (_x0, _x1) -> (o#_Loc_t _x0)#ctyp _x1
- | TySta (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#ctyp _x1)#ctyp _x2
- | TyVrnEq (_x0, _x1) -> (o#_Loc_t _x0)#ctyp _x1
- | TyVrnSup (_x0, _x1) -> (o#_Loc_t _x0)#ctyp _x1
- | TyVrnInf (_x0, _x1) -> (o#_Loc_t _x0)#ctyp _x1
- | TyVrnInfSup (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#ctyp _x1)#ctyp _x2
- | TyAmp (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#ctyp _x1)#ctyp _x2
- | TyOfAmp (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#ctyp _x1)#ctyp _x2
- | TyAnt (_x0, _x1) -> (o#_Loc_t _x0)#string _x1
+ | TyNil _x -> let o = o#loc _x in o
+ | TyAli (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
+ | TyAny _x -> let o = o#loc _x in o
+ | TyApp (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
+ | TyArr (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
+ | TyCls (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#ident _x_i1 in o
+ | TyLab (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in let o = o#ctyp _x_i2 in o
+ | TyId (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#ident _x_i1 in o
+ | TyMan (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
+ | TyDcl (_x, _x_i1, _x_i2, _x_i3, _x_i4) ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in
+ let o = o#list (fun o -> o#ctyp) _x_i2 in
+ let o = o#ctyp _x_i3 in
+ let o =
+ o#list
+ (fun o (_x, _x_i1) ->
+ let o = o#ctyp _x in let o = o#ctyp _x_i1 in o)
+ _x_i4
+ in o
+ | TyObj (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#ctyp _x_i1 in let o = o#meta_bool _x_i2 in o
+ | TyOlb (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in let o = o#ctyp _x_i2 in o
+ | TyPol (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
+ | TyQuo (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#string _x_i1 in o
+ | TyQuP (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#string _x_i1 in o
+ | TyQuM (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#string _x_i1 in o
+ | TyVrn (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#string _x_i1 in o
+ | TyRec (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#ctyp _x_i1 in o
+ | TyCol (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
+ | TySem (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
+ | TyCom (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
+ | TySum (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#ctyp _x_i1 in o
+ | TyOf (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
+ | TyAnd (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
+ | TyOr (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
+ | TyPrv (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#ctyp _x_i1 in o
+ | TyMut (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#ctyp _x_i1 in o
+ | TyTup (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#ctyp _x_i1 in o
+ | TySta (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
+ | TyVrnEq (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#ctyp _x_i1 in o
+ | TyVrnSup (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#ctyp _x_i1 in o
+ | TyVrnInf (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#ctyp _x_i1 in o
+ | TyVrnInfSup (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
+ | TyAmp (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
+ | TyOfAmp (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
+ | TyAnt (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#string _x_i1 in o
+
method class_type : class_type -> 'self_type =
function
- | CtNil _x0 -> o#_Loc_t _x0
- | CtCon (_x0, _x1, _x2, _x3) ->
- (((o#_Loc_t _x0)#meta_bool _x1)#ident _x2)#ctyp _x3
- | CtFun (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#ctyp _x1)#class_type _x2
- | CtSig (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#ctyp _x1)#class_sig_item _x2
- | CtAnd (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#class_type _x1)#class_type _x2
- | CtCol (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#class_type _x1)#class_type _x2
- | CtEq (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#class_type _x1)#class_type _x2
- | CtAnt (_x0, _x1) -> (o#_Loc_t _x0)#string _x1
+ | CtNil _x -> let o = o#loc _x in o
+ | CtCon (_x, _x_i1, _x_i2, _x_i3) ->
+ let o = o#loc _x in
+ let o = o#meta_bool _x_i1 in
+ let o = o#ident _x_i2 in let o = o#ctyp _x_i3 in o
+ | CtFun (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#ctyp _x_i1 in let o = o#class_type _x_i2 in o
+ | CtSig (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#ctyp _x_i1 in
+ let o = o#class_sig_item _x_i2 in o
+ | CtAnd (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#class_type _x_i1 in
+ let o = o#class_type _x_i2 in o
+ | CtCol (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#class_type _x_i1 in
+ let o = o#class_type _x_i2 in o
+ | CtEq (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#class_type _x_i1 in
+ let o = o#class_type _x_i2 in o
+ | CtAnt (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#string _x_i1 in o
+
method class_str_item : class_str_item -> 'self_type =
function
- | CrNil _x0 -> o#_Loc_t _x0
- | CrSem (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#class_str_item _x1)#class_str_item _x2
- | CrCtr (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#ctyp _x1)#ctyp _x2
- | CrInh (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#class_expr _x1)#string _x2
- | CrIni (_x0, _x1) -> (o#_Loc_t _x0)#expr _x1
- | CrMth (_x0, _x1, _x2, _x3, _x4) ->
- ((((o#_Loc_t _x0)#string _x1)#meta_bool _x2)#expr _x3)#
- ctyp _x4
- | CrVal (_x0, _x1, _x2, _x3) ->
- (((o#_Loc_t _x0)#string _x1)#meta_bool _x2)#expr _x3
- | CrVir (_x0, _x1, _x2, _x3) ->
- (((o#_Loc_t _x0)#string _x1)#meta_bool _x2)#ctyp _x3
- | CrVvr (_x0, _x1, _x2, _x3) ->
- (((o#_Loc_t _x0)#string _x1)#meta_bool _x2)#ctyp _x3
- | CrAnt (_x0, _x1) -> (o#_Loc_t _x0)#string _x1
+ | CrNil _x -> let o = o#loc _x in o
+ | CrSem (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#class_str_item _x_i1 in
+ let o = o#class_str_item _x_i2 in o
+ | CrCtr (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
+ | CrInh (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#class_expr _x_i1 in
+ let o = o#string _x_i2 in o
+ | CrIni (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#expr _x_i1 in o
+ | CrMth (_x, _x_i1, _x_i2, _x_i3, _x_i4) ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in
+ let o = o#meta_bool _x_i2 in
+ let o = o#expr _x_i3 in let o = o#ctyp _x_i4 in o
+ | CrVal (_x, _x_i1, _x_i2, _x_i3) ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in
+ let o = o#meta_bool _x_i2 in let o = o#expr _x_i3 in o
+ | CrVir (_x, _x_i1, _x_i2, _x_i3) ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in
+ let o = o#meta_bool _x_i2 in let o = o#ctyp _x_i3 in o
+ | CrVvr (_x, _x_i1, _x_i2, _x_i3) ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in
+ let o = o#meta_bool _x_i2 in let o = o#ctyp _x_i3 in o
+ | CrAnt (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#string _x_i1 in o
+
method class_sig_item : class_sig_item -> 'self_type =
function
- | CgNil _x0 -> o#_Loc_t _x0
- | CgCtr (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#ctyp _x1)#ctyp _x2
- | CgSem (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#class_sig_item _x1)#class_sig_item _x2
- | CgInh (_x0, _x1) -> (o#_Loc_t _x0)#class_type _x1
- | CgMth (_x0, _x1, _x2, _x3) ->
- (((o#_Loc_t _x0)#string _x1)#meta_bool _x2)#ctyp _x3
- | CgVal (_x0, _x1, _x2, _x3, _x4) ->
- ((((o#_Loc_t _x0)#string _x1)#meta_bool _x2)#meta_bool
- _x3)#
- ctyp _x4
- | CgVir (_x0, _x1, _x2, _x3) ->
- (((o#_Loc_t _x0)#string _x1)#meta_bool _x2)#ctyp _x3
- | CgAnt (_x0, _x1) -> (o#_Loc_t _x0)#string _x1
+ | CgNil _x -> let o = o#loc _x in o
+ | CgCtr (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
+ | CgSem (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#class_sig_item _x_i1 in
+ let o = o#class_sig_item _x_i2 in o
+ | CgInh (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#class_type _x_i1 in o
+ | CgMth (_x, _x_i1, _x_i2, _x_i3) ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in
+ let o = o#meta_bool _x_i2 in let o = o#ctyp _x_i3 in o
+ | CgVal (_x, _x_i1, _x_i2, _x_i3, _x_i4) ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in
+ let o = o#meta_bool _x_i2 in
+ let o = o#meta_bool _x_i3 in let o = o#ctyp _x_i4 in o
+ | CgVir (_x, _x_i1, _x_i2, _x_i3) ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in
+ let o = o#meta_bool _x_i2 in let o = o#ctyp _x_i3 in o
+ | CgAnt (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#string _x_i1 in o
+
method class_expr : class_expr -> 'self_type =
function
- | CeNil _x0 -> o#_Loc_t _x0
- | CeApp (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#class_expr _x1)#expr _x2
- | CeCon (_x0, _x1, _x2, _x3) ->
- (((o#_Loc_t _x0)#meta_bool _x1)#ident _x2)#ctyp _x3
- | CeFun (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#patt _x1)#class_expr _x2
- | CeLet (_x0, _x1, _x2, _x3) ->
- (((o#_Loc_t _x0)#meta_bool _x1)#binding _x2)#class_expr
- _x3
- | CeStr (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#patt _x1)#class_str_item _x2
- | CeTyc (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#class_expr _x1)#class_type _x2
- | CeAnd (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#class_expr _x1)#class_expr _x2
- | CeEq (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#class_expr _x1)#class_expr _x2
- | CeAnt (_x0, _x1) -> (o#_Loc_t _x0)#string _x1
+ | CeNil _x -> let o = o#loc _x in o
+ | CeApp (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#class_expr _x_i1 in let o = o#expr _x_i2 in o
+ | CeCon (_x, _x_i1, _x_i2, _x_i3) ->
+ let o = o#loc _x in
+ let o = o#meta_bool _x_i1 in
+ let o = o#ident _x_i2 in let o = o#ctyp _x_i3 in o
+ | CeFun (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#patt _x_i1 in let o = o#class_expr _x_i2 in o
+ | CeLet (_x, _x_i1, _x_i2, _x_i3) ->
+ let o = o#loc _x in
+ let o = o#meta_bool _x_i1 in
+ let o = o#binding _x_i2 in
+ let o = o#class_expr _x_i3 in o
+ | CeStr (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#patt _x_i1 in
+ let o = o#class_str_item _x_i2 in o
+ | CeTyc (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#class_expr _x_i1 in
+ let o = o#class_type _x_i2 in o
+ | CeAnd (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#class_expr _x_i1 in
+ let o = o#class_expr _x_i2 in o
+ | CeEq (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#class_expr _x_i1 in
+ let o = o#class_expr _x_i2 in o
+ | CeAnt (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#string _x_i1 in o
+
method binding : binding -> 'self_type =
function
- | BiNil _x0 -> o#_Loc_t _x0
- | BiAnd (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#binding _x1)#binding _x2
- | BiEq (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#patt _x1)#expr _x2
- | BiAnt (_x0, _x1) -> (o#_Loc_t _x0)#string _x1
+ | BiNil _x -> let o = o#loc _x in o
+ | BiAnd (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#binding _x_i1 in let o = o#binding _x_i2 in o
+ | BiEq (_x, _x_i1, _x_i2) ->
+ let o = o#loc _x in
+ let o = o#patt _x_i1 in let o = o#expr _x_i2 in o
+ | BiAnt (_x, _x_i1) ->
+ let o = o#loc _x in let o = o#string _x_i1 in o
+
+ method unknown : 'a. 'a -> 'self_type = fun _ -> o
+
end
+
let map_expr f =
object
inherit map as super
+
method expr = fun x -> f (super#expr x)
+
end
+
let map_patt f =
object
inherit map as super
+
method patt = fun x -> f (super#patt x)
+
end
+
let map_ctyp f =
object
inherit map as super
+
method ctyp = fun x -> f (super#ctyp x)
+
end
+
let map_str_item f =
object
inherit map as super
+
method str_item = fun x -> f (super#str_item x)
+
end
+
let map_sig_item f =
object
inherit map as super
+
method sig_item = fun x -> f (super#sig_item x)
+
end
+
let map_loc f =
object
inherit map as super
- method _Loc_t = fun x -> f (super#_Loc_t x)
+
+ method loc = fun x -> f (super#loc x)
+
end
+
end
+
end
+
module DynAst =
struct
module Make (Ast : Sig.Ast) : Sig.DynAst with module Ast = Ast =
struct
module Ast = Ast
+
type 'a tag =
- | Tag_ctyp | Tag_patt | Tag_expr | Tag_module_type
- | Tag_sig_item | Tag_with_constr | Tag_module_expr
- | Tag_str_item | Tag_class_type | Tag_class_sig_item
- | Tag_class_expr | Tag_class_str_item | Tag_match_case
- | Tag_ident | Tag_binding | Tag_rec_binding
+ | Tag_ctyp
+ | Tag_patt
+ | Tag_expr
+ | Tag_module_type
+ | Tag_sig_item
+ | Tag_with_constr
+ | Tag_module_expr
+ | Tag_str_item
+ | Tag_class_type
+ | Tag_class_sig_item
+ | Tag_class_expr
+ | Tag_class_str_item
+ | Tag_match_case
+ | Tag_ident
+ | Tag_binding
+ | Tag_rec_binding
| Tag_module_binding
+
let string_of_tag =
function
| Tag_ctyp -> "ctyp"
| Tag_binding -> "binding"
| Tag_rec_binding -> "rec_binding"
| Tag_module_binding -> "module_binding"
+
let ctyp_tag = Tag_ctyp
+
let patt_tag = Tag_patt
+
let expr_tag = Tag_expr
+
let module_type_tag = Tag_module_type
+
let sig_item_tag = Tag_sig_item
+
let with_constr_tag = Tag_with_constr
+
let module_expr_tag = Tag_module_expr
+
let str_item_tag = Tag_str_item
+
let class_type_tag = Tag_class_type
+
let class_sig_item_tag = Tag_class_sig_item
+
let class_expr_tag = Tag_class_expr
+
let class_str_item_tag = Tag_class_str_item
+
let match_case_tag = Tag_match_case
+
let ident_tag = Tag_ident
+
let binding_tag = Tag_binding
+
let rec_binding_tag = Tag_rec_binding
+
let module_binding_tag = Tag_module_binding
+
type dyn
+
external dyn_tag : 'a tag -> dyn tag = "%identity"
- module Pack (X : sig type 'a t end) =
+
+ module Pack (X : sig type 'a t
+ end) =
struct
type pack = ((dyn tag) * Obj.t)
+
exception Pack_error
+
let pack tag v = ((dyn_tag tag), (Obj.repr v))
+
let unpack (tag : 'a tag) (tag', obj) =
if (dyn_tag tag) = tag'
then (Obj.obj obj : 'a X.t)
else raise Pack_error
+
let print_tag f (tag, _) =
Format.pp_print_string f (string_of_tag tag)
+
end
+
end
+
end
+
module Quotation =
struct
- module Make (Ast : Sig.Ast) : Sig.Quotation with module Ast = Ast =
+ module Make (Ast : Sig.Camlp4Ast) :
+ Sig.Quotation with module Ast = Ast =
struct
module Ast = Ast
+
module DynAst = DynAst.Make(Ast)
+
module Loc = Ast.Loc
+
open Format
+
open Sig
+
type 'a expand_fun = Loc.t -> string option -> string -> 'a
- module Exp_key = DynAst.Pack(struct type 'a t = unit end)
+
+ module Exp_key = DynAst.Pack(struct type 'a t = unit
+ end)
+
module Exp_fun =
- DynAst.Pack(struct type 'a t = 'a expand_fun end)
+ DynAst.Pack(struct type 'a t = 'a expand_fun
+ end)
+
let expanders_table :
(((string * Exp_key.pack) * Exp_fun.pack) list) ref = ref []
+
let default = ref ""
+
let translate = ref (fun x -> x)
+
let expander_name name =
match !translate name with | "" -> !default | name -> name
+
let find name tag =
let key = ((expander_name name), (Exp_key.pack tag ()))
in Exp_fun.unpack tag (List.assoc key !expanders_table)
+
let add name tag f =
let elt = ((name, (Exp_key.pack tag ())), (Exp_fun.pack tag f))
in expanders_table := elt :: !expanders_table
+
let dump_file = ref None
+
module Error =
struct
type error =
- | Finding | Expanding | ParsingResult of Loc.t * string
+ | Finding
+ | Expanding
+ | ParsingResult of Loc.t * string
| Locating
+
type t = (string * string * error * exn)
+
exception E of t
+
let print ppf (name, position, ctx, exn) =
let name = if name = "" then !default else name in
let pp x =
match ctx with
| Finding ->
(pp "finding quotation";
- fprintf ppf "@ @[<hv2>Available quotations are:@\n";
- List.iter
- (fun ((s, t), _) ->
- fprintf ppf
- "@[<2>%s@ (in@ a@ position@ of %a)@]@ " s
- Exp_key.print_tag t)
- !expanders_table;
- fprintf ppf "@]")
+ if !expanders_table = []
+ then
+ fprintf ppf
+ "@ There is no quotation expander available."
+ else
+ (fprintf ppf
+ "@ @[<hv2>Available quotation expanders are:@\n";
+ List.iter
+ (fun ((s, t), _) ->
+ fprintf ppf
+ "@[<2>%s@ (in@ a@ position@ of %a)@]@ " s
+ Exp_key.print_tag t)
+ !expanders_table;
+ fprintf ppf "@]"))
| Expanding -> pp "expanding quotation"
| Locating -> pp "parsing"
| ParsingResult (loc, str) ->
fprintf ppf
"\n(consider setting variable Quotation.dump_file, or using the -QD option)")
in fprintf ppf "@\n%a@]@." ErrorHandler.print exn
+
let to_string x =
let b = Buffer.create 50 in
let () = bprintf b "%a" print x in Buffer.contents b
+
end
+
let _ = let module M = ErrorHandler.Register(Error) in ()
+
open Error
+
let expand_quotation loc expander pos_tag quot =
let loc_name_opt =
if quot.q_loc = "" then None else Some quot.q_loc
let exc1 =
Error.E (((quot.q_name), pos_tag, Expanding, exc))
in raise (Loc.Exc_located (loc, exc1))
+
let parse_quotation_result parse loc quot pos_tag str =
try parse loc str
with
let ctx = ParsingResult (iloc, quot.q_contents) in
let exc1 = Error.E (((quot.q_name), pos_tag, ctx, exc))
in raise (Loc.Exc_located (iloc, exc1))
+
let expand loc quotation tag =
let pos_tag = DynAst.string_of_tag tag in
let name = quotation.q_name in
Error.E ((name, pos_tag, Finding, exc)))) in
let loc = Loc.join (Loc.move `start quotation.q_shift loc)
in expand_quotation loc expander pos_tag quotation
+
end
+
end
+
module AstFilters =
struct
module Make (Ast : Sig.Camlp4Ast) :
Sig.AstFilters with module Ast = Ast =
struct
module Ast = Ast
+
type 'a filter = 'a -> 'a
+
let interf_filters = Queue.create ()
+
let fold_interf_filters f i = Queue.fold f i interf_filters
+
let implem_filters = Queue.create ()
+
let fold_implem_filters f i = Queue.fold f i implem_filters
+
let register_sig_item_filter f = Queue.add f interf_filters
+
let register_str_item_filter f = Queue.add f implem_filters
+
end
+
end
+
module Camlp4Ast2OCamlAst :
sig
module Make (Camlp4Ast : Sig.Camlp4Ast) :
sig
open Camlp4Ast
- val sig_item : sig_item -> Parsetree.signature
- val str_item : str_item -> Parsetree.structure
- val phrase : str_item -> Parsetree.toplevel_phrase
+
+ val sig_item : sig_item -> Camlp4_import.Parsetree.signature
+
+ val str_item : str_item -> Camlp4_import.Parsetree.structure
+
+ val phrase : str_item -> Camlp4_import.Parsetree.toplevel_phrase
+
end
+
end =
struct
module Make (Ast : Sig.Camlp4Ast) =
struct
open Format
- open Parsetree
- open Longident
- open Asttypes
+
+ open Camlp4_import.Parsetree
+
+ open Camlp4_import.Longident
+
+ open Camlp4_import.Asttypes
+
open Ast
+
let constructors_arity () = !Camlp4_config.constructors_arity
+
let error loc str = Loc.raise loc (Failure str)
+
let char_of_char_token loc s =
try Token.Eval.char s
with | (Failure _ as exn) -> Loc.raise loc exn
+
let string_of_string_token loc s =
try Token.Eval.string s
with | (Failure _ as exn) -> Loc.raise loc exn
+
let remove_underscores s =
let l = String.length s in
let rec remove src dst =
| '_' -> remove (src + 1) dst
| c -> (s.[dst] <- c; remove (src + 1) (dst + 1)))
in remove 0 0
+
let mkloc = Loc.to_ocaml_location
+
let mkghloc loc = Loc.to_ocaml_location (Loc.ghostify loc)
+
let mktyp loc d = { ptyp_desc = d; ptyp_loc = mkloc loc; }
+
let mkpat loc d = { ppat_desc = d; ppat_loc = mkloc loc; }
+
let mkghpat loc d = { ppat_desc = d; ppat_loc = mkghloc loc; }
+
let mkexp loc d = { pexp_desc = d; pexp_loc = mkloc loc; }
+
let mkmty loc d = { pmty_desc = d; pmty_loc = mkloc loc; }
+
let mksig loc d = { psig_desc = d; psig_loc = mkloc loc; }
+
let mkmod loc d = { pmod_desc = d; pmod_loc = mkloc loc; }
+
let mkstr loc d = { pstr_desc = d; pstr_loc = mkloc loc; }
+
let mkfield loc d = { pfield_desc = d; pfield_loc = mkloc loc; }
+
let mkcty loc d = { pcty_desc = d; pcty_loc = mkloc loc; }
+
let mkpcl loc d = { pcl_desc = d; pcl_loc = mkloc loc; }
+
let mkpolytype t =
match t.ptyp_desc with
| Ptyp_poly (_, _) -> t
| _ -> { (t) with ptyp_desc = Ptyp_poly ([], t); }
+
let mb2b =
function
| Ast.BTrue -> true
| Ast.BFalse -> false
| Ast.BAnt _ -> assert false
+
let mkvirtual m = if mb2b m then Virtual else Concrete
+
let lident s = Lident s
+
let ldot l s = Ldot (l, s)
+
let lapply l s = Lapply (l, s)
+
let conv_con =
let t = Hashtbl.create 73
in
[ ("True", "true"); ("False", "false"); (" True", "True");
(" False", "False") ];
fun s -> try Hashtbl.find t s with | Not_found -> s)
+
let conv_lab =
let t = Hashtbl.create 73
in
(List.iter (fun (s, s') -> Hashtbl.add t s s')
[ ("val", "contents") ];
fun s -> try Hashtbl.find t s with | Not_found -> s)
+
let array_function str name =
ldot (lident str)
(if !Camlp4_config.unsafe then "unsafe_" ^ name else name)
+
let mkrf =
function
| Ast.BTrue -> Recursive
| Ast.BFalse -> Nonrecursive
| Ast.BAnt _ -> assert false
+
let mkli s =
let rec loop f =
function
| i :: il -> loop (fun s -> ldot (f i) s) il
| [] -> f s
in loop (fun s -> lident s)
+
let rec ctyp_fa al =
function
| TyApp (_, f, a) -> ctyp_fa (a :: al) f
| f -> (f, al)
+
let ident_tag ?(conv_lid = fun x -> x) i =
let rec self i acc =
match i with
in (x, `lident)
| _ -> error (loc_of_ident i) "invalid long identifier"
in self i None
+
let ident ?conv_lid i = fst (ident_tag ?conv_lid i)
+
let long_lident msg i =
match ident_tag i with
| (i, `lident) -> i
| _ -> error (loc_of_ident i) msg
+
let long_type_ident = long_lident "invalid long identifier type"
+
let long_class_ident = long_lident "invalid class name"
+
let long_uident ?(conv_con = fun x -> x) i =
match ident_tag i with
| (Ldot (i, s), `uident) -> ldot i (conv_con s)
| (Lident s, `uident) -> lident (conv_con s)
| (i, `app) -> i
| _ -> error (loc_of_ident i) "uppercase identifier expected"
+
let rec ctyp_long_id_prefix t =
match t with
| Ast.TyId (_, i) -> ident i
let li1 = ctyp_long_id_prefix m1 in
let li2 = ctyp_long_id_prefix m2 in Lapply (li1, li2)
| t -> error (loc_of_ctyp t) "invalid module expression"
+
let ctyp_long_id t =
match t with
| Ast.TyId (_, i) -> (false, (long_type_ident i))
| TyApp (loc, _, _) -> error loc "invalid type name"
| TyCls (_, i) -> (true, (ident i))
| t -> error (loc_of_ctyp t) "invalid type"
+
let rec ty_var_list_of_ctyp =
function
| Ast.TyApp (_, t1, t2) ->
(ty_var_list_of_ctyp t1) @ (ty_var_list_of_ctyp t2)
| Ast.TyQuo (_, s) -> [ s ]
| _ -> assert false
+
let rec ctyp =
function
| TyId (loc, i) ->
in mktyp loc (Ptyp_arrow ("?" ^ lab, ctyp t1, ctyp t2))
| TyArr (loc, t1, t2) ->
mktyp loc (Ptyp_arrow ("", ctyp t1, ctyp t2))
- | Ast.TyObj (loc, (Ast.TyNil _), Ast.BFalse) ->
- mktyp loc (Ptyp_object [])
- | Ast.TyObj (loc, (Ast.TyNil _), Ast.BTrue) ->
- mktyp loc (Ptyp_object [ mkfield loc Pfield_var ])
| Ast.TyObj (loc, fl, Ast.BFalse) ->
mktyp loc (Ptyp_object (meth_list fl []))
| Ast.TyObj (loc, fl, Ast.BTrue) ->
assert false
and row_field =
function
+ | Ast.TyNil _ -> []
| Ast.TyVrn (_, i) -> [ Rtag (i, true, []) ]
| Ast.TyOfAmp (_, (Ast.TyVrn (_, i)), t) ->
[ Rtag (i, true, List.map ctyp (list_of_ctyp t [])) ]
| _ -> assert false
and meth_list fl acc =
match fl with
+ | Ast.TyNil _ -> acc
| Ast.TySem (_, t1, t2) -> meth_list t1 (meth_list t2 acc)
| Ast.TyCol (loc, (Ast.TyId (_, (Ast.IdLid (_, lab)))), t) ->
(mkfield loc (Pfield (lab, mkpolytype (ctyp t)))) :: acc
| _ -> assert false
+
let mktype loc tl cl tk tm =
let (params, variance) = List.split tl
in
ptype_loc = mkloc loc;
ptype_variance = variance;
}
+
let mkprivate' m = if m then Private else Public
+
let mkprivate m = mkprivate' (mb2b m)
+
let mktrecord =
function
| Ast.TyCol (loc, (Ast.TyId (_, (Ast.IdLid (_, s)))),
| Ast.TyCol (loc, (Ast.TyId (_, (Ast.IdLid (_, s)))), t) ->
(s, Immutable, (mkpolytype (ctyp t)), (mkloc loc))
| _ -> assert false
+
let mkvariant =
function
| Ast.TyId (loc, (Ast.IdUid (_, s))) ->
((conv_con s), (List.map ctyp (list_of_ctyp t [])),
(mkloc loc))
| _ -> assert false
+
let rec type_decl tl cl loc m pflag =
function
| Ast.TyMan (_, t1, t2) ->
| _ -> Some (ctyp t) in
let k = if pflag then Ptype_private else Ptype_abstract
in mktype loc tl cl k m)
+
let type_decl tl cl t =
type_decl tl cl (loc_of_ctyp t) None false t
+
let mkvalue_desc t p = { pval_type = ctyp t; pval_prim = p; }
+
let rec list_of_meta_list =
function
| Ast.LNil -> []
| Ast.LCons (x, xs) -> x :: (list_of_meta_list xs)
| Ast.LAnt _ -> assert false
+
let mkmutable m = if mb2b m then Mutable else Immutable
+
let paolab lab p =
match (lab, p) with
| ("",
-> i
| ("", p) -> error (loc_of_patt p) "bad ast in label"
| _ -> lab
+
let opt_private_ctyp =
function
| Ast.TyPrv (_, t) -> (Ptype_private, (ctyp t))
| t -> (Ptype_abstract, (ctyp t))
+
let rec type_parameters t acc =
match t with
| Ast.TyApp (_, t1, t2) ->
| Ast.TyQuM (_, s) -> (s, (false, true)) :: acc
| Ast.TyQuo (_, s) -> (s, (false, false)) :: acc
| _ -> assert false
+
let rec class_parameters t acc =
match t with
| Ast.TyCom (_, t1, t2) ->
| Ast.TyQuM (_, s) -> (s, (false, true)) :: acc
| Ast.TyQuo (_, s) -> (s, (false, false)) :: acc
| _ -> assert false
+
let rec type_parameters_and_type_name t acc =
match t with
| Ast.TyApp (_, t1, t2) ->
type_parameters_and_type_name t1 (type_parameters t2 acc)
| Ast.TyId (_, i) -> ((ident i), acc)
| _ -> assert false
+
let rec mkwithc wc acc =
match wc with
| WcNil _ -> acc
| Ast.WcAnd (_, wc1, wc2) -> mkwithc wc1 (mkwithc wc2 acc)
| Ast.WcAnt (loc, _) ->
error loc "bad with constraint (antiquotation)"
+
let rec patt_fa al =
function
| PaApp (_, f, a) -> patt_fa (a :: al) f
| f -> (f, al)
+
let rec deep_mkrangepat loc c1 c2 =
if c1 = c2
then mkghpat loc (Ppat_constant (Const_char c1))
mkghpat loc
(Ppat_or (mkghpat loc (Ppat_constant (Const_char c1)),
deep_mkrangepat loc (Char.chr ((Char.code c1) + 1)) c2))
+
let rec mkrangepat loc c1 c2 =
if c1 > c2
then mkrangepat loc c2 c1
mkpat loc
(Ppat_or (mkghpat loc (Ppat_constant (Const_char c1)),
deep_mkrangepat loc (Char.chr ((Char.code c1) + 1)) c2))
+
let rec patt =
function
| Ast.PaId (loc, (Ast.IdLid (_, s))) -> mkpat loc (Ppat_var s)
| Ast.PaEq (_, i, p) ->
((ident ~conv_lid: conv_lab i), (patt p))
| p -> error (loc_of_patt p) "invalid pattern"
+
let rec expr_fa al =
function
| ExApp (_, f, a) -> expr_fa (a :: al) f
| f -> (f, al)
+
let rec class_expr_fa al =
function
| CeApp (_, ce, a) -> class_expr_fa (a :: al) ce
| ce -> (ce, al)
+
let rec sep_expr_acc l =
function
| ExAcc (_, e1, e2) -> sep_expr_acc (sep_expr_acc l e2) e1
as i) -> Ast.ExId (_loc, i))
in sep_expr_acc l (normalize_acc i)
| e -> ((loc_of_expr e), [], e) :: l
+
let list_of_opt_ctyp ot acc =
match ot with | Ast.TyNil _ -> acc | t -> list_of_ctyp t acc
+
let rec expr =
function
| Ast.ExAcc (loc, x, (Ast.ExId (_, (Ast.IdLid (_, "val"))))) ->
| _ -> assert false
and mkideexp x acc =
match x with
+ | Ast.RbNil _ -> acc
| Ast.RbSem (_, x, y) -> mkideexp x (mkideexp y acc)
| Ast.RbEq (_, (Ast.IdLid (_, s)), e) -> (s, (expr e)) :: acc
| _ -> assert false
(Pcf_valvirt ((s, (mkmutable b), (ctyp t), (mkloc loc)))) ::
l
| CrAnt (_, _) -> assert false
+
let sig_item ast = sig_item ast []
+
let str_item ast = str_item ast []
+
let directive =
function
| Ast.ExNil _ -> Pdir_none
| Ast.ExId (_, (Ast.IdUid (_, "True"))) -> Pdir_bool true
| Ast.ExId (_, (Ast.IdUid (_, "False"))) -> Pdir_bool false
| e -> Pdir_ident (ident (ident_of_expr e))
+
let phrase =
function
| StDir (_, d, dp) -> Ptop_dir (d, directive dp)
| si -> Ptop_def (str_item si)
+
end
+
end
+
module CleanAst =
struct
module Make (Ast : Sig.Camlp4Ast) =
struct
class clean_ast =
- object (self)
- inherit Ast.map as super
+ object inherit Ast.map as super
+
method with_constr =
- function
- | Ast.WcAnd (_, (Ast.WcNil _), wc) |
- Ast.WcAnd (_, wc, (Ast.WcNil _)) -> self#with_constr wc
- | wc -> super#with_constr wc
+ fun wc ->
+ match super#with_constr wc with
+ | Ast.WcAnd (_, (Ast.WcNil _), wc) |
+ Ast.WcAnd (_, wc, (Ast.WcNil _)) -> wc
+ | wc -> wc
+
method expr =
- function
- | Ast.ExLet (_, _, (Ast.BiNil _), e) |
- Ast.ExRec (_, (Ast.RbNil _), e) |
- Ast.ExCom (_, (Ast.ExNil _), e) |
- Ast.ExCom (_, e, (Ast.ExNil _)) |
- Ast.ExSem (_, (Ast.ExNil _), e) |
- Ast.ExSem (_, e, (Ast.ExNil _)) -> self#expr e
- | e -> super#expr e
+ fun e ->
+ match super#expr e with
+ | Ast.ExLet (_, _, (Ast.BiNil _), e) |
+ Ast.ExRec (_, (Ast.RbNil _), e) |
+ Ast.ExCom (_, (Ast.ExNil _), e) |
+ Ast.ExCom (_, e, (Ast.ExNil _)) |
+ Ast.ExSem (_, (Ast.ExNil _), e) |
+ Ast.ExSem (_, e, (Ast.ExNil _)) -> e
+ | e -> e
+
method patt =
- function
- | Ast.PaAli (_, p, (Ast.PaNil _)) |
- Ast.PaOrp (_, (Ast.PaNil _), p) |
- Ast.PaOrp (_, p, (Ast.PaNil _)) |
- Ast.PaCom (_, (Ast.PaNil _), p) |
- Ast.PaCom (_, p, (Ast.PaNil _)) |
- Ast.PaSem (_, (Ast.PaNil _), p) |
- Ast.PaSem (_, p, (Ast.PaNil _)) -> self#patt p
- | p -> super#patt p
+ fun p ->
+ match super#patt p with
+ | Ast.PaAli (_, p, (Ast.PaNil _)) |
+ Ast.PaOrp (_, (Ast.PaNil _), p) |
+ Ast.PaOrp (_, p, (Ast.PaNil _)) |
+ Ast.PaCom (_, (Ast.PaNil _), p) |
+ Ast.PaCom (_, p, (Ast.PaNil _)) |
+ Ast.PaSem (_, (Ast.PaNil _), p) |
+ Ast.PaSem (_, p, (Ast.PaNil _)) -> p
+ | p -> p
+
method match_case =
- function
- | Ast.McOr (_, (Ast.McNil _), mc) |
- Ast.McOr (_, mc, (Ast.McNil _)) -> self#match_case mc
- | mc -> super#match_case mc
+ fun mc ->
+ match super#match_case mc with
+ | Ast.McOr (_, (Ast.McNil _), mc) |
+ Ast.McOr (_, mc, (Ast.McNil _)) -> mc
+ | mc -> mc
+
method binding =
- function
- | Ast.BiAnd (_, (Ast.BiNil _), bi) |
- Ast.BiAnd (_, bi, (Ast.BiNil _)) -> self#binding bi
- | bi -> super#binding bi
+ fun bi ->
+ match super#binding bi with
+ | Ast.BiAnd (_, (Ast.BiNil _), bi) |
+ Ast.BiAnd (_, bi, (Ast.BiNil _)) -> bi
+ | bi -> bi
+
method rec_binding =
- function
- | Ast.RbSem (_, (Ast.RbNil _), bi) |
- Ast.RbSem (_, bi, (Ast.RbNil _)) -> self#rec_binding bi
- | bi -> super#rec_binding bi
+ fun rb ->
+ match super#rec_binding rb with
+ | Ast.RbSem (_, (Ast.RbNil _), bi) |
+ Ast.RbSem (_, bi, (Ast.RbNil _)) -> bi
+ | bi -> bi
+
method module_binding =
- function
- | Ast.MbAnd (_, (Ast.MbNil _), mb) |
- Ast.MbAnd (_, mb, (Ast.MbNil _)) ->
- self#module_binding mb
- | mb -> super#module_binding mb
+ fun mb ->
+ match super#module_binding mb with
+ | Ast.MbAnd (_, (Ast.MbNil _), mb) |
+ Ast.MbAnd (_, mb, (Ast.MbNil _)) -> mb
+ | mb -> mb
+
method ctyp =
- function
- | Ast.TyPol (_, (Ast.TyNil _), t) |
- Ast.TyAli (_, (Ast.TyNil _), t) |
- Ast.TyAli (_, t, (Ast.TyNil _)) |
- Ast.TyArr (_, t, (Ast.TyNil _)) |
- Ast.TyArr (_, (Ast.TyNil _), t) |
- Ast.TyOr (_, (Ast.TyNil _), t) |
- Ast.TyOr (_, t, (Ast.TyNil _)) |
- Ast.TyOf (_, t, (Ast.TyNil _)) |
- Ast.TyAnd (_, (Ast.TyNil _), t) |
- Ast.TyAnd (_, t, (Ast.TyNil _)) |
- Ast.TySem (_, t, (Ast.TyNil _)) |
- Ast.TySem (_, (Ast.TyNil _), t) |
- Ast.TyCom (_, (Ast.TyNil _), t) |
- Ast.TyCom (_, t, (Ast.TyNil _)) |
- Ast.TyAmp (_, t, (Ast.TyNil _)) |
- Ast.TyAmp (_, (Ast.TyNil _), t) |
- Ast.TySta (_, (Ast.TyNil _), t) |
- Ast.TySta (_, t, (Ast.TyNil _)) -> self#ctyp t
- | t -> super#ctyp t
+ fun t ->
+ match super#ctyp t with
+ | Ast.TyPol (_, (Ast.TyNil _), t) |
+ Ast.TyAli (_, (Ast.TyNil _), t) |
+ Ast.TyAli (_, t, (Ast.TyNil _)) |
+ Ast.TyArr (_, t, (Ast.TyNil _)) |
+ Ast.TyArr (_, (Ast.TyNil _), t) |
+ Ast.TyOr (_, (Ast.TyNil _), t) |
+ Ast.TyOr (_, t, (Ast.TyNil _)) |
+ Ast.TyOf (_, t, (Ast.TyNil _)) |
+ Ast.TyAnd (_, (Ast.TyNil _), t) |
+ Ast.TyAnd (_, t, (Ast.TyNil _)) |
+ Ast.TySem (_, t, (Ast.TyNil _)) |
+ Ast.TySem (_, (Ast.TyNil _), t) |
+ Ast.TyCom (_, (Ast.TyNil _), t) |
+ Ast.TyCom (_, t, (Ast.TyNil _)) |
+ Ast.TyAmp (_, t, (Ast.TyNil _)) |
+ Ast.TyAmp (_, (Ast.TyNil _), t) |
+ Ast.TySta (_, (Ast.TyNil _), t) |
+ Ast.TySta (_, t, (Ast.TyNil _)) -> t
+ | t -> t
+
method sig_item =
- function
- | Ast.SgSem (_, (Ast.SgNil _), sg) |
- Ast.SgSem (_, sg, (Ast.SgNil _)) -> self#sig_item sg
- | sg -> super#sig_item sg
+ fun sg ->
+ match super#sig_item sg with
+ | Ast.SgSem (_, (Ast.SgNil _), sg) |
+ Ast.SgSem (_, sg, (Ast.SgNil _)) -> sg
+ | Ast.SgTyp (loc, (Ast.TyNil _)) -> Ast.SgNil loc
+ | sg -> sg
+
method str_item =
- function
- | Ast.StSem (_, (Ast.StNil _), st) |
- Ast.StSem (_, st, (Ast.StNil _)) -> self#str_item st
- | st -> super#str_item st
+ fun st ->
+ match super#str_item st with
+ | Ast.StSem (_, (Ast.StNil _), st) |
+ Ast.StSem (_, st, (Ast.StNil _)) -> st
+ | Ast.StTyp (loc, (Ast.TyNil _)) -> Ast.StNil loc
+ | Ast.StVal (loc, _, (Ast.BiNil _)) -> Ast.StNil loc
+ | st -> st
+
method module_type =
- function
- | Ast.MtWit (_, mt, (Ast.WcNil _)) -> self#module_type mt
- | mt -> super#module_type mt
+ fun mt ->
+ match super#module_type mt with
+ | Ast.MtWit (_, mt, (Ast.WcNil _)) -> mt
+ | mt -> mt
+
method class_expr =
- function
- | Ast.CeAnd (_, (Ast.CeNil _), ce) |
- Ast.CeAnd (_, ce, (Ast.CeNil _)) -> self#class_expr ce
- | ce -> super#class_expr ce
+ fun ce ->
+ match super#class_expr ce with
+ | Ast.CeAnd (_, (Ast.CeNil _), ce) |
+ Ast.CeAnd (_, ce, (Ast.CeNil _)) -> ce
+ | ce -> ce
+
method class_type =
- function
- | Ast.CtAnd (_, (Ast.CtNil _), ct) |
- Ast.CtAnd (_, ct, (Ast.CtNil _)) -> self#class_type ct
- | ct -> super#class_type ct
+ fun ct ->
+ match super#class_type ct with
+ | Ast.CtAnd (_, (Ast.CtNil _), ct) |
+ Ast.CtAnd (_, ct, (Ast.CtNil _)) -> ct
+ | ct -> ct
+
method class_sig_item =
- function
- | Ast.CgSem (_, (Ast.CgNil _), csg) |
- Ast.CgSem (_, csg, (Ast.CgNil _)) ->
- self#class_sig_item csg
- | csg -> super#class_sig_item csg
+ fun csg ->
+ match super#class_sig_item csg with
+ | Ast.CgSem (_, (Ast.CgNil _), csg) |
+ Ast.CgSem (_, csg, (Ast.CgNil _)) -> csg
+ | csg -> csg
+
method class_str_item =
- function
- | Ast.CrSem (_, (Ast.CrNil _), cst) |
- Ast.CrSem (_, cst, (Ast.CrNil _)) ->
- self#class_str_item cst
- | cst -> super#class_str_item cst
+ fun cst ->
+ match super#class_str_item cst with
+ | Ast.CrSem (_, (Ast.CrNil _), cst) |
+ Ast.CrSem (_, cst, (Ast.CrNil _)) -> cst
+ | cst -> cst
+
end
+
end
+
end
+
module CommentFilter :
sig
module Make (Token : Sig.Camlp4Token) :
sig
open Token
+
type t
+
val mk : unit -> t
+
val define : Token.Filter.t -> t -> unit
+
val filter :
t -> (Token.t * Loc.t) Stream.t -> (Token.t * Loc.t) Stream.t
+
val take_list : t -> (string * Loc.t) list
+
val take_stream : t -> (string * Loc.t) Stream.t
+
end
+
end =
struct
module Make (Token : Sig.Camlp4Token) =
struct
open Token
+
type t =
(((string * Loc.t) Stream.t) * ((string * Loc.t) Queue.t))
+
let mk () =
let q = Queue.create () in
let f _ = try Some (Queue.take q) with | Queue.Empty -> None
in ((Stream.from f), q)
+
let filter (_, q) =
let rec self (__strm : _ Stream.t) =
match Stream.peek __strm with
in Stream.icons x (Stream.slazy (fun _ -> self xs)))
| _ -> Stream.sempty
in self
+
let take_list (_, q) =
let rec self accu =
if Queue.is_empty q
then accu
else self ((Queue.take q) :: accu)
in self []
+
let take_stream = fst
+
let define token_fiter comments_strm =
Token.Filter.define_filter token_fiter
(fun previous strm -> previous (filter comments_strm strm))
+
end
+
end
- module DynLoader : sig include Sig.DynLoader end =
+
+ module DynLoader : sig include Sig.DynLoader
+ end =
struct
type t = string Queue.t
+
exception Error of string * string
+
let include_dir x y = Queue.add y x
+
let fold_load_path x f acc = Queue.fold (fun x y -> f y x) acc x
+
let mk ?(ocaml_stdlib = true) ?(camlp4_stdlib = true) () =
let q = Queue.create ()
in
else ();
include_dir q ".";
q)
+
let find_in_path x name =
if not (Filename.is_implicit name)
then if Sys.file_exists name then name else raise Not_found
| x -> x)
None
in match res with | None -> raise Not_found | Some x -> x)
+
let load =
let _initialized = ref false
in
fun _path file ->
raise
(Error (file, "native-code program cannot do a dynamic load"))
+
end
- module EmptyError : sig include Sig.Error end =
+
+ module EmptyError : sig include Sig.Error
+ end =
struct
type t = unit
+
exception E of t
+
let print _ = assert false
+
let to_string _ = assert false
+
end
+
module EmptyPrinter :
- sig module Make (Ast : Sig.Ast) : Sig.Printer(Ast).S end =
+ sig module Make (Ast : Sig.Ast) : Sig.Printer(Ast).S
+ end =
struct
module Make (Ast : Sig.Ast) =
struct
let print_interf ?input_file:(_) ?output_file:(_) _ =
failwith "No interface printer"
+
let print_implem ?input_file:(_) ?output_file:(_) _ =
failwith "No implementation printer"
+
end
+
end
+
module FreeVars :
sig
module Make (Ast : Sig.Camlp4Ast) :
sig
module S : Set.S with type elt = string
+
val fold_binding_vars :
(string -> 'accu -> 'accu) -> Ast.binding -> 'accu -> 'accu
+
class ['accu] c_fold_pattern_vars :
(string -> 'accu -> 'accu) ->
'accu ->
- object inherit Ast.fold val acc : 'accu method acc : 'accu
+ object inherit Ast.fold
+ val acc : 'accu
+ method acc : 'accu
+
end
+
val fold_pattern_vars :
(string -> 'accu -> 'accu) -> Ast.patt -> 'accu -> 'accu
+
class ['accu] fold_free_vars :
(string -> 'accu -> 'accu) ->
?env_init: S.t ->
'accu ->
object ('self_type)
inherit Ast.fold
+
val free : 'accu
+
val env : S.t
+
method free : 'accu
+
method set_env : S.t -> 'self_type
+
method add_atom : string -> 'self_type
+
method add_patt : Ast.patt -> 'self_type
+
method add_binding : Ast.binding -> 'self_type
+
end
+
val free_vars : S.t -> Ast.expr -> S.t
+
end
+
end =
struct
module Make (Ast : Sig.Camlp4Ast) =
struct
module S = Set.Make(String)
+
let rec fold_binding_vars f bi acc =
match bi with
| Ast.BiAnd (_, bi1, bi2) ->
| Ast.BiEq (_, (Ast.PaId (_, (Ast.IdLid (_, i)))), _) ->
f i acc
| _ -> assert false
+
class ['accu] c_fold_pattern_vars f init =
object inherit Ast.fold as super
+
val acc = init
+
method acc : 'accu = acc
+
method patt =
function
| Ast.PaId (_, (Ast.IdLid (_, s))) |
Ast.PaLab (_, s, (Ast.PaNil _)) |
Ast.PaOlb (_, s, (Ast.PaNil _)) -> {< acc = f s acc; >}
| p -> super#patt p
+
end
+
let fold_pattern_vars f p init =
((new c_fold_pattern_vars f init)#patt p)#acc
+
class ['accu] fold_free_vars (f : string -> 'accu -> 'accu)
?(env_init = S.empty) free_init =
object (o)
inherit Ast.fold as super
+
val free = (free_init : 'accu)
+
val env = (env_init : S.t)
+
method free = free
+
method set_env = fun env -> {< env = env; >}
+
method add_atom = fun s -> {< env = S.add s env; >}
+
method add_patt =
fun p -> {< env = fold_pattern_vars S.add p env; >}
+
method add_binding =
fun bi -> {< env = fold_binding_vars S.add bi env; >}
+
method expr =
function
| Ast.ExId (_, (Ast.IdLid (_, s))) |
| Ast.ExObj (_, p, cst) ->
((o#add_patt p)#class_str_item cst)#set_env env
| e -> super#expr e
+
method match_case =
function
| Ast.McArr (_, p, e1, e2) ->
(((o#add_patt p)#expr e1)#expr e2)#set_env env
| m -> super#match_case m
+
method str_item =
function
| Ast.StExt (_, s, t, _) -> (o#ctyp t)#add_atom s
| Ast.StVal (_, Ast.BTrue, bi) ->
(o#add_binding bi)#binding bi
| st -> super#str_item st
+
method class_expr =
function
| Ast.CeFun (_, p, ce) ->
| Ast.CeStr (_, p, cst) ->
((o#add_patt p)#class_str_item cst)#set_env env
| ce -> super#class_expr ce
+
method class_str_item =
function
| (Ast.CrInh (_, _, "") as cst) -> super#class_str_item cst
| Ast.CrVal (_, s, _, e) -> (o#expr e)#add_atom s
| Ast.CrVvr (_, s, _, t) -> (o#ctyp t)#add_atom s
| cst -> super#class_str_item cst
+
method module_expr =
function
| Ast.MeStr (_, st) -> (o#str_item st)#set_env env
| me -> super#module_expr me
+
end
+
let free_vars env_init e =
let fold = new fold_free_vars S.add ~env_init S.empty
in (fold#expr e)#free
+
end
+
end
+
module Grammar =
struct
module Context =
module type S =
sig
module Token : Sig.Token
+
open Token
+
type t
+
val call_with_ctx :
(Token.t * Loc.t) Stream.t -> (t -> 'a) -> 'a
+
val loc_bp : t -> Loc.t
+
val loc_ep : t -> Loc.t
+
val stream : t -> (Token.t * Loc.t) Stream.t
+
val peek_nth : t -> int -> (Token.t * Loc.t) option
+
val njunk : t -> int -> unit
+
val junk : (Token.t * Loc.t) Stream.t -> unit
+
val bp : (Token.t * Loc.t) Stream.t -> Loc.t
+
end
+
module Make (Token : Sig.Token) : S with module Token = Token =
struct
module Token = Token
+
open Token
+
type t =
{ mutable strm : (Token.t * Loc.t) Stream.t;
mutable loc : Loc.t
}
+
let loc_bp c =
match Stream.peek c.strm with
| None -> Loc.ghost
| Some ((_, loc)) -> loc
+
let loc_ep c = c.loc
+
let set_loc c =
match Stream.peek c.strm with
| Some ((_, loc)) -> c.loc <- loc
| None -> ()
+
let mk strm =
match Stream.peek strm with
| Some ((_, loc)) -> { strm = strm; loc = loc; }
| None -> { strm = strm; loc = Loc.ghost; }
+
let stream c = c.strm
+
let peek_nth c n =
let list = Stream.npeek n c.strm in
let rec loop list n =
| (_ :: l, n) -> loop l (n - 1)
| ([], _) -> None
in loop list n
+
let njunk c n =
(for i = 1 to n do Stream.junk c.strm done; set_loc c)
+
let streams = ref []
+
let mk strm =
let c = mk strm in
let () = streams := (strm, c) :: !streams in c
+
let junk strm =
(set_loc (List.assq strm !streams); Stream.junk strm)
+
let bp strm = loc_bp (List.assq strm !streams)
+
let call_with_ctx strm f =
let streams_v = !streams in
let r =
try f (mk strm)
with | exc -> (streams := streams_v; raise exc)
in (streams := streams_v; r)
+
end
+
end
+
module Structure =
struct
open Sig.Grammar
+
module type S =
sig
module Loc : Sig.Loc
+
module Token : Sig.Token with module Loc = Loc
+
module Lexer : Sig.Lexer with module Loc = Loc
and module Token = Token
+
module Context : Context.S with module Token = Token
+
module Action : Sig.Grammar.Action
+
type gram =
{ gfilter : Token.Filter.t;
gkeywords : (string, int ref) Hashtbl.t;
Loc.t -> char Stream.t -> (Token.t * Loc.t) Stream.t;
warning_verbose : bool ref; error_verbose : bool ref
}
+
type efun =
Context.t -> (Token.t * Loc.t) Stream.t -> Action.t
+
type token_pattern = ((Token.t -> bool) * string)
+
type internal_entry =
{ egram : gram; ename : string;
mutable estart : int -> efun;
and symbol =
| Smeta of string * symbol list * Action.t
| Snterm of internal_entry
- | Snterml of internal_entry * string | Slist0 of symbol
- | Slist0sep of symbol * symbol | Slist1 of symbol
- | Slist1sep of symbol * symbol | Sopt of symbol | Sself
- | Snext | Stoken of token_pattern | Skeyword of string
+ | Snterml of internal_entry * string
+ | Slist0 of symbol
+ | Slist0sep of symbol * symbol
+ | Slist1 of symbol
+ | Slist1sep of symbol * symbol
+ | Sopt of symbol
+ | Sself
+ | Snext
+ | Stoken of token_pattern
+ | Skeyword of string
| Stree of tree
and tree =
- | Node of node | LocAct of Action.t * Action.t list
+ | Node of node
+ | LocAct of Action.t * Action.t list
| DeadEnd
and node =
{ node : symbol; son : tree; brother : tree
}
+
type production_rule = ((symbol list) * Action.t)
+
type single_extend_statment =
((string option) * (assoc option) * (production_rule list))
+
type extend_statment =
((position option) * (single_extend_statment list))
+
type delete_statment = symbol list
+
type ('a, 'b, 'c) fold =
internal_entry ->
symbol list -> ('a Stream.t -> 'b) -> 'a Stream.t -> 'c
+
type ('a, 'b, 'c) foldsep =
internal_entry ->
symbol list ->
('a Stream.t -> 'b) ->
('a Stream.t -> unit) -> 'a Stream.t -> 'c
+
val get_filter : gram -> Token.Filter.t
+
val using : gram -> string -> unit
+
val removing : gram -> string -> unit
+
end
+
module Make (Lexer : Sig.Lexer) =
struct
module Loc = Lexer.Loc
+
module Token = Lexer.Token
+
module Action : Sig.Grammar.Action =
struct
type t = Obj.t
+
let mk = Obj.repr
+
let get = Obj.obj
+
let getf = Obj.obj
+
let getf2 = Obj.obj
+
end
+
module Lexer = Lexer
+
type gram =
{ gfilter : Token.Filter.t;
gkeywords : (string, int ref) Hashtbl.t;
Loc.t -> char Stream.t -> (Token.t * Loc.t) Stream.t;
warning_verbose : bool ref; error_verbose : bool ref
}
+
module Context = Context.Make(Token)
+
type efun =
Context.t -> (Token.t * Loc.t) Stream.t -> Action.t
+
type token_pattern = ((Token.t -> bool) * string)
+
type internal_entry =
{ egram : gram; ename : string;
mutable estart : int -> efun;
and symbol =
| Smeta of string * symbol list * Action.t
| Snterm of internal_entry
- | Snterml of internal_entry * string | Slist0 of symbol
- | Slist0sep of symbol * symbol | Slist1 of symbol
- | Slist1sep of symbol * symbol | Sopt of symbol | Sself
- | Snext | Stoken of token_pattern | Skeyword of string
+ | Snterml of internal_entry * string
+ | Slist0 of symbol
+ | Slist0sep of symbol * symbol
+ | Slist1 of symbol
+ | Slist1sep of symbol * symbol
+ | Sopt of symbol
+ | Sself
+ | Snext
+ | Stoken of token_pattern
+ | Skeyword of string
| Stree of tree
and tree =
- | Node of node | LocAct of Action.t * Action.t list
+ | Node of node
+ | LocAct of Action.t * Action.t list
| DeadEnd
and node =
{ node : symbol; son : tree; brother : tree
}
+
type production_rule = ((symbol list) * Action.t)
+
type single_extend_statment =
((string option) * (assoc option) * (production_rule list))
+
type extend_statment =
((position option) * (single_extend_statment list))
+
type delete_statment = symbol list
+
type ('a, 'b, 'c) fold =
internal_entry ->
symbol list -> ('a Stream.t -> 'b) -> 'a Stream.t -> 'c
+
type ('a, 'b, 'c) foldsep =
internal_entry ->
symbol list ->
('a Stream.t -> 'b) ->
('a Stream.t -> unit) -> 'a Stream.t -> 'c
+
let get_filter g = g.gfilter
+
type 'a not_filtered = 'a
+
let using { gkeywords = table; gfilter = filter } kwd =
let r =
try Hashtbl.find table kwd
| Not_found ->
let r = ref 0 in (Hashtbl.add table kwd r; r)
in (Token.Filter.keyword_added filter kwd (!r = 0); incr r)
+
let removing { gkeywords = table; gfilter = filter } kwd =
let r = Hashtbl.find table kwd in
let () = decr r
(Token.Filter.keyword_removed filter kwd;
Hashtbl.remove table kwd)
else ()
+
end
+
end
+
module Search =
struct
module Make (Structure : Structure.S) =
struct
open Structure
+
let tree_in_entry prev_symb tree =
function
| Dlevels levels ->
| _ -> None)
in search_levels levels
| Dparser _ -> tree
+
end
+
end
+
module Tools =
struct
module Make (Structure : Structure.S) =
struct
open Structure
+
let empty_entry ename _ _ _ =
raise (Stream.Error ("entry [" ^ (ename ^ "] is empty")))
+
let is_level_labelled n lev =
match lev.lname with | Some n1 -> n = n1 | None -> false
+
let warning_verbose = ref true
+
let rec get_token_list entry tokl last_tok tree =
match tree with
| Node
else
Some
(((List.rev (last_tok :: tokl)), last_tok, tree))
+
let is_antiquot s =
let len = String.length s in (len > 1) && (s.[0] = '$')
+
let eq_Stoken_ids s1 s2 =
(not (is_antiquot s1)) &&
((not (is_antiquot s2)) && (s1 = s2))
+
let logically_eq_symbols entry =
let rec eq_symbols s1 s2 =
match (s1, s2) with
-> true
| _ -> false
in eq_symbols
+
let rec eq_symbol s1 s2 =
match (s1, s2) with
| (Snterm e1, Snterm e2) -> e1 == e2
| (Stoken ((_, s1)), Stoken ((_, s2))) ->
eq_Stoken_ids s1 s2
| _ -> s1 = s2
+
end
+
end
+
module Print :
sig
module Make (Structure : Structure.S) :
sig
val flatten_tree :
Structure.tree -> (Structure.symbol list) list
+
val print_symbol :
Format.formatter -> Structure.symbol -> unit
+
val print_meta :
Format.formatter -> string -> Structure.symbol list -> unit
+
val print_symbol1 :
Format.formatter -> Structure.symbol -> unit
+
val print_rule :
Format.formatter -> Structure.symbol list -> unit
+
val print_level :
Format.formatter ->
(Format.formatter -> unit -> unit) ->
(Structure.symbol list) list -> unit
+
val levels : Format.formatter -> Structure.level list -> unit
+
val entry :
Format.formatter -> Structure.internal_entry -> unit
+
end
+
module MakeDump (Structure : Structure.S) :
sig
val print_symbol :
Format.formatter -> Structure.symbol -> unit
+
val print_meta :
Format.formatter -> string -> Structure.symbol list -> unit
+
val print_symbol1 :
Format.formatter -> Structure.symbol -> unit
+
val print_rule :
Format.formatter -> Structure.symbol list -> unit
+
val print_level :
Format.formatter ->
(Format.formatter -> unit -> unit) ->
(Structure.symbol list) list -> unit
+
val levels : Format.formatter -> Structure.level list -> unit
+
val entry :
Format.formatter -> Structure.internal_entry -> unit
+
end
+
end =
struct
module Make (Structure : Structure.S) =
struct
open Structure
+
open Format
+
open Sig.Grammar
+
let rec flatten_tree =
function
| DeadEnd -> []
| Node { node = n; brother = b; son = s } ->
(List.map (fun l -> n :: l) (flatten_tree s)) @
(flatten_tree b)
+
let rec print_symbol ppf =
function
| Smeta (n, sl, _) -> print_meta ppf n sl
fun ppf -> fprintf ppf "%a| " pp_print_space ()))
(fun _ -> ()) rules
in fprintf ppf " ]@]")
+
let levels ppf elev =
let _ =
List.fold_left
fun ppf -> fprintf ppf "@,| "))
(fun _ -> ()) elev
in ()
+
let entry ppf e =
(fprintf ppf "@[<v 0>%s: [ " e.ename;
(match e.edesc with
| Dlevels elev -> levels ppf elev
| Dparser _ -> fprintf ppf "<parser>");
fprintf ppf " ]@]")
+
end
+
module MakeDump (Structure : Structure.S) =
struct
open Structure
+
open Format
+
open Sig.Grammar
+
type brothers = | Bro of symbol * brothers list
+
let rec print_tree ppf tree =
let rec get_brothers acc =
function
fun ppf -> fprintf ppf "%a| " pp_print_space ()))
(fun _ -> ()) rules
in fprintf ppf " ]@]")
+
let levels ppf elev =
let _ =
List.fold_left
fun ppf -> fprintf ppf "@,| "))
(fun _ -> ()) elev
in ()
+
let entry ppf e =
(fprintf ppf "@[<v 0>%s: [ " e.ename;
(match e.edesc with
| Dlevels elev -> levels ppf elev
| Dparser _ -> fprintf ppf "<parser>");
fprintf ppf " ]@]")
+
end
+
end
+
module Failed =
struct
module Make (Structure : Structure.S) =
struct
module Tools = Tools.Make(Structure)
+
module Search = Search.Make(Structure)
+
module Print = Print.Make(Structure)
+
open Structure
+
open Format
+
let rec name_of_symbol entry =
function
| Snterm e -> "[" ^ (e.ename ^ "]")
| Stoken ((_, descr)) -> descr
| Skeyword kwd -> "\"" ^ (kwd ^ "\"")
| _ -> "???"
+
let rec name_of_symbol_failed entry =
function
| Slist0 s -> name_of_symbol_failed entry s
| _ -> assert false))
"" tokl)
| DeadEnd | LocAct (_, _) -> "???"
+
let magic _s x = Obj.magic x
+
let tree_failed entry prev_symb_result prev_symb tree =
let txt = name_of_tree_failed entry tree in
let txt =
fprintf ppf "@]@."))
else ();
txt ^ (" (in [" ^ (entry.ename ^ "])")))
+
let symb_failed entry prev_symb_result prev_symb symb =
let tree =
Node { node = symb; brother = DeadEnd; son = DeadEnd; }
in tree_failed entry prev_symb_result prev_symb tree
+
let symb_failed_txt e s1 s2 = symb_failed e 0 s1 s2
+
end
+
end
+
module Parser =
struct
module Make (Structure : Structure.S) =
struct
module Tools = Tools.Make(Structure)
+
module Failed = Failed.Make(Structure)
+
module Print = Print.Make(Structure)
+
open Structure
+
open Sig.Grammar
+
module Stream =
struct
include Stream
+
let junk strm = Context.junk strm
+
let count strm = Context.bp strm
+
end
+
let add_loc c bp parse_fun strm =
let x = parse_fun c strm in
let ep = Context.loc_ep c in
let loc = Loc.merge bp ep in (x, loc)
+
let level_number entry lab =
let rec lookup levn =
function
match entry.edesc with
| Dlevels elev -> lookup 0 elev
| Dparser _ -> raise Not_found
+
let strict_parsing = ref false
+
let strict_parsing_warning = ref false
+
let rec top_symb entry =
function
| Sself | Snext -> Snterm entry
| Snterml (e, _) -> Snterm e
| Slist1sep (s, sep) -> Slist1sep (top_symb entry s, sep)
| _ -> raise Stream.Failure
+
let top_tree entry =
function
| Node { node = s; brother = bro; son = son } ->
{ node = top_symb entry s; brother = bro; son = son;
}
| LocAct (_, _) | DeadEnd -> raise Stream.Failure
+
let entry_of_symb entry =
function
| Sself | Snext -> entry
| Snterm e -> e
| Snterml (e, _) -> e
| _ -> raise Stream.Failure
+
let continue entry loc a s c son p1 (__strm : _ Stream.t) =
let a =
(entry_of_symb entry s).econtinue 0 loc a c __strm in
raise
(Stream.Error (Failed.tree_failed entry a s son))
in Action.mk (fun _ -> Action.getf act a)
+
let skip_if_empty c bp p strm =
if (Context.loc_ep c) == bp
then Action.mk (fun _ -> p strm)
else raise Stream.Failure
+
let do_recover parser_of_tree entry nlevn alevn loc a s c son
(__strm : _ Stream.t) =
try
| Stream.Failure ->
continue entry loc a s c son
(parser_of_tree entry nlevn alevn son c) __strm)
+
let recover parser_of_tree entry nlevn alevn loc a s c son
strm =
if !strict_parsing
in
do_recover parser_of_tree entry nlevn alevn loc a s c
son strm)
+
let rec parser_of_tree entry nlevn alevn =
function
| DeadEnd ->
and parse_top_symb entry symb strm =
Context.call_with_ctx strm
(fun c -> parse_top_symb' entry symb c (Context.stream c))
+
let rec start_parser_of_levels entry clevn =
function
| [] ->
entry.econtinue levn loc a
c strm
| _ -> p1 levn c __strm))))
+
let start_parser_of_entry entry =
match entry.edesc with
| Dlevels [] -> Tools.empty_entry entry.ename
| Dlevels elev -> start_parser_of_levels entry 0 elev
| Dparser p -> (fun _ _ strm -> p strm)
+
let rec continue_parser_of_levels entry clevn =
function
| [] ->
in
entry.econtinue levn loc a c
strm)))
+
let continue_parser_of_entry entry =
match entry.edesc with
| Dlevels elev ->
| Dparser _ ->
(fun _ _ _ _ (__strm : _ Stream.t) ->
raise Stream.Failure)
+
end
+
end
+
module Insert =
struct
module Make (Structure : Structure.S) =
struct
module Tools = Tools.Make(Structure)
+
module Parser = Parser.Make(Structure)
+
open Structure
+
open Format
+
open Sig.Grammar
+
let is_before s1 s2 =
match (s1, s2) with
| ((Skeyword _ | Stoken _), (Skeyword _ | Stoken _)) ->
false
| ((Skeyword _ | Stoken _), _) -> true
| _ -> false
+
let rec derive_eps =
function
| Slist0 _ -> true
((derive_eps s) && (tree_derive_eps son)) ||
(tree_derive_eps bro)
| DeadEnd -> false
+
let empty_lev lname assoc =
let assoc = match assoc with | Some a -> a | None -> LeftA
in
lsuffix = DeadEnd;
lprefix = DeadEnd;
}
+
let change_lev entry lev n lname assoc =
let a =
match assoc with
lsuffix = lev.lsuffix;
lprefix = lev.lprefix;
})
+
let change_to_self entry =
function | Snterm e when e == entry -> Sself | x -> x
+
let get_level entry position levs =
match position with
| Some First -> ([], empty_lev, levs)
| lev :: levs ->
([], (change_lev entry lev "<top>"), levs)
| [] -> ([], empty_lev, []))
+
let rec check_gram entry =
function
| Snterm e ->
- if e.egram != entry.egram
+ if ( != ) e.egram entry.egram
then
(eprintf
"\
failwith "Grammar.extend error")
else ()
| Snterml (e, _) ->
- if e.egram != entry.egram
+ if ( != ) e.egram entry.egram
then
(eprintf
"\
tree_check_gram entry bro;
tree_check_gram entry son)
| LocAct (_, _) | DeadEnd -> ()
+
let get_initial =
function
| Sself :: symbols -> (true, symbols)
| symbols -> (false, symbols)
+
let insert_tokens gram symbols =
let rec insert =
function
(insert s; tinsert bro; tinsert son)
| LocAct (_, _) | DeadEnd -> ()
in List.iter insert symbols
+
let insert_tree entry gsymbols action tree =
let rec insert symbols tree =
match symbols with
}
| [] -> LocAct (action, [])
in insert gsymbols tree
+
let insert_level entry e1 symbols action slev =
match e1 with
| true ->
lprefix =
insert_tree entry symbols action slev.lprefix;
}
+
let levels_of_rules entry position rules =
let elev =
match entry.edesc with
in ((lev :: levs), empty_lev))
([], make_lev) rules
in levs1 @ ((List.rev levs) @ levs2))
+
let extend entry (position, rules) =
let elev = levels_of_rules entry position rules
in
fun lev bp a c strm ->
let f = Parser.continue_parser_of_entry entry
in (entry.econtinue <- f; f lev bp a c strm))
+
end
+
end
+
module Delete =
struct
module Make (Structure : Structure.S) =
struct
module Tools = Tools.Make(Structure)
+
module Parser = Parser.Make(Structure)
+
open Structure
+
let delete_rule_in_tree entry =
let rec delete_in_tree symbols tree =
match (symbols, tree) with
in Some ((None, t))
| None -> None
in delete_in_tree
+
let rec decr_keyw_use gram =
function
| Skeyword kwd -> removing gram kwd
(decr_keyw_use gram n.node;
decr_keyw_use_in_tree gram n.son;
decr_keyw_use_in_tree gram n.brother)
+
let rec delete_rule_in_suffix entry symbols =
function
| lev :: levs ->
delete_rule_in_suffix entry symbols levs
in lev :: levs)
| [] -> raise Not_found
+
let rec delete_rule_in_prefix entry symbols =
function
| lev :: levs ->
delete_rule_in_prefix entry symbols levs
in lev :: levs)
| [] -> raise Not_found
+
let rec delete_rule_in_level_list entry symbols levs =
match symbols with
| Sself :: symbols ->
| Snterm e :: symbols when e == entry ->
delete_rule_in_suffix entry symbols levs
| _ -> delete_rule_in_prefix entry symbols levs
+
let delete_rule entry sl =
match entry.edesc with
| Dlevels levs ->
let f = Parser.continue_parser_of_entry entry
in (entry.econtinue <- f; f lev bp a c strm)))
| Dparser _ -> ()
+
end
+
end
+
module Fold :
sig
module Make (Structure : Structure.S) :
sig
open Structure
+
val sfold0 : ('a -> 'b -> 'b) -> 'b -> (_, 'a, 'b) fold
+
val sfold1 : ('a -> 'b -> 'b) -> 'b -> (_, 'a, 'b) fold
+
val sfold0sep : ('a -> 'b -> 'b) -> 'b -> (_, 'a, 'b) foldsep
+
end
+
end =
struct
module Make (Structure : Structure.S) =
struct
open Structure
+
open Format
+
module Parse = Parser.Make(Structure)
+
module Fail = Failed.Make(Structure)
+
open Sig.Grammar
+
module Stream =
struct
include Stream
+
let junk strm = Context.junk strm
+
let count strm = Context.bp strm
+
end
+
let sfold0 f e _entry _symbl psymb =
let rec fold accu (__strm : _ Stream.t) =
match try Some (psymb __strm)
| Some a -> fold (f a accu) __strm
| _ -> accu
in fun (__strm : _ Stream.t) -> fold e __strm
+
let sfold1 f e _entry _symbl psymb =
let rec fold accu (__strm : _ Stream.t) =
match try Some (psymb __strm)
in
try fold (f a e) __strm
with | Stream.Failure -> raise (Stream.Error "")
+
let sfold0sep f e entry symbl psymb psep =
let failed =
function
with
| Some a -> kont (f a e) __strm
| _ -> e
+
let sfold1sep f e entry symbl psymb psep =
let failed =
function
in
fun (__strm : _ Stream.t) ->
let a = psymb __strm in kont (f a e) __strm
+
end
+
end
+
module Entry =
struct
module Make (Structure : Structure.S) =
struct
module Dump = Print.MakeDump(Structure)
+
module Print = Print.Make(Structure)
+
module Tools = Tools.Make(Structure)
+
open Format
+
open Structure
+
type 'a t = internal_entry
+
let name e = e.ename
+
let print ppf e = fprintf ppf "%a@\n" Print.entry e
+
let dump ppf e = fprintf ppf "%a@\n" Dump.entry e
+
let mk g n =
{
egram = g;
raise Stream.Failure);
edesc = Dlevels [];
}
+
let action_parse entry ts : Action.t =
Context.call_with_ctx ts
(fun c ->
("illegal begin of " ^ entry.ename))
| (Loc.Exc_located (_, _) as exc) -> raise exc
| exc -> Loc.raise (Context.loc_ep c) exc)
+
let lex entry loc cs = entry.egram.glexer loc cs
+
let lex_string entry loc str =
lex entry loc (Stream.of_string str)
+
let filter entry ts =
Token.Filter.filter (get_filter entry.egram) ts
+
let parse_tokens_after_filter entry ts =
Action.get (action_parse entry ts)
+
let parse_tokens_before_filter entry ts =
parse_tokens_after_filter entry (filter entry ts)
+
let parse entry loc cs =
parse_tokens_before_filter entry (lex entry loc cs)
+
let parse_string entry loc str =
parse_tokens_before_filter entry (lex_string entry loc str)
+
let of_parser g n (p : (Token.t * Loc.t) Stream.t -> 'a) :
'a t =
{
raise Stream.Failure);
edesc = Dparser (fun ts -> Action.mk (p ts));
}
+
let setup_parser e (p : (Token.t * Loc.t) Stream.t -> 'a) =
let f ts = Action.mk (p ts)
in
(fun _ _ _ _ (__strm : _ Stream.t) ->
raise Stream.Failure);
e.edesc <- Dparser f)
+
let clear e =
(e.estart <-
(fun _ _ (__strm : _ Stream.t) -> raise Stream.Failure);
(fun _ _ _ _ (__strm : _ Stream.t) ->
raise Stream.Failure);
e.edesc <- Dlevels [])
+
let obj x = x
+
end
+
end
+
module Static =
struct
module Make (Lexer : Sig.Lexer) :
and module Token = Lexer.Token =
struct
module Structure = Structure.Make(Lexer)
+
module Delete = Delete.Make(Structure)
+
module Insert = Insert.Make(Structure)
+
module Fold = Fold.Make(Structure)
+
include Structure
+
let gram =
let gkeywords = Hashtbl.create 301
in
warning_verbose = ref true;
error_verbose = Camlp4_config.verbose;
}
+
module Entry =
struct
module E = Entry.Make(Structure)
+
type 'a t = 'a E.t
+
let mk = E.mk gram
+
let of_parser name strm = E.of_parser gram name strm
+
let setup_parser = E.setup_parser
+
let name = E.name
+
let print = E.print
+
let clear = E.clear
+
let dump = E.dump
+
let obj x = x
+
end
+
let get_filter () = gram.gfilter
+
let lex loc cs = gram.glexer loc cs
+
let lex_string loc str = lex loc (Stream.of_string str)
+
let filter ts = Token.Filter.filter gram.gfilter ts
+
let parse_tokens_after_filter entry ts =
Entry.E.parse_tokens_after_filter entry ts
+
let parse_tokens_before_filter entry ts =
parse_tokens_after_filter entry (filter ts)
+
let parse entry loc cs =
parse_tokens_before_filter entry (lex loc cs)
+
let parse_string entry loc str =
parse_tokens_before_filter entry (lex_string loc str)
+
let delete_rule = Delete.delete_rule
+
let srules e rl =
let t =
List.fold_left
Insert.insert_tree e symbols action tree)
DeadEnd rl
in Stree t
+
let sfold0 = Fold.sfold0
+
let sfold1 = Fold.sfold1
+
let sfold0sep = Fold.sfold0sep
+
let extend = Insert.extend
+
end
+
end
+
module Dynamic =
struct
module Make (Lexer : Sig.Lexer) :
and module Token = Lexer.Token =
struct
module Structure = Structure.Make(Lexer)
+
module Delete = Delete.Make(Structure)
+
module Insert = Insert.Make(Structure)
+
module Entry = Entry.Make(Structure)
+
module Fold = Fold.Make(Structure)
+
include Structure
+
let mk () =
let gkeywords = Hashtbl.create 301
in
warning_verbose = ref true;
error_verbose = Camlp4_config.verbose;
}
+
let get_filter g = g.gfilter
+
let lex g loc cs = g.glexer loc cs
+
let lex_string g loc str = lex g loc (Stream.of_string str)
+
let filter g ts = Token.Filter.filter g.gfilter ts
+
let parse_tokens_after_filter entry ts =
Entry.parse_tokens_after_filter entry ts
+
let parse_tokens_before_filter entry ts =
parse_tokens_after_filter entry (filter entry.egram ts)
+
let parse entry loc cs =
parse_tokens_before_filter entry (lex entry.egram loc cs)
+
let parse_string entry loc str =
parse_tokens_before_filter entry
(lex_string entry.egram loc str)
+
let delete_rule = Delete.delete_rule
+
let srules e rl =
let t =
List.fold_left
Insert.insert_tree e symbols action tree)
DeadEnd rl
in Stree t
+
let sfold0 = Fold.sfold0
+
let sfold1 = Fold.sfold1
+
let sfold0sep = Fold.sfold0sep
+
let extend = Insert.extend
+
end
+
end
+
end
+
end
+
module Printers =
struct
module DumpCamlp4Ast :
sig
module Id : Sig.Id
+
module Make (Syntax : Sig.Syntax) : Sig.Printer(Syntax.Ast).S
+
end =
struct
module Id =
struct
let name = "Camlp4Printers.DumpCamlp4Ast"
- let version =
- "$Id: DumpCamlp4Ast.ml,v 1.5.4.1 2007/03/30 15:50:12 pouillar Exp $"
+
+ let version = "$Id$"
+
end
+
module Make (Syntax : Sig.Syntax) : Sig.Printer(Syntax.Ast).S =
struct
include Syntax
+
let with_open_out_file x f =
match x with
| Some file ->
in (f oc; flush oc; close_out oc)
| None ->
(set_binary_mode_out stdout true; f stdout; flush stdout)
+
let dump_ast magic ast oc =
(output_string oc magic; output_value oc ast)
+
let print_interf ?input_file:(_) ?output_file ast =
with_open_out_file output_file
(dump_ast Camlp4_config.camlp4_ast_intf_magic_number ast)
+
let print_implem ?input_file:(_) ?output_file ast =
with_open_out_file output_file
(dump_ast Camlp4_config.camlp4_ast_impl_magic_number ast)
+
end
+
end
+
module DumpOCamlAst :
sig
module Id : Sig.Id
+
module Make (Syntax : Sig.Camlp4Syntax) : Sig.Printer(Syntax.Ast).S
+
end =
struct
module Id : Sig.Id =
struct
let name = "Camlp4Printers.DumpOCamlAst"
- let version =
- "$Id: DumpOCamlAst.ml,v 1.5.4.1 2007/03/30 15:50:12 pouillar Exp $"
+
+ let version = "$Id$"
+
end
+
module Make (Syntax : Sig.Camlp4Syntax) : Sig.Printer(Syntax.Ast).S =
struct
include Syntax
+
module Ast2pt = Struct.Camlp4Ast2OCamlAst.Make(Ast)
+
let with_open_out_file x f =
match x with
| Some file ->
in (f oc; flush oc; close_out oc)
| None ->
(set_binary_mode_out stdout true; f stdout; flush stdout)
+
let dump_pt magic fname pt oc =
(output_string oc magic;
output_value oc (if fname = "-" then "" else fname);
output_value oc pt)
+
let print_interf ?(input_file = "-") ?output_file ast =
let pt = Ast2pt.sig_item ast
in
with_open_out_file output_file
(dump_pt Camlp4_config.ocaml_ast_intf_magic_number
input_file pt)
+
let print_implem ?(input_file = "-") ?output_file ast =
let pt = Ast2pt.str_item ast
in
with_open_out_file output_file
(dump_pt Camlp4_config.ocaml_ast_impl_magic_number
input_file pt)
+
end
+
end
+
module Null :
sig
module Id : Sig.Id
+
module Make (Syntax : Sig.Syntax) : Sig.Printer(Syntax.Ast).S
+
end =
struct
module Id =
- struct
- let name = "Camlp4.Printers.Null"
- let version =
- "$Id: Null.ml,v 1.2 2007/02/07 10:09:21 ertai Exp $"
- end
+ struct let name = "Camlp4.Printers.Null"
+ let version = "$Id$"
+ end
+
module Make (Syntax : Sig.Syntax) =
struct
include Syntax
+
let print_interf ?input_file:(_) ?output_file:(_) _ = ()
+
let print_implem ?input_file:(_) ?output_file:(_) _ = ()
+
end
+
end
+
module OCaml :
sig
module Id : Sig.Id
+
module Make (Syntax : Sig.Camlp4Syntax) :
sig
open Format
+
include Sig.Camlp4Syntax with module Loc = Syntax.Loc
and module Token = Syntax.Token and module Ast = Syntax.Ast
and module Gram = Syntax.Gram
+
+ type sep = (unit, formatter, unit) format
+
val list' :
(formatter -> 'a -> unit) ->
('b, formatter, unit) format ->
(unit, formatter, unit) format ->
formatter -> 'a list -> unit
+
val list :
(formatter -> 'a -> unit) ->
('b, formatter, unit) format -> formatter -> 'a list -> unit
+
val lex_string : string -> Token.t
+
val is_infix : string -> bool
+
val is_keyword : string -> bool
+
val ocaml_char : string -> string
+
val get_expr_args :
Ast.expr -> Ast.expr list -> (Ast.expr * (Ast.expr list))
+
val get_patt_args :
Ast.patt -> Ast.patt list -> (Ast.patt * (Ast.patt list))
+
val get_ctyp_args :
Ast.ctyp -> Ast.ctyp list -> (Ast.ctyp * (Ast.ctyp list))
+
val expr_fun_args : Ast.expr -> ((Ast.patt list) * Ast.expr)
+
class printer :
?curry_constr: bool ->
?comments: bool ->
unit ->
object ('a)
method interf : formatter -> Ast.sig_item -> unit
+
method implem : formatter -> Ast.str_item -> unit
+
method sig_item : formatter -> Ast.sig_item -> unit
+
method str_item : formatter -> Ast.str_item -> unit
+
val pipe : bool
+
val semi : bool
- val semisep : string
+
+ val semisep : sep
+
val value_val : string
+
val value_let : string
+
method anti : formatter -> string -> unit
+
method class_declaration :
formatter -> Ast.class_expr -> unit
+
method class_expr : formatter -> Ast.class_expr -> unit
+
method class_sig_item :
formatter -> Ast.class_sig_item -> unit
+
method class_str_item :
formatter -> Ast.class_str_item -> unit
+
method class_type : formatter -> Ast.class_type -> unit
+
method constrain :
formatter -> (Ast.ctyp * Ast.ctyp) -> unit
+
method ctyp : formatter -> Ast.ctyp -> unit
+
method ctyp1 : formatter -> Ast.ctyp -> unit
+
method constructor_type : formatter -> Ast.ctyp -> unit
+
method dot_expr : formatter -> Ast.expr -> unit
+
method apply_expr : formatter -> Ast.expr -> unit
+
method expr : formatter -> Ast.expr -> unit
+
method expr_list : formatter -> Ast.expr list -> unit
+
method expr_list_cons :
bool -> formatter -> Ast.expr -> unit
+
method functor_arg :
formatter -> (string * Ast.module_type) -> unit
+
method functor_args :
formatter -> (string * Ast.module_type) list -> unit
+
method ident : formatter -> Ast.ident -> unit
- method intlike : formatter -> string -> unit
+
+ method numeric : formatter -> string -> string -> unit
+
method binding : formatter -> Ast.binding -> unit
+
method record_binding :
formatter -> Ast.rec_binding -> unit
+
method match_case : formatter -> Ast.match_case -> unit
+
method match_case_aux :
formatter -> Ast.match_case -> unit
+
method mk_expr_list :
Ast.expr -> ((Ast.expr list) * (Ast.expr option))
+
method mk_patt_list :
Ast.patt -> ((Ast.patt list) * (Ast.patt option))
+
method module_expr :
formatter -> Ast.module_expr -> unit
+
method module_expr_get_functor_args :
(string * Ast.module_type) list ->
Ast.module_expr ->
(((string * Ast.module_type) list) * Ast.
module_expr * (Ast.module_type option))
+
method module_rec_binding :
formatter -> Ast.module_binding -> unit
+
method module_type :
formatter -> Ast.module_type -> unit
+
method mutable_flag :
formatter -> Ast.meta_bool -> unit
+
method direction_flag :
formatter -> Ast.meta_bool -> unit
+
method rec_flag : formatter -> Ast.meta_bool -> unit
+
method flag :
formatter -> Ast.meta_bool -> string -> unit
+
method node : formatter -> 'b -> ('b -> Loc.t) -> unit
- method object_dup :
- formatter -> (string * Ast.expr) list -> unit
+
method patt : formatter -> Ast.patt -> unit
+
method patt1 : formatter -> Ast.patt -> unit
+
method patt2 : formatter -> Ast.patt -> unit
+
method patt3 : formatter -> Ast.patt -> unit
+
method patt4 : formatter -> Ast.patt -> unit
+
method patt5 : formatter -> Ast.patt -> unit
+
+ method patt_tycon : formatter -> Ast.patt -> unit
+
method patt_expr_fun_args :
formatter -> (Ast.patt * Ast.expr) -> unit
+
method patt_class_expr_fun_args :
formatter -> (Ast.patt * Ast.class_expr) -> unit
+
method print_comments_before :
Loc.t -> formatter -> unit
+
method private_flag :
formatter -> Ast.meta_bool -> unit
+
method virtual_flag :
formatter -> Ast.meta_bool -> unit
+
method quoted_string : formatter -> string -> unit
+
method raise_match_failure : formatter -> Loc.t -> unit
+
method reset : 'a
+
method reset_semi : 'a
- method semisep : string
+
+ method semisep : sep
+
method set_comments : bool -> 'a
+
method set_curry_constr : bool -> 'a
+
method set_loc_and_comments : 'a
- method set_semisep : string -> 'a
+
+ method set_semisep : sep -> 'a
+
method simple_ctyp : formatter -> Ast.ctyp -> unit
+
method simple_expr : formatter -> Ast.expr -> unit
+
method simple_patt : formatter -> Ast.patt -> unit
+
method seq : formatter -> Ast.expr -> unit
+
method string : formatter -> string -> unit
+
method sum_type : formatter -> Ast.ctyp -> unit
+
method type_params : formatter -> Ast.ctyp list -> unit
+
method class_params : formatter -> Ast.ctyp -> unit
+
method under_pipe : 'a
+
method under_semi : 'a
+
method var : formatter -> string -> unit
+
method with_constraint :
formatter -> Ast.with_constr -> unit
+
end
+
val with_outfile :
string option -> (formatter -> 'a -> unit) -> 'a -> unit
+
val print :
string option ->
(printer -> formatter -> 'a -> unit) -> 'a -> unit
+
end
+
module MakeMore (Syntax : Sig.Camlp4Syntax) : Sig.Printer(Syntax.
Ast).S
+
end =
struct
open Format
+
module Id =
- struct
- let name = "Camlp4.Printers.OCaml"
- let version =
- "$Id: OCaml.ml,v 1.21.2.7 2007/05/10 13:31:20 pouillar Exp $"
- end
+ struct let name = "Camlp4.Printers.OCaml"
+ let version = "$Id$"
+ end
+
module Make (Syntax : Sig.Camlp4Syntax) =
struct
include Syntax
+
+ type sep = (unit, formatter, unit) format
+
let pp = fprintf
+
let cut f = fprintf f "@ "
+
let list' elt sep sep' f =
let rec loop =
function
| [] -> ()
| [ x ] -> (elt f x; pp f sep')
| x :: xs -> (elt f x; pp f sep'; loop xs)
+
let list elt sep f =
let rec loop =
function | [] -> () | x :: xs -> (pp f sep; elt f x; loop xs)
| [] -> ()
| [ x ] -> elt f x
| x :: xs -> (elt f x; loop xs)
+
let rec list_of_meta_list =
function
| Ast.LNil -> []
| Ast.LCons (x, xs) -> x :: (list_of_meta_list xs)
| Ast.LAnt x -> assert false
+
let meta_list elt sep f mxs =
let xs = list_of_meta_list mxs in list elt sep f xs
+
module CommentFilter = Struct.CommentFilter.Make(Token)
+
let comment_filter = CommentFilter.mk ()
+
let _ = CommentFilter.define (Gram.get_filter ()) comment_filter
+
module StringSet = Set.Make(String)
+
+ let infix_lidents =
+ [ "asr"; "land"; "lor"; "lsl"; "lsr"; "lxor"; "mod"; "or" ]
+
let is_infix =
- let infixes =
- List.fold_right StringSet.add
- [ "=="; "!="; "+"; "-"; "+."; "-."; "*"; "*."; "/"; "/.";
- "**"; "="; "<>"; "<"; ">"; "<="; ">="; "^"; "^^"; "@";
- "&&"; "||"; "asr"; "land"; "lor"; "lsl"; "lsr"; "lxor";
- "mod"; "or" ]
- StringSet.empty
- in fun s -> StringSet.mem s infixes
+ let first_chars =
+ [ '='; '<'; '>'; '|'; '&'; '$'; '@'; '^'; '+'; '-'; '*'; '/';
+ '%'; '\\' ]
+ and infixes =
+ List.fold_right StringSet.add infix_lidents StringSet.empty
+ in
+ fun s ->
+ (StringSet.mem s infixes) ||
+ ((s <> "") && (List.mem s.[0] first_chars))
+
let is_keyword =
let keywords =
List.fold_right StringSet.add
- [ "and"; "as"; "assert"; "asr"; "begin"; "class";
- "constraint"; "do"; "done"; "downto"; "else"; "end";
- "exception"; "external"; "false"; "for"; "fun";
- "function"; "functor"; "if"; "in"; "include"; "inherit";
- "initializer"; "land"; "lazy"; "let"; "lor"; "lsl";
- "lsr"; "lxor"; "match"; "method"; "mod"; "module";
- "mutable"; "new"; "object"; "of"; "open"; "or"; "parser";
- "private"; "rec"; "sig"; "struct"; "then"; "to"; "true";
- "try"; "type"; "val"; "virtual"; "when"; "while"; "with" ]
+ [ "and"; "as"; "assert"; "begin"; "class"; "constraint";
+ "do"; "done"; "downto"; "else"; "end"; "exception";
+ "external"; "false"; "for"; "fun"; "function"; "functor";
+ "if"; "in"; "include"; "inherit"; "initializer"; "lazy";
+ "let"; "match"; "method"; "module"; "mutable"; "new";
+ "object"; "of"; "open"; "parser"; "private"; "rec";
+ "sig"; "struct"; "then"; "to"; "true"; "try"; "type";
+ "val"; "virtual"; "when"; "while"; "with" ]
StringSet.empty
in fun s -> StringSet.mem s keywords
+
module Lexer = Struct.Lexer.Make(Token)
+
let _ = let module M = ErrorHandler.Register(Lexer.Error) in ()
+
open Sig
+
let lexer s =
Lexer.from_string ~quotations: !Camlp4_config.quotations Loc.
ghost s
+
let lex_string str =
try
let (__strm : _ Stream.t) = lexer str
| _ -> raise (Stream.Error "")))
| _ -> raise Stream.Failure
with
- | Stream.Failure ->
+ | Stream.Failure | Stream.Error _ ->
failwith
(sprintf
"Cannot print %S this string contains more than one token"
(sprintf
"Cannot print %S this identifier does not respect OCaml lexing rules (%s)"
str (Lexer.Error.to_string exn))
+
let ocaml_char = function | "'" -> "\\'" | c -> c
+
let rec get_expr_args a al =
match a with
| Ast.ExApp (_, a1, a2) -> get_expr_args a1 (a2 :: al)
| _ -> (a, al)
+
let rec get_patt_args a al =
match a with
| Ast.PaApp (_, a1, a2) -> get_patt_args a1 (a2 :: al)
| _ -> (a, al)
+
let rec get_ctyp_args a al =
match a with
| Ast.TyApp (_, a1, a2) -> get_ctyp_args a1 (a2 :: al)
| _ -> (a, al)
+
let is_irrefut_patt = Ast.is_irrefut_patt
+
let rec expr_fun_args =
function
| (Ast.ExFun (_, (Ast.McArr (_, p, (Ast.ExNil _), e))) as ge)
then (let (pl, e) = expr_fun_args e in ((p :: pl), e))
else ([], ge)
| ge -> ([], ge)
+
let rec class_expr_fun_args =
function
| (Ast.CeFun (_, p, ce) as ge) ->
(let (pl, ce) = class_expr_fun_args ce in ((p :: pl), ce))
else ([], ge)
| ge -> ([], ge)
+
let rec do_print_comments_before loc f (__strm : _ Stream.t) =
match Stream.peek __strm with
| Some ((comm, comm_loc)) when Loc.strictly_before comm_loc loc
let () = f comm comm_loc
in do_print_comments_before loc f s)
| _ -> ()
+
class printer ?curry_constr:(init_curry_constr = false)
?(comments = true) () =
object (o)
val pipe = false
+
val semi = false
+
method under_pipe = {< pipe = true; >}
+
method under_semi = {< semi = true; >}
+
method reset_semi = {< semi = false; >}
+
method reset = {< pipe = false; semi = false; >}
- val semisep = ";;"
- val andsep =
- ("@]@ @[<2>and@ " : (unit, formatter, unit) format)
+
+ val semisep = (";;" : sep)
+
+ val andsep = ("@]@ @[<2>and@ " : sep)
+
val value_val = "val"
+
val value_let = "let"
+
val mode = if comments then `comments else `no_comments
+
val curry_constr = init_curry_constr
+
val var_conversion = false
+
method semisep = semisep
+
method set_semisep = fun s -> {< semisep = s; >}
+
method set_comments =
fun b ->
{< mode = if b then `comments else `no_comments; >}
+
method set_loc_and_comments = {< mode = `loc_and_comments; >}
+
method set_curry_constr = fun b -> {< curry_constr = b; >}
+
method print_comments_before =
fun loc f ->
match mode with
(fun s -> pp f "%s(*comm_loc: %a*)@ " s Loc.dump)
(CommentFilter.take_stream comment_filter)
| _ -> ()
+
method var =
fun f ->
function
(match lex_string v with
| LIDENT s | UIDENT s | ESCAPED_IDENT s when
is_keyword s -> pp f "%s__" s
+ | LIDENT s | ESCAPED_IDENT s when
+ List.mem s infix_lidents -> pp f "( %s )" s
| SYMBOL s -> pp f "( %s )" s
| LIDENT s | UIDENT s | ESCAPED_IDENT s ->
pp_print_string f s
(sprintf
"Bad token used as an identifier: %s"
(Token.to_string tok))))
+
method type_params =
fun f ->
function
| [] -> ()
| [ x ] -> pp f "%a@ " o#ctyp x
| l -> pp f "@[<1>(%a)@]@ " (list o#ctyp ",@ ") l
+
method class_params =
fun f ->
function
pp f "@[<1>%a,@ %a@]" o#class_params t1
o#class_params t2
| x -> o#ctyp f x
+
method mutable_flag = fun f b -> o#flag f b "mutable"
+
method rec_flag = fun f b -> o#flag f b "rec"
+
method virtual_flag = fun f b -> o#flag f b "virtual"
+
method private_flag = fun f b -> o#flag f b "private"
+
method flag =
fun f b n ->
match b with
| Ast.BTrue -> (pp_print_string f n; pp f "@ ")
| Ast.BFalse -> ()
| Ast.BAnt s -> o#anti f s
+
method anti = fun f s -> pp f "$%s$" s
+
method seq =
fun f ->
function
pp f "%a;@ %a" o#under_semi#seq e1 o#seq e2
| Ast.ExSeq (_, e) -> o#seq f e
| e -> o#expr f e
+
method match_case =
fun f ->
function
| Ast.McNil _loc ->
- pp f "@[<2>_@ ->@ %a@]" o#raise_match_failure _loc
+ pp f "@[<2>@ _ ->@ %a@]" o#raise_match_failure _loc
| a -> o#match_case_aux f a
+
method match_case_aux =
fun f ->
function
| Ast.McArr (_, p, w, e) ->
pp f "@ | @[<2>%a@ when@ %a@ ->@ %a@]" o#patt p
o#under_pipe#expr w o#under_pipe#expr e
+
method binding =
fun f bi ->
let () = o#node f bi Ast.loc_of_binding
pp f "%a @[<0>%a=@]@ %a" o#simple_patt p
(list' o#simple_patt "" "@ ") pl o#expr e)
| Ast.BiAnt (_, s) -> o#anti f s
+
method record_binding =
fun f bi ->
let () = o#node f bi Ast.loc_of_rec_binding
(o#under_semi#record_binding f b1;
o#under_semi#record_binding f b2)
| Ast.RbAnt (_, s) -> o#anti f s
- method object_dup =
- fun f ->
- list
- (fun f (s, e) ->
- pp f "@[<2>%a =@ %a@]" o#var s o#expr e)
- ";@ " f
+
method mk_patt_list =
function
| Ast.PaApp (_,
let (pl, c) = o#mk_patt_list p2 in ((p1 :: pl), c)
| Ast.PaId (_, (Ast.IdUid (_, "[]"))) -> ([], None)
| p -> ([], (Some p))
+
method mk_expr_list =
function
| Ast.ExApp (_,
let (el, c) = o#mk_expr_list e2 in ((e1 :: el), c)
| Ast.ExId (_, (Ast.IdUid (_, "[]"))) -> ([], None)
| e -> ([], (Some e))
+
method expr_list =
fun f ->
function
| [] -> pp f "[]"
- | [ e ] -> pp f "[ %a ]" o#expr e
- | el -> pp f "@[<2>[ %a@] ]" (list o#expr ";@ ") el
+ | [ e ] -> pp f "[ %a ]" o#under_semi#expr e
+ | el ->
+ pp f "@[<2>[ %a@] ]" (list o#under_semi#expr ";@ ")
+ el
+
method expr_list_cons =
fun simple f e ->
let (el, c) = o#mk_expr_list e
| Some x ->
(if simple
then pp f "@[<2>(%a)@]"
- else pp f "@[<2>%a@]") (list o#dot_expr " ::@ ")
- (el @ [ x ])
+ else pp f "@[<2>%a@]")
+ (list o#under_semi#dot_expr " ::@ ") (el @ [ x ])
+
method patt_expr_fun_args =
fun f (p, e) ->
let (pl, e) = expr_fun_args e
in
pp f "%a@ ->@ %a" (list o#patt "@ ") (p :: pl) o#expr e
+
method patt_class_expr_fun_args =
fun f (p, ce) ->
let (pl, ce) = class_expr_fun_args ce
in
pp f "%a =@]@ %a" (list o#patt "@ ") (p :: pl)
o#class_expr ce
+
method constrain =
fun f (t1, t2) ->
pp f "@[<2>constraint@ %a =@ %a@]" o#ctyp t1 o#ctyp t2
+
method sum_type =
- fun f t -> (pp_print_string f "| "; o#ctyp f t)
+ fun f t ->
+ match Ast.list_of_ctyp t [] with
+ | [] -> ()
+ | ts -> pp f "@[<hv0>| %a@]" (list o#ctyp "@ | ") ts
+
method string = fun f -> pp f "%s"
+
method quoted_string = fun f -> pp f "%S"
- method intlike =
- fun f s ->
- if s.[0] = '-' then pp f "(%s)" s else pp f "%s" s
+
+ method numeric =
+ fun f num suff ->
+ if num.[0] = '-'
+ then pp f "(%s%s)" num suff
+ else pp f "%s%s" num suff
+
method module_expr_get_functor_args =
fun accu ->
function
| Ast.MeTyc (_, me, mt) ->
((List.rev accu), me, (Some mt))
| me -> ((List.rev accu), me, None)
+
method functor_args = fun f -> list o#functor_arg "@ " f
+
method functor_arg =
fun f (s, mt) ->
pp f "@[<2>(%a :@ %a)@]" o#var s o#module_type mt
+
method module_rec_binding =
fun f ->
function
pp f andsep;
o#module_rec_binding f mb2)
| Ast.MbAnt (_, s) -> o#anti f s
+
method class_declaration =
fun f ->
function
| Ast.CeTyc (_, ce, ct) ->
pp f "%a :@ %a" o#class_expr ce o#class_type ct
| ce -> o#class_expr f ce
+
method raise_match_failure =
fun f _loc ->
let n = Loc.file_name _loc in
Ast.ExStr (_loc, Ast.safe_string_escaped n)),
Ast.ExInt (_loc, string_of_int l)),
Ast.ExInt (_loc, string_of_int c))))
+
method node : 'a. formatter -> 'a -> ('a -> Loc.t) -> unit =
fun f node loc_of_node ->
o#print_comments_before (loc_of_node node) f
+
method ident =
fun f i ->
let () = o#node f i Ast.loc_of_ident
pp f "%a@,(%a)" o#ident i1 o#ident i2
| Ast.IdAnt (_, s) -> o#anti f s
| Ast.IdLid (_, s) | Ast.IdUid (_, s) -> o#var f s
+
method private var_ident = {< var_conversion = true; >}#ident
+
method expr =
fun f e ->
let () = o#node f e Ast.loc_of_expr
as e) when pipe || semi ->
pp f "(%a)" o#reset#expr e
| Ast.ExApp (_, (Ast.ExId (_, (Ast.IdLid (_, "~-")))),
- x) -> pp f "@[<2>-@,%a@]" o#expr x
+ x) -> pp f "@[<2>-@ %a@]" o#dot_expr x
| Ast.ExApp (_, (Ast.ExId (_, (Ast.IdLid (_, "~-.")))),
- x) -> pp f "@[<2>-.@,%a@]" o#expr x
+ x) -> pp f "@[<2>-.@ %a@]" o#dot_expr x
| Ast.ExApp (_,
(Ast.ExApp (_,
(Ast.ExId (_, (Ast.IdUid (_, "::")))), _)),
| Ast.ExAss (_,
(Ast.ExAcc (_, e1,
(Ast.ExId (_, (Ast.IdLid (_, "val")))))),
- e2) -> pp f "@[<2>%a :=@ %a@]" o#expr e1 o#expr e2
+ e2) ->
+ pp f "@[<2>%a :=@ %a@]" o#dot_expr e1 o#expr e2
| Ast.ExAss (_, e1, e2) ->
- pp f "@[<2>%a@ <-@ %a@]" o#expr e1 o#expr e2
+ pp f "@[<2>%a@ <-@ %a@]" o#dot_expr e1 o#expr e2
| Ast.ExFun (loc, (Ast.McNil _)) ->
pp f "@[<2>fun@ _@ ->@ %a@]" o#raise_match_failure
loc
pp f "@[<2>assert@ %a@]" o#dot_expr e
| Ast.ExLmd (_, s, me, e) ->
pp f "@[<2>let module %a =@ %a@]@ @[<2>in@ %a@]"
- o#var s o#module_expr me o#expr e
+ o#var s o#module_expr me o#reset_semi#expr e
| e -> o#apply_expr f e
+
method apply_expr =
fun f e ->
let () = o#node f e Ast.loc_of_expr
match e with
| Ast.ExNew (_, i) -> pp f "@[<2>new@ %a@]" o#ident i
| e -> o#dot_expr f e
+
method dot_expr =
fun f e ->
let () = o#node f e Ast.loc_of_expr
| Ast.ExSnd (_, e, s) ->
pp f "@[<2>%a#@,%s@]" o#dot_expr e s
| e -> o#simple_expr f e
+
method simple_expr =
fun f e ->
let () = o#node f e Ast.loc_of_expr
"@[<hv0>@[<hv2>@[<2>for %a =@ %a@ %a@ %a@ do@]@ %a@]@ done@]"
o#var s o#expr e1 o#direction_flag df o#expr e2
o#seq e3
- | Ast.ExInt (_, s) -> pp f "%a" o#intlike s
- | Ast.ExNativeInt (_, s) -> pp f "%an" o#intlike s
- | Ast.ExInt64 (_, s) -> pp f "%aL" o#intlike s
- | Ast.ExInt32 (_, s) -> pp f "%al" o#intlike s
- | Ast.ExFlo (_, s) -> pp f "%s" s
+ | Ast.ExInt (_, s) -> o#numeric f s ""
+ | Ast.ExNativeInt (_, s) -> o#numeric f s "n"
+ | Ast.ExInt64 (_, s) -> o#numeric f s "L"
+ | Ast.ExInt32 (_, s) -> o#numeric f s "l"
+ | Ast.ExFlo (_, s) -> o#numeric f s ""
| Ast.ExChr (_, s) -> pp f "'%s'" (ocaml_char s)
| Ast.ExId (_, i) -> o#var_ident f i
| Ast.ExRec (_, b, (Ast.ExNil _)) ->
Ast.ExLet (_, _, _, _) | Ast.ExLmd (_, _, _, _) |
Ast.ExAsr (_, _) | Ast.ExAsf _ | Ast.ExLaz (_, _) |
Ast.ExNew (_, _) -> pp f "(%a)" o#reset#expr e
+
method direction_flag =
fun f b ->
match b with
| Ast.BTrue -> pp_print_string f "to"
| Ast.BFalse -> pp_print_string f "downto"
| Ast.BAnt s -> o#anti f s
+
method patt =
fun f p ->
let () = o#node f p Ast.loc_of_patt
| Ast.PaSem (_, p1, p2) ->
pp f "%a;@ %a" o#patt p1 o#patt p2
| p -> o#patt1 f p
+
method patt1 =
fun f ->
function
| Ast.PaOrp (_, p1, p2) ->
pp f "@[<2>%a@ |@ %a@]" o#patt1 p1 o#patt2 p2
| p -> o#patt2 f p
+
method patt2 = fun f p -> o#patt3 f p
+
method patt3 =
fun f ->
function
| Ast.PaCom (_, p1, p2) ->
pp f "%a,@ %a" o#patt3 p1 o#patt3 p2
| p -> o#patt4 f p
+
method patt4 =
fun f ->
function
pp f "@[<2>%a@]" (list o#patt5 " ::@ ")
(pl @ [ x ]))
| p -> o#patt5 f p
+
method patt5 =
fun f ->
function
| Ast.PaApp (_, x, y) ->
let (a, al) = get_patt_args x [ y ]
in
- if
- (not curry_constr) && (Ast.is_patt_constructor a)
+ if not (Ast.is_patt_constructor a)
then
- (match al with
- | [ Ast.PaTup (_, _) ] ->
- pp f "@[<2>%a@ (%a)@]" o#simple_patt x
- o#patt y
- | [ _ ] ->
- pp f "@[<2>%a@ %a@]" o#patt5 x o#simple_patt
- y
- | al ->
- pp f "@[<2>%a@ (%a)@]" o#patt5 a
- (list o#simple_patt ",@ ") al)
+ Format.eprintf
+ "WARNING: strange pattern application of a non constructor@."
else
- pp f "@[<2>%a@]" (list o#simple_patt "@ ")
- (a :: al)
+ if curry_constr
+ then
+ pp f "@[<2>%a@]" (list o#simple_patt "@ ")
+ (a :: al)
+ else
+ (match al with
+ | [ Ast.PaTup (_, _) ] ->
+ pp f "@[<2>%a@ (%a)@]" o#simple_patt x
+ o#patt y
+ | [ _ ] ->
+ pp f "@[<2>%a@ %a@]" o#patt5 x
+ o#simple_patt y
+ | al ->
+ pp f "@[<2>%a@ (%a)@]" o#patt5 a
+ (list o#simple_patt ",@ ") al)
| p -> o#simple_patt f p
+
method simple_patt =
fun f p ->
let () = o#node f p Ast.loc_of_patt
| Ast.PaStr (_, s) -> pp f "\"%s\"" s
| Ast.PaTyc (_, p, t) ->
pp f "@[<1>(%a :@ %a)@]" o#patt p o#ctyp t
- | Ast.PaNativeInt (_, s) -> pp f "%an" o#intlike s
- | Ast.PaInt64 (_, s) -> pp f "%aL" o#intlike s
- | Ast.PaInt32 (_, s) -> pp f "%al" o#intlike s
- | Ast.PaInt (_, s) -> pp f "%a" o#intlike s
- | Ast.PaFlo (_, s) -> pp f "%s" s
+ | Ast.PaNativeInt (_, s) -> o#numeric f s "n"
+ | Ast.PaInt64 (_, s) -> o#numeric f s "L"
+ | Ast.PaInt32 (_, s) -> o#numeric f s "l"
+ | Ast.PaInt (_, s) -> o#numeric f s ""
+ | Ast.PaFlo (_, s) -> o#numeric f s ""
| Ast.PaChr (_, s) -> pp f "'%s'" (ocaml_char s)
| Ast.PaLab (_, s, (Ast.PaNil _)) -> pp f "~%s" s
| Ast.PaVrn (_, s) -> pp f "`%a" o#var s
| Ast.PaLab (_, s, p) ->
pp f "@[<2>~%s:@ (%a)@]" s o#patt p
| Ast.PaOlb (_, s, (Ast.PaNil _)) -> pp f "?%s" s
- | Ast.PaOlb (_, "", p) -> pp f "@[<2>?(%a)@]" o#patt p
+ | Ast.PaOlb (_, "", p) ->
+ pp f "@[<2>?(%a)@]" o#patt_tycon p
| Ast.PaOlb (_, s, p) ->
- pp f "@[<2>?%s:@,@[<1>(%a)@]@]" s o#patt p
+ pp f "@[<2>?%s:@,@[<1>(%a)@]@]" s o#patt_tycon p
| Ast.PaOlbi (_, "", p, e) ->
- pp f "@[<2>?(%a =@ %a)@]" o#patt p o#expr e
+ pp f "@[<2>?(%a =@ %a)@]" o#patt_tycon p o#expr e
| Ast.PaOlbi (_, s, p, e) ->
- pp f "@[<2>?%s:@,@[<1>(%a =@ %a)@]@]" s o#patt p
- o#expr e
+ pp f "@[<2>?%s:@,@[<1>(%a =@ %a)@]@]" s
+ o#patt_tycon p o#expr e
| (Ast.PaApp (_, _, _) | Ast.PaAli (_, _, _) |
Ast.PaOrp (_, _, _) | Ast.PaRng (_, _, _) |
Ast.PaCom (_, _, _) | Ast.PaSem (_, _, _) |
Ast.PaEq (_, _, _)
as p) -> pp f "@[<1>(%a)@]" o#patt p
+
+ method patt_tycon =
+ fun f ->
+ function
+ | Ast.PaTyc (_, p, t) ->
+ pp f "%a :@ %a" o#patt p o#ctyp t
+ | p -> o#patt f p
+
method simple_ctyp =
fun f t ->
let () = o#node f t Ast.loc_of_ctyp
| Ast.TyRec (_, t) -> pp f "@[<2>{@ %a@]@ }" o#ctyp t
| Ast.TySum (_, t) -> pp f "@[<0>%a@]" o#sum_type t
| Ast.TyTup (_, t) -> pp f "@[<1>(%a)@]" o#ctyp t
- | Ast.TyVrnEq (_, t) -> pp f "@[<2>[@ %a@]@ ]" o#ctyp t
+ | Ast.TyVrnEq (_, t) ->
+ pp f "@[<2>[@ %a@]@ ]" o#sum_type t
| Ast.TyVrnInf (_, t) ->
- pp f "@[<2>[<@ %a@]@,]" o#ctyp t
+ pp f "@[<2>[<@ %a@]@,]" o#sum_type t
| Ast.TyVrnInfSup (_, t1, t2) ->
- pp f "@[<2>[<@ %a@ >@ %a@]@ ]" o#ctyp t1 o#ctyp t2
+ let (a, al) = get_ctyp_args t2 []
+ in
+ pp f "@[<2>[<@ %a@ >@ %a@]@ ]" o#sum_type t1
+ (list o#simple_ctyp "@ ") (a :: al)
| Ast.TyVrnSup (_, t) ->
- pp f "@[<2>[>@ %a@]@,]" o#ctyp t
+ pp f "@[<2>[>@ %a@]@,]" o#sum_type t
| Ast.TyCls (_, i) -> pp f "@[<2>#%a@]" o#ident i
| Ast.TyMan (_, t1, t2) ->
pp f "@[<2>%a =@ %a@]" o#simple_ctyp t1
| Ast.TyVrn (_, s) -> pp f "`%a" o#var s
| Ast.TySta (_, t1, t2) ->
pp f "%a *@ %a" o#simple_ctyp t1 o#simple_ctyp t2
+ | Ast.TyNil _ -> assert false
| t -> pp f "@[<1>(%a)@]" o#ctyp t
+
method ctyp =
fun f t ->
let () = o#node f t Ast.loc_of_ctyp
then pp f "@ %a" (list o#constrain "@ ") cl
else ())
| t -> o#ctyp1 f t
+
method ctyp1 =
fun f ->
function
| Ast.TyPrv (_, t) ->
pp f "@[private@ %a@]" o#simple_ctyp t
| t -> o#simple_ctyp f t
+
method constructor_type =
fun f t ->
match t with
o#constructor_type t2
| Ast.TyArr (_, _, _) -> pp f "(%a)" o#ctyp t
| t -> o#ctyp f t
+
method sig_item =
fun f sg ->
let () = o#node f sg Ast.loc_of_sig_item
| Ast.SgSem (_, sg1, sg2) ->
(o#sig_item f sg1; cut f; o#sig_item f sg2)
| Ast.SgExc (_, t) ->
- pp f "@[<2>exception@ %a%s@]" o#ctyp t semisep
+ pp f "@[<2>exception@ %a%(%)@]" o#ctyp t semisep
| Ast.SgExt (_, s, t, sl) ->
- pp f "@[<2>external@ %a :@ %a =@ %a%s@]" o#var s
- o#ctyp t (meta_list o#quoted_string "@ ") sl
- semisep
+ pp f "@[<2>external@ %a :@ %a =@ %a%(%)@]"
+ o#var s o#ctyp t (meta_list o#quoted_string "@ ")
+ sl semisep
| Ast.SgMod (_, s1, (Ast.MtFun (_, s2, mt1, mt2))) ->
let rec loop accu =
(function
| mt -> ((List.rev accu), mt)) in
let (al, mt) = loop [ (s2, mt1) ] mt2
in
- pp f "@[<2>module %a@ @[<0>%a@] :@ %a%s@]"
+ pp f "@[<2>module %a@ @[<0>%a@] :@ %a%(%)@]"
o#var s1 o#functor_args al o#module_type mt
semisep
| Ast.SgMod (_, s, mt) ->
- pp f "@[<2>module %a :@ %a%s@]" o#var s
+ pp f "@[<2>module %a :@ %a%(%)@]" o#var s
o#module_type mt semisep
| Ast.SgMty (_, s, (Ast.MtNil _)) ->
- pp f "@[<2>module type %a%s@]" o#var s semisep
+ pp f "@[<2>module type %a%(%)@]" o#var s semisep
| Ast.SgMty (_, s, mt) ->
- pp f "@[<2>module type %a =@ %a%s@]" o#var s
+ pp f "@[<2>module type %a =@ %a%(%)@]" o#var s
o#module_type mt semisep
| Ast.SgOpn (_, sl) ->
- pp f "@[<2>open@ %a%s@]" o#ident sl semisep
+ pp f "@[<2>open@ %a%(%)@]" o#ident sl semisep
| Ast.SgTyp (_, t) ->
- pp f "@[<hv0>@[<hv2>type %a@]%s@]" o#ctyp t semisep
+ pp f "@[<hv0>@[<hv2>type %a@]%(%)@]" o#ctyp t
+ semisep
| Ast.SgVal (_, s, t) ->
- pp f "@[<2>%s %a :@ %a%s@]" value_val o#var s
+ pp f "@[<2>%s %a :@ %a%(%)@]" value_val o#var s
o#ctyp t semisep
| Ast.SgInc (_, mt) ->
- pp f "@[<2>include@ %a%s@]" o#module_type mt
+ pp f "@[<2>include@ %a%(%)@]" o#module_type mt
semisep
| Ast.SgClt (_, ct) ->
- pp f "@[<2>class type %a%s@]" o#class_type ct
+ pp f "@[<2>class type %a%(%)@]" o#class_type ct
semisep
| Ast.SgCls (_, ce) ->
- pp f "@[<2>class %a%s@]" o#class_type ce semisep
+ pp f "@[<2>class %a%(%)@]" o#class_type ce semisep
| Ast.SgRecMod (_, mb) ->
- pp f "@[<2>module rec %a%s@]" o#module_rec_binding
- mb semisep
+ pp f "@[<2>module rec %a%(%)@]"
+ o#module_rec_binding mb semisep
| Ast.SgDir (_, _, _) -> ()
- | Ast.SgAnt (_, s) -> pp f "%a%s" o#anti s semisep
+ | Ast.SgAnt (_, s) -> pp f "%a%(%)" o#anti s semisep
+
method str_item =
fun f st ->
let () = o#node f st Ast.loc_of_str_item
| Ast.StSem (_, st1, st2) ->
(o#str_item f st1; cut f; o#str_item f st2)
| Ast.StExc (_, t, Ast.ONone) ->
- pp f "@[<2>exception@ %a%s@]" o#ctyp t semisep
+ pp f "@[<2>exception@ %a%(%)@]" o#ctyp t semisep
| Ast.StExc (_, t, (Ast.OSome sl)) ->
- pp f "@[<2>exception@ %a =@ %a%s@]" o#ctyp t
+ pp f "@[<2>exception@ %a =@ %a%(%)@]" o#ctyp t
o#ident sl semisep
| Ast.StExt (_, s, t, sl) ->
- pp f "@[<2>external@ %a :@ %a =@ %a%s@]" o#var s
- o#ctyp t (meta_list o#quoted_string "@ ") sl
- semisep
+ pp f "@[<2>external@ %a :@ %a =@ %a%(%)@]"
+ o#var s o#ctyp t (meta_list o#quoted_string "@ ")
+ sl semisep
| Ast.StMod (_, s1, (Ast.MeFun (_, s2, mt1, me))) ->
(match o#module_expr_get_functor_args [ (s2, mt1) ]
me
with
| (al, me, Some mt2) ->
pp f
- "@[<2>module %a@ @[<0>%a@] :@ %a =@ %a%s@]"
+ "@[<2>module %a@ @[<0>%a@] :@ %a =@ %a%(%)@]"
o#var s1 o#functor_args al o#module_type mt2
o#module_expr me semisep
| (al, me, _) ->
- pp f "@[<2>module %a@ @[<0>%a@] =@ %a%s@]"
+ pp f "@[<2>module %a@ @[<0>%a@] =@ %a%(%)@]"
o#var s1 o#functor_args al o#module_expr me
semisep)
| Ast.StMod (_, s, (Ast.MeTyc (_, me, mt))) ->
- pp f "@[<2>module %a :@ %a =@ %a%s@]" o#var s
+ pp f "@[<2>module %a :@ %a =@ %a%(%)@]" o#var s
o#module_type mt o#module_expr me semisep
| Ast.StMod (_, s, me) ->
- pp f "@[<2>module %a =@ %a%s@]" o#var s
+ pp f "@[<2>module %a =@ %a%(%)@]" o#var s
o#module_expr me semisep
| Ast.StMty (_, s, mt) ->
- pp f "@[<2>module type %a =@ %a%s@]" o#var s
+ pp f "@[<2>module type %a =@ %a%(%)@]" o#var s
o#module_type mt semisep
| Ast.StOpn (_, sl) ->
- pp f "@[<2>open@ %a%s@]" o#ident sl semisep
+ pp f "@[<2>open@ %a%(%)@]" o#ident sl semisep
| Ast.StTyp (_, t) ->
- pp f "@[<hv0>@[<hv2>type %a@]%s@]" o#ctyp t semisep
+ pp f "@[<hv0>@[<hv2>type %a@]%(%)@]" o#ctyp t
+ semisep
| Ast.StVal (_, r, bi) ->
- pp f "@[<2>%s %a%a%s@]" value_let o#rec_flag r
+ pp f "@[<2>%s %a%a%(%)@]" value_let o#rec_flag r
o#binding bi semisep
| Ast.StExp (_, e) ->
- pp f "@[<2>let _ =@ %a%s@]" o#expr e semisep
+ pp f "@[<2>let _ =@ %a%(%)@]" o#expr e semisep
| Ast.StInc (_, me) ->
- pp f "@[<2>include@ %a%s@]" o#module_expr me
+ pp f "@[<2>include@ %a%(%)@]" o#module_expr me
semisep
| Ast.StClt (_, ct) ->
- pp f "@[<2>class type %a%s@]" o#class_type ct
+ pp f "@[<2>class type %a%(%)@]" o#class_type ct
semisep
| Ast.StCls (_, ce) ->
- pp f "@[<hv2>class %a%s@]" o#class_declaration ce
+ pp f "@[<hv2>class %a%(%)@]" o#class_declaration ce
semisep
| Ast.StRecMod (_, mb) ->
- pp f "@[<2>module rec %a%s@]" o#module_rec_binding
- mb semisep
+ pp f "@[<2>module rec %a%(%)@]"
+ o#module_rec_binding mb semisep
| Ast.StDir (_, _, _) -> ()
- | Ast.StAnt (_, s) -> pp f "%a%s" o#anti s semisep
+ | Ast.StAnt (_, s) -> pp f "%a%(%)" o#anti s semisep
| Ast.StExc (_, _, (Ast.OAnt _)) -> assert false
+
method module_type =
fun f mt ->
let () = o#node f mt Ast.loc_of_module_type
| Ast.MtWit (_, mt, wc) ->
pp f "@[<2>%a@ with@ %a@]" o#module_type mt
o#with_constraint wc
+
method with_constraint =
fun f wc ->
let () = o#node f wc Ast.loc_of_with_constr
pp f andsep;
o#with_constraint f wc2)
| Ast.WcAnt (_, s) -> o#anti f s
+
method module_expr =
fun f me ->
let () = o#node f me Ast.loc_of_module_expr
| Ast.MeTyc (_, me, mt) ->
pp f "@[<1>(%a :@ %a)@]" o#module_expr me
o#module_type mt
+
method class_expr =
fun f ce ->
let () = o#node f ce Ast.loc_of_class_expr
pp f "@[<2>%a =@]@ %a" o#class_expr ce1
o#class_expr ce2
| _ -> assert false
+
method class_type =
fun f ct ->
let () = o#node f ct Ast.loc_of_class_type
| Ast.CtEq (_, ct1, ct2) ->
pp f "%a =@ %a" o#class_type ct1 o#class_type ct2
| _ -> assert false
+
method class_sig_item =
fun f csg ->
let () = o#node f csg Ast.loc_of_class_sig_item
cut f;
o#class_sig_item f csg2)
| Ast.CgCtr (_, t1, t2) ->
- pp f "@[<2>type@ %a =@ %a%s@]" o#ctyp t1 o#ctyp t2
- semisep
+ pp f "@[<2>constraint@ %a =@ %a%(%)@]" o#ctyp t1
+ o#ctyp t2 semisep
| Ast.CgInh (_, ct) ->
- pp f "@[<2>inherit@ %a%s@]" o#class_type ct semisep
+ pp f "@[<2>inherit@ %a%(%)@]" o#class_type ct
+ semisep
| Ast.CgMth (_, s, pr, t) ->
- pp f "@[<2>method %a%a :@ %a%s@]" o#private_flag pr
- o#var s o#ctyp t semisep
+ pp f "@[<2>method %a%a :@ %a%(%)@]" o#private_flag
+ pr o#var s o#ctyp t semisep
| Ast.CgVir (_, s, pr, t) ->
- pp f "@[<2>method virtual %a%a :@ %a%s@]"
+ pp f "@[<2>method virtual %a%a :@ %a%(%)@]"
o#private_flag pr o#var s o#ctyp t semisep
| Ast.CgVal (_, s, mu, vi, t) ->
- pp f "@[<2>%s %a%a%a :@ %a%s@]" value_val
+ pp f "@[<2>%s %a%a%a :@ %a%(%)@]" value_val
o#mutable_flag mu o#virtual_flag vi o#var s
o#ctyp t semisep
- | Ast.CgAnt (_, s) -> pp f "%a%s" o#anti s semisep
+ | Ast.CgAnt (_, s) -> pp f "%a%(%)" o#anti s semisep
+
method class_str_item =
fun f cst ->
let () = o#node f cst Ast.loc_of_class_str_item
cut f;
o#class_str_item f cst2)
| Ast.CrCtr (_, t1, t2) ->
- pp f "@[<2>type %a =@ %a%s@]" o#ctyp t1 o#ctyp t2
- semisep
+ pp f "@[<2>constraint %a =@ %a%(%)@]" o#ctyp t1
+ o#ctyp t2 semisep
| Ast.CrInh (_, ce, "") ->
- pp f "@[<2>inherit@ %a%s@]" o#class_expr ce semisep
+ pp f "@[<2>inherit@ %a%(%)@]" o#class_expr ce
+ semisep
| Ast.CrInh (_, ce, s) ->
- pp f "@[<2>inherit@ %a as@ %a%s@]" o#class_expr ce
- o#var s semisep
+ pp f "@[<2>inherit@ %a as@ %a%(%)@]" o#class_expr
+ ce o#var s semisep
| Ast.CrIni (_, e) ->
- pp f "@[<2>initializer@ %a%s@]" o#expr e semisep
+ pp f "@[<2>initializer@ %a%(%)@]" o#expr e semisep
| Ast.CrMth (_, s, pr, e, (Ast.TyNil _)) ->
- pp f "@[<2>method %a%a =@ %a%s@]" o#private_flag pr
- o#var s o#expr e semisep
+ pp f "@[<2>method %a%a =@ %a%(%)@]" o#private_flag
+ pr o#var s o#expr e semisep
| Ast.CrMth (_, s, pr, e, t) ->
- pp f "@[<2>method %a%a :@ %a =@ %a%s@]"
+ pp f "@[<2>method %a%a :@ %a =@ %a%(%)@]"
o#private_flag pr o#var s o#ctyp t o#expr e
semisep
| Ast.CrVir (_, s, pr, t) ->
- pp f "@[<2>method virtual@ %a%a :@ %a%s@]"
+ pp f "@[<2>method virtual@ %a%a :@ %a%(%)@]"
o#private_flag pr o#var s o#ctyp t semisep
| Ast.CrVvr (_, s, mu, t) ->
- pp f "@[<2>%s virtual %a%a :@ %a%s@]" value_val
+ pp f "@[<2>%s virtual %a%a :@ %a%(%)@]" value_val
o#mutable_flag mu o#var s o#ctyp t semisep
| Ast.CrVal (_, s, mu, e) ->
- pp f "@[<2>%s %a%a =@ %a%s@]" value_val
+ pp f "@[<2>%s %a%a =@ %a%(%)@]" value_val
o#mutable_flag mu o#var s o#expr e semisep
- | Ast.CrAnt (_, s) -> pp f "%a%s" o#anti s semisep
+ | Ast.CrAnt (_, s) -> pp f "%a%(%)" o#anti s semisep
+
method implem =
fun f st ->
match st with
| Ast.StExp (_, e) ->
- pp f "@[<0>%a%s@]@." o#expr e semisep
+ pp f "@[<0>%a%(%)@]@." o#expr e semisep
| st -> pp f "@[<v0>%a@]@." o#str_item st
+
method interf = fun f sg -> pp f "@[<v0>%a@]@." o#sig_item sg
+
end
+
let with_outfile output_file fct arg =
let call close f =
((try fct f arg with | exn -> (close (); raise exn));
let oc = open_out s in
let f = formatter_of_out_channel oc
in call (fun () -> close_out oc) f
+
let print output_file fct =
let o = new printer () in with_outfile output_file (fct o)
+
let print_interf ?input_file:(_) ?output_file sg =
print output_file (fun o -> o#interf) sg
+
let print_implem ?input_file:(_) ?output_file st =
print output_file (fun o -> o#implem) st
+
end
+
module MakeMore (Syntax : Sig.Camlp4Syntax) : Sig.Printer(Syntax.
Ast).S =
struct
include Make(Syntax)
- let semisep = ref false
+
+ let semisep : sep ref = ref ("@\n" : sep)
+
let margin = ref 78
+
let comments = ref true
+
let locations = ref false
+
let curry_constr = ref false
+
let print output_file fct =
let o =
new printer ~comments: !comments ~curry_constr: !curry_constr
() in
- let o =
- if !semisep then o#set_semisep ";;" else o#set_semisep "" in
+ let o = o#set_semisep !semisep in
let o = if !locations then o#set_loc_and_comments else o
in
with_outfile output_file
(fun f ->
let () = Format.pp_set_margin f !margin
in Format.fprintf f "@[<v0>%a@]@." (fct o))
+
let print_interf ?input_file:(_) ?output_file sg =
print output_file (fun o -> o#interf) sg
+
let print_implem ?input_file:(_) ?output_file st =
print output_file (fun o -> o#implem) st
+
+ let check_sep s =
+ if String.contains s '%'
+ then failwith "-sep Format error, % found in string"
+ else (Obj.magic (Struct.Token.Eval.string s : string) : sep)
+
let _ =
Options.add "-l" (Arg.Int (fun i -> margin := i))
"<length> line length for pretty printing."
+
let _ =
- Options.add "-ss" (Arg.Set semisep) "Print double semicolons."
+ Options.add "-ss" (Arg.Unit (fun () -> semisep := ";;"))
+ " Print double semicolons."
+
+ let _ =
+ Options.add "-no_ss" (Arg.Unit (fun () -> semisep := ""))
+ " Do not print double semicolons (default)."
+
+ let _ =
+ Options.add "-sep"
+ (Arg.String (fun s -> semisep := check_sep s))
+ " Use this string between phrases."
+
let _ =
Options.add "-curry-constr" (Arg.Set curry_constr)
"Use currified constructors."
- let _ =
- Options.add "-no_ss" (Arg.Clear semisep)
- "Do not print double semicolons (default)."
+
let _ =
Options.add "-no_comments" (Arg.Clear comments)
"Do not add comments."
+
let _ =
Options.add "-add_locations" (Arg.Set locations)
"Add locations as comment."
+
end
+
end
+
module OCamlr :
sig
module Id : Sig.Id
+
module Make (Syntax : Sig.Camlp4Syntax) :
sig
open Format
+
include Sig.Camlp4Syntax with module Loc = Syntax.Loc
and module Token = Syntax.Token and module Ast = Syntax.Ast
and module Gram = Syntax.Gram
+
class printer :
?curry_constr: bool ->
?comments: bool ->
- unit -> object ('a) inherit OCaml.Make(Syntax).printer end
+ unit -> object ('a) inherit OCaml.Make(Syntax).printer
+ end
+
val with_outfile :
string option -> (formatter -> 'a -> unit) -> 'a -> unit
+
val print :
string option ->
(printer -> formatter -> 'a -> unit) -> 'a -> unit
+
end
+
module MakeMore (Syntax : Sig.Camlp4Syntax) : Sig.Printer(Syntax.
Ast).S
+
end =
struct
open Format
+
module Id =
- struct
- let name = "Camlp4.Printers.OCamlr"
- let version =
- "$Id: OCamlr.ml,v 1.17.4.3 2007/05/10 13:31:20 pouillar Exp $"
- end
+ struct let name = "Camlp4.Printers.OCamlr"
+ let version = "$Id$"
+ end
+
module Make (Syntax : Sig.Camlp4Syntax) =
struct
include Syntax
+
open Sig
+
module PP_o = OCaml.Make(Syntax)
+
open PP_o
+
let pp = fprintf
+
let is_keyword =
let keywords = [ "where" ]
and not_keywords = [ "false"; "function"; "true"; "val" ]
fun s ->
(not (List.mem s not_keywords)) &&
((is_keyword s) || (List.mem s keywords))
+
class printer ?curry_constr:(init_curry_constr = true)
?(comments = true) () =
object (o)
inherit
PP_o.printer ~curry_constr: init_curry_constr ~comments () as
super
- val semisep = ";"
- val andsep =
- ("@]@ @[<2>and@ " : (unit, formatter, unit) format)
+
+ val semisep = (";" : sep)
+
+ val andsep = ("@]@ @[<2>and@ " : sep)
+
val value_val = "value"
+
val value_let = "value"
+
val mode = if comments then `comments else `no_comments
+
val curry_constr = init_curry_constr
+
val first_match_case = true
+
method under_pipe = o
+
method under_semi = o
+
method reset_semi = o
+
method reset = o
+
method private unset_first_match_case =
{< first_match_case = false; >}
+
method private set_first_match_case =
{< first_match_case = true; >}
+
method seq =
fun f e ->
let rec self right f e =
| _ -> go_right f e2))
| e -> o#expr f e
in self true f e
+
method var =
fun f ->
function
failwith
(sprintf "Bad token used as an identifier: %s"
(Token.to_string tok)))
+
method type_params =
fun f ->
function
| [] -> ()
| [ x ] -> pp f "@ %a" o#ctyp x
| l -> pp f "@ @[<1>%a@]" (list o#ctyp "@ ") l
+
method match_case =
fun f ->
function
| m ->
pp f "@ [ %a ]" o#set_first_match_case#match_case_aux
m
+
method match_case_aux =
fun f ->
function
in
pp f "@[<2>%a@ when@ %a@ ->@ %a@]" o#patt p
o#under_pipe#expr w o#under_pipe#expr e
+
method sum_type = fun f t -> pp f "@[<hv0>[ %a ]@]" o#ctyp t
+
method ident =
fun f i ->
let () = o#node f i Ast.loc_of_ident
| Ast.IdApp (_, i1, i2) ->
pp f "%a@ %a" o#dot_ident i1 o#dot_ident i2
| i -> o#dot_ident f i
+
method private dot_ident =
fun f i ->
let () = o#node f i Ast.loc_of_ident
| Ast.IdAnt (_, s) -> o#anti f s
| Ast.IdLid (_, s) | Ast.IdUid (_, s) -> o#var f s
| i -> pp f "(%a)" o#ident i
+
method patt4 =
fun f ->
function
pp f "@[<2>[ %a ::@ %a ]@]"
(list o#patt ";@ ") pl o#patt x)
| p -> super#patt4 f p
+
method expr_list_cons =
fun _ f e ->
let (el, c) = o#mk_expr_list e
| Some x ->
pp f "@[<2>[ %a ::@ %a ]@]" (list o#expr ";@ ") el
o#expr x
+
method expr =
fun f e ->
let () = o#node f e Ast.loc_of_expr
in
match e with
| Ast.ExAss (_, e1, e2) ->
- pp f "@[<2>%a@ :=@ %a@]" o#expr e1 o#expr e2
+ pp f "@[<2>%a@ :=@ %a@]" o#dot_expr e1 o#expr e2
| Ast.ExFun (_, (Ast.McArr (_, p, (Ast.ExNil _), e)))
when Ast.is_irrefut_patt p ->
pp f "@[<2>fun@ %a@]" o#patt_expr_fun_args (p, e)
pp f "@[<hv0>fun%a@]" o#match_case a
| Ast.ExAsf _ -> pp f "@[<2>assert@ False@]"
| e -> super#expr f e
+
method dot_expr =
fun f e ->
let () = o#node f e Ast.loc_of_expr
(Ast.ExId (_, (Ast.IdLid (_, "val"))))) ->
pp f "@[<2>%a.@,val@]" o#simple_expr e
| e -> super#dot_expr f e
+
method ctyp =
fun f t ->
let () = o#node f t Ast.loc_of_ctyp
| Ast.TyCol (_, t1, (Ast.TyMut (_, t2))) ->
pp f "@[%a :@ mutable %a@]" o#ctyp t1 o#ctyp t2
| t -> super#ctyp f t
+
method simple_ctyp =
fun f t ->
let () = o#node f t Ast.loc_of_ctyp
| Ast.TyLab (_, s, t) ->
pp f "@[<2>~%s:@ %a@]" s o#simple_ctyp t
| t -> super#simple_ctyp f t
+
method ctyp1 =
fun f ->
function
pp f "@[<2>! %a.@ %a@]" (list o#ctyp "@ ")
(a :: al) o#ctyp t2
| t -> super#ctyp1 f t
+
method constructor_type =
fun f t ->
match t with
pp f "%a@ and %a" o#constructor_type t1
o#constructor_type t2
| t -> o#ctyp f t
+
method str_item =
fun f st ->
match st with
- | Ast.StExp (_, e) -> pp f "@[<2>%a%s@]" o#expr e semisep
+ | Ast.StExp (_, e) ->
+ pp f "@[<2>%a%(%)@]" o#expr e semisep
| st -> super#str_item f st
+
method module_expr =
fun f me ->
let () = o#node f me Ast.loc_of_module_expr
pp f "@[<2>%a@,(%a)@]" o#module_expr me1
o#module_expr me2
| me -> super#module_expr f me
+
method implem = fun f st -> pp f "@[<v0>%a@]@." o#str_item st
+
method class_type =
fun f ct ->
let () = o#node f ct Ast.loc_of_class_type
pp f "@[<2>virtual@ %a@ [@,%a@]@,]" o#var i
o#class_params t
| ct -> super#class_type f ct
+
method class_expr =
fun f ce ->
let () = o#node f ce Ast.loc_of_class_expr
pp f "@[<2>virtual@ %a@ @[<1>[%a]@]@]" o#var i
o#ctyp t
| ce -> super#class_expr f ce
+
end
+
let with_outfile = with_outfile
+
let print = print
+
let print_interf = print_interf
+
let print_implem = print_implem
+
end
+
module MakeMore (Syntax : Sig.Camlp4Syntax) : Sig.Printer(Syntax.
Ast).S =
struct
include Make(Syntax)
+
let margin = ref 78
+
let comments = ref true
+
let locations = ref false
+
let curry_constr = ref true
+
let print output_file fct =
let o =
new printer ~comments: !comments ~curry_constr: !curry_constr
(fun f ->
let () = Format.pp_set_margin f !margin
in Format.fprintf f "@[<v0>%a@]@." (fct o))
+
let print_interf ?input_file:(_) ?output_file sg =
print output_file (fun o -> o#interf) sg
+
let print_implem ?input_file:(_) ?output_file st =
print output_file (fun o -> o#implem) st
+
let _ =
Options.add "-l" (Arg.Int (fun i -> margin := i))
"<length> line length for pretty printing."
+
let _ =
Options.add "-no_comments" (Arg.Clear comments)
"Do not add comments."
+
let _ =
Options.add "-add_locations" (Arg.Set locations)
"Add locations as comment."
+
end
+
end
+
end
+
module OCamlInitSyntax =
struct
module Make
(Quotation : Sig.Quotation with module Ast = Sig.Camlp4AstToAst(Ast)) :
Sig.Camlp4Syntax with module Loc = Ast.Loc and module Ast = Ast
and module Token = Gram.Token and module Gram = Gram
- and module AntiquotSyntax.Ast = Sig.Camlp4AstToAst(Ast)
and module Quotation = Quotation =
struct
module Loc = Ast.Loc
+
module Ast = Ast
+
module Gram = Gram
+
module Token = Gram.Token
+
open Sig
+
type warning = Loc.t -> string -> unit
+
let default_warning loc txt =
Format.eprintf "<W> %a: %s@." Loc.print loc txt
+
let current_warning = ref default_warning
+
let print_warning loc txt = !current_warning loc txt
+
let a_CHAR = Gram.Entry.mk "a_CHAR"
+
let a_FLOAT = Gram.Entry.mk "a_FLOAT"
+
let a_INT = Gram.Entry.mk "a_INT"
+
let a_INT32 = Gram.Entry.mk "a_INT32"
+
let a_INT64 = Gram.Entry.mk "a_INT64"
+
let a_LABEL = Gram.Entry.mk "a_LABEL"
+
let a_LIDENT = Gram.Entry.mk "a_LIDENT"
+
let a_NATIVEINT = Gram.Entry.mk "a_NATIVEINT"
+
let a_OPTLABEL = Gram.Entry.mk "a_OPTLABEL"
+
let a_STRING = Gram.Entry.mk "a_STRING"
+
let a_UIDENT = Gram.Entry.mk "a_UIDENT"
+
let a_ident = Gram.Entry.mk "a_ident"
+
let amp_ctyp = Gram.Entry.mk "amp_ctyp"
+
let and_ctyp = Gram.Entry.mk "and_ctyp"
+
let match_case = Gram.Entry.mk "match_case"
+
let match_case0 = Gram.Entry.mk "match_case0"
+
let binding = Gram.Entry.mk "binding"
+
let class_declaration = Gram.Entry.mk "class_declaration"
+
let class_description = Gram.Entry.mk "class_description"
+
let class_expr = Gram.Entry.mk "class_expr"
+
let class_fun_binding = Gram.Entry.mk "class_fun_binding"
+
let class_fun_def = Gram.Entry.mk "class_fun_def"
+
let class_info_for_class_expr =
Gram.Entry.mk "class_info_for_class_expr"
+
let class_info_for_class_type =
Gram.Entry.mk "class_info_for_class_type"
+
let class_longident = Gram.Entry.mk "class_longident"
+
let class_longident_and_param =
Gram.Entry.mk "class_longident_and_param"
+
let class_name_and_param = Gram.Entry.mk "class_name_and_param"
+
let class_sig_item = Gram.Entry.mk "class_sig_item"
+
let class_signature = Gram.Entry.mk "class_signature"
+
let class_str_item = Gram.Entry.mk "class_str_item"
+
let class_structure = Gram.Entry.mk "class_structure"
+
let class_type = Gram.Entry.mk "class_type"
+
let class_type_declaration = Gram.Entry.mk "class_type_declaration"
+
let class_type_longident = Gram.Entry.mk "class_type_longident"
+
let class_type_longident_and_param =
Gram.Entry.mk "class_type_longident_and_param"
+
let class_type_plus = Gram.Entry.mk "class_type_plus"
+
let comma_ctyp = Gram.Entry.mk "comma_ctyp"
+
let comma_expr = Gram.Entry.mk "comma_expr"
+
let comma_ipatt = Gram.Entry.mk "comma_ipatt"
+
let comma_patt = Gram.Entry.mk "comma_patt"
+
let comma_type_parameter = Gram.Entry.mk "comma_type_parameter"
+
let constrain = Gram.Entry.mk "constrain"
+
let constructor_arg_list = Gram.Entry.mk "constructor_arg_list"
+
let constructor_declaration = Gram.Entry.mk "constructor_declaration"
+
let constructor_declarations =
Gram.Entry.mk "constructor_declarations"
+
let ctyp = Gram.Entry.mk "ctyp"
+
let cvalue_binding = Gram.Entry.mk "cvalue_binding"
+
let direction_flag = Gram.Entry.mk "direction_flag"
+
let dummy = Gram.Entry.mk "dummy"
+
let entry_eoi = Gram.Entry.mk "entry_eoi"
+
let eq_expr = Gram.Entry.mk "eq_expr"
+
let expr = Gram.Entry.mk "expr"
+
let expr_eoi = Gram.Entry.mk "expr_eoi"
+
let field_expr = Gram.Entry.mk "field_expr"
+
let fun_binding = Gram.Entry.mk "fun_binding"
+
let fun_def = Gram.Entry.mk "fun_def"
+
let ident = Gram.Entry.mk "ident"
+
let implem = Gram.Entry.mk "implem"
+
let interf = Gram.Entry.mk "interf"
+
let ipatt = Gram.Entry.mk "ipatt"
+
let ipatt_tcon = Gram.Entry.mk "ipatt_tcon"
+
let label = Gram.Entry.mk "label"
+
let label_declaration = Gram.Entry.mk "label_declaration"
+
let label_expr = Gram.Entry.mk "label_expr"
+
let label_ipatt = Gram.Entry.mk "label_ipatt"
+
let label_longident = Gram.Entry.mk "label_longident"
+
let label_patt = Gram.Entry.mk "label_patt"
+
let labeled_ipatt = Gram.Entry.mk "labeled_ipatt"
+
let let_binding = Gram.Entry.mk "let_binding"
+
let meth_list = Gram.Entry.mk "meth_list"
+
let module_binding = Gram.Entry.mk "module_binding"
+
let module_binding0 = Gram.Entry.mk "module_binding0"
+
let module_declaration = Gram.Entry.mk "module_declaration"
+
let module_expr = Gram.Entry.mk "module_expr"
+
let module_longident = Gram.Entry.mk "module_longident"
+
let module_longident_with_app =
Gram.Entry.mk "module_longident_with_app"
+
let module_rec_declaration = Gram.Entry.mk "module_rec_declaration"
+
let module_type = Gram.Entry.mk "module_type"
+
let more_ctyp = Gram.Entry.mk "more_ctyp"
+
let name_tags = Gram.Entry.mk "name_tags"
+
let opt_as_lident = Gram.Entry.mk "opt_as_lident"
+
let opt_class_self_patt = Gram.Entry.mk "opt_class_self_patt"
+
let opt_class_self_type = Gram.Entry.mk "opt_class_self_type"
+
let opt_class_signature = Gram.Entry.mk "opt_class_signature"
+
let opt_class_structure = Gram.Entry.mk "opt_class_structure"
+
let opt_comma_ctyp = Gram.Entry.mk "opt_comma_ctyp"
+
let opt_dot_dot = Gram.Entry.mk "opt_dot_dot"
+
let opt_eq_ctyp = Gram.Entry.mk "opt_eq_ctyp"
+
let opt_expr = Gram.Entry.mk "opt_expr"
+
let opt_meth_list = Gram.Entry.mk "opt_meth_list"
+
let opt_mutable = Gram.Entry.mk "opt_mutable"
+
let opt_polyt = Gram.Entry.mk "opt_polyt"
+
let opt_private = Gram.Entry.mk "opt_private"
+
let opt_rec = Gram.Entry.mk "opt_rec"
+
let opt_sig_items = Gram.Entry.mk "opt_sig_items"
+
let opt_str_items = Gram.Entry.mk "opt_str_items"
+
let opt_virtual = Gram.Entry.mk "opt_virtual"
+
let opt_when_expr = Gram.Entry.mk "opt_when_expr"
+
let patt = Gram.Entry.mk "patt"
+
let patt_as_patt_opt = Gram.Entry.mk "patt_as_patt_opt"
+
let patt_eoi = Gram.Entry.mk "patt_eoi"
+
let patt_tcon = Gram.Entry.mk "patt_tcon"
+
let phrase = Gram.Entry.mk "phrase"
+
let poly_type = Gram.Entry.mk "poly_type"
+
let row_field = Gram.Entry.mk "row_field"
+
let sem_expr = Gram.Entry.mk "sem_expr"
+
let sem_expr_for_list = Gram.Entry.mk "sem_expr_for_list"
+
let sem_patt = Gram.Entry.mk "sem_patt"
+
let sem_patt_for_list = Gram.Entry.mk "sem_patt_for_list"
+
let semi = Gram.Entry.mk "semi"
+
let sequence = Gram.Entry.mk "sequence"
+
let do_sequence = Gram.Entry.mk "do_sequence"
+
let sig_item = Gram.Entry.mk "sig_item"
+
let sig_items = Gram.Entry.mk "sig_items"
+
let star_ctyp = Gram.Entry.mk "star_ctyp"
+
let str_item = Gram.Entry.mk "str_item"
+
let str_items = Gram.Entry.mk "str_items"
+
let top_phrase = Gram.Entry.mk "top_phrase"
+
let type_constraint = Gram.Entry.mk "type_constraint"
+
let type_declaration = Gram.Entry.mk "type_declaration"
+
let type_ident_and_parameters =
Gram.Entry.mk "type_ident_and_parameters"
+
let type_kind = Gram.Entry.mk "type_kind"
+
let type_longident = Gram.Entry.mk "type_longident"
+
let type_longident_and_parameters =
Gram.Entry.mk "type_longident_and_parameters"
+
let type_parameter = Gram.Entry.mk "type_parameter"
+
let type_parameters = Gram.Entry.mk "type_parameters"
+
let typevars = Gram.Entry.mk "typevars"
+
let use_file = Gram.Entry.mk "use_file"
+
let val_longident = Gram.Entry.mk "val_longident"
+
let value_let = Gram.Entry.mk "value_let"
+
let value_val = Gram.Entry.mk "value_val"
+
let with_constr = Gram.Entry.mk "with_constr"
+
let expr_quot = Gram.Entry.mk "quotation of expression"
+
let patt_quot = Gram.Entry.mk "quotation of pattern"
+
let ctyp_quot = Gram.Entry.mk "quotation of type"
+
let str_item_quot = Gram.Entry.mk "quotation of structure item"
+
let sig_item_quot = Gram.Entry.mk "quotation of signature item"
+
let class_str_item_quot =
Gram.Entry.mk "quotation of class structure item"
+
let class_sig_item_quot =
Gram.Entry.mk "quotation of class signature item"
+
let module_expr_quot = Gram.Entry.mk "quotation of module expression"
+
let module_type_quot = Gram.Entry.mk "quotation of module type"
+
let class_type_quot = Gram.Entry.mk "quotation of class type"
+
let class_expr_quot = Gram.Entry.mk "quotation of class expression"
+
let with_constr_quot = Gram.Entry.mk "quotation of with constraint"
+
let binding_quot = Gram.Entry.mk "quotation of binding"
+
let rec_binding_quot = Gram.Entry.mk "quotation of record binding"
+
let match_case_quot =
Gram.Entry.mk "quotation of match_case (try/match/function case)"
+
let module_binding_quot =
Gram.Entry.mk "quotation of module rec binding"
+
let ident_quot = Gram.Entry.mk "quotation of identifier"
+
let prefixop =
Gram.Entry.mk "prefix operator (start with '!', '?', '~')"
+
let infixop0 =
Gram.Entry.mk
"infix operator (level 0) (comparison operators, and some others)"
+
let infixop1 =
Gram.Entry.mk "infix operator (level 1) (start with '^', '@')"
+
let infixop2 =
Gram.Entry.mk "infix operator (level 2) (start with '+', '-')"
+
let infixop3 =
Gram.Entry.mk "infix operator (level 3) (start with '*', '/', '%')"
+
let infixop4 =
Gram.Entry.mk
"infix operator (level 4) (start with \"**\") (right assoc)"
+
let _ =
Gram.extend (top_phrase : 'top_phrase Gram.Entry.t)
((fun () ->
[ ([ Gram.Stoken
(((function | EOI -> true | _ -> false), "EOI")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t) ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| EOI -> (None : 'top_phrase)
| _ -> assert false))) ]) ]))
())
+
module AntiquotSyntax =
struct
module Loc = Ast.Loc
+
module Ast = Sig.Camlp4AstToAst(Ast)
+
module Gram = Gram
+
let antiquot_expr = Gram.Entry.mk "antiquot_expr"
+
let antiquot_patt = Gram.Entry.mk "antiquot_patt"
+
let _ =
(Gram.extend (antiquot_expr : 'antiquot_expr Gram.Entry.t)
((fun () ->
"EOI")) ],
(Gram.Action.mk
(fun (__camlp4_0 : Gram.Token.t) (x : 'expr)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| EOI -> (x : 'antiquot_expr)
| _ -> assert false))) ]) ]))
"EOI")) ],
(Gram.Action.mk
(fun (__camlp4_0 : Gram.Token.t) (x : 'patt)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| EOI -> (x : 'antiquot_patt)
| _ -> assert false))) ]) ]))
()))
+
let parse_expr loc str = Gram.parse_string antiquot_expr loc str
+
let parse_patt loc str = Gram.parse_string antiquot_patt loc str
+
end
+
module Quotation = Quotation
+
let wrap directive_handler pa init_loc cs =
let rec loop loc =
let (pl, stopped_at_directive) = pa loc cs
in (List.rev pl) @ (loop new_loc)
| None -> pl
in loop init_loc
+
let parse_implem ?(directive_handler = fun _ -> None) _loc cs =
let l = wrap directive_handler (Gram.parse implem) _loc cs
in Ast.stSem_of_list l
+
let parse_interf ?(directive_handler = fun _ -> None) _loc cs =
let l = wrap directive_handler (Gram.parse interf) _loc cs
in Ast.sgSem_of_list l
+
let print_interf ?input_file:(_) ?output_file:(_) _ =
failwith "No interface printer"
+
let print_implem ?input_file:(_) ?output_file:(_) _ =
failwith "No implementation printer"
+
end
+
end
+
module PreCast :
sig
type camlp4_token =
Sig.camlp4_token =
- | KEYWORD of string | SYMBOL of string | LIDENT of string
- | UIDENT of string | ESCAPED_IDENT of string | INT of int * string
- | INT32 of int32 * string | INT64 of int64 * string
- | NATIVEINT of nativeint * string | FLOAT of float * string
- | CHAR of char * string | STRING of string * string | LABEL of string
- | OPTLABEL of string | QUOTATION of Sig.quotation
- | ANTIQUOT of string * string | COMMENT of string | BLANKS of string
- | NEWLINE | LINE_DIRECTIVE of int * string option | EOI
+ | KEYWORD of string
+ | SYMBOL of string
+ | LIDENT of string
+ | UIDENT of string
+ | ESCAPED_IDENT of string
+ | INT of int * string
+ | INT32 of int32 * string
+ | INT64 of int64 * string
+ | NATIVEINT of nativeint * string
+ | FLOAT of float * string
+ | CHAR of char * string
+ | STRING of string * string
+ | LABEL of string
+ | OPTLABEL of string
+ | QUOTATION of Sig.quotation
+ | ANTIQUOT of string * string
+ | COMMENT of string
+ | BLANKS of string
+ | NEWLINE
+ | LINE_DIRECTIVE of int * string option
+ | EOI
+
module Id : Sig.Id
+
module Loc : Sig.Loc
+
module Ast : Sig.Camlp4Ast with module Loc = Loc
+
module Token : Sig.Token with module Loc = Loc and type t = camlp4_token
+
module Lexer : Sig.Lexer with module Loc = Loc and module Token = Token
+
module Gram : Sig.Grammar.Static with module Loc = Loc
and module Token = Token
+
module Quotation :
Sig.Quotation with module Ast = Sig.Camlp4AstToAst(Ast)
+
module DynLoader : Sig.DynLoader
+
module AstFilters : Sig.AstFilters with module Ast = Ast
+
module Syntax : Sig.Camlp4Syntax with module Loc = Loc
and module Token = Token and module Ast = Ast and module Gram = Gram
and module Quotation = Quotation
+
module Printers :
sig
module OCaml : Sig.Printer(Ast).S
+
module OCamlr : Sig.Printer(Ast).S
+
module DumpOCamlAst : Sig.Printer(Ast).S
+
module DumpCamlp4Ast : Sig.Printer(Ast).S
+
module Null : Sig.Printer(Ast).S
+
end
+
module MakeGram (Lexer : Sig.Lexer with module Loc = Loc) :
Sig.Grammar.Static with module Loc = Loc and module Token = Lexer.Token
+
module MakeSyntax (U : sig end) : Sig.Syntax
+
end =
struct
- module Id =
- struct
- let name = "Camlp4.PreCast"
- let version =
- "$Id: PreCast.ml,v 1.4.4.1 2007/03/30 15:50:12 pouillar Exp $"
- end
+ module Id = struct let name = "Camlp4.PreCast"
+ let version = "$Id$"
+ end
+
type camlp4_token =
Sig.camlp4_token =
- | KEYWORD of string | SYMBOL of string | LIDENT of string
- | UIDENT of string | ESCAPED_IDENT of string | INT of int * string
- | INT32 of int32 * string | INT64 of int64 * string
- | NATIVEINT of nativeint * string | FLOAT of float * string
- | CHAR of char * string | STRING of string * string | LABEL of string
- | OPTLABEL of string | QUOTATION of Sig.quotation
- | ANTIQUOT of string * string | COMMENT of string | BLANKS of string
- | NEWLINE | LINE_DIRECTIVE of int * string option | EOI
+ | KEYWORD of string
+ | SYMBOL of string
+ | LIDENT of string
+ | UIDENT of string
+ | ESCAPED_IDENT of string
+ | INT of int * string
+ | INT32 of int32 * string
+ | INT64 of int64 * string
+ | NATIVEINT of nativeint * string
+ | FLOAT of float * string
+ | CHAR of char * string
+ | STRING of string * string
+ | LABEL of string
+ | OPTLABEL of string
+ | QUOTATION of Sig.quotation
+ | ANTIQUOT of string * string
+ | COMMENT of string
+ | BLANKS of string
+ | NEWLINE
+ | LINE_DIRECTIVE of int * string option
+ | EOI
+
module Loc = Struct.Loc
+
module Ast = Struct.Camlp4Ast.Make(Loc)
+
module Token = Struct.Token.Make(Loc)
+
module Lexer = Struct.Lexer.Make(Token)
+
module Gram = Struct.Grammar.Static.Make(Lexer)
+
module DynLoader = Struct.DynLoader
+
module Quotation = Struct.Quotation.Make(Ast)
+
module MakeSyntax (U : sig end) =
OCamlInitSyntax.Make(Ast)(Gram)(Quotation)
+
module Syntax = MakeSyntax(struct end)
+
module AstFilters = Struct.AstFilters.Make(Ast)
+
module MakeGram = Struct.Grammar.Static.Make
+
module Printers =
struct
module OCaml = Printers.OCaml.Make(Syntax)
+
module OCamlr = Printers.OCamlr.Make(Syntax)
+
module DumpOCamlAst = Printers.DumpOCamlAst.Make(Syntax)
+
module DumpCamlp4Ast = Printers.DumpCamlp4Ast.Make(Syntax)
+
module Null = Printers.Null.Make(Syntax)
+
end
+
end
+
module Register :
sig
module Plugin
(Id : Sig.Id) (Plugin : functor (Unit : sig end) -> sig end) :
sig end
+
module SyntaxPlugin
(Id : Sig.Id) (SyntaxPlugin : functor (Syn : Sig.Syntax) -> sig end) :
sig end
+
module SyntaxExtension
(Id : Sig.Id) (SyntaxExtension : Sig.SyntaxExtension) : sig end
+
module OCamlSyntaxExtension
(Id : Sig.Id)
(SyntaxExtension :
functor (Syntax : Sig.Camlp4Syntax) -> Sig.Camlp4Syntax) :
sig end
+
type 'a parser_fun =
?directive_handler: ('a -> 'a option) ->
PreCast.Loc.t -> char Stream.t -> 'a
+
val register_str_item_parser : PreCast.Ast.str_item parser_fun -> unit
+
val register_sig_item_parser : PreCast.Ast.sig_item parser_fun -> unit
+
val register_parser :
PreCast.Ast.str_item parser_fun ->
PreCast.Ast.sig_item parser_fun -> unit
+
module Parser
(Id : Sig.Id) (Maker : functor (Ast : Sig.Ast) -> Sig.Parser(Ast).S) :
sig end
+
module OCamlParser
(Id : Sig.Id)
(Maker : functor (Ast : Sig.Camlp4Ast) -> Sig.Parser(Ast).S) :
sig end
+
module OCamlPreCastParser
(Id : Sig.Id) (Parser : Sig.Parser(PreCast.Ast).S) : sig end
+
type 'a printer_fun =
?input_file: string -> ?output_file: string -> 'a -> unit
+
val register_str_item_printer : PreCast.Ast.str_item printer_fun -> unit
+
val register_sig_item_printer : PreCast.Ast.sig_item printer_fun -> unit
+
val register_printer :
PreCast.Ast.str_item printer_fun ->
PreCast.Ast.sig_item printer_fun -> unit
+
module Printer
(Id : Sig.Id)
(Maker : functor (Syn : Sig.Syntax) -> Sig.Printer(Syn.Ast).S) :
sig end
+
module OCamlPrinter
(Id : Sig.Id)
(Maker : functor (Syn : Sig.Camlp4Syntax) -> Sig.Printer(Syn.Ast).S) :
sig end
+
module OCamlPreCastPrinter
(Id : Sig.Id) (Printer : Sig.Printer(PreCast.Ast).S) : sig end
+
module AstFilter
(Id : Sig.Id) (Maker : functor (F : Sig.AstFilters) -> sig end) :
sig end
+
val declare_dyn_module : string -> (unit -> unit) -> unit
+
val iter_and_take_callbacks : ((string * (unit -> unit)) -> unit) -> unit
+
val loaded_modules : (string list) ref
+
module CurrentParser : Sig.Parser(PreCast.Ast).S
+
module CurrentPrinter : Sig.Printer(PreCast.Ast).S
+
val enable_ocaml_printer : unit -> unit
+
val enable_ocamlr_printer : unit -> unit
+
val enable_null_printer : unit -> unit
+
val enable_dump_ocaml_ast_printer : unit -> unit
+
val enable_dump_camlp4_ast_printer : unit -> unit
+
end =
struct
module PP = Printers
+
open PreCast
+
type 'a parser_fun =
?directive_handler: ('a -> 'a option) ->
PreCast.Loc.t -> char Stream.t -> 'a
+
type 'a printer_fun =
?input_file: string -> ?output_file: string -> 'a -> unit
+
let sig_item_parser =
ref (fun ?directive_handler:(_) _ _ -> failwith "No interface parser")
+
let str_item_parser =
ref
(fun ?directive_handler:(_) _ _ ->
failwith "No implementation parser")
+
let sig_item_printer =
ref
(fun ?input_file:(_) ?output_file:(_) _ ->
failwith "No interface printer")
+
let str_item_printer =
ref
(fun ?input_file:(_) ?output_file:(_) _ ->
failwith "No implementation printer")
+
let callbacks = Queue.create ()
+
let loaded_modules = ref []
+
let iter_and_take_callbacks f =
let rec loop () = loop (f (Queue.take callbacks))
in try loop () with | Queue.Empty -> ()
+
let declare_dyn_module m f =
(loaded_modules := m :: !loaded_modules; Queue.add (m, f) callbacks)
+
let register_str_item_parser f = str_item_parser := f
+
let register_sig_item_parser f = sig_item_parser := f
+
let register_parser f g = (str_item_parser := f; sig_item_parser := g)
+
let register_str_item_printer f = str_item_printer := f
+
let register_sig_item_printer f = sig_item_printer := f
+
let register_printer f g = (str_item_printer := f; sig_item_printer := g)
+
module Plugin
(Id : Sig.Id) (Maker : functor (Unit : sig end) -> sig end) =
struct
let _ =
declare_dyn_module Id.name
(fun _ -> let module M = Maker(struct end) in ())
+
end
+
module SyntaxExtension (Id : Sig.Id) (Maker : Sig.SyntaxExtension) =
struct
let _ =
declare_dyn_module Id.name
(fun _ -> let module M = Maker(Syntax) in ())
+
end
+
module OCamlSyntaxExtension
(Id : Sig.Id)
(Maker : functor (Syn : Sig.Camlp4Syntax) -> Sig.Camlp4Syntax) =
let _ =
declare_dyn_module Id.name
(fun _ -> let module M = Maker(Syntax) in ())
+
end
+
module SyntaxPlugin
(Id : Sig.Id) (Maker : functor (Syn : Sig.Syntax) -> sig end) =
struct
let _ =
declare_dyn_module Id.name
(fun _ -> let module M = Maker(Syntax) in ())
+
end
+
module Printer
(Id : Sig.Id)
(Maker : functor (Syn : Sig.Syntax) -> Sig.Printer(Syn.Ast).S) =
declare_dyn_module Id.name
(fun _ -> let module M = Maker(Syntax)
in register_printer M.print_implem M.print_interf)
+
end
+
module OCamlPrinter
(Id : Sig.Id)
(Maker : functor (Syn : Sig.Camlp4Syntax) -> Sig.Printer(Syn.Ast).S) =
declare_dyn_module Id.name
(fun _ -> let module M = Maker(Syntax)
in register_printer M.print_implem M.print_interf)
+
end
+
module OCamlPreCastPrinter
(Id : Sig.Id) (P : Sig.Printer(PreCast.Ast).S) =
struct
let _ =
declare_dyn_module Id.name
(fun _ -> register_printer P.print_implem P.print_interf)
+
end
+
module Parser
(Id : Sig.Id) (Maker : functor (Ast : Sig.Ast) -> Sig.Parser(Ast).S) =
struct
declare_dyn_module Id.name
(fun _ -> let module M = Maker(PreCast.Ast)
in register_parser M.parse_implem M.parse_interf)
+
end
+
module OCamlParser
(Id : Sig.Id)
(Maker : functor (Ast : Sig.Camlp4Ast) -> Sig.Parser(Ast).S) =
declare_dyn_module Id.name
(fun _ -> let module M = Maker(PreCast.Ast)
in register_parser M.parse_implem M.parse_interf)
+
end
+
module OCamlPreCastParser (Id : Sig.Id) (P : Sig.Parser(PreCast.Ast).S) =
struct
let _ =
declare_dyn_module Id.name
(fun _ -> register_parser P.parse_implem P.parse_interf)
+
end
+
module AstFilter
(Id : Sig.Id) (Maker : functor (F : Sig.AstFilters) -> sig end) =
struct
let _ =
declare_dyn_module Id.name
(fun _ -> let module M = Maker(AstFilters) in ())
+
end
+
let _ = sig_item_parser := Syntax.parse_interf
+
let _ = str_item_parser := Syntax.parse_implem
+
module CurrentParser =
struct
module Ast = Ast
+
let parse_interf ?directive_handler loc strm =
!sig_item_parser ?directive_handler loc strm
+
let parse_implem ?directive_handler loc strm =
!str_item_parser ?directive_handler loc strm
+
end
+
module CurrentPrinter =
struct
module Ast = Ast
+
let print_interf ?input_file ?output_file ast =
!sig_item_printer ?input_file ?output_file ast
+
let print_implem ?input_file ?output_file ast =
!str_item_printer ?input_file ?output_file ast
+
end
+
let enable_ocaml_printer () =
let module M = OCamlPrinter(PP.OCaml.Id)(PP.OCaml.MakeMore) in ()
+
let enable_ocamlr_printer () =
let module M = OCamlPrinter(PP.OCamlr.Id)(PP.OCamlr.MakeMore) in ()
+
let enable_dump_ocaml_ast_printer () =
let module M = OCamlPrinter(PP.DumpOCamlAst.Id)(PP.DumpOCamlAst.Make)
in ()
+
let enable_dump_camlp4_ast_printer () =
let module M = Printer(PP.DumpCamlp4Ast.Id)(PP.DumpCamlp4Ast.Make)
in ()
+
let enable_null_printer () =
let module M = Printer(PP.Null.Id)(PP.Null.Make) in ()
+
end
+
| Ast.PaAny _ -> True
| Ast.PaAli _ x y -> (is_irrefut_patt x) && (is_irrefut_patt y)
| Ast.PaRec _ p -> is_irrefut_patt p
- | Ast.PaEq _ (Ast.IdLid _ _) p -> is_irrefut_patt p
+ | Ast.PaEq _ _ p -> is_irrefut_patt p
| Ast.PaSem _ p1 p2 -> (is_irrefut_patt p1) && (is_irrefut_patt p2)
| Ast.PaCom _ p1 p2 -> (is_irrefut_patt p1) && (is_irrefut_patt p2)
| Ast.PaTyc _ p _ -> is_irrefut_patt p
struct
module type META_LOC =
sig
- (** The first location is where to put the returned pattern.
- Generally it's _loc to match with <:patt< ... >> quotations.
- The second location is the one to treat. *)
value meta_loc_patt : Loc.t -> Loc.t -> Ast.patt;
- (** The first location is where to put the returned expression.
- Generally it's _loc to match with <:expr< ... >> quotations.
- The second location is the one to treat. *)
value meta_loc_expr : Loc.t -> Loc.t -> Ast.expr;
end;
module MetaLoc =
module Make (MetaLoc : META_LOC) =
struct
open MetaLoc;
- value meta_acc_Loc_t = meta_loc_expr;
+ value meta_loc = meta_loc_expr;
module Expr =
struct
value meta_string _loc s = Ast.ExStr _loc s;
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "BiEq")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_patt _loc x1))
(meta_expr _loc x2)
| Ast.BiAnd x0 x1 x2 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "BiAnd")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_binding _loc x1))
(meta_binding _loc x2)
| Ast.BiNil x0 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "BiNil")))
- (meta_acc_Loc_t _loc x0) ]
+ (meta_loc _loc x0) ]
and meta_class_expr _loc =
fun
[ Ast.CeAnt x0 x1 -> Ast.ExAnt x0 x1
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CeEq")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_class_expr _loc x1))
(meta_class_expr _loc x2)
| Ast.CeAnd x0 x1 x2 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CeAnd")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_class_expr _loc x1))
(meta_class_expr _loc x2)
| Ast.CeTyc x0 x1 x2 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CeTyc")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_class_expr _loc x1))
(meta_class_type _loc x2)
| Ast.CeStr x0 x1 x2 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CeStr")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_patt _loc x1))
(meta_class_str_item _loc x2)
| Ast.CeLet x0 x1 x2 x3 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CeLet")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_meta_bool _loc x1))
(meta_binding _loc x2))
(meta_class_expr _loc x3)
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CeFun")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_patt _loc x1))
(meta_class_expr _loc x2)
| Ast.CeCon x0 x1 x2 x3 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CeCon")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_meta_bool _loc x1))
(meta_ident _loc x2))
(meta_ctyp _loc x3)
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CeApp")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_class_expr _loc x1))
(meta_expr _loc x2)
| Ast.CeNil x0 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CeNil")))
- (meta_acc_Loc_t _loc x0) ]
+ (meta_loc _loc x0) ]
and meta_class_sig_item _loc =
fun
[ Ast.CgAnt x0 x1 -> Ast.ExAnt x0 x1
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CgVir")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_meta_bool _loc x2))
(meta_ctyp _loc x3)
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CgVal")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_meta_bool _loc x2))
(meta_meta_bool _loc x3))
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CgMth")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_meta_bool _loc x2))
(meta_ctyp _loc x3)
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CgInh")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_class_type _loc x1)
| Ast.CgSem x0 x1 x2 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CgSem")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_class_sig_item _loc x1))
(meta_class_sig_item _loc x2)
| Ast.CgCtr x0 x1 x2 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CgCtr")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1))
(meta_ctyp _loc x2)
| Ast.CgNil x0 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CgNil")))
- (meta_acc_Loc_t _loc x0) ]
+ (meta_loc _loc x0) ]
and meta_class_str_item _loc =
fun
[ Ast.CrAnt x0 x1 -> Ast.ExAnt x0 x1
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CrVvr")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_meta_bool _loc x2))
(meta_ctyp _loc x3)
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CrVir")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_meta_bool _loc x2))
(meta_ctyp _loc x3)
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CrVal")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_meta_bool _loc x2))
(meta_expr _loc x3)
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CrMth")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_meta_bool _loc x2))
(meta_expr _loc x3))
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CrIni")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_expr _loc x1)
| Ast.CrInh x0 x1 x2 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CrInh")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_class_expr _loc x1))
(meta_string _loc x2)
| Ast.CrCtr x0 x1 x2 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CrCtr")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1))
(meta_ctyp _loc x2)
| Ast.CrSem x0 x1 x2 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CrSem")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_class_str_item _loc x1))
(meta_class_str_item _loc x2)
| Ast.CrNil x0 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CrNil")))
- (meta_acc_Loc_t _loc x0) ]
+ (meta_loc _loc x0) ]
and meta_class_type _loc =
fun
[ Ast.CtAnt x0 x1 -> Ast.ExAnt x0 x1
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CtEq")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_class_type _loc x1))
(meta_class_type _loc x2)
| Ast.CtCol x0 x1 x2 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CtCol")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_class_type _loc x1))
(meta_class_type _loc x2)
| Ast.CtAnd x0 x1 x2 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CtAnd")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_class_type _loc x1))
(meta_class_type _loc x2)
| Ast.CtSig x0 x1 x2 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CtSig")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1))
(meta_class_sig_item _loc x2)
| Ast.CtFun x0 x1 x2 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CtFun")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1))
(meta_class_type _loc x2)
| Ast.CtCon x0 x1 x2 x3 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CtCon")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_meta_bool _loc x1))
(meta_ident _loc x2))
(meta_ctyp _loc x3)
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CtNil")))
- (meta_acc_Loc_t _loc x0) ]
+ (meta_loc _loc x0) ]
and meta_ctyp _loc =
fun
[ Ast.TyAnt x0 x1 -> Ast.ExAnt x0 x1
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyOfAmp")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1))
(meta_ctyp _loc x2)
| Ast.TyAmp x0 x1 x2 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyAmp")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1))
(meta_ctyp _loc x2)
| Ast.TyVrnInfSup x0 x1 x2 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyVrnInfSup")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1))
(meta_ctyp _loc x2)
| Ast.TyVrnInf x0 x1 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyVrnInf")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1)
| Ast.TyVrnSup x0 x1 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyVrnSup")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1)
| Ast.TyVrnEq x0 x1 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyVrnEq")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1)
| Ast.TySta x0 x1 x2 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TySta")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1))
(meta_ctyp _loc x2)
| Ast.TyTup x0 x1 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyTup")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1)
| Ast.TyMut x0 x1 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyMut")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1)
| Ast.TyPrv x0 x1 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyPrv")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1)
| Ast.TyOr x0 x1 x2 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyOr")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1))
(meta_ctyp _loc x2)
| Ast.TyAnd x0 x1 x2 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyAnd")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1))
(meta_ctyp _loc x2)
| Ast.TyOf x0 x1 x2 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyOf")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1))
(meta_ctyp _loc x2)
| Ast.TySum x0 x1 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TySum")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1)
| Ast.TyCom x0 x1 x2 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyCom")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1))
(meta_ctyp _loc x2)
| Ast.TySem x0 x1 x2 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TySem")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1))
(meta_ctyp _loc x2)
| Ast.TyCol x0 x1 x2 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyCol")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1))
(meta_ctyp _loc x2)
| Ast.TyRec x0 x1 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyRec")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1)
| Ast.TyVrn x0 x1 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyVrn")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1)
| Ast.TyQuM x0 x1 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyQuM")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1)
| Ast.TyQuP x0 x1 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyQuP")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1)
| Ast.TyQuo x0 x1 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyQuo")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1)
| Ast.TyPol x0 x1 x2 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyPol")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1))
(meta_ctyp _loc x2)
| Ast.TyOlb x0 x1 x2 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyOlb")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_ctyp _loc x2)
| Ast.TyObj x0 x1 x2 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyObj")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1))
(meta_meta_bool _loc x2)
| Ast.TyDcl x0 x1 x2 x3 x4 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyDcl")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_list meta_ctyp _loc x2))
(meta_ctyp _loc x3))
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyMan")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1))
(meta_ctyp _loc x2)
| Ast.TyId x0 x1 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyId")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ident _loc x1)
| Ast.TyLab x0 x1 x2 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyLab")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_ctyp _loc x2)
| Ast.TyCls x0 x1 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyCls")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ident _loc x1)
| Ast.TyArr x0 x1 x2 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyArr")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1))
(meta_ctyp _loc x2)
| Ast.TyApp x0 x1 x2 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyApp")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1))
(meta_ctyp _loc x2)
| Ast.TyAny x0 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyAny")))
- (meta_acc_Loc_t _loc x0)
+ (meta_loc _loc x0)
| Ast.TyAli x0 x1 x2 ->
Ast.ExApp _loc
(Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyAli")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1))
(meta_ctyp _loc x2)
| Ast.TyNil x0 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyNil")))
- (meta_acc_Loc_t _loc x0) ]
+ (meta_loc _loc x0) ]
and meta_expr _loc =
fun
[ Ast.ExWhi x0 x1 x2 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExWhi")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_expr _loc x1))
(meta_expr _loc x2)
| Ast.ExVrn x0 x1 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExVrn")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1)
| Ast.ExTyc x0 x1 x2 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExTyc")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_expr _loc x1))
(meta_ctyp _loc x2)
| Ast.ExCom x0 x1 x2 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExCom")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_expr _loc x1))
(meta_expr _loc x2)
| Ast.ExTup x0 x1 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExTup")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_expr _loc x1)
| Ast.ExTry x0 x1 x2 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExTry")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_expr _loc x1))
(meta_match_case _loc x2)
| Ast.ExStr x0 x1 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExStr")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1)
| Ast.ExSte x0 x1 x2 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExSte")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_expr _loc x1))
(meta_expr _loc x2)
| Ast.ExSnd x0 x1 x2 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExSnd")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_expr _loc x1))
(meta_string _loc x2)
| Ast.ExSeq x0 x1 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExSeq")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_expr _loc x1)
| Ast.ExRec x0 x1 x2 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExRec")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_rec_binding _loc x1))
(meta_expr _loc x2)
| Ast.ExOvr x0 x1 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExOvr")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_rec_binding _loc x1)
| Ast.ExOlb x0 x1 x2 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExOlb")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_expr _loc x2)
| Ast.ExObj x0 x1 x2 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExObj")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_patt _loc x1))
(meta_class_str_item _loc x2)
| Ast.ExNew x0 x1 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExNew")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ident _loc x1)
| Ast.ExMat x0 x1 x2 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExMat")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_expr _loc x1))
(meta_match_case _loc x2)
| Ast.ExLmd x0 x1 x2 x3 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExLmd")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_module_expr _loc x2))
(meta_expr _loc x3)
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExLet")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_meta_bool _loc x1))
(meta_binding _loc x2))
(meta_expr _loc x3)
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExLaz")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_expr _loc x1)
| Ast.ExLab x0 x1 x2 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExLab")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_expr _loc x2)
| Ast.ExNativeInt x0 x1 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExNativeInt")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1)
| Ast.ExInt64 x0 x1 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExInt64")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1)
| Ast.ExInt32 x0 x1 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExInt32")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1)
| Ast.ExInt x0 x1 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExInt")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1)
| Ast.ExIfe x0 x1 x2 x3 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExIfe")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_expr _loc x1))
(meta_expr _loc x2))
(meta_expr _loc x3)
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExFun")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_match_case _loc x1)
| Ast.ExFor x0 x1 x2 x3 x4 x5 ->
Ast.ExApp _loc
(Ast.IdAcc _loc
(Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExFor")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_expr _loc x2))
(meta_expr _loc x3))
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExFlo")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1)
| Ast.ExCoe x0 x1 x2 x3 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExCoe")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_expr _loc x1))
(meta_ctyp _loc x2))
(meta_ctyp _loc x3)
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExChr")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1)
| Ast.ExAss x0 x1 x2 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExAss")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_expr _loc x1))
(meta_expr _loc x2)
| Ast.ExAsr x0 x1 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExAsr")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_expr _loc x1)
| Ast.ExAsf x0 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExAsf")))
- (meta_acc_Loc_t _loc x0)
+ (meta_loc _loc x0)
| Ast.ExSem x0 x1 x2 ->
Ast.ExApp _loc
(Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExSem")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_expr _loc x1))
(meta_expr _loc x2)
| Ast.ExArr x0 x1 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExArr")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_expr _loc x1)
| Ast.ExAre x0 x1 x2 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExAre")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_expr _loc x1))
(meta_expr _loc x2)
| Ast.ExApp x0 x1 x2 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExApp")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_expr _loc x1))
(meta_expr _loc x2)
| Ast.ExAnt x0 x1 -> Ast.ExAnt x0 x1
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExAcc")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_expr _loc x1))
(meta_expr _loc x2)
| Ast.ExId x0 x1 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExId")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ident _loc x1)
| Ast.ExNil x0 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExNil")))
- (meta_acc_Loc_t _loc x0) ]
+ (meta_loc _loc x0) ]
and meta_ident _loc =
fun
[ Ast.IdAnt x0 x1 -> Ast.ExAnt x0 x1
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "IdUid")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1)
| Ast.IdLid x0 x1 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "IdLid")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1)
| Ast.IdApp x0 x1 x2 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "IdApp")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ident _loc x1))
(meta_ident _loc x2)
| Ast.IdAcc x0 x1 x2 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "IdAcc")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ident _loc x1))
(meta_ident _loc x2) ]
and meta_match_case _loc =
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "McArr")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_patt _loc x1))
(meta_expr _loc x2))
(meta_expr _loc x3)
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "McOr")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_match_case _loc x1))
(meta_match_case _loc x2)
| Ast.McNil x0 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "McNil")))
- (meta_acc_Loc_t _loc x0) ]
+ (meta_loc _loc x0) ]
and meta_meta_bool _loc =
fun
[ Ast.BAnt x0 -> Ast.ExAnt _loc x0
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "MbCol")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_module_type _loc x2)
| Ast.MbColEq x0 x1 x2 x3 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "MbColEq")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_module_type _loc x2))
(meta_module_expr _loc x3)
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "MbAnd")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_module_binding _loc x1))
(meta_module_binding _loc x2)
| Ast.MbNil x0 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "MbNil")))
- (meta_acc_Loc_t _loc x0) ]
+ (meta_loc _loc x0) ]
and meta_module_expr _loc =
fun
[ Ast.MeAnt x0 x1 -> Ast.ExAnt x0 x1
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "MeTyc")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_module_expr _loc x1))
(meta_module_type _loc x2)
| Ast.MeStr x0 x1 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "MeStr")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_str_item _loc x1)
| Ast.MeFun x0 x1 x2 x3 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "MeFun")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_module_type _loc x2))
(meta_module_expr _loc x3)
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "MeApp")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_module_expr _loc x1))
(meta_module_expr _loc x2)
| Ast.MeId x0 x1 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "MeId")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ident _loc x1)
| Ast.MeNil x0 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "MeNil")))
- (meta_acc_Loc_t _loc x0) ]
+ (meta_loc _loc x0) ]
and meta_module_type _loc =
fun
[ Ast.MtAnt x0 x1 -> Ast.ExAnt x0 x1
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "MtWit")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_module_type _loc x1))
(meta_with_constr _loc x2)
| Ast.MtSig x0 x1 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "MtSig")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_sig_item _loc x1)
| Ast.MtQuo x0 x1 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "MtQuo")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1)
| Ast.MtFun x0 x1 x2 x3 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "MtFun")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_module_type _loc x2))
(meta_module_type _loc x3)
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "MtId")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ident _loc x1)
| Ast.MtNil x0 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "MtNil")))
- (meta_acc_Loc_t _loc x0) ]
+ (meta_loc _loc x0) ]
and meta_patt _loc =
fun
[ Ast.PaVrn x0 x1 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaVrn")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1)
| Ast.PaTyp x0 x1 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaTyp")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ident _loc x1)
| Ast.PaTyc x0 x1 x2 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaTyc")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_patt _loc x1))
(meta_ctyp _loc x2)
| Ast.PaTup x0 x1 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaTup")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_patt _loc x1)
| Ast.PaStr x0 x1 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaStr")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1)
| Ast.PaEq x0 x1 x2 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaEq")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ident _loc x1))
(meta_patt _loc x2)
| Ast.PaRec x0 x1 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaRec")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_patt _loc x1)
| Ast.PaRng x0 x1 x2 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaRng")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_patt _loc x1))
(meta_patt _loc x2)
| Ast.PaOrp x0 x1 x2 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaOrp")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_patt _loc x1))
(meta_patt _loc x2)
| Ast.PaOlbi x0 x1 x2 x3 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaOlbi")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_patt _loc x2))
(meta_expr _loc x3)
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaOlb")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_patt _loc x2)
| Ast.PaLab x0 x1 x2 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaLab")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_patt _loc x2)
| Ast.PaFlo x0 x1 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaFlo")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1)
| Ast.PaNativeInt x0 x1 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaNativeInt")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1)
| Ast.PaInt64 x0 x1 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaInt64")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1)
| Ast.PaInt32 x0 x1 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaInt32")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1)
| Ast.PaInt x0 x1 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaInt")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1)
| Ast.PaChr x0 x1 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaChr")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1)
| Ast.PaSem x0 x1 x2 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaSem")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_patt _loc x1))
(meta_patt _loc x2)
| Ast.PaCom x0 x1 x2 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaCom")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_patt _loc x1))
(meta_patt _loc x2)
| Ast.PaArr x0 x1 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaArr")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_patt _loc x1)
| Ast.PaApp x0 x1 x2 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaApp")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_patt _loc x1))
(meta_patt _loc x2)
| Ast.PaAny x0 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaAny")))
- (meta_acc_Loc_t _loc x0)
+ (meta_loc _loc x0)
| Ast.PaAnt x0 x1 -> Ast.ExAnt x0 x1
| Ast.PaAli x0 x1 x2 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaAli")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_patt _loc x1))
(meta_patt _loc x2)
| Ast.PaId x0 x1 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaId")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ident _loc x1)
| Ast.PaNil x0 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaNil")))
- (meta_acc_Loc_t _loc x0) ]
+ (meta_loc _loc x0) ]
and meta_rec_binding _loc =
fun
[ Ast.RbAnt x0 x1 -> Ast.ExAnt x0 x1
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "RbEq")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ident _loc x1))
(meta_expr _loc x2)
| Ast.RbSem x0 x1 x2 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "RbSem")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_rec_binding _loc x1))
(meta_rec_binding _loc x2)
| Ast.RbNil x0 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "RbNil")))
- (meta_acc_Loc_t _loc x0) ]
+ (meta_loc _loc x0) ]
and meta_sig_item _loc =
fun
[ Ast.SgAnt x0 x1 -> Ast.ExAnt x0 x1
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "SgVal")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_ctyp _loc x2)
| Ast.SgTyp x0 x1 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "SgTyp")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1)
| Ast.SgOpn x0 x1 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "SgOpn")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ident _loc x1)
| Ast.SgMty x0 x1 x2 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "SgMty")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_module_type _loc x2)
| Ast.SgRecMod x0 x1 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "SgRecMod")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_module_binding _loc x1)
| Ast.SgMod x0 x1 x2 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "SgMod")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_module_type _loc x2)
| Ast.SgInc x0 x1 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "SgInc")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_module_type _loc x1)
| Ast.SgExt x0 x1 x2 x3 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "SgExt")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_ctyp _loc x2))
(meta_meta_list meta_string _loc x3)
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "SgExc")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1)
| Ast.SgDir x0 x1 x2 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "SgDir")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_expr _loc x2)
| Ast.SgSem x0 x1 x2 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "SgSem")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_sig_item _loc x1))
(meta_sig_item _loc x2)
| Ast.SgClt x0 x1 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "SgClt")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_class_type _loc x1)
| Ast.SgCls x0 x1 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "SgCls")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_class_type _loc x1)
| Ast.SgNil x0 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "SgNil")))
- (meta_acc_Loc_t _loc x0) ]
+ (meta_loc _loc x0) ]
and meta_str_item _loc =
fun
[ Ast.StAnt x0 x1 -> Ast.ExAnt x0 x1
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "StVal")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_meta_bool _loc x1))
(meta_binding _loc x2)
| Ast.StTyp x0 x1 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "StTyp")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1)
| Ast.StOpn x0 x1 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "StOpn")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ident _loc x1)
| Ast.StMty x0 x1 x2 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "StMty")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_module_type _loc x2)
| Ast.StRecMod x0 x1 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "StRecMod")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_module_binding _loc x1)
| Ast.StMod x0 x1 x2 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "StMod")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_module_expr _loc x2)
| Ast.StInc x0 x1 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "StInc")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_module_expr _loc x1)
| Ast.StExt x0 x1 x2 x3 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "StExt")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_ctyp _loc x2))
(meta_meta_list meta_string _loc x3)
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "StExp")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_expr _loc x1)
| Ast.StExc x0 x1 x2 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "StExc")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1))
(meta_meta_option meta_ident _loc x2)
| Ast.StDir x0 x1 x2 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "StDir")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_expr _loc x2)
| Ast.StSem x0 x1 x2 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "StSem")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_str_item _loc x1))
(meta_str_item _loc x2)
| Ast.StClt x0 x1 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "StClt")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_class_type _loc x1)
| Ast.StCls x0 x1 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "StCls")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_class_expr _loc x1)
| Ast.StNil x0 ->
Ast.ExApp _loc
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "StNil")))
- (meta_acc_Loc_t _loc x0) ]
+ (meta_loc _loc x0) ]
and meta_with_constr _loc =
fun
[ Ast.WcAnt x0 x1 -> Ast.ExAnt x0 x1
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "WcAnd")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_with_constr _loc x1))
(meta_with_constr _loc x2)
| Ast.WcMod x0 x1 x2 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "WcMod")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ident _loc x1))
(meta_ident _loc x2)
| Ast.WcTyp x0 x1 x2 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "WcTyp")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1))
(meta_ctyp _loc x2)
| Ast.WcNil x0 ->
(Ast.ExId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "WcNil")))
- (meta_acc_Loc_t _loc x0) ];
+ (meta_loc _loc x0) ];
end;
- value meta_acc_Loc_t = meta_loc_patt;
+ value meta_loc = meta_loc_patt;
module Patt =
struct
value meta_string _loc s = Ast.PaStr _loc s;
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "BiEq")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_patt _loc x1))
(meta_expr _loc x2)
| Ast.BiAnd x0 x1 x2 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "BiAnd")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_binding _loc x1))
(meta_binding _loc x2)
| Ast.BiNil x0 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "BiNil")))
- (meta_acc_Loc_t _loc x0) ]
+ (meta_loc _loc x0) ]
and meta_class_expr _loc =
fun
[ Ast.CeAnt x0 x1 -> Ast.PaAnt x0 x1
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CeEq")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_class_expr _loc x1))
(meta_class_expr _loc x2)
| Ast.CeAnd x0 x1 x2 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CeAnd")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_class_expr _loc x1))
(meta_class_expr _loc x2)
| Ast.CeTyc x0 x1 x2 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CeTyc")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_class_expr _loc x1))
(meta_class_type _loc x2)
| Ast.CeStr x0 x1 x2 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CeStr")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_patt _loc x1))
(meta_class_str_item _loc x2)
| Ast.CeLet x0 x1 x2 x3 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CeLet")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_meta_bool _loc x1))
(meta_binding _loc x2))
(meta_class_expr _loc x3)
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CeFun")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_patt _loc x1))
(meta_class_expr _loc x2)
| Ast.CeCon x0 x1 x2 x3 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CeCon")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_meta_bool _loc x1))
(meta_ident _loc x2))
(meta_ctyp _loc x3)
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CeApp")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_class_expr _loc x1))
(meta_expr _loc x2)
| Ast.CeNil x0 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CeNil")))
- (meta_acc_Loc_t _loc x0) ]
+ (meta_loc _loc x0) ]
and meta_class_sig_item _loc =
fun
[ Ast.CgAnt x0 x1 -> Ast.PaAnt x0 x1
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CgVir")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_meta_bool _loc x2))
(meta_ctyp _loc x3)
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CgVal")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_meta_bool _loc x2))
(meta_meta_bool _loc x3))
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CgMth")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_meta_bool _loc x2))
(meta_ctyp _loc x3)
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CgInh")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_class_type _loc x1)
| Ast.CgSem x0 x1 x2 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CgSem")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_class_sig_item _loc x1))
(meta_class_sig_item _loc x2)
| Ast.CgCtr x0 x1 x2 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CgCtr")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1))
(meta_ctyp _loc x2)
| Ast.CgNil x0 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CgNil")))
- (meta_acc_Loc_t _loc x0) ]
+ (meta_loc _loc x0) ]
and meta_class_str_item _loc =
fun
[ Ast.CrAnt x0 x1 -> Ast.PaAnt x0 x1
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CrVvr")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_meta_bool _loc x2))
(meta_ctyp _loc x3)
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CrVir")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_meta_bool _loc x2))
(meta_ctyp _loc x3)
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CrVal")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_meta_bool _loc x2))
(meta_expr _loc x3)
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CrMth")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_meta_bool _loc x2))
(meta_expr _loc x3))
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CrIni")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_expr _loc x1)
| Ast.CrInh x0 x1 x2 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CrInh")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_class_expr _loc x1))
(meta_string _loc x2)
| Ast.CrCtr x0 x1 x2 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CrCtr")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1))
(meta_ctyp _loc x2)
| Ast.CrSem x0 x1 x2 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CrSem")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_class_str_item _loc x1))
(meta_class_str_item _loc x2)
| Ast.CrNil x0 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CrNil")))
- (meta_acc_Loc_t _loc x0) ]
+ (meta_loc _loc x0) ]
and meta_class_type _loc =
fun
[ Ast.CtAnt x0 x1 -> Ast.PaAnt x0 x1
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CtEq")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_class_type _loc x1))
(meta_class_type _loc x2)
| Ast.CtCol x0 x1 x2 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CtCol")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_class_type _loc x1))
(meta_class_type _loc x2)
| Ast.CtAnd x0 x1 x2 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CtAnd")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_class_type _loc x1))
(meta_class_type _loc x2)
| Ast.CtSig x0 x1 x2 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CtSig")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1))
(meta_class_sig_item _loc x2)
| Ast.CtFun x0 x1 x2 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CtFun")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1))
(meta_class_type _loc x2)
| Ast.CtCon x0 x1 x2 x3 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CtCon")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_meta_bool _loc x1))
(meta_ident _loc x2))
(meta_ctyp _loc x3)
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "CtNil")))
- (meta_acc_Loc_t _loc x0) ]
+ (meta_loc _loc x0) ]
and meta_ctyp _loc =
fun
[ Ast.TyAnt x0 x1 -> Ast.PaAnt x0 x1
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyOfAmp")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1))
(meta_ctyp _loc x2)
| Ast.TyAmp x0 x1 x2 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyAmp")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1))
(meta_ctyp _loc x2)
| Ast.TyVrnInfSup x0 x1 x2 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyVrnInfSup")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1))
(meta_ctyp _loc x2)
| Ast.TyVrnInf x0 x1 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyVrnInf")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1)
| Ast.TyVrnSup x0 x1 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyVrnSup")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1)
| Ast.TyVrnEq x0 x1 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyVrnEq")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1)
| Ast.TySta x0 x1 x2 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TySta")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1))
(meta_ctyp _loc x2)
| Ast.TyTup x0 x1 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyTup")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1)
| Ast.TyMut x0 x1 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyMut")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1)
| Ast.TyPrv x0 x1 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyPrv")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1)
| Ast.TyOr x0 x1 x2 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyOr")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1))
(meta_ctyp _loc x2)
| Ast.TyAnd x0 x1 x2 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyAnd")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1))
(meta_ctyp _loc x2)
| Ast.TyOf x0 x1 x2 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyOf")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1))
(meta_ctyp _loc x2)
| Ast.TySum x0 x1 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TySum")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1)
| Ast.TyCom x0 x1 x2 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyCom")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1))
(meta_ctyp _loc x2)
| Ast.TySem x0 x1 x2 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TySem")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1))
(meta_ctyp _loc x2)
| Ast.TyCol x0 x1 x2 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyCol")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1))
(meta_ctyp _loc x2)
| Ast.TyRec x0 x1 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyRec")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1)
| Ast.TyVrn x0 x1 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyVrn")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1)
| Ast.TyQuM x0 x1 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyQuM")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1)
| Ast.TyQuP x0 x1 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyQuP")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1)
| Ast.TyQuo x0 x1 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyQuo")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1)
| Ast.TyPol x0 x1 x2 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyPol")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1))
(meta_ctyp _loc x2)
| Ast.TyOlb x0 x1 x2 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyOlb")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_ctyp _loc x2)
| Ast.TyObj x0 x1 x2 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyObj")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1))
(meta_meta_bool _loc x2)
| Ast.TyDcl x0 x1 x2 x3 x4 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyDcl")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_list meta_ctyp _loc x2))
(meta_ctyp _loc x3))
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyMan")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1))
(meta_ctyp _loc x2)
| Ast.TyId x0 x1 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyId")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ident _loc x1)
| Ast.TyLab x0 x1 x2 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyLab")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_ctyp _loc x2)
| Ast.TyCls x0 x1 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyCls")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ident _loc x1)
| Ast.TyArr x0 x1 x2 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyArr")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1))
(meta_ctyp _loc x2)
| Ast.TyApp x0 x1 x2 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyApp")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1))
(meta_ctyp _loc x2)
| Ast.TyAny x0 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyAny")))
- (meta_acc_Loc_t _loc x0)
+ (meta_loc _loc x0)
| Ast.TyAli x0 x1 x2 ->
Ast.PaApp _loc
(Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyAli")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1))
(meta_ctyp _loc x2)
| Ast.TyNil x0 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "TyNil")))
- (meta_acc_Loc_t _loc x0) ]
+ (meta_loc _loc x0) ]
and meta_expr _loc =
fun
[ Ast.ExWhi x0 x1 x2 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExWhi")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_expr _loc x1))
(meta_expr _loc x2)
| Ast.ExVrn x0 x1 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExVrn")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1)
| Ast.ExTyc x0 x1 x2 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExTyc")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_expr _loc x1))
(meta_ctyp _loc x2)
| Ast.ExCom x0 x1 x2 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExCom")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_expr _loc x1))
(meta_expr _loc x2)
| Ast.ExTup x0 x1 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExTup")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_expr _loc x1)
| Ast.ExTry x0 x1 x2 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExTry")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_expr _loc x1))
(meta_match_case _loc x2)
| Ast.ExStr x0 x1 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExStr")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1)
| Ast.ExSte x0 x1 x2 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExSte")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_expr _loc x1))
(meta_expr _loc x2)
| Ast.ExSnd x0 x1 x2 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExSnd")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_expr _loc x1))
(meta_string _loc x2)
| Ast.ExSeq x0 x1 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExSeq")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_expr _loc x1)
| Ast.ExRec x0 x1 x2 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExRec")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_rec_binding _loc x1))
(meta_expr _loc x2)
| Ast.ExOvr x0 x1 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExOvr")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_rec_binding _loc x1)
| Ast.ExOlb x0 x1 x2 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExOlb")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_expr _loc x2)
| Ast.ExObj x0 x1 x2 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExObj")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_patt _loc x1))
(meta_class_str_item _loc x2)
| Ast.ExNew x0 x1 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExNew")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ident _loc x1)
| Ast.ExMat x0 x1 x2 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExMat")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_expr _loc x1))
(meta_match_case _loc x2)
| Ast.ExLmd x0 x1 x2 x3 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExLmd")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_module_expr _loc x2))
(meta_expr _loc x3)
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExLet")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_meta_bool _loc x1))
(meta_binding _loc x2))
(meta_expr _loc x3)
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExLaz")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_expr _loc x1)
| Ast.ExLab x0 x1 x2 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExLab")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_expr _loc x2)
| Ast.ExNativeInt x0 x1 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExNativeInt")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1)
| Ast.ExInt64 x0 x1 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExInt64")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1)
| Ast.ExInt32 x0 x1 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExInt32")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1)
| Ast.ExInt x0 x1 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExInt")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1)
| Ast.ExIfe x0 x1 x2 x3 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExIfe")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_expr _loc x1))
(meta_expr _loc x2))
(meta_expr _loc x3)
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExFun")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_match_case _loc x1)
| Ast.ExFor x0 x1 x2 x3 x4 x5 ->
Ast.PaApp _loc
(Ast.IdAcc _loc
(Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExFor")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_expr _loc x2))
(meta_expr _loc x3))
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExFlo")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1)
| Ast.ExCoe x0 x1 x2 x3 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExCoe")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_expr _loc x1))
(meta_ctyp _loc x2))
(meta_ctyp _loc x3)
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExChr")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1)
| Ast.ExAss x0 x1 x2 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExAss")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_expr _loc x1))
(meta_expr _loc x2)
| Ast.ExAsr x0 x1 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExAsr")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_expr _loc x1)
| Ast.ExAsf x0 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExAsf")))
- (meta_acc_Loc_t _loc x0)
+ (meta_loc _loc x0)
| Ast.ExSem x0 x1 x2 ->
Ast.PaApp _loc
(Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExSem")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_expr _loc x1))
(meta_expr _loc x2)
| Ast.ExArr x0 x1 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExArr")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_expr _loc x1)
| Ast.ExAre x0 x1 x2 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExAre")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_expr _loc x1))
(meta_expr _loc x2)
| Ast.ExApp x0 x1 x2 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExApp")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_expr _loc x1))
(meta_expr _loc x2)
| Ast.ExAnt x0 x1 -> Ast.PaAnt x0 x1
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExAcc")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_expr _loc x1))
(meta_expr _loc x2)
| Ast.ExId x0 x1 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExId")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ident _loc x1)
| Ast.ExNil x0 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExNil")))
- (meta_acc_Loc_t _loc x0) ]
+ (meta_loc _loc x0) ]
and meta_ident _loc =
fun
[ Ast.IdAnt x0 x1 -> Ast.PaAnt x0 x1
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "IdUid")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1)
| Ast.IdLid x0 x1 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "IdLid")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1)
| Ast.IdApp x0 x1 x2 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "IdApp")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ident _loc x1))
(meta_ident _loc x2)
| Ast.IdAcc x0 x1 x2 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "IdAcc")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ident _loc x1))
(meta_ident _loc x2) ]
and meta_match_case _loc =
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "McArr")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_patt _loc x1))
(meta_expr _loc x2))
(meta_expr _loc x3)
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "McOr")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_match_case _loc x1))
(meta_match_case _loc x2)
| Ast.McNil x0 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "McNil")))
- (meta_acc_Loc_t _loc x0) ]
+ (meta_loc _loc x0) ]
and meta_meta_bool _loc =
fun
[ Ast.BAnt x0 -> Ast.PaAnt _loc x0
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "MbCol")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_module_type _loc x2)
| Ast.MbColEq x0 x1 x2 x3 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "MbColEq")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_module_type _loc x2))
(meta_module_expr _loc x3)
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "MbAnd")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_module_binding _loc x1))
(meta_module_binding _loc x2)
| Ast.MbNil x0 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "MbNil")))
- (meta_acc_Loc_t _loc x0) ]
+ (meta_loc _loc x0) ]
and meta_module_expr _loc =
fun
[ Ast.MeAnt x0 x1 -> Ast.PaAnt x0 x1
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "MeTyc")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_module_expr _loc x1))
(meta_module_type _loc x2)
| Ast.MeStr x0 x1 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "MeStr")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_str_item _loc x1)
| Ast.MeFun x0 x1 x2 x3 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "MeFun")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_module_type _loc x2))
(meta_module_expr _loc x3)
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "MeApp")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_module_expr _loc x1))
(meta_module_expr _loc x2)
| Ast.MeId x0 x1 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "MeId")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ident _loc x1)
| Ast.MeNil x0 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "MeNil")))
- (meta_acc_Loc_t _loc x0) ]
+ (meta_loc _loc x0) ]
and meta_module_type _loc =
fun
[ Ast.MtAnt x0 x1 -> Ast.PaAnt x0 x1
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "MtWit")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_module_type _loc x1))
(meta_with_constr _loc x2)
| Ast.MtSig x0 x1 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "MtSig")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_sig_item _loc x1)
| Ast.MtQuo x0 x1 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "MtQuo")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1)
| Ast.MtFun x0 x1 x2 x3 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "MtFun")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_module_type _loc x2))
(meta_module_type _loc x3)
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "MtId")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ident _loc x1)
| Ast.MtNil x0 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "MtNil")))
- (meta_acc_Loc_t _loc x0) ]
+ (meta_loc _loc x0) ]
and meta_patt _loc =
fun
[ Ast.PaVrn x0 x1 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaVrn")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1)
| Ast.PaTyp x0 x1 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaTyp")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ident _loc x1)
| Ast.PaTyc x0 x1 x2 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaTyc")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_patt _loc x1))
(meta_ctyp _loc x2)
| Ast.PaTup x0 x1 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaTup")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_patt _loc x1)
| Ast.PaStr x0 x1 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaStr")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1)
| Ast.PaEq x0 x1 x2 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaEq")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ident _loc x1))
(meta_patt _loc x2)
| Ast.PaRec x0 x1 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaRec")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_patt _loc x1)
| Ast.PaRng x0 x1 x2 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaRng")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_patt _loc x1))
(meta_patt _loc x2)
| Ast.PaOrp x0 x1 x2 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaOrp")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_patt _loc x1))
(meta_patt _loc x2)
| Ast.PaOlbi x0 x1 x2 x3 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaOlbi")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_patt _loc x2))
(meta_expr _loc x3)
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaOlb")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_patt _loc x2)
| Ast.PaLab x0 x1 x2 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaLab")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_patt _loc x2)
| Ast.PaFlo x0 x1 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaFlo")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1)
| Ast.PaNativeInt x0 x1 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaNativeInt")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1)
| Ast.PaInt64 x0 x1 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaInt64")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1)
| Ast.PaInt32 x0 x1 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaInt32")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1)
| Ast.PaInt x0 x1 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaInt")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1)
| Ast.PaChr x0 x1 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaChr")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1)
| Ast.PaSem x0 x1 x2 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaSem")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_patt _loc x1))
(meta_patt _loc x2)
| Ast.PaCom x0 x1 x2 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaCom")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_patt _loc x1))
(meta_patt _loc x2)
| Ast.PaArr x0 x1 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaArr")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_patt _loc x1)
| Ast.PaApp x0 x1 x2 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaApp")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_patt _loc x1))
(meta_patt _loc x2)
| Ast.PaAny x0 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaAny")))
- (meta_acc_Loc_t _loc x0)
+ (meta_loc _loc x0)
| Ast.PaAnt x0 x1 -> Ast.PaAnt x0 x1
| Ast.PaAli x0 x1 x2 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaAli")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_patt _loc x1))
(meta_patt _loc x2)
| Ast.PaId x0 x1 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaId")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ident _loc x1)
| Ast.PaNil x0 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaNil")))
- (meta_acc_Loc_t _loc x0) ]
+ (meta_loc _loc x0) ]
and meta_rec_binding _loc =
fun
[ Ast.RbAnt x0 x1 -> Ast.PaAnt x0 x1
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "RbEq")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ident _loc x1))
(meta_expr _loc x2)
| Ast.RbSem x0 x1 x2 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "RbSem")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_rec_binding _loc x1))
(meta_rec_binding _loc x2)
| Ast.RbNil x0 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "RbNil")))
- (meta_acc_Loc_t _loc x0) ]
+ (meta_loc _loc x0) ]
and meta_sig_item _loc =
fun
[ Ast.SgAnt x0 x1 -> Ast.PaAnt x0 x1
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "SgVal")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_ctyp _loc x2)
| Ast.SgTyp x0 x1 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "SgTyp")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1)
| Ast.SgOpn x0 x1 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "SgOpn")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ident _loc x1)
| Ast.SgMty x0 x1 x2 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "SgMty")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_module_type _loc x2)
| Ast.SgRecMod x0 x1 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "SgRecMod")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_module_binding _loc x1)
| Ast.SgMod x0 x1 x2 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "SgMod")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_module_type _loc x2)
| Ast.SgInc x0 x1 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "SgInc")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_module_type _loc x1)
| Ast.SgExt x0 x1 x2 x3 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "SgExt")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_ctyp _loc x2))
(meta_meta_list meta_string _loc x3)
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "SgExc")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1)
| Ast.SgDir x0 x1 x2 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "SgDir")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_expr _loc x2)
| Ast.SgSem x0 x1 x2 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "SgSem")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_sig_item _loc x1))
(meta_sig_item _loc x2)
| Ast.SgClt x0 x1 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "SgClt")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_class_type _loc x1)
| Ast.SgCls x0 x1 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "SgCls")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_class_type _loc x1)
| Ast.SgNil x0 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "SgNil")))
- (meta_acc_Loc_t _loc x0) ]
+ (meta_loc _loc x0) ]
and meta_str_item _loc =
fun
[ Ast.StAnt x0 x1 -> Ast.PaAnt x0 x1
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "StVal")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_meta_bool _loc x1))
(meta_binding _loc x2)
| Ast.StTyp x0 x1 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "StTyp")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1)
| Ast.StOpn x0 x1 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "StOpn")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ident _loc x1)
| Ast.StMty x0 x1 x2 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "StMty")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_module_type _loc x2)
| Ast.StRecMod x0 x1 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "StRecMod")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_module_binding _loc x1)
| Ast.StMod x0 x1 x2 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "StMod")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_module_expr _loc x2)
| Ast.StInc x0 x1 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "StInc")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_module_expr _loc x1)
| Ast.StExt x0 x1 x2 x3 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "StExt")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_ctyp _loc x2))
(meta_meta_list meta_string _loc x3)
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "StExp")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_expr _loc x1)
| Ast.StExc x0 x1 x2 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "StExc")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1))
(meta_meta_option meta_ident _loc x2)
| Ast.StDir x0 x1 x2 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "StDir")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_string _loc x1))
(meta_expr _loc x2)
| Ast.StSem x0 x1 x2 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "StSem")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_str_item _loc x1))
(meta_str_item _loc x2)
| Ast.StClt x0 x1 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "StClt")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_class_type _loc x1)
| Ast.StCls x0 x1 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "StCls")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_class_expr _loc x1)
| Ast.StNil x0 ->
Ast.PaApp _loc
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "StNil")))
- (meta_acc_Loc_t _loc x0) ]
+ (meta_loc _loc x0) ]
and meta_with_constr _loc =
fun
[ Ast.WcAnt x0 x1 -> Ast.PaAnt x0 x1
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "WcAnd")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_with_constr _loc x1))
(meta_with_constr _loc x2)
| Ast.WcMod x0 x1 x2 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "WcMod")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ident _loc x1))
(meta_ident _loc x2)
| Ast.WcTyp x0 x1 x2 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "WcTyp")))
- (meta_acc_Loc_t _loc x0))
+ (meta_loc _loc x0))
(meta_ctyp _loc x1))
(meta_ctyp _loc x2)
| Ast.WcNil x0 ->
(Ast.PaId _loc
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "WcNil")))
- (meta_acc_Loc_t _loc x0) ];
+ (meta_loc _loc x0) ];
end;
end;
end;
class map =
- object (o)
- method string = fun x -> (x : string);
- method int = fun x -> (x : int);
- method float = fun x -> (x : float);
- method bool = fun x -> (x : bool);
- method list : ! 'a 'b. ('a -> 'b) -> list 'a -> list 'b = List.map;
- method option : ! 'a 'b. ('a -> 'b) -> option 'a -> option 'b =
- fun f -> fun [ None -> None | Some x -> Some (f x) ];
- method array : ! 'a 'b. ('a -> 'b) -> array 'a -> array 'b = Array.
- map;
- method ref : ! 'a 'b. ('a -> 'b) -> ref 'a -> ref 'b =
- fun f { val = x } -> { val = f x; };
- method _Loc_t : Loc.t -> Loc.t = fun x -> x;
+ object ((o : 'self_type))
+ method string : string -> string = o#unknown;
+ method list :
+ ! 'a 'a_out. ('self_type -> 'a -> 'a_out) -> list 'a -> list 'a_out =
+ fun _f_a ->
+ fun
+ [ [] -> []
+ | [ _x :: _x_i1 ] ->
+ let _x = _f_a o _x in
+ let _x_i1 = o#list _f_a _x_i1 in [ _x :: _x_i1 ] ];
method with_constr : with_constr -> with_constr =
fun
- [ WcNil _x0 -> WcNil (o#_Loc_t _x0)
- | WcTyp _x0 _x1 _x2 ->
- WcTyp (o#_Loc_t _x0) (o#ctyp _x1) (o#ctyp _x2)
- | WcMod _x0 _x1 _x2 ->
- WcMod (o#_Loc_t _x0) (o#ident _x1) (o#ident _x2)
- | WcAnd _x0 _x1 _x2 ->
- WcAnd (o#_Loc_t _x0) (o#with_constr _x1) (o#with_constr _x2)
- | WcAnt _x0 _x1 -> WcAnt (o#_Loc_t _x0) (o#string _x1) ];
+ [ WcNil _x -> let _x = o#loc _x in WcNil _x
+ | WcTyp _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in WcTyp _x _x_i1 _x_i2
+ | WcMod _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ident _x_i1 in
+ let _x_i2 = o#ident _x_i2 in WcMod _x _x_i1 _x_i2
+ | WcAnd _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#with_constr _x_i1 in
+ let _x_i2 = o#with_constr _x_i2 in WcAnd _x _x_i1 _x_i2
+ | WcAnt _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in WcAnt _x _x_i1 ];
method str_item : str_item -> str_item =
fun
- [ StNil _x0 -> StNil (o#_Loc_t _x0)
- | StCls _x0 _x1 -> StCls (o#_Loc_t _x0) (o#class_expr _x1)
- | StClt _x0 _x1 -> StClt (o#_Loc_t _x0) (o#class_type _x1)
- | StSem _x0 _x1 _x2 ->
- StSem (o#_Loc_t _x0) (o#str_item _x1) (o#str_item _x2)
- | StDir _x0 _x1 _x2 ->
- StDir (o#_Loc_t _x0) (o#string _x1) (o#expr _x2)
- | StExc _x0 _x1 _x2 ->
- StExc (o#_Loc_t _x0) (o#ctyp _x1) (o#meta_option o#ident _x2)
- | StExp _x0 _x1 -> StExp (o#_Loc_t _x0) (o#expr _x1)
- | StExt _x0 _x1 _x2 _x3 ->
- StExt (o#_Loc_t _x0) (o#string _x1) (o#ctyp _x2)
- (o#meta_list o#string _x3)
- | StInc _x0 _x1 -> StInc (o#_Loc_t _x0) (o#module_expr _x1)
- | StMod _x0 _x1 _x2 ->
- StMod (o#_Loc_t _x0) (o#string _x1) (o#module_expr _x2)
- | StRecMod _x0 _x1 ->
- StRecMod (o#_Loc_t _x0) (o#module_binding _x1)
- | StMty _x0 _x1 _x2 ->
- StMty (o#_Loc_t _x0) (o#string _x1) (o#module_type _x2)
- | StOpn _x0 _x1 -> StOpn (o#_Loc_t _x0) (o#ident _x1)
- | StTyp _x0 _x1 -> StTyp (o#_Loc_t _x0) (o#ctyp _x1)
- | StVal _x0 _x1 _x2 ->
- StVal (o#_Loc_t _x0) (o#meta_bool _x1) (o#binding _x2)
- | StAnt _x0 _x1 -> StAnt (o#_Loc_t _x0) (o#string _x1) ];
+ [ StNil _x -> let _x = o#loc _x in StNil _x
+ | StCls _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#class_expr _x_i1 in StCls _x _x_i1
+ | StClt _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#class_type _x_i1 in StClt _x _x_i1
+ | StSem _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#str_item _x_i1 in
+ let _x_i2 = o#str_item _x_i2 in StSem _x _x_i1 _x_i2
+ | StDir _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#expr _x_i2 in StDir _x _x_i1 _x_i2
+ | StExc _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in
+ let _x_i2 = o#meta_option (fun o -> o#ident) _x_i2
+ in StExc _x _x_i1 _x_i2
+ | StExp _x _x_i1 ->
+ let _x = o#loc _x in let _x_i1 = o#expr _x_i1 in StExp _x _x_i1
+ | StExt _x _x_i1 _x_i2 _x_i3 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in
+ let _x_i3 = o#meta_list (fun o -> o#string) _x_i3
+ in StExt _x _x_i1 _x_i2 _x_i3
+ | StInc _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#module_expr _x_i1 in StInc _x _x_i1
+ | StMod _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#module_expr _x_i2 in StMod _x _x_i1 _x_i2
+ | StRecMod _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#module_binding _x_i1 in StRecMod _x _x_i1
+ | StMty _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#module_type _x_i2 in StMty _x _x_i1 _x_i2
+ | StOpn _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ident _x_i1 in StOpn _x _x_i1
+ | StTyp _x _x_i1 ->
+ let _x = o#loc _x in let _x_i1 = o#ctyp _x_i1 in StTyp _x _x_i1
+ | StVal _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#meta_bool _x_i1 in
+ let _x_i2 = o#binding _x_i2 in StVal _x _x_i1 _x_i2
+ | StAnt _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in StAnt _x _x_i1 ];
method sig_item : sig_item -> sig_item =
fun
- [ SgNil _x0 -> SgNil (o#_Loc_t _x0)
- | SgCls _x0 _x1 -> SgCls (o#_Loc_t _x0) (o#class_type _x1)
- | SgClt _x0 _x1 -> SgClt (o#_Loc_t _x0) (o#class_type _x1)
- | SgSem _x0 _x1 _x2 ->
- SgSem (o#_Loc_t _x0) (o#sig_item _x1) (o#sig_item _x2)
- | SgDir _x0 _x1 _x2 ->
- SgDir (o#_Loc_t _x0) (o#string _x1) (o#expr _x2)
- | SgExc _x0 _x1 -> SgExc (o#_Loc_t _x0) (o#ctyp _x1)
- | SgExt _x0 _x1 _x2 _x3 ->
- SgExt (o#_Loc_t _x0) (o#string _x1) (o#ctyp _x2)
- (o#meta_list o#string _x3)
- | SgInc _x0 _x1 -> SgInc (o#_Loc_t _x0) (o#module_type _x1)
- | SgMod _x0 _x1 _x2 ->
- SgMod (o#_Loc_t _x0) (o#string _x1) (o#module_type _x2)
- | SgRecMod _x0 _x1 ->
- SgRecMod (o#_Loc_t _x0) (o#module_binding _x1)
- | SgMty _x0 _x1 _x2 ->
- SgMty (o#_Loc_t _x0) (o#string _x1) (o#module_type _x2)
- | SgOpn _x0 _x1 -> SgOpn (o#_Loc_t _x0) (o#ident _x1)
- | SgTyp _x0 _x1 -> SgTyp (o#_Loc_t _x0) (o#ctyp _x1)
- | SgVal _x0 _x1 _x2 ->
- SgVal (o#_Loc_t _x0) (o#string _x1) (o#ctyp _x2)
- | SgAnt _x0 _x1 -> SgAnt (o#_Loc_t _x0) (o#string _x1) ];
+ [ SgNil _x -> let _x = o#loc _x in SgNil _x
+ | SgCls _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#class_type _x_i1 in SgCls _x _x_i1
+ | SgClt _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#class_type _x_i1 in SgClt _x _x_i1
+ | SgSem _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#sig_item _x_i1 in
+ let _x_i2 = o#sig_item _x_i2 in SgSem _x _x_i1 _x_i2
+ | SgDir _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#expr _x_i2 in SgDir _x _x_i1 _x_i2
+ | SgExc _x _x_i1 ->
+ let _x = o#loc _x in let _x_i1 = o#ctyp _x_i1 in SgExc _x _x_i1
+ | SgExt _x _x_i1 _x_i2 _x_i3 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in
+ let _x_i3 = o#meta_list (fun o -> o#string) _x_i3
+ in SgExt _x _x_i1 _x_i2 _x_i3
+ | SgInc _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#module_type _x_i1 in SgInc _x _x_i1
+ | SgMod _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#module_type _x_i2 in SgMod _x _x_i1 _x_i2
+ | SgRecMod _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#module_binding _x_i1 in SgRecMod _x _x_i1
+ | SgMty _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#module_type _x_i2 in SgMty _x _x_i1 _x_i2
+ | SgOpn _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ident _x_i1 in SgOpn _x _x_i1
+ | SgTyp _x _x_i1 ->
+ let _x = o#loc _x in let _x_i1 = o#ctyp _x_i1 in SgTyp _x _x_i1
+ | SgVal _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in SgVal _x _x_i1 _x_i2
+ | SgAnt _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in SgAnt _x _x_i1 ];
method rec_binding : rec_binding -> rec_binding =
fun
- [ RbNil _x0 -> RbNil (o#_Loc_t _x0)
- | RbSem _x0 _x1 _x2 ->
- RbSem (o#_Loc_t _x0) (o#rec_binding _x1) (o#rec_binding _x2)
- | RbEq _x0 _x1 _x2 ->
- RbEq (o#_Loc_t _x0) (o#ident _x1) (o#expr _x2)
- | RbAnt _x0 _x1 -> RbAnt (o#_Loc_t _x0) (o#string _x1) ];
+ [ RbNil _x -> let _x = o#loc _x in RbNil _x
+ | RbSem _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#rec_binding _x_i1 in
+ let _x_i2 = o#rec_binding _x_i2 in RbSem _x _x_i1 _x_i2
+ | RbEq _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ident _x_i1 in
+ let _x_i2 = o#expr _x_i2 in RbEq _x _x_i1 _x_i2
+ | RbAnt _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in RbAnt _x _x_i1 ];
method patt : patt -> patt =
fun
- [ PaNil _x0 -> PaNil (o#_Loc_t _x0)
- | PaId _x0 _x1 -> PaId (o#_Loc_t _x0) (o#ident _x1)
- | PaAli _x0 _x1 _x2 ->
- PaAli (o#_Loc_t _x0) (o#patt _x1) (o#patt _x2)
- | PaAnt _x0 _x1 -> PaAnt (o#_Loc_t _x0) (o#string _x1)
- | PaAny _x0 -> PaAny (o#_Loc_t _x0)
- | PaApp _x0 _x1 _x2 ->
- PaApp (o#_Loc_t _x0) (o#patt _x1) (o#patt _x2)
- | PaArr _x0 _x1 -> PaArr (o#_Loc_t _x0) (o#patt _x1)
- | PaCom _x0 _x1 _x2 ->
- PaCom (o#_Loc_t _x0) (o#patt _x1) (o#patt _x2)
- | PaSem _x0 _x1 _x2 ->
- PaSem (o#_Loc_t _x0) (o#patt _x1) (o#patt _x2)
- | PaChr _x0 _x1 -> PaChr (o#_Loc_t _x0) (o#string _x1)
- | PaInt _x0 _x1 -> PaInt (o#_Loc_t _x0) (o#string _x1)
- | PaInt32 _x0 _x1 -> PaInt32 (o#_Loc_t _x0) (o#string _x1)
- | PaInt64 _x0 _x1 -> PaInt64 (o#_Loc_t _x0) (o#string _x1)
- | PaNativeInt _x0 _x1 -> PaNativeInt (o#_Loc_t _x0) (o#string _x1)
- | PaFlo _x0 _x1 -> PaFlo (o#_Loc_t _x0) (o#string _x1)
- | PaLab _x0 _x1 _x2 ->
- PaLab (o#_Loc_t _x0) (o#string _x1) (o#patt _x2)
- | PaOlb _x0 _x1 _x2 ->
- PaOlb (o#_Loc_t _x0) (o#string _x1) (o#patt _x2)
- | PaOlbi _x0 _x1 _x2 _x3 ->
- PaOlbi (o#_Loc_t _x0) (o#string _x1) (o#patt _x2) (o#expr _x3)
- | PaOrp _x0 _x1 _x2 ->
- PaOrp (o#_Loc_t _x0) (o#patt _x1) (o#patt _x2)
- | PaRng _x0 _x1 _x2 ->
- PaRng (o#_Loc_t _x0) (o#patt _x1) (o#patt _x2)
- | PaRec _x0 _x1 -> PaRec (o#_Loc_t _x0) (o#patt _x1)
- | PaEq _x0 _x1 _x2 ->
- PaEq (o#_Loc_t _x0) (o#ident _x1) (o#patt _x2)
- | PaStr _x0 _x1 -> PaStr (o#_Loc_t _x0) (o#string _x1)
- | PaTup _x0 _x1 -> PaTup (o#_Loc_t _x0) (o#patt _x1)
- | PaTyc _x0 _x1 _x2 ->
- PaTyc (o#_Loc_t _x0) (o#patt _x1) (o#ctyp _x2)
- | PaTyp _x0 _x1 -> PaTyp (o#_Loc_t _x0) (o#ident _x1)
- | PaVrn _x0 _x1 -> PaVrn (o#_Loc_t _x0) (o#string _x1) ];
+ [ PaNil _x -> let _x = o#loc _x in PaNil _x
+ | PaId _x _x_i1 ->
+ let _x = o#loc _x in let _x_i1 = o#ident _x_i1 in PaId _x _x_i1
+ | PaAli _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#patt _x_i1 in
+ let _x_i2 = o#patt _x_i2 in PaAli _x _x_i1 _x_i2
+ | PaAnt _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in PaAnt _x _x_i1
+ | PaAny _x -> let _x = o#loc _x in PaAny _x
+ | PaApp _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#patt _x_i1 in
+ let _x_i2 = o#patt _x_i2 in PaApp _x _x_i1 _x_i2
+ | PaArr _x _x_i1 ->
+ let _x = o#loc _x in let _x_i1 = o#patt _x_i1 in PaArr _x _x_i1
+ | PaCom _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#patt _x_i1 in
+ let _x_i2 = o#patt _x_i2 in PaCom _x _x_i1 _x_i2
+ | PaSem _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#patt _x_i1 in
+ let _x_i2 = o#patt _x_i2 in PaSem _x _x_i1 _x_i2
+ | PaChr _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in PaChr _x _x_i1
+ | PaInt _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in PaInt _x _x_i1
+ | PaInt32 _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in PaInt32 _x _x_i1
+ | PaInt64 _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in PaInt64 _x _x_i1
+ | PaNativeInt _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in PaNativeInt _x _x_i1
+ | PaFlo _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in PaFlo _x _x_i1
+ | PaLab _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#patt _x_i2 in PaLab _x _x_i1 _x_i2
+ | PaOlb _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#patt _x_i2 in PaOlb _x _x_i1 _x_i2
+ | PaOlbi _x _x_i1 _x_i2 _x_i3 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#patt _x_i2 in
+ let _x_i3 = o#expr _x_i3 in PaOlbi _x _x_i1 _x_i2 _x_i3
+ | PaOrp _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#patt _x_i1 in
+ let _x_i2 = o#patt _x_i2 in PaOrp _x _x_i1 _x_i2
+ | PaRng _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#patt _x_i1 in
+ let _x_i2 = o#patt _x_i2 in PaRng _x _x_i1 _x_i2
+ | PaRec _x _x_i1 ->
+ let _x = o#loc _x in let _x_i1 = o#patt _x_i1 in PaRec _x _x_i1
+ | PaEq _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ident _x_i1 in
+ let _x_i2 = o#patt _x_i2 in PaEq _x _x_i1 _x_i2
+ | PaStr _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in PaStr _x _x_i1
+ | PaTup _x _x_i1 ->
+ let _x = o#loc _x in let _x_i1 = o#patt _x_i1 in PaTup _x _x_i1
+ | PaTyc _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#patt _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in PaTyc _x _x_i1 _x_i2
+ | PaTyp _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ident _x_i1 in PaTyp _x _x_i1
+ | PaVrn _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in PaVrn _x _x_i1 ];
method module_type : module_type -> module_type =
fun
- [ MtNil _x0 -> MtNil (o#_Loc_t _x0)
- | MtId _x0 _x1 -> MtId (o#_Loc_t _x0) (o#ident _x1)
- | MtFun _x0 _x1 _x2 _x3 ->
- MtFun (o#_Loc_t _x0) (o#string _x1) (o#module_type _x2)
- (o#module_type _x3)
- | MtQuo _x0 _x1 -> MtQuo (o#_Loc_t _x0) (o#string _x1)
- | MtSig _x0 _x1 -> MtSig (o#_Loc_t _x0) (o#sig_item _x1)
- | MtWit _x0 _x1 _x2 ->
- MtWit (o#_Loc_t _x0) (o#module_type _x1) (o#with_constr _x2)
- | MtAnt _x0 _x1 -> MtAnt (o#_Loc_t _x0) (o#string _x1) ];
+ [ MtNil _x -> let _x = o#loc _x in MtNil _x
+ | MtId _x _x_i1 ->
+ let _x = o#loc _x in let _x_i1 = o#ident _x_i1 in MtId _x _x_i1
+ | MtFun _x _x_i1 _x_i2 _x_i3 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#module_type _x_i2 in
+ let _x_i3 = o#module_type _x_i3 in MtFun _x _x_i1 _x_i2 _x_i3
+ | MtQuo _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in MtQuo _x _x_i1
+ | MtSig _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#sig_item _x_i1 in MtSig _x _x_i1
+ | MtWit _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#module_type _x_i1 in
+ let _x_i2 = o#with_constr _x_i2 in MtWit _x _x_i1 _x_i2
+ | MtAnt _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in MtAnt _x _x_i1 ];
method module_expr : module_expr -> module_expr =
fun
- [ MeNil _x0 -> MeNil (o#_Loc_t _x0)
- | MeId _x0 _x1 -> MeId (o#_Loc_t _x0) (o#ident _x1)
- | MeApp _x0 _x1 _x2 ->
- MeApp (o#_Loc_t _x0) (o#module_expr _x1) (o#module_expr _x2)
- | MeFun _x0 _x1 _x2 _x3 ->
- MeFun (o#_Loc_t _x0) (o#string _x1) (o#module_type _x2)
- (o#module_expr _x3)
- | MeStr _x0 _x1 -> MeStr (o#_Loc_t _x0) (o#str_item _x1)
- | MeTyc _x0 _x1 _x2 ->
- MeTyc (o#_Loc_t _x0) (o#module_expr _x1) (o#module_type _x2)
- | MeAnt _x0 _x1 -> MeAnt (o#_Loc_t _x0) (o#string _x1) ];
+ [ MeNil _x -> let _x = o#loc _x in MeNil _x
+ | MeId _x _x_i1 ->
+ let _x = o#loc _x in let _x_i1 = o#ident _x_i1 in MeId _x _x_i1
+ | MeApp _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#module_expr _x_i1 in
+ let _x_i2 = o#module_expr _x_i2 in MeApp _x _x_i1 _x_i2
+ | MeFun _x _x_i1 _x_i2 _x_i3 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#module_type _x_i2 in
+ let _x_i3 = o#module_expr _x_i3 in MeFun _x _x_i1 _x_i2 _x_i3
+ | MeStr _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#str_item _x_i1 in MeStr _x _x_i1
+ | MeTyc _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#module_expr _x_i1 in
+ let _x_i2 = o#module_type _x_i2 in MeTyc _x _x_i1 _x_i2
+ | MeAnt _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in MeAnt _x _x_i1 ];
method module_binding : module_binding -> module_binding =
fun
- [ MbNil _x0 -> MbNil (o#_Loc_t _x0)
- | MbAnd _x0 _x1 _x2 ->
- MbAnd (o#_Loc_t _x0) (o#module_binding _x1)
- (o#module_binding _x2)
- | MbColEq _x0 _x1 _x2 _x3 ->
- MbColEq (o#_Loc_t _x0) (o#string _x1) (o#module_type _x2)
- (o#module_expr _x3)
- | MbCol _x0 _x1 _x2 ->
- MbCol (o#_Loc_t _x0) (o#string _x1) (o#module_type _x2)
- | MbAnt _x0 _x1 -> MbAnt (o#_Loc_t _x0) (o#string _x1) ];
+ [ MbNil _x -> let _x = o#loc _x in MbNil _x
+ | MbAnd _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#module_binding _x_i1 in
+ let _x_i2 = o#module_binding _x_i2 in MbAnd _x _x_i1 _x_i2
+ | MbColEq _x _x_i1 _x_i2 _x_i3 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#module_type _x_i2 in
+ let _x_i3 = o#module_expr _x_i3 in MbColEq _x _x_i1 _x_i2 _x_i3
+ | MbCol _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#module_type _x_i2 in MbCol _x _x_i1 _x_i2
+ | MbAnt _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in MbAnt _x _x_i1 ];
method meta_option :
- ! 'a 'b. ('a -> 'b) -> meta_option 'a -> meta_option 'b =
+ ! 'a 'a_out.
+ ('self_type -> 'a -> 'a_out) ->
+ meta_option 'a -> meta_option 'a_out =
fun _f_a ->
fun
[ ONone -> ONone
- | OSome _x0 -> OSome (_f_a _x0)
- | OAnt _x0 -> OAnt (o#string _x0) ];
+ | OSome _x -> let _x = _f_a o _x in OSome _x
+ | OAnt _x -> let _x = o#string _x in OAnt _x ];
method meta_list :
- ! 'a 'b. ('a -> 'b) -> meta_list 'a -> meta_list 'b =
+ ! 'a 'a_out.
+ ('self_type -> 'a -> 'a_out) -> meta_list 'a -> meta_list 'a_out =
fun _f_a ->
fun
[ LNil -> LNil
- | LCons _x0 _x1 -> LCons (_f_a _x0) (o#meta_list _f_a _x1)
- | LAnt _x0 -> LAnt (o#string _x0) ];
+ | LCons _x _x_i1 ->
+ let _x = _f_a o _x in
+ let _x_i1 = o#meta_list _f_a _x_i1 in LCons _x _x_i1
+ | LAnt _x -> let _x = o#string _x in LAnt _x ];
method meta_bool : meta_bool -> meta_bool =
fun
[ BTrue -> BTrue
| BFalse -> BFalse
- | BAnt _x0 -> BAnt (o#string _x0) ];
+ | BAnt _x -> let _x = o#string _x in BAnt _x ];
method match_case : match_case -> match_case =
fun
- [ McNil _x0 -> McNil (o#_Loc_t _x0)
- | McOr _x0 _x1 _x2 ->
- McOr (o#_Loc_t _x0) (o#match_case _x1) (o#match_case _x2)
- | McArr _x0 _x1 _x2 _x3 ->
- McArr (o#_Loc_t _x0) (o#patt _x1) (o#expr _x2) (o#expr _x3)
- | McAnt _x0 _x1 -> McAnt (o#_Loc_t _x0) (o#string _x1) ];
+ [ McNil _x -> let _x = o#loc _x in McNil _x
+ | McOr _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#match_case _x_i1 in
+ let _x_i2 = o#match_case _x_i2 in McOr _x _x_i1 _x_i2
+ | McArr _x _x_i1 _x_i2 _x_i3 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#patt _x_i1 in
+ let _x_i2 = o#expr _x_i2 in
+ let _x_i3 = o#expr _x_i3 in McArr _x _x_i1 _x_i2 _x_i3
+ | McAnt _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in McAnt _x _x_i1 ];
+ method loc : loc -> loc = o#unknown;
method ident : ident -> ident =
fun
- [ IdAcc _x0 _x1 _x2 ->
- IdAcc (o#_Loc_t _x0) (o#ident _x1) (o#ident _x2)
- | IdApp _x0 _x1 _x2 ->
- IdApp (o#_Loc_t _x0) (o#ident _x1) (o#ident _x2)
- | IdLid _x0 _x1 -> IdLid (o#_Loc_t _x0) (o#string _x1)
- | IdUid _x0 _x1 -> IdUid (o#_Loc_t _x0) (o#string _x1)
- | IdAnt _x0 _x1 -> IdAnt (o#_Loc_t _x0) (o#string _x1) ];
+ [ IdAcc _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ident _x_i1 in
+ let _x_i2 = o#ident _x_i2 in IdAcc _x _x_i1 _x_i2
+ | IdApp _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ident _x_i1 in
+ let _x_i2 = o#ident _x_i2 in IdApp _x _x_i1 _x_i2
+ | IdLid _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in IdLid _x _x_i1
+ | IdUid _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in IdUid _x _x_i1
+ | IdAnt _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in IdAnt _x _x_i1 ];
method expr : expr -> expr =
fun
- [ ExNil _x0 -> ExNil (o#_Loc_t _x0)
- | ExId _x0 _x1 -> ExId (o#_Loc_t _x0) (o#ident _x1)
- | ExAcc _x0 _x1 _x2 ->
- ExAcc (o#_Loc_t _x0) (o#expr _x1) (o#expr _x2)
- | ExAnt _x0 _x1 -> ExAnt (o#_Loc_t _x0) (o#string _x1)
- | ExApp _x0 _x1 _x2 ->
- ExApp (o#_Loc_t _x0) (o#expr _x1) (o#expr _x2)
- | ExAre _x0 _x1 _x2 ->
- ExAre (o#_Loc_t _x0) (o#expr _x1) (o#expr _x2)
- | ExArr _x0 _x1 -> ExArr (o#_Loc_t _x0) (o#expr _x1)
- | ExSem _x0 _x1 _x2 ->
- ExSem (o#_Loc_t _x0) (o#expr _x1) (o#expr _x2)
- | ExAsf _x0 -> ExAsf (o#_Loc_t _x0)
- | ExAsr _x0 _x1 -> ExAsr (o#_Loc_t _x0) (o#expr _x1)
- | ExAss _x0 _x1 _x2 ->
- ExAss (o#_Loc_t _x0) (o#expr _x1) (o#expr _x2)
- | ExChr _x0 _x1 -> ExChr (o#_Loc_t _x0) (o#string _x1)
- | ExCoe _x0 _x1 _x2 _x3 ->
- ExCoe (o#_Loc_t _x0) (o#expr _x1) (o#ctyp _x2) (o#ctyp _x3)
- | ExFlo _x0 _x1 -> ExFlo (o#_Loc_t _x0) (o#string _x1)
- | ExFor _x0 _x1 _x2 _x3 _x4 _x5 ->
- ExFor (o#_Loc_t _x0) (o#string _x1) (o#expr _x2) (o#expr _x3)
- (o#meta_bool _x4) (o#expr _x5)
- | ExFun _x0 _x1 -> ExFun (o#_Loc_t _x0) (o#match_case _x1)
- | ExIfe _x0 _x1 _x2 _x3 ->
- ExIfe (o#_Loc_t _x0) (o#expr _x1) (o#expr _x2) (o#expr _x3)
- | ExInt _x0 _x1 -> ExInt (o#_Loc_t _x0) (o#string _x1)
- | ExInt32 _x0 _x1 -> ExInt32 (o#_Loc_t _x0) (o#string _x1)
- | ExInt64 _x0 _x1 -> ExInt64 (o#_Loc_t _x0) (o#string _x1)
- | ExNativeInt _x0 _x1 -> ExNativeInt (o#_Loc_t _x0) (o#string _x1)
- | ExLab _x0 _x1 _x2 ->
- ExLab (o#_Loc_t _x0) (o#string _x1) (o#expr _x2)
- | ExLaz _x0 _x1 -> ExLaz (o#_Loc_t _x0) (o#expr _x1)
- | ExLet _x0 _x1 _x2 _x3 ->
- ExLet (o#_Loc_t _x0) (o#meta_bool _x1) (o#binding _x2)
- (o#expr _x3)
- | ExLmd _x0 _x1 _x2 _x3 ->
- ExLmd (o#_Loc_t _x0) (o#string _x1) (o#module_expr _x2)
- (o#expr _x3)
- | ExMat _x0 _x1 _x2 ->
- ExMat (o#_Loc_t _x0) (o#expr _x1) (o#match_case _x2)
- | ExNew _x0 _x1 -> ExNew (o#_Loc_t _x0) (o#ident _x1)
- | ExObj _x0 _x1 _x2 ->
- ExObj (o#_Loc_t _x0) (o#patt _x1) (o#class_str_item _x2)
- | ExOlb _x0 _x1 _x2 ->
- ExOlb (o#_Loc_t _x0) (o#string _x1) (o#expr _x2)
- | ExOvr _x0 _x1 -> ExOvr (o#_Loc_t _x0) (o#rec_binding _x1)
- | ExRec _x0 _x1 _x2 ->
- ExRec (o#_Loc_t _x0) (o#rec_binding _x1) (o#expr _x2)
- | ExSeq _x0 _x1 -> ExSeq (o#_Loc_t _x0) (o#expr _x1)
- | ExSnd _x0 _x1 _x2 ->
- ExSnd (o#_Loc_t _x0) (o#expr _x1) (o#string _x2)
- | ExSte _x0 _x1 _x2 ->
- ExSte (o#_Loc_t _x0) (o#expr _x1) (o#expr _x2)
- | ExStr _x0 _x1 -> ExStr (o#_Loc_t _x0) (o#string _x1)
- | ExTry _x0 _x1 _x2 ->
- ExTry (o#_Loc_t _x0) (o#expr _x1) (o#match_case _x2)
- | ExTup _x0 _x1 -> ExTup (o#_Loc_t _x0) (o#expr _x1)
- | ExCom _x0 _x1 _x2 ->
- ExCom (o#_Loc_t _x0) (o#expr _x1) (o#expr _x2)
- | ExTyc _x0 _x1 _x2 ->
- ExTyc (o#_Loc_t _x0) (o#expr _x1) (o#ctyp _x2)
- | ExVrn _x0 _x1 -> ExVrn (o#_Loc_t _x0) (o#string _x1)
- | ExWhi _x0 _x1 _x2 ->
- ExWhi (o#_Loc_t _x0) (o#expr _x1) (o#expr _x2) ];
+ [ ExNil _x -> let _x = o#loc _x in ExNil _x
+ | ExId _x _x_i1 ->
+ let _x = o#loc _x in let _x_i1 = o#ident _x_i1 in ExId _x _x_i1
+ | ExAcc _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#expr _x_i1 in
+ let _x_i2 = o#expr _x_i2 in ExAcc _x _x_i1 _x_i2
+ | ExAnt _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in ExAnt _x _x_i1
+ | ExApp _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#expr _x_i1 in
+ let _x_i2 = o#expr _x_i2 in ExApp _x _x_i1 _x_i2
+ | ExAre _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#expr _x_i1 in
+ let _x_i2 = o#expr _x_i2 in ExAre _x _x_i1 _x_i2
+ | ExArr _x _x_i1 ->
+ let _x = o#loc _x in let _x_i1 = o#expr _x_i1 in ExArr _x _x_i1
+ | ExSem _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#expr _x_i1 in
+ let _x_i2 = o#expr _x_i2 in ExSem _x _x_i1 _x_i2
+ | ExAsf _x -> let _x = o#loc _x in ExAsf _x
+ | ExAsr _x _x_i1 ->
+ let _x = o#loc _x in let _x_i1 = o#expr _x_i1 in ExAsr _x _x_i1
+ | ExAss _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#expr _x_i1 in
+ let _x_i2 = o#expr _x_i2 in ExAss _x _x_i1 _x_i2
+ | ExChr _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in ExChr _x _x_i1
+ | ExCoe _x _x_i1 _x_i2 _x_i3 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#expr _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in
+ let _x_i3 = o#ctyp _x_i3 in ExCoe _x _x_i1 _x_i2 _x_i3
+ | ExFlo _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in ExFlo _x _x_i1
+ | ExFor _x _x_i1 _x_i2 _x_i3 _x_i4 _x_i5 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#expr _x_i2 in
+ let _x_i3 = o#expr _x_i3 in
+ let _x_i4 = o#meta_bool _x_i4 in
+ let _x_i5 = o#expr _x_i5
+ in ExFor _x _x_i1 _x_i2 _x_i3 _x_i4 _x_i5
+ | ExFun _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#match_case _x_i1 in ExFun _x _x_i1
+ | ExIfe _x _x_i1 _x_i2 _x_i3 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#expr _x_i1 in
+ let _x_i2 = o#expr _x_i2 in
+ let _x_i3 = o#expr _x_i3 in ExIfe _x _x_i1 _x_i2 _x_i3
+ | ExInt _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in ExInt _x _x_i1
+ | ExInt32 _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in ExInt32 _x _x_i1
+ | ExInt64 _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in ExInt64 _x _x_i1
+ | ExNativeInt _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in ExNativeInt _x _x_i1
+ | ExLab _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#expr _x_i2 in ExLab _x _x_i1 _x_i2
+ | ExLaz _x _x_i1 ->
+ let _x = o#loc _x in let _x_i1 = o#expr _x_i1 in ExLaz _x _x_i1
+ | ExLet _x _x_i1 _x_i2 _x_i3 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#meta_bool _x_i1 in
+ let _x_i2 = o#binding _x_i2 in
+ let _x_i3 = o#expr _x_i3 in ExLet _x _x_i1 _x_i2 _x_i3
+ | ExLmd _x _x_i1 _x_i2 _x_i3 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#module_expr _x_i2 in
+ let _x_i3 = o#expr _x_i3 in ExLmd _x _x_i1 _x_i2 _x_i3
+ | ExMat _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#expr _x_i1 in
+ let _x_i2 = o#match_case _x_i2 in ExMat _x _x_i1 _x_i2
+ | ExNew _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ident _x_i1 in ExNew _x _x_i1
+ | ExObj _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#patt _x_i1 in
+ let _x_i2 = o#class_str_item _x_i2 in ExObj _x _x_i1 _x_i2
+ | ExOlb _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#expr _x_i2 in ExOlb _x _x_i1 _x_i2
+ | ExOvr _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#rec_binding _x_i1 in ExOvr _x _x_i1
+ | ExRec _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#rec_binding _x_i1 in
+ let _x_i2 = o#expr _x_i2 in ExRec _x _x_i1 _x_i2
+ | ExSeq _x _x_i1 ->
+ let _x = o#loc _x in let _x_i1 = o#expr _x_i1 in ExSeq _x _x_i1
+ | ExSnd _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#expr _x_i1 in
+ let _x_i2 = o#string _x_i2 in ExSnd _x _x_i1 _x_i2
+ | ExSte _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#expr _x_i1 in
+ let _x_i2 = o#expr _x_i2 in ExSte _x _x_i1 _x_i2
+ | ExStr _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in ExStr _x _x_i1
+ | ExTry _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#expr _x_i1 in
+ let _x_i2 = o#match_case _x_i2 in ExTry _x _x_i1 _x_i2
+ | ExTup _x _x_i1 ->
+ let _x = o#loc _x in let _x_i1 = o#expr _x_i1 in ExTup _x _x_i1
+ | ExCom _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#expr _x_i1 in
+ let _x_i2 = o#expr _x_i2 in ExCom _x _x_i1 _x_i2
+ | ExTyc _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#expr _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in ExTyc _x _x_i1 _x_i2
+ | ExVrn _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in ExVrn _x _x_i1
+ | ExWhi _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#expr _x_i1 in
+ let _x_i2 = o#expr _x_i2 in ExWhi _x _x_i1 _x_i2 ];
method ctyp : ctyp -> ctyp =
fun
- [ TyNil _x0 -> TyNil (o#_Loc_t _x0)
- | TyAli _x0 _x1 _x2 ->
- TyAli (o#_Loc_t _x0) (o#ctyp _x1) (o#ctyp _x2)
- | TyAny _x0 -> TyAny (o#_Loc_t _x0)
- | TyApp _x0 _x1 _x2 ->
- TyApp (o#_Loc_t _x0) (o#ctyp _x1) (o#ctyp _x2)
- | TyArr _x0 _x1 _x2 ->
- TyArr (o#_Loc_t _x0) (o#ctyp _x1) (o#ctyp _x2)
- | TyCls _x0 _x1 -> TyCls (o#_Loc_t _x0) (o#ident _x1)
- | TyLab _x0 _x1 _x2 ->
- TyLab (o#_Loc_t _x0) (o#string _x1) (o#ctyp _x2)
- | TyId _x0 _x1 -> TyId (o#_Loc_t _x0) (o#ident _x1)
- | TyMan _x0 _x1 _x2 ->
- TyMan (o#_Loc_t _x0) (o#ctyp _x1) (o#ctyp _x2)
- | TyDcl _x0 _x1 _x2 _x3 _x4 ->
- TyDcl (o#_Loc_t _x0) (o#string _x1) (o#list o#ctyp _x2)
- (o#ctyp _x3)
- (o#list (fun (_x0, _x1) -> ((o#ctyp _x0), (o#ctyp _x1))) _x4)
- | TyObj _x0 _x1 _x2 ->
- TyObj (o#_Loc_t _x0) (o#ctyp _x1) (o#meta_bool _x2)
- | TyOlb _x0 _x1 _x2 ->
- TyOlb (o#_Loc_t _x0) (o#string _x1) (o#ctyp _x2)
- | TyPol _x0 _x1 _x2 ->
- TyPol (o#_Loc_t _x0) (o#ctyp _x1) (o#ctyp _x2)
- | TyQuo _x0 _x1 -> TyQuo (o#_Loc_t _x0) (o#string _x1)
- | TyQuP _x0 _x1 -> TyQuP (o#_Loc_t _x0) (o#string _x1)
- | TyQuM _x0 _x1 -> TyQuM (o#_Loc_t _x0) (o#string _x1)
- | TyVrn _x0 _x1 -> TyVrn (o#_Loc_t _x0) (o#string _x1)
- | TyRec _x0 _x1 -> TyRec (o#_Loc_t _x0) (o#ctyp _x1)
- | TyCol _x0 _x1 _x2 ->
- TyCol (o#_Loc_t _x0) (o#ctyp _x1) (o#ctyp _x2)
- | TySem _x0 _x1 _x2 ->
- TySem (o#_Loc_t _x0) (o#ctyp _x1) (o#ctyp _x2)
- | TyCom _x0 _x1 _x2 ->
- TyCom (o#_Loc_t _x0) (o#ctyp _x1) (o#ctyp _x2)
- | TySum _x0 _x1 -> TySum (o#_Loc_t _x0) (o#ctyp _x1)
- | TyOf _x0 _x1 _x2 -> TyOf (o#_Loc_t _x0) (o#ctyp _x1) (o#ctyp _x2)
- | TyAnd _x0 _x1 _x2 ->
- TyAnd (o#_Loc_t _x0) (o#ctyp _x1) (o#ctyp _x2)
- | TyOr _x0 _x1 _x2 -> TyOr (o#_Loc_t _x0) (o#ctyp _x1) (o#ctyp _x2)
- | TyPrv _x0 _x1 -> TyPrv (o#_Loc_t _x0) (o#ctyp _x1)
- | TyMut _x0 _x1 -> TyMut (o#_Loc_t _x0) (o#ctyp _x1)
- | TyTup _x0 _x1 -> TyTup (o#_Loc_t _x0) (o#ctyp _x1)
- | TySta _x0 _x1 _x2 ->
- TySta (o#_Loc_t _x0) (o#ctyp _x1) (o#ctyp _x2)
- | TyVrnEq _x0 _x1 -> TyVrnEq (o#_Loc_t _x0) (o#ctyp _x1)
- | TyVrnSup _x0 _x1 -> TyVrnSup (o#_Loc_t _x0) (o#ctyp _x1)
- | TyVrnInf _x0 _x1 -> TyVrnInf (o#_Loc_t _x0) (o#ctyp _x1)
- | TyVrnInfSup _x0 _x1 _x2 ->
- TyVrnInfSup (o#_Loc_t _x0) (o#ctyp _x1) (o#ctyp _x2)
- | TyAmp _x0 _x1 _x2 ->
- TyAmp (o#_Loc_t _x0) (o#ctyp _x1) (o#ctyp _x2)
- | TyOfAmp _x0 _x1 _x2 ->
- TyOfAmp (o#_Loc_t _x0) (o#ctyp _x1) (o#ctyp _x2)
- | TyAnt _x0 _x1 -> TyAnt (o#_Loc_t _x0) (o#string _x1) ];
+ [ TyNil _x -> let _x = o#loc _x in TyNil _x
+ | TyAli _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in TyAli _x _x_i1 _x_i2
+ | TyAny _x -> let _x = o#loc _x in TyAny _x
+ | TyApp _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in TyApp _x _x_i1 _x_i2
+ | TyArr _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in TyArr _x _x_i1 _x_i2
+ | TyCls _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ident _x_i1 in TyCls _x _x_i1
+ | TyLab _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in TyLab _x _x_i1 _x_i2
+ | TyId _x _x_i1 ->
+ let _x = o#loc _x in let _x_i1 = o#ident _x_i1 in TyId _x _x_i1
+ | TyMan _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in TyMan _x _x_i1 _x_i2
+ | TyDcl _x _x_i1 _x_i2 _x_i3 _x_i4 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#list (fun o -> o#ctyp) _x_i2 in
+ let _x_i3 = o#ctyp _x_i3 in
+ let _x_i4 =
+ o#list
+ (fun o (_x, _x_i1) ->
+ let _x = o#ctyp _x in
+ let _x_i1 = o#ctyp _x_i1 in (_x, _x_i1))
+ _x_i4
+ in TyDcl _x _x_i1 _x_i2 _x_i3 _x_i4
+ | TyObj _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in
+ let _x_i2 = o#meta_bool _x_i2 in TyObj _x _x_i1 _x_i2
+ | TyOlb _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in TyOlb _x _x_i1 _x_i2
+ | TyPol _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in TyPol _x _x_i1 _x_i2
+ | TyQuo _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in TyQuo _x _x_i1
+ | TyQuP _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in TyQuP _x _x_i1
+ | TyQuM _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in TyQuM _x _x_i1
+ | TyVrn _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in TyVrn _x _x_i1
+ | TyRec _x _x_i1 ->
+ let _x = o#loc _x in let _x_i1 = o#ctyp _x_i1 in TyRec _x _x_i1
+ | TyCol _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in TyCol _x _x_i1 _x_i2
+ | TySem _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in TySem _x _x_i1 _x_i2
+ | TyCom _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in TyCom _x _x_i1 _x_i2
+ | TySum _x _x_i1 ->
+ let _x = o#loc _x in let _x_i1 = o#ctyp _x_i1 in TySum _x _x_i1
+ | TyOf _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in TyOf _x _x_i1 _x_i2
+ | TyAnd _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in TyAnd _x _x_i1 _x_i2
+ | TyOr _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in TyOr _x _x_i1 _x_i2
+ | TyPrv _x _x_i1 ->
+ let _x = o#loc _x in let _x_i1 = o#ctyp _x_i1 in TyPrv _x _x_i1
+ | TyMut _x _x_i1 ->
+ let _x = o#loc _x in let _x_i1 = o#ctyp _x_i1 in TyMut _x _x_i1
+ | TyTup _x _x_i1 ->
+ let _x = o#loc _x in let _x_i1 = o#ctyp _x_i1 in TyTup _x _x_i1
+ | TySta _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in TySta _x _x_i1 _x_i2
+ | TyVrnEq _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in TyVrnEq _x _x_i1
+ | TyVrnSup _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in TyVrnSup _x _x_i1
+ | TyVrnInf _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in TyVrnInf _x _x_i1
+ | TyVrnInfSup _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in TyVrnInfSup _x _x_i1 _x_i2
+ | TyAmp _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in TyAmp _x _x_i1 _x_i2
+ | TyOfAmp _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in TyOfAmp _x _x_i1 _x_i2
+ | TyAnt _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in TyAnt _x _x_i1 ];
method class_type : class_type -> class_type =
fun
- [ CtNil _x0 -> CtNil (o#_Loc_t _x0)
- | CtCon _x0 _x1 _x2 _x3 ->
- CtCon (o#_Loc_t _x0) (o#meta_bool _x1) (o#ident _x2)
- (o#ctyp _x3)
- | CtFun _x0 _x1 _x2 ->
- CtFun (o#_Loc_t _x0) (o#ctyp _x1) (o#class_type _x2)
- | CtSig _x0 _x1 _x2 ->
- CtSig (o#_Loc_t _x0) (o#ctyp _x1) (o#class_sig_item _x2)
- | CtAnd _x0 _x1 _x2 ->
- CtAnd (o#_Loc_t _x0) (o#class_type _x1) (o#class_type _x2)
- | CtCol _x0 _x1 _x2 ->
- CtCol (o#_Loc_t _x0) (o#class_type _x1) (o#class_type _x2)
- | CtEq _x0 _x1 _x2 ->
- CtEq (o#_Loc_t _x0) (o#class_type _x1) (o#class_type _x2)
- | CtAnt _x0 _x1 -> CtAnt (o#_Loc_t _x0) (o#string _x1) ];
+ [ CtNil _x -> let _x = o#loc _x in CtNil _x
+ | CtCon _x _x_i1 _x_i2 _x_i3 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#meta_bool _x_i1 in
+ let _x_i2 = o#ident _x_i2 in
+ let _x_i3 = o#ctyp _x_i3 in CtCon _x _x_i1 _x_i2 _x_i3
+ | CtFun _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in
+ let _x_i2 = o#class_type _x_i2 in CtFun _x _x_i1 _x_i2
+ | CtSig _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in
+ let _x_i2 = o#class_sig_item _x_i2 in CtSig _x _x_i1 _x_i2
+ | CtAnd _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#class_type _x_i1 in
+ let _x_i2 = o#class_type _x_i2 in CtAnd _x _x_i1 _x_i2
+ | CtCol _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#class_type _x_i1 in
+ let _x_i2 = o#class_type _x_i2 in CtCol _x _x_i1 _x_i2
+ | CtEq _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#class_type _x_i1 in
+ let _x_i2 = o#class_type _x_i2 in CtEq _x _x_i1 _x_i2
+ | CtAnt _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in CtAnt _x _x_i1 ];
method class_str_item : class_str_item -> class_str_item =
fun
- [ CrNil _x0 -> CrNil (o#_Loc_t _x0)
- | CrSem _x0 _x1 _x2 ->
- CrSem (o#_Loc_t _x0) (o#class_str_item _x1)
- (o#class_str_item _x2)
- | CrCtr _x0 _x1 _x2 ->
- CrCtr (o#_Loc_t _x0) (o#ctyp _x1) (o#ctyp _x2)
- | CrInh _x0 _x1 _x2 ->
- CrInh (o#_Loc_t _x0) (o#class_expr _x1) (o#string _x2)
- | CrIni _x0 _x1 -> CrIni (o#_Loc_t _x0) (o#expr _x1)
- | CrMth _x0 _x1 _x2 _x3 _x4 ->
- CrMth (o#_Loc_t _x0) (o#string _x1) (o#meta_bool _x2)
- (o#expr _x3) (o#ctyp _x4)
- | CrVal _x0 _x1 _x2 _x3 ->
- CrVal (o#_Loc_t _x0) (o#string _x1) (o#meta_bool _x2)
- (o#expr _x3)
- | CrVir _x0 _x1 _x2 _x3 ->
- CrVir (o#_Loc_t _x0) (o#string _x1) (o#meta_bool _x2)
- (o#ctyp _x3)
- | CrVvr _x0 _x1 _x2 _x3 ->
- CrVvr (o#_Loc_t _x0) (o#string _x1) (o#meta_bool _x2)
- (o#ctyp _x3)
- | CrAnt _x0 _x1 -> CrAnt (o#_Loc_t _x0) (o#string _x1) ];
+ [ CrNil _x -> let _x = o#loc _x in CrNil _x
+ | CrSem _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#class_str_item _x_i1 in
+ let _x_i2 = o#class_str_item _x_i2 in CrSem _x _x_i1 _x_i2
+ | CrCtr _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in CrCtr _x _x_i1 _x_i2
+ | CrInh _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#class_expr _x_i1 in
+ let _x_i2 = o#string _x_i2 in CrInh _x _x_i1 _x_i2
+ | CrIni _x _x_i1 ->
+ let _x = o#loc _x in let _x_i1 = o#expr _x_i1 in CrIni _x _x_i1
+ | CrMth _x _x_i1 _x_i2 _x_i3 _x_i4 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#meta_bool _x_i2 in
+ let _x_i3 = o#expr _x_i3 in
+ let _x_i4 = o#ctyp _x_i4 in CrMth _x _x_i1 _x_i2 _x_i3 _x_i4
+ | CrVal _x _x_i1 _x_i2 _x_i3 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#meta_bool _x_i2 in
+ let _x_i3 = o#expr _x_i3 in CrVal _x _x_i1 _x_i2 _x_i3
+ | CrVir _x _x_i1 _x_i2 _x_i3 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#meta_bool _x_i2 in
+ let _x_i3 = o#ctyp _x_i3 in CrVir _x _x_i1 _x_i2 _x_i3
+ | CrVvr _x _x_i1 _x_i2 _x_i3 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#meta_bool _x_i2 in
+ let _x_i3 = o#ctyp _x_i3 in CrVvr _x _x_i1 _x_i2 _x_i3
+ | CrAnt _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in CrAnt _x _x_i1 ];
method class_sig_item : class_sig_item -> class_sig_item =
fun
- [ CgNil _x0 -> CgNil (o#_Loc_t _x0)
- | CgCtr _x0 _x1 _x2 ->
- CgCtr (o#_Loc_t _x0) (o#ctyp _x1) (o#ctyp _x2)
- | CgSem _x0 _x1 _x2 ->
- CgSem (o#_Loc_t _x0) (o#class_sig_item _x1)
- (o#class_sig_item _x2)
- | CgInh _x0 _x1 -> CgInh (o#_Loc_t _x0) (o#class_type _x1)
- | CgMth _x0 _x1 _x2 _x3 ->
- CgMth (o#_Loc_t _x0) (o#string _x1) (o#meta_bool _x2)
- (o#ctyp _x3)
- | CgVal _x0 _x1 _x2 _x3 _x4 ->
- CgVal (o#_Loc_t _x0) (o#string _x1) (o#meta_bool _x2)
- (o#meta_bool _x3) (o#ctyp _x4)
- | CgVir _x0 _x1 _x2 _x3 ->
- CgVir (o#_Loc_t _x0) (o#string _x1) (o#meta_bool _x2)
- (o#ctyp _x3)
- | CgAnt _x0 _x1 -> CgAnt (o#_Loc_t _x0) (o#string _x1) ];
+ [ CgNil _x -> let _x = o#loc _x in CgNil _x
+ | CgCtr _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#ctyp _x_i1 in
+ let _x_i2 = o#ctyp _x_i2 in CgCtr _x _x_i1 _x_i2
+ | CgSem _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#class_sig_item _x_i1 in
+ let _x_i2 = o#class_sig_item _x_i2 in CgSem _x _x_i1 _x_i2
+ | CgInh _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#class_type _x_i1 in CgInh _x _x_i1
+ | CgMth _x _x_i1 _x_i2 _x_i3 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#meta_bool _x_i2 in
+ let _x_i3 = o#ctyp _x_i3 in CgMth _x _x_i1 _x_i2 _x_i3
+ | CgVal _x _x_i1 _x_i2 _x_i3 _x_i4 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#meta_bool _x_i2 in
+ let _x_i3 = o#meta_bool _x_i3 in
+ let _x_i4 = o#ctyp _x_i4 in CgVal _x _x_i1 _x_i2 _x_i3 _x_i4
+ | CgVir _x _x_i1 _x_i2 _x_i3 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in
+ let _x_i2 = o#meta_bool _x_i2 in
+ let _x_i3 = o#ctyp _x_i3 in CgVir _x _x_i1 _x_i2 _x_i3
+ | CgAnt _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in CgAnt _x _x_i1 ];
method class_expr : class_expr -> class_expr =
fun
- [ CeNil _x0 -> CeNil (o#_Loc_t _x0)
- | CeApp _x0 _x1 _x2 ->
- CeApp (o#_Loc_t _x0) (o#class_expr _x1) (o#expr _x2)
- | CeCon _x0 _x1 _x2 _x3 ->
- CeCon (o#_Loc_t _x0) (o#meta_bool _x1) (o#ident _x2)
- (o#ctyp _x3)
- | CeFun _x0 _x1 _x2 ->
- CeFun (o#_Loc_t _x0) (o#patt _x1) (o#class_expr _x2)
- | CeLet _x0 _x1 _x2 _x3 ->
- CeLet (o#_Loc_t _x0) (o#meta_bool _x1) (o#binding _x2)
- (o#class_expr _x3)
- | CeStr _x0 _x1 _x2 ->
- CeStr (o#_Loc_t _x0) (o#patt _x1) (o#class_str_item _x2)
- | CeTyc _x0 _x1 _x2 ->
- CeTyc (o#_Loc_t _x0) (o#class_expr _x1) (o#class_type _x2)
- | CeAnd _x0 _x1 _x2 ->
- CeAnd (o#_Loc_t _x0) (o#class_expr _x1) (o#class_expr _x2)
- | CeEq _x0 _x1 _x2 ->
- CeEq (o#_Loc_t _x0) (o#class_expr _x1) (o#class_expr _x2)
- | CeAnt _x0 _x1 -> CeAnt (o#_Loc_t _x0) (o#string _x1) ];
+ [ CeNil _x -> let _x = o#loc _x in CeNil _x
+ | CeApp _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#class_expr _x_i1 in
+ let _x_i2 = o#expr _x_i2 in CeApp _x _x_i1 _x_i2
+ | CeCon _x _x_i1 _x_i2 _x_i3 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#meta_bool _x_i1 in
+ let _x_i2 = o#ident _x_i2 in
+ let _x_i3 = o#ctyp _x_i3 in CeCon _x _x_i1 _x_i2 _x_i3
+ | CeFun _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#patt _x_i1 in
+ let _x_i2 = o#class_expr _x_i2 in CeFun _x _x_i1 _x_i2
+ | CeLet _x _x_i1 _x_i2 _x_i3 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#meta_bool _x_i1 in
+ let _x_i2 = o#binding _x_i2 in
+ let _x_i3 = o#class_expr _x_i3 in CeLet _x _x_i1 _x_i2 _x_i3
+ | CeStr _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#patt _x_i1 in
+ let _x_i2 = o#class_str_item _x_i2 in CeStr _x _x_i1 _x_i2
+ | CeTyc _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#class_expr _x_i1 in
+ let _x_i2 = o#class_type _x_i2 in CeTyc _x _x_i1 _x_i2
+ | CeAnd _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#class_expr _x_i1 in
+ let _x_i2 = o#class_expr _x_i2 in CeAnd _x _x_i1 _x_i2
+ | CeEq _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#class_expr _x_i1 in
+ let _x_i2 = o#class_expr _x_i2 in CeEq _x _x_i1 _x_i2
+ | CeAnt _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in CeAnt _x _x_i1 ];
method binding : binding -> binding =
fun
- [ BiNil _x0 -> BiNil (o#_Loc_t _x0)
- | BiAnd _x0 _x1 _x2 ->
- BiAnd (o#_Loc_t _x0) (o#binding _x1) (o#binding _x2)
- | BiEq _x0 _x1 _x2 -> BiEq (o#_Loc_t _x0) (o#patt _x1) (o#expr _x2)
- | BiAnt _x0 _x1 -> BiAnt (o#_Loc_t _x0) (o#string _x1) ];
+ [ BiNil _x -> let _x = o#loc _x in BiNil _x
+ | BiAnd _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#binding _x_i1 in
+ let _x_i2 = o#binding _x_i2 in BiAnd _x _x_i1 _x_i2
+ | BiEq _x _x_i1 _x_i2 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#patt _x_i1 in
+ let _x_i2 = o#expr _x_i2 in BiEq _x _x_i1 _x_i2
+ | BiAnt _x _x_i1 ->
+ let _x = o#loc _x in
+ let _x_i1 = o#string _x_i1 in BiAnt _x _x_i1 ];
+ method unknown : ! 'a. 'a -> 'a = fun x -> x;
end;
class fold =
object ((o : 'self_type))
- method string = fun (_ : string) -> (o : 'self_type);
- method int = fun (_ : int) -> (o : 'self_type);
- method float = fun (_ : float) -> (o : 'self_type);
- method bool = fun (_ : bool) -> (o : 'self_type);
+ method string : string -> 'self_type = o#unknown;
method list :
! 'a. ('self_type -> 'a -> 'self_type) -> list 'a -> 'self_type =
- fun f -> List.fold_left f o;
- method option :
- ! 'a. ('self_type -> 'a -> 'self_type) -> option 'a -> 'self_type =
- fun f -> fun [ None -> o | Some x -> f o x ];
- method array :
- ! 'a. ('self_type -> 'a -> 'self_type) -> array 'a -> 'self_type =
- fun f -> Array.fold_left f o;
- method ref :
- ! 'a. ('self_type -> 'a -> 'self_type) -> ref 'a -> 'self_type =
- fun f { val = x } -> f o x;
- method _Loc_t : Loc.t -> 'self_type = fun _ -> o;
+ fun _f_a ->
+ fun
+ [ [] -> o
+ | [ _x :: _x_i1 ] ->
+ let o = _f_a o _x in let o = o#list _f_a _x_i1 in o ];
method with_constr : with_constr -> 'self_type =
fun
- [ WcNil _x0 -> o#_Loc_t _x0
- | WcTyp _x0 _x1 _x2 -> ((o#_Loc_t _x0)#ctyp _x1)#ctyp _x2
- | WcMod _x0 _x1 _x2 -> ((o#_Loc_t _x0)#ident _x1)#ident _x2
- | WcAnd _x0 _x1 _x2 ->
- ((o#_Loc_t _x0)#with_constr _x1)#with_constr _x2
- | WcAnt _x0 _x1 -> (o#_Loc_t _x0)#string _x1 ];
+ [ WcNil _x -> let o = o#loc _x in o
+ | WcTyp _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
+ | WcMod _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#ident _x_i1 in let o = o#ident _x_i2 in o
+ | WcAnd _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#with_constr _x_i1 in let o = o#with_constr _x_i2 in o
+ | WcAnt _x _x_i1 -> let o = o#loc _x in let o = o#string _x_i1 in o ];
method str_item : str_item -> 'self_type =
fun
- [ StNil _x0 -> o#_Loc_t _x0
- | StCls _x0 _x1 -> (o#_Loc_t _x0)#class_expr _x1
- | StClt _x0 _x1 -> (o#_Loc_t _x0)#class_type _x1
- | StSem _x0 _x1 _x2 -> ((o#_Loc_t _x0)#str_item _x1)#str_item _x2
- | StDir _x0 _x1 _x2 -> ((o#_Loc_t _x0)#string _x1)#expr _x2
- | StExc _x0 _x1 _x2 ->
- ((o#_Loc_t _x0)#ctyp _x1)#meta_option (fun o -> o#ident) _x2
- | StExp _x0 _x1 -> (o#_Loc_t _x0)#expr _x1
- | StExt _x0 _x1 _x2 _x3 ->
- (((o#_Loc_t _x0)#string _x1)#ctyp _x2)#meta_list
- (fun o -> o#string) _x3
- | StInc _x0 _x1 -> (o#_Loc_t _x0)#module_expr _x1
- | StMod _x0 _x1 _x2 -> ((o#_Loc_t _x0)#string _x1)#module_expr _x2
- | StRecMod _x0 _x1 -> (o#_Loc_t _x0)#module_binding _x1
- | StMty _x0 _x1 _x2 -> ((o#_Loc_t _x0)#string _x1)#module_type _x2
- | StOpn _x0 _x1 -> (o#_Loc_t _x0)#ident _x1
- | StTyp _x0 _x1 -> (o#_Loc_t _x0)#ctyp _x1
- | StVal _x0 _x1 _x2 -> ((o#_Loc_t _x0)#meta_bool _x1)#binding _x2
- | StAnt _x0 _x1 -> (o#_Loc_t _x0)#string _x1 ];
+ [ StNil _x -> let o = o#loc _x in o
+ | StCls _x _x_i1 ->
+ let o = o#loc _x in let o = o#class_expr _x_i1 in o
+ | StClt _x _x_i1 ->
+ let o = o#loc _x in let o = o#class_type _x_i1 in o
+ | StSem _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#str_item _x_i1 in let o = o#str_item _x_i2 in o
+ | StDir _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in let o = o#expr _x_i2 in o
+ | StExc _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#ctyp _x_i1 in
+ let o = o#meta_option (fun o -> o#ident) _x_i2 in o
+ | StExp _x _x_i1 -> let o = o#loc _x in let o = o#expr _x_i1 in o
+ | StExt _x _x_i1 _x_i2 _x_i3 ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in
+ let o = o#ctyp _x_i2 in
+ let o = o#meta_list (fun o -> o#string) _x_i3 in o
+ | StInc _x _x_i1 ->
+ let o = o#loc _x in let o = o#module_expr _x_i1 in o
+ | StMod _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in let o = o#module_expr _x_i2 in o
+ | StRecMod _x _x_i1 ->
+ let o = o#loc _x in let o = o#module_binding _x_i1 in o
+ | StMty _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in let o = o#module_type _x_i2 in o
+ | StOpn _x _x_i1 -> let o = o#loc _x in let o = o#ident _x_i1 in o
+ | StTyp _x _x_i1 -> let o = o#loc _x in let o = o#ctyp _x_i1 in o
+ | StVal _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#meta_bool _x_i1 in let o = o#binding _x_i2 in o
+ | StAnt _x _x_i1 -> let o = o#loc _x in let o = o#string _x_i1 in o ];
method sig_item : sig_item -> 'self_type =
fun
- [ SgNil _x0 -> o#_Loc_t _x0
- | SgCls _x0 _x1 -> (o#_Loc_t _x0)#class_type _x1
- | SgClt _x0 _x1 -> (o#_Loc_t _x0)#class_type _x1
- | SgSem _x0 _x1 _x2 -> ((o#_Loc_t _x0)#sig_item _x1)#sig_item _x2
- | SgDir _x0 _x1 _x2 -> ((o#_Loc_t _x0)#string _x1)#expr _x2
- | SgExc _x0 _x1 -> (o#_Loc_t _x0)#ctyp _x1
- | SgExt _x0 _x1 _x2 _x3 ->
- (((o#_Loc_t _x0)#string _x1)#ctyp _x2)#meta_list
- (fun o -> o#string) _x3
- | SgInc _x0 _x1 -> (o#_Loc_t _x0)#module_type _x1
- | SgMod _x0 _x1 _x2 -> ((o#_Loc_t _x0)#string _x1)#module_type _x2
- | SgRecMod _x0 _x1 -> (o#_Loc_t _x0)#module_binding _x1
- | SgMty _x0 _x1 _x2 -> ((o#_Loc_t _x0)#string _x1)#module_type _x2
- | SgOpn _x0 _x1 -> (o#_Loc_t _x0)#ident _x1
- | SgTyp _x0 _x1 -> (o#_Loc_t _x0)#ctyp _x1
- | SgVal _x0 _x1 _x2 -> ((o#_Loc_t _x0)#string _x1)#ctyp _x2
- | SgAnt _x0 _x1 -> (o#_Loc_t _x0)#string _x1 ];
+ [ SgNil _x -> let o = o#loc _x in o
+ | SgCls _x _x_i1 ->
+ let o = o#loc _x in let o = o#class_type _x_i1 in o
+ | SgClt _x _x_i1 ->
+ let o = o#loc _x in let o = o#class_type _x_i1 in o
+ | SgSem _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#sig_item _x_i1 in let o = o#sig_item _x_i2 in o
+ | SgDir _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in let o = o#expr _x_i2 in o
+ | SgExc _x _x_i1 -> let o = o#loc _x in let o = o#ctyp _x_i1 in o
+ | SgExt _x _x_i1 _x_i2 _x_i3 ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in
+ let o = o#ctyp _x_i2 in
+ let o = o#meta_list (fun o -> o#string) _x_i3 in o
+ | SgInc _x _x_i1 ->
+ let o = o#loc _x in let o = o#module_type _x_i1 in o
+ | SgMod _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in let o = o#module_type _x_i2 in o
+ | SgRecMod _x _x_i1 ->
+ let o = o#loc _x in let o = o#module_binding _x_i1 in o
+ | SgMty _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in let o = o#module_type _x_i2 in o
+ | SgOpn _x _x_i1 -> let o = o#loc _x in let o = o#ident _x_i1 in o
+ | SgTyp _x _x_i1 -> let o = o#loc _x in let o = o#ctyp _x_i1 in o
+ | SgVal _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in let o = o#ctyp _x_i2 in o
+ | SgAnt _x _x_i1 -> let o = o#loc _x in let o = o#string _x_i1 in o ];
method rec_binding : rec_binding -> 'self_type =
fun
- [ RbNil _x0 -> o#_Loc_t _x0
- | RbSem _x0 _x1 _x2 ->
- ((o#_Loc_t _x0)#rec_binding _x1)#rec_binding _x2
- | RbEq _x0 _x1 _x2 -> ((o#_Loc_t _x0)#ident _x1)#expr _x2
- | RbAnt _x0 _x1 -> (o#_Loc_t _x0)#string _x1 ];
+ [ RbNil _x -> let o = o#loc _x in o
+ | RbSem _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#rec_binding _x_i1 in let o = o#rec_binding _x_i2 in o
+ | RbEq _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#ident _x_i1 in let o = o#expr _x_i2 in o
+ | RbAnt _x _x_i1 -> let o = o#loc _x in let o = o#string _x_i1 in o ];
method patt : patt -> 'self_type =
fun
- [ PaNil _x0 -> o#_Loc_t _x0
- | PaId _x0 _x1 -> (o#_Loc_t _x0)#ident _x1
- | PaAli _x0 _x1 _x2 -> ((o#_Loc_t _x0)#patt _x1)#patt _x2
- | PaAnt _x0 _x1 -> (o#_Loc_t _x0)#string _x1
- | PaAny _x0 -> o#_Loc_t _x0
- | PaApp _x0 _x1 _x2 -> ((o#_Loc_t _x0)#patt _x1)#patt _x2
- | PaArr _x0 _x1 -> (o#_Loc_t _x0)#patt _x1
- | PaCom _x0 _x1 _x2 -> ((o#_Loc_t _x0)#patt _x1)#patt _x2
- | PaSem _x0 _x1 _x2 -> ((o#_Loc_t _x0)#patt _x1)#patt _x2
- | PaChr _x0 _x1 -> (o#_Loc_t _x0)#string _x1
- | PaInt _x0 _x1 -> (o#_Loc_t _x0)#string _x1
- | PaInt32 _x0 _x1 -> (o#_Loc_t _x0)#string _x1
- | PaInt64 _x0 _x1 -> (o#_Loc_t _x0)#string _x1
- | PaNativeInt _x0 _x1 -> (o#_Loc_t _x0)#string _x1
- | PaFlo _x0 _x1 -> (o#_Loc_t _x0)#string _x1
- | PaLab _x0 _x1 _x2 -> ((o#_Loc_t _x0)#string _x1)#patt _x2
- | PaOlb _x0 _x1 _x2 -> ((o#_Loc_t _x0)#string _x1)#patt _x2
- | PaOlbi _x0 _x1 _x2 _x3 ->
- (((o#_Loc_t _x0)#string _x1)#patt _x2)#expr _x3
- | PaOrp _x0 _x1 _x2 -> ((o#_Loc_t _x0)#patt _x1)#patt _x2
- | PaRng _x0 _x1 _x2 -> ((o#_Loc_t _x0)#patt _x1)#patt _x2
- | PaRec _x0 _x1 -> (o#_Loc_t _x0)#patt _x1
- | PaEq _x0 _x1 _x2 -> ((o#_Loc_t _x0)#ident _x1)#patt _x2
- | PaStr _x0 _x1 -> (o#_Loc_t _x0)#string _x1
- | PaTup _x0 _x1 -> (o#_Loc_t _x0)#patt _x1
- | PaTyc _x0 _x1 _x2 -> ((o#_Loc_t _x0)#patt _x1)#ctyp _x2
- | PaTyp _x0 _x1 -> (o#_Loc_t _x0)#ident _x1
- | PaVrn _x0 _x1 -> (o#_Loc_t _x0)#string _x1 ];
+ [ PaNil _x -> let o = o#loc _x in o
+ | PaId _x _x_i1 -> let o = o#loc _x in let o = o#ident _x_i1 in o
+ | PaAli _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#patt _x_i1 in let o = o#patt _x_i2 in o
+ | PaAnt _x _x_i1 -> let o = o#loc _x in let o = o#string _x_i1 in o
+ | PaAny _x -> let o = o#loc _x in o
+ | PaApp _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#patt _x_i1 in let o = o#patt _x_i2 in o
+ | PaArr _x _x_i1 -> let o = o#loc _x in let o = o#patt _x_i1 in o
+ | PaCom _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#patt _x_i1 in let o = o#patt _x_i2 in o
+ | PaSem _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#patt _x_i1 in let o = o#patt _x_i2 in o
+ | PaChr _x _x_i1 -> let o = o#loc _x in let o = o#string _x_i1 in o
+ | PaInt _x _x_i1 -> let o = o#loc _x in let o = o#string _x_i1 in o
+ | PaInt32 _x _x_i1 ->
+ let o = o#loc _x in let o = o#string _x_i1 in o
+ | PaInt64 _x _x_i1 ->
+ let o = o#loc _x in let o = o#string _x_i1 in o
+ | PaNativeInt _x _x_i1 ->
+ let o = o#loc _x in let o = o#string _x_i1 in o
+ | PaFlo _x _x_i1 -> let o = o#loc _x in let o = o#string _x_i1 in o
+ | PaLab _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in let o = o#patt _x_i2 in o
+ | PaOlb _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in let o = o#patt _x_i2 in o
+ | PaOlbi _x _x_i1 _x_i2 _x_i3 ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in
+ let o = o#patt _x_i2 in let o = o#expr _x_i3 in o
+ | PaOrp _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#patt _x_i1 in let o = o#patt _x_i2 in o
+ | PaRng _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#patt _x_i1 in let o = o#patt _x_i2 in o
+ | PaRec _x _x_i1 -> let o = o#loc _x in let o = o#patt _x_i1 in o
+ | PaEq _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#ident _x_i1 in let o = o#patt _x_i2 in o
+ | PaStr _x _x_i1 -> let o = o#loc _x in let o = o#string _x_i1 in o
+ | PaTup _x _x_i1 -> let o = o#loc _x in let o = o#patt _x_i1 in o
+ | PaTyc _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#patt _x_i1 in let o = o#ctyp _x_i2 in o
+ | PaTyp _x _x_i1 -> let o = o#loc _x in let o = o#ident _x_i1 in o
+ | PaVrn _x _x_i1 -> let o = o#loc _x in let o = o#string _x_i1 in o ];
method module_type : module_type -> 'self_type =
fun
- [ MtNil _x0 -> o#_Loc_t _x0
- | MtId _x0 _x1 -> (o#_Loc_t _x0)#ident _x1
- | MtFun _x0 _x1 _x2 _x3 ->
- (((o#_Loc_t _x0)#string _x1)#module_type _x2)#module_type _x3
- | MtQuo _x0 _x1 -> (o#_Loc_t _x0)#string _x1
- | MtSig _x0 _x1 -> (o#_Loc_t _x0)#sig_item _x1
- | MtWit _x0 _x1 _x2 ->
- ((o#_Loc_t _x0)#module_type _x1)#with_constr _x2
- | MtAnt _x0 _x1 -> (o#_Loc_t _x0)#string _x1 ];
+ [ MtNil _x -> let o = o#loc _x in o
+ | MtId _x _x_i1 -> let o = o#loc _x in let o = o#ident _x_i1 in o
+ | MtFun _x _x_i1 _x_i2 _x_i3 ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in
+ let o = o#module_type _x_i2 in let o = o#module_type _x_i3 in o
+ | MtQuo _x _x_i1 -> let o = o#loc _x in let o = o#string _x_i1 in o
+ | MtSig _x _x_i1 ->
+ let o = o#loc _x in let o = o#sig_item _x_i1 in o
+ | MtWit _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#module_type _x_i1 in let o = o#with_constr _x_i2 in o
+ | MtAnt _x _x_i1 -> let o = o#loc _x in let o = o#string _x_i1 in o ];
method module_expr : module_expr -> 'self_type =
fun
- [ MeNil _x0 -> o#_Loc_t _x0
- | MeId _x0 _x1 -> (o#_Loc_t _x0)#ident _x1
- | MeApp _x0 _x1 _x2 ->
- ((o#_Loc_t _x0)#module_expr _x1)#module_expr _x2
- | MeFun _x0 _x1 _x2 _x3 ->
- (((o#_Loc_t _x0)#string _x1)#module_type _x2)#module_expr _x3
- | MeStr _x0 _x1 -> (o#_Loc_t _x0)#str_item _x1
- | MeTyc _x0 _x1 _x2 ->
- ((o#_Loc_t _x0)#module_expr _x1)#module_type _x2
- | MeAnt _x0 _x1 -> (o#_Loc_t _x0)#string _x1 ];
+ [ MeNil _x -> let o = o#loc _x in o
+ | MeId _x _x_i1 -> let o = o#loc _x in let o = o#ident _x_i1 in o
+ | MeApp _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#module_expr _x_i1 in let o = o#module_expr _x_i2 in o
+ | MeFun _x _x_i1 _x_i2 _x_i3 ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in
+ let o = o#module_type _x_i2 in let o = o#module_expr _x_i3 in o
+ | MeStr _x _x_i1 ->
+ let o = o#loc _x in let o = o#str_item _x_i1 in o
+ | MeTyc _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#module_expr _x_i1 in let o = o#module_type _x_i2 in o
+ | MeAnt _x _x_i1 -> let o = o#loc _x in let o = o#string _x_i1 in o ];
method module_binding : module_binding -> 'self_type =
fun
- [ MbNil _x0 -> o#_Loc_t _x0
- | MbAnd _x0 _x1 _x2 ->
- ((o#_Loc_t _x0)#module_binding _x1)#module_binding _x2
- | MbColEq _x0 _x1 _x2 _x3 ->
- (((o#_Loc_t _x0)#string _x1)#module_type _x2)#module_expr _x3
- | MbCol _x0 _x1 _x2 -> ((o#_Loc_t _x0)#string _x1)#module_type _x2
- | MbAnt _x0 _x1 -> (o#_Loc_t _x0)#string _x1 ];
+ [ MbNil _x -> let o = o#loc _x in o
+ | MbAnd _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#module_binding _x_i1 in
+ let o = o#module_binding _x_i2 in o
+ | MbColEq _x _x_i1 _x_i2 _x_i3 ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in
+ let o = o#module_type _x_i2 in let o = o#module_expr _x_i3 in o
+ | MbCol _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in let o = o#module_type _x_i2 in o
+ | MbAnt _x _x_i1 -> let o = o#loc _x in let o = o#string _x_i1 in o ];
method meta_option :
! 'a.
('self_type -> 'a -> 'self_type) -> meta_option 'a -> 'self_type =
fun _f_a ->
fun
[ ONone -> o
- | OSome _x0 -> _f_a o _x0
- | OAnt _x0 -> o#string _x0 ];
+ | OSome _x -> let o = _f_a o _x in o
+ | OAnt _x -> let o = o#string _x in o ];
method meta_list :
! 'a.
('self_type -> 'a -> 'self_type) -> meta_list 'a -> 'self_type =
fun _f_a ->
fun
[ LNil -> o
- | LCons _x0 _x1 -> (_f_a o _x0)#meta_list (fun o -> _f_a o) _x1
- | LAnt _x0 -> o#string _x0 ];
+ | LCons _x _x_i1 ->
+ let o = _f_a o _x in let o = o#meta_list _f_a _x_i1 in o
+ | LAnt _x -> let o = o#string _x in o ];
method meta_bool : meta_bool -> 'self_type =
- fun [ BTrue -> o | BFalse -> o | BAnt _x0 -> o#string _x0 ];
+ fun
+ [ BTrue -> o
+ | BFalse -> o
+ | BAnt _x -> let o = o#string _x in o ];
method match_case : match_case -> 'self_type =
fun
- [ McNil _x0 -> o#_Loc_t _x0
- | McOr _x0 _x1 _x2 ->
- ((o#_Loc_t _x0)#match_case _x1)#match_case _x2
- | McArr _x0 _x1 _x2 _x3 ->
- (((o#_Loc_t _x0)#patt _x1)#expr _x2)#expr _x3
- | McAnt _x0 _x1 -> (o#_Loc_t _x0)#string _x1 ];
+ [ McNil _x -> let o = o#loc _x in o
+ | McOr _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#match_case _x_i1 in let o = o#match_case _x_i2 in o
+ | McArr _x _x_i1 _x_i2 _x_i3 ->
+ let o = o#loc _x in
+ let o = o#patt _x_i1 in
+ let o = o#expr _x_i2 in let o = o#expr _x_i3 in o
+ | McAnt _x _x_i1 -> let o = o#loc _x in let o = o#string _x_i1 in o ];
+ method loc : loc -> 'self_type = o#unknown;
method ident : ident -> 'self_type =
fun
- [ IdAcc _x0 _x1 _x2 -> ((o#_Loc_t _x0)#ident _x1)#ident _x2
- | IdApp _x0 _x1 _x2 -> ((o#_Loc_t _x0)#ident _x1)#ident _x2
- | IdLid _x0 _x1 -> (o#_Loc_t _x0)#string _x1
- | IdUid _x0 _x1 -> (o#_Loc_t _x0)#string _x1
- | IdAnt _x0 _x1 -> (o#_Loc_t _x0)#string _x1 ];
+ [ IdAcc _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#ident _x_i1 in let o = o#ident _x_i2 in o
+ | IdApp _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#ident _x_i1 in let o = o#ident _x_i2 in o
+ | IdLid _x _x_i1 -> let o = o#loc _x in let o = o#string _x_i1 in o
+ | IdUid _x _x_i1 -> let o = o#loc _x in let o = o#string _x_i1 in o
+ | IdAnt _x _x_i1 -> let o = o#loc _x in let o = o#string _x_i1 in o ];
method expr : expr -> 'self_type =
fun
- [ ExNil _x0 -> o#_Loc_t _x0
- | ExId _x0 _x1 -> (o#_Loc_t _x0)#ident _x1
- | ExAcc _x0 _x1 _x2 -> ((o#_Loc_t _x0)#expr _x1)#expr _x2
- | ExAnt _x0 _x1 -> (o#_Loc_t _x0)#string _x1
- | ExApp _x0 _x1 _x2 -> ((o#_Loc_t _x0)#expr _x1)#expr _x2
- | ExAre _x0 _x1 _x2 -> ((o#_Loc_t _x0)#expr _x1)#expr _x2
- | ExArr _x0 _x1 -> (o#_Loc_t _x0)#expr _x1
- | ExSem _x0 _x1 _x2 -> ((o#_Loc_t _x0)#expr _x1)#expr _x2
- | ExAsf _x0 -> o#_Loc_t _x0
- | ExAsr _x0 _x1 -> (o#_Loc_t _x0)#expr _x1
- | ExAss _x0 _x1 _x2 -> ((o#_Loc_t _x0)#expr _x1)#expr _x2
- | ExChr _x0 _x1 -> (o#_Loc_t _x0)#string _x1
- | ExCoe _x0 _x1 _x2 _x3 ->
- (((o#_Loc_t _x0)#expr _x1)#ctyp _x2)#ctyp _x3
- | ExFlo _x0 _x1 -> (o#_Loc_t _x0)#string _x1
- | ExFor _x0 _x1 _x2 _x3 _x4 _x5 ->
- (((((o#_Loc_t _x0)#string _x1)#expr _x2)#expr _x3)#meta_bool
- _x4)#
- expr _x5
- | ExFun _x0 _x1 -> (o#_Loc_t _x0)#match_case _x1
- | ExIfe _x0 _x1 _x2 _x3 ->
- (((o#_Loc_t _x0)#expr _x1)#expr _x2)#expr _x3
- | ExInt _x0 _x1 -> (o#_Loc_t _x0)#string _x1
- | ExInt32 _x0 _x1 -> (o#_Loc_t _x0)#string _x1
- | ExInt64 _x0 _x1 -> (o#_Loc_t _x0)#string _x1
- | ExNativeInt _x0 _x1 -> (o#_Loc_t _x0)#string _x1
- | ExLab _x0 _x1 _x2 -> ((o#_Loc_t _x0)#string _x1)#expr _x2
- | ExLaz _x0 _x1 -> (o#_Loc_t _x0)#expr _x1
- | ExLet _x0 _x1 _x2 _x3 ->
- (((o#_Loc_t _x0)#meta_bool _x1)#binding _x2)#expr _x3
- | ExLmd _x0 _x1 _x2 _x3 ->
- (((o#_Loc_t _x0)#string _x1)#module_expr _x2)#expr _x3
- | ExMat _x0 _x1 _x2 -> ((o#_Loc_t _x0)#expr _x1)#match_case _x2
- | ExNew _x0 _x1 -> (o#_Loc_t _x0)#ident _x1
- | ExObj _x0 _x1 _x2 -> ((o#_Loc_t _x0)#patt _x1)#class_str_item _x2
- | ExOlb _x0 _x1 _x2 -> ((o#_Loc_t _x0)#string _x1)#expr _x2
- | ExOvr _x0 _x1 -> (o#_Loc_t _x0)#rec_binding _x1
- | ExRec _x0 _x1 _x2 -> ((o#_Loc_t _x0)#rec_binding _x1)#expr _x2
- | ExSeq _x0 _x1 -> (o#_Loc_t _x0)#expr _x1
- | ExSnd _x0 _x1 _x2 -> ((o#_Loc_t _x0)#expr _x1)#string _x2
- | ExSte _x0 _x1 _x2 -> ((o#_Loc_t _x0)#expr _x1)#expr _x2
- | ExStr _x0 _x1 -> (o#_Loc_t _x0)#string _x1
- | ExTry _x0 _x1 _x2 -> ((o#_Loc_t _x0)#expr _x1)#match_case _x2
- | ExTup _x0 _x1 -> (o#_Loc_t _x0)#expr _x1
- | ExCom _x0 _x1 _x2 -> ((o#_Loc_t _x0)#expr _x1)#expr _x2
- | ExTyc _x0 _x1 _x2 -> ((o#_Loc_t _x0)#expr _x1)#ctyp _x2
- | ExVrn _x0 _x1 -> (o#_Loc_t _x0)#string _x1
- | ExWhi _x0 _x1 _x2 -> ((o#_Loc_t _x0)#expr _x1)#expr _x2 ];
+ [ ExNil _x -> let o = o#loc _x in o
+ | ExId _x _x_i1 -> let o = o#loc _x in let o = o#ident _x_i1 in o
+ | ExAcc _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#expr _x_i1 in let o = o#expr _x_i2 in o
+ | ExAnt _x _x_i1 -> let o = o#loc _x in let o = o#string _x_i1 in o
+ | ExApp _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#expr _x_i1 in let o = o#expr _x_i2 in o
+ | ExAre _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#expr _x_i1 in let o = o#expr _x_i2 in o
+ | ExArr _x _x_i1 -> let o = o#loc _x in let o = o#expr _x_i1 in o
+ | ExSem _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#expr _x_i1 in let o = o#expr _x_i2 in o
+ | ExAsf _x -> let o = o#loc _x in o
+ | ExAsr _x _x_i1 -> let o = o#loc _x in let o = o#expr _x_i1 in o
+ | ExAss _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#expr _x_i1 in let o = o#expr _x_i2 in o
+ | ExChr _x _x_i1 -> let o = o#loc _x in let o = o#string _x_i1 in o
+ | ExCoe _x _x_i1 _x_i2 _x_i3 ->
+ let o = o#loc _x in
+ let o = o#expr _x_i1 in
+ let o = o#ctyp _x_i2 in let o = o#ctyp _x_i3 in o
+ | ExFlo _x _x_i1 -> let o = o#loc _x in let o = o#string _x_i1 in o
+ | ExFor _x _x_i1 _x_i2 _x_i3 _x_i4 _x_i5 ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in
+ let o = o#expr _x_i2 in
+ let o = o#expr _x_i3 in
+ let o = o#meta_bool _x_i4 in let o = o#expr _x_i5 in o
+ | ExFun _x _x_i1 ->
+ let o = o#loc _x in let o = o#match_case _x_i1 in o
+ | ExIfe _x _x_i1 _x_i2 _x_i3 ->
+ let o = o#loc _x in
+ let o = o#expr _x_i1 in
+ let o = o#expr _x_i2 in let o = o#expr _x_i3 in o
+ | ExInt _x _x_i1 -> let o = o#loc _x in let o = o#string _x_i1 in o
+ | ExInt32 _x _x_i1 ->
+ let o = o#loc _x in let o = o#string _x_i1 in o
+ | ExInt64 _x _x_i1 ->
+ let o = o#loc _x in let o = o#string _x_i1 in o
+ | ExNativeInt _x _x_i1 ->
+ let o = o#loc _x in let o = o#string _x_i1 in o
+ | ExLab _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in let o = o#expr _x_i2 in o
+ | ExLaz _x _x_i1 -> let o = o#loc _x in let o = o#expr _x_i1 in o
+ | ExLet _x _x_i1 _x_i2 _x_i3 ->
+ let o = o#loc _x in
+ let o = o#meta_bool _x_i1 in
+ let o = o#binding _x_i2 in let o = o#expr _x_i3 in o
+ | ExLmd _x _x_i1 _x_i2 _x_i3 ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in
+ let o = o#module_expr _x_i2 in let o = o#expr _x_i3 in o
+ | ExMat _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#expr _x_i1 in let o = o#match_case _x_i2 in o
+ | ExNew _x _x_i1 -> let o = o#loc _x in let o = o#ident _x_i1 in o
+ | ExObj _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#patt _x_i1 in let o = o#class_str_item _x_i2 in o
+ | ExOlb _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in let o = o#expr _x_i2 in o
+ | ExOvr _x _x_i1 ->
+ let o = o#loc _x in let o = o#rec_binding _x_i1 in o
+ | ExRec _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#rec_binding _x_i1 in let o = o#expr _x_i2 in o
+ | ExSeq _x _x_i1 -> let o = o#loc _x in let o = o#expr _x_i1 in o
+ | ExSnd _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#expr _x_i1 in let o = o#string _x_i2 in o
+ | ExSte _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#expr _x_i1 in let o = o#expr _x_i2 in o
+ | ExStr _x _x_i1 -> let o = o#loc _x in let o = o#string _x_i1 in o
+ | ExTry _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#expr _x_i1 in let o = o#match_case _x_i2 in o
+ | ExTup _x _x_i1 -> let o = o#loc _x in let o = o#expr _x_i1 in o
+ | ExCom _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#expr _x_i1 in let o = o#expr _x_i2 in o
+ | ExTyc _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#expr _x_i1 in let o = o#ctyp _x_i2 in o
+ | ExVrn _x _x_i1 -> let o = o#loc _x in let o = o#string _x_i1 in o
+ | ExWhi _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#expr _x_i1 in let o = o#expr _x_i2 in o ];
method ctyp : ctyp -> 'self_type =
fun
- [ TyNil _x0 -> o#_Loc_t _x0
- | TyAli _x0 _x1 _x2 -> ((o#_Loc_t _x0)#ctyp _x1)#ctyp _x2
- | TyAny _x0 -> o#_Loc_t _x0
- | TyApp _x0 _x1 _x2 -> ((o#_Loc_t _x0)#ctyp _x1)#ctyp _x2
- | TyArr _x0 _x1 _x2 -> ((o#_Loc_t _x0)#ctyp _x1)#ctyp _x2
- | TyCls _x0 _x1 -> (o#_Loc_t _x0)#ident _x1
- | TyLab _x0 _x1 _x2 -> ((o#_Loc_t _x0)#string _x1)#ctyp _x2
- | TyId _x0 _x1 -> (o#_Loc_t _x0)#ident _x1
- | TyMan _x0 _x1 _x2 -> ((o#_Loc_t _x0)#ctyp _x1)#ctyp _x2
- | TyDcl _x0 _x1 _x2 _x3 _x4 ->
- ((((o#_Loc_t _x0)#string _x1)#list (fun o -> o#ctyp) _x2)#ctyp
- _x3)#
- list (fun o (_x0, _x1) -> (o#ctyp _x0)#ctyp _x1) _x4
- | TyObj _x0 _x1 _x2 -> ((o#_Loc_t _x0)#ctyp _x1)#meta_bool _x2
- | TyOlb _x0 _x1 _x2 -> ((o#_Loc_t _x0)#string _x1)#ctyp _x2
- | TyPol _x0 _x1 _x2 -> ((o#_Loc_t _x0)#ctyp _x1)#ctyp _x2
- | TyQuo _x0 _x1 -> (o#_Loc_t _x0)#string _x1
- | TyQuP _x0 _x1 -> (o#_Loc_t _x0)#string _x1
- | TyQuM _x0 _x1 -> (o#_Loc_t _x0)#string _x1
- | TyVrn _x0 _x1 -> (o#_Loc_t _x0)#string _x1
- | TyRec _x0 _x1 -> (o#_Loc_t _x0)#ctyp _x1
- | TyCol _x0 _x1 _x2 -> ((o#_Loc_t _x0)#ctyp _x1)#ctyp _x2
- | TySem _x0 _x1 _x2 -> ((o#_Loc_t _x0)#ctyp _x1)#ctyp _x2
- | TyCom _x0 _x1 _x2 -> ((o#_Loc_t _x0)#ctyp _x1)#ctyp _x2
- | TySum _x0 _x1 -> (o#_Loc_t _x0)#ctyp _x1
- | TyOf _x0 _x1 _x2 -> ((o#_Loc_t _x0)#ctyp _x1)#ctyp _x2
- | TyAnd _x0 _x1 _x2 -> ((o#_Loc_t _x0)#ctyp _x1)#ctyp _x2
- | TyOr _x0 _x1 _x2 -> ((o#_Loc_t _x0)#ctyp _x1)#ctyp _x2
- | TyPrv _x0 _x1 -> (o#_Loc_t _x0)#ctyp _x1
- | TyMut _x0 _x1 -> (o#_Loc_t _x0)#ctyp _x1
- | TyTup _x0 _x1 -> (o#_Loc_t _x0)#ctyp _x1
- | TySta _x0 _x1 _x2 -> ((o#_Loc_t _x0)#ctyp _x1)#ctyp _x2
- | TyVrnEq _x0 _x1 -> (o#_Loc_t _x0)#ctyp _x1
- | TyVrnSup _x0 _x1 -> (o#_Loc_t _x0)#ctyp _x1
- | TyVrnInf _x0 _x1 -> (o#_Loc_t _x0)#ctyp _x1
- | TyVrnInfSup _x0 _x1 _x2 -> ((o#_Loc_t _x0)#ctyp _x1)#ctyp _x2
- | TyAmp _x0 _x1 _x2 -> ((o#_Loc_t _x0)#ctyp _x1)#ctyp _x2
- | TyOfAmp _x0 _x1 _x2 -> ((o#_Loc_t _x0)#ctyp _x1)#ctyp _x2
- | TyAnt _x0 _x1 -> (o#_Loc_t _x0)#string _x1 ];
+ [ TyNil _x -> let o = o#loc _x in o
+ | TyAli _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
+ | TyAny _x -> let o = o#loc _x in o
+ | TyApp _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
+ | TyArr _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
+ | TyCls _x _x_i1 -> let o = o#loc _x in let o = o#ident _x_i1 in o
+ | TyLab _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in let o = o#ctyp _x_i2 in o
+ | TyId _x _x_i1 -> let o = o#loc _x in let o = o#ident _x_i1 in o
+ | TyMan _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
+ | TyDcl _x _x_i1 _x_i2 _x_i3 _x_i4 ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in
+ let o = o#list (fun o -> o#ctyp) _x_i2 in
+ let o = o#ctyp _x_i3 in
+ let o =
+ o#list
+ (fun o (_x, _x_i1) ->
+ let o = o#ctyp _x in let o = o#ctyp _x_i1 in o)
+ _x_i4
+ in o
+ | TyObj _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#ctyp _x_i1 in let o = o#meta_bool _x_i2 in o
+ | TyOlb _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in let o = o#ctyp _x_i2 in o
+ | TyPol _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
+ | TyQuo _x _x_i1 -> let o = o#loc _x in let o = o#string _x_i1 in o
+ | TyQuP _x _x_i1 -> let o = o#loc _x in let o = o#string _x_i1 in o
+ | TyQuM _x _x_i1 -> let o = o#loc _x in let o = o#string _x_i1 in o
+ | TyVrn _x _x_i1 -> let o = o#loc _x in let o = o#string _x_i1 in o
+ | TyRec _x _x_i1 -> let o = o#loc _x in let o = o#ctyp _x_i1 in o
+ | TyCol _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
+ | TySem _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
+ | TyCom _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
+ | TySum _x _x_i1 -> let o = o#loc _x in let o = o#ctyp _x_i1 in o
+ | TyOf _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
+ | TyAnd _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
+ | TyOr _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
+ | TyPrv _x _x_i1 -> let o = o#loc _x in let o = o#ctyp _x_i1 in o
+ | TyMut _x _x_i1 -> let o = o#loc _x in let o = o#ctyp _x_i1 in o
+ | TyTup _x _x_i1 -> let o = o#loc _x in let o = o#ctyp _x_i1 in o
+ | TySta _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
+ | TyVrnEq _x _x_i1 -> let o = o#loc _x in let o = o#ctyp _x_i1 in o
+ | TyVrnSup _x _x_i1 ->
+ let o = o#loc _x in let o = o#ctyp _x_i1 in o
+ | TyVrnInf _x _x_i1 ->
+ let o = o#loc _x in let o = o#ctyp _x_i1 in o
+ | TyVrnInfSup _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
+ | TyAmp _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
+ | TyOfAmp _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
+ | TyAnt _x _x_i1 -> let o = o#loc _x in let o = o#string _x_i1 in o ];
method class_type : class_type -> 'self_type =
fun
- [ CtNil _x0 -> o#_Loc_t _x0
- | CtCon _x0 _x1 _x2 _x3 ->
- (((o#_Loc_t _x0)#meta_bool _x1)#ident _x2)#ctyp _x3
- | CtFun _x0 _x1 _x2 -> ((o#_Loc_t _x0)#ctyp _x1)#class_type _x2
- | CtSig _x0 _x1 _x2 -> ((o#_Loc_t _x0)#ctyp _x1)#class_sig_item _x2
- | CtAnd _x0 _x1 _x2 ->
- ((o#_Loc_t _x0)#class_type _x1)#class_type _x2
- | CtCol _x0 _x1 _x2 ->
- ((o#_Loc_t _x0)#class_type _x1)#class_type _x2
- | CtEq _x0 _x1 _x2 ->
- ((o#_Loc_t _x0)#class_type _x1)#class_type _x2
- | CtAnt _x0 _x1 -> (o#_Loc_t _x0)#string _x1 ];
+ [ CtNil _x -> let o = o#loc _x in o
+ | CtCon _x _x_i1 _x_i2 _x_i3 ->
+ let o = o#loc _x in
+ let o = o#meta_bool _x_i1 in
+ let o = o#ident _x_i2 in let o = o#ctyp _x_i3 in o
+ | CtFun _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#ctyp _x_i1 in let o = o#class_type _x_i2 in o
+ | CtSig _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#ctyp _x_i1 in let o = o#class_sig_item _x_i2 in o
+ | CtAnd _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#class_type _x_i1 in let o = o#class_type _x_i2 in o
+ | CtCol _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#class_type _x_i1 in let o = o#class_type _x_i2 in o
+ | CtEq _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#class_type _x_i1 in let o = o#class_type _x_i2 in o
+ | CtAnt _x _x_i1 -> let o = o#loc _x in let o = o#string _x_i1 in o ];
method class_str_item : class_str_item -> 'self_type =
fun
- [ CrNil _x0 -> o#_Loc_t _x0
- | CrSem _x0 _x1 _x2 ->
- ((o#_Loc_t _x0)#class_str_item _x1)#class_str_item _x2
- | CrCtr _x0 _x1 _x2 -> ((o#_Loc_t _x0)#ctyp _x1)#ctyp _x2
- | CrInh _x0 _x1 _x2 -> ((o#_Loc_t _x0)#class_expr _x1)#string _x2
- | CrIni _x0 _x1 -> (o#_Loc_t _x0)#expr _x1
- | CrMth _x0 _x1 _x2 _x3 _x4 ->
- ((((o#_Loc_t _x0)#string _x1)#meta_bool _x2)#expr _x3)#ctyp _x4
- | CrVal _x0 _x1 _x2 _x3 ->
- (((o#_Loc_t _x0)#string _x1)#meta_bool _x2)#expr _x3
- | CrVir _x0 _x1 _x2 _x3 ->
- (((o#_Loc_t _x0)#string _x1)#meta_bool _x2)#ctyp _x3
- | CrVvr _x0 _x1 _x2 _x3 ->
- (((o#_Loc_t _x0)#string _x1)#meta_bool _x2)#ctyp _x3
- | CrAnt _x0 _x1 -> (o#_Loc_t _x0)#string _x1 ];
+ [ CrNil _x -> let o = o#loc _x in o
+ | CrSem _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#class_str_item _x_i1 in
+ let o = o#class_str_item _x_i2 in o
+ | CrCtr _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
+ | CrInh _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#class_expr _x_i1 in let o = o#string _x_i2 in o
+ | CrIni _x _x_i1 -> let o = o#loc _x in let o = o#expr _x_i1 in o
+ | CrMth _x _x_i1 _x_i2 _x_i3 _x_i4 ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in
+ let o = o#meta_bool _x_i2 in
+ let o = o#expr _x_i3 in let o = o#ctyp _x_i4 in o
+ | CrVal _x _x_i1 _x_i2 _x_i3 ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in
+ let o = o#meta_bool _x_i2 in let o = o#expr _x_i3 in o
+ | CrVir _x _x_i1 _x_i2 _x_i3 ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in
+ let o = o#meta_bool _x_i2 in let o = o#ctyp _x_i3 in o
+ | CrVvr _x _x_i1 _x_i2 _x_i3 ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in
+ let o = o#meta_bool _x_i2 in let o = o#ctyp _x_i3 in o
+ | CrAnt _x _x_i1 -> let o = o#loc _x in let o = o#string _x_i1 in o ];
method class_sig_item : class_sig_item -> 'self_type =
fun
- [ CgNil _x0 -> o#_Loc_t _x0
- | CgCtr _x0 _x1 _x2 -> ((o#_Loc_t _x0)#ctyp _x1)#ctyp _x2
- | CgSem _x0 _x1 _x2 ->
- ((o#_Loc_t _x0)#class_sig_item _x1)#class_sig_item _x2
- | CgInh _x0 _x1 -> (o#_Loc_t _x0)#class_type _x1
- | CgMth _x0 _x1 _x2 _x3 ->
- (((o#_Loc_t _x0)#string _x1)#meta_bool _x2)#ctyp _x3
- | CgVal _x0 _x1 _x2 _x3 _x4 ->
- ((((o#_Loc_t _x0)#string _x1)#meta_bool _x2)#meta_bool _x3)#
- ctyp _x4
- | CgVir _x0 _x1 _x2 _x3 ->
- (((o#_Loc_t _x0)#string _x1)#meta_bool _x2)#ctyp _x3
- | CgAnt _x0 _x1 -> (o#_Loc_t _x0)#string _x1 ];
+ [ CgNil _x -> let o = o#loc _x in o
+ | CgCtr _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
+ | CgSem _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#class_sig_item _x_i1 in
+ let o = o#class_sig_item _x_i2 in o
+ | CgInh _x _x_i1 ->
+ let o = o#loc _x in let o = o#class_type _x_i1 in o
+ | CgMth _x _x_i1 _x_i2 _x_i3 ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in
+ let o = o#meta_bool _x_i2 in let o = o#ctyp _x_i3 in o
+ | CgVal _x _x_i1 _x_i2 _x_i3 _x_i4 ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in
+ let o = o#meta_bool _x_i2 in
+ let o = o#meta_bool _x_i3 in let o = o#ctyp _x_i4 in o
+ | CgVir _x _x_i1 _x_i2 _x_i3 ->
+ let o = o#loc _x in
+ let o = o#string _x_i1 in
+ let o = o#meta_bool _x_i2 in let o = o#ctyp _x_i3 in o
+ | CgAnt _x _x_i1 -> let o = o#loc _x in let o = o#string _x_i1 in o ];
method class_expr : class_expr -> 'self_type =
fun
- [ CeNil _x0 -> o#_Loc_t _x0
- | CeApp _x0 _x1 _x2 -> ((o#_Loc_t _x0)#class_expr _x1)#expr _x2
- | CeCon _x0 _x1 _x2 _x3 ->
- (((o#_Loc_t _x0)#meta_bool _x1)#ident _x2)#ctyp _x3
- | CeFun _x0 _x1 _x2 -> ((o#_Loc_t _x0)#patt _x1)#class_expr _x2
- | CeLet _x0 _x1 _x2 _x3 ->
- (((o#_Loc_t _x0)#meta_bool _x1)#binding _x2)#class_expr _x3
- | CeStr _x0 _x1 _x2 -> ((o#_Loc_t _x0)#patt _x1)#class_str_item _x2
- | CeTyc _x0 _x1 _x2 ->
- ((o#_Loc_t _x0)#class_expr _x1)#class_type _x2
- | CeAnd _x0 _x1 _x2 ->
- ((o#_Loc_t _x0)#class_expr _x1)#class_expr _x2
- | CeEq _x0 _x1 _x2 ->
- ((o#_Loc_t _x0)#class_expr _x1)#class_expr _x2
- | CeAnt _x0 _x1 -> (o#_Loc_t _x0)#string _x1 ];
+ [ CeNil _x -> let o = o#loc _x in o
+ | CeApp _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#class_expr _x_i1 in let o = o#expr _x_i2 in o
+ | CeCon _x _x_i1 _x_i2 _x_i3 ->
+ let o = o#loc _x in
+ let o = o#meta_bool _x_i1 in
+ let o = o#ident _x_i2 in let o = o#ctyp _x_i3 in o
+ | CeFun _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#patt _x_i1 in let o = o#class_expr _x_i2 in o
+ | CeLet _x _x_i1 _x_i2 _x_i3 ->
+ let o = o#loc _x in
+ let o = o#meta_bool _x_i1 in
+ let o = o#binding _x_i2 in let o = o#class_expr _x_i3 in o
+ | CeStr _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#patt _x_i1 in let o = o#class_str_item _x_i2 in o
+ | CeTyc _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#class_expr _x_i1 in let o = o#class_type _x_i2 in o
+ | CeAnd _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#class_expr _x_i1 in let o = o#class_expr _x_i2 in o
+ | CeEq _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#class_expr _x_i1 in let o = o#class_expr _x_i2 in o
+ | CeAnt _x _x_i1 -> let o = o#loc _x in let o = o#string _x_i1 in o ];
method binding : binding -> 'self_type =
fun
- [ BiNil _x0 -> o#_Loc_t _x0
- | BiAnd _x0 _x1 _x2 -> ((o#_Loc_t _x0)#binding _x1)#binding _x2
- | BiEq _x0 _x1 _x2 -> ((o#_Loc_t _x0)#patt _x1)#expr _x2
- | BiAnt _x0 _x1 -> (o#_Loc_t _x0)#string _x1 ];
+ [ BiNil _x -> let o = o#loc _x in o
+ | BiAnd _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#binding _x_i1 in let o = o#binding _x_i2 in o
+ | BiEq _x _x_i1 _x_i2 ->
+ let o = o#loc _x in
+ let o = o#patt _x_i1 in let o = o#expr _x_i2 in o
+ | BiAnt _x _x_i1 -> let o = o#loc _x in let o = o#string _x_i1 in o ];
+ method unknown : ! 'a. 'a -> 'self_type = fun _ -> o;
end;
value map_expr f =
object inherit map as super; method expr = fun x -> f (super#expr x);
method sig_item = fun x -> f (super#sig_item x);
end;
value map_loc f =
- object
- inherit map as super;
- method _Loc_t = fun x -> f (super#_Loc_t x);
- end;
+ object inherit map as super; method loc = fun x -> f (super#loc x); end;
end;
module R =
struct
open Camlp4
+
(* -*- camlp4r -*- *)
(****************************************************************************)
(* *)
* - Nicolas Pouillard: refactoring
*)
module Id =
- struct
- let name = "Camlp4RevisedParserParser"
- let version =
- "$Id: Camlp4OCamlRevisedParser.ml,v 1.2.2.17 2007/05/10 14:24:22 pouillar Exp $"
- end
+ struct let name = "Camlp4OCamlRevisedParser"
+ let version = "$Id$"
+ end
+
module Make (Syntax : Sig.Camlp4Syntax) =
struct
open Sig
+
include Syntax
+
(* Camlp4_config.constructors_arity.val := True; *)
let _ = Camlp4_config.constructors_arity := false
+
let help_sequences () =
(Printf.eprintf
"\
New syntax:
+ (e1; e2; ... ; en) OR begin e1; e2; ... ; en end
+ while e do e1; e2; ... ; en done
+ for v = v1 to/downto v2 do e1; e2; ... ; en done
+Old syntax (still supported):
do {e1; e2; ... ; en}
while e do {e1; e2; ... ; en}
for v = v1 to/downto v2 do {e1; e2; ... ; en}
-Old (no more supported) syntax:
+Very old (no more supported) syntax:
do e1; e2; ... ; en-1; return en
while e do e1; e2; ... ; en; done
for v = v1 to/downto v2 do e1; e2; ... ; en; done
";
flush stderr;
exit 1)
+
let _ =
Options.add "-help_seq" (Arg.Unit help_sequences)
"Print explanations about new sequences and exit."
+
let _ = Gram.Entry.clear a_CHAR
+
let _ = Gram.Entry.clear a_FLOAT
+
let _ = Gram.Entry.clear a_INT
+
let _ = Gram.Entry.clear a_INT32
+
let _ = Gram.Entry.clear a_INT64
+
let _ = Gram.Entry.clear a_LABEL
+
let _ = Gram.Entry.clear a_LIDENT
+
let _ = Gram.Entry.clear a_NATIVEINT
+
let _ = Gram.Entry.clear a_OPTLABEL
+
let _ = Gram.Entry.clear a_STRING
+
let _ = Gram.Entry.clear a_UIDENT
+
let _ = Gram.Entry.clear a_ident
+
let _ = Gram.Entry.clear amp_ctyp
+
let _ = Gram.Entry.clear and_ctyp
+
let _ = Gram.Entry.clear match_case
+
let _ = Gram.Entry.clear match_case0
+
let _ = Gram.Entry.clear match_case_quot
+
let _ = Gram.Entry.clear binding
+
let _ = Gram.Entry.clear binding_quot
+
let _ = Gram.Entry.clear rec_binding_quot
+
let _ = Gram.Entry.clear class_declaration
+
let _ = Gram.Entry.clear class_description
+
let _ = Gram.Entry.clear class_expr
+
let _ = Gram.Entry.clear class_expr_quot
+
let _ = Gram.Entry.clear class_fun_binding
+
let _ = Gram.Entry.clear class_fun_def
+
let _ = Gram.Entry.clear class_info_for_class_expr
+
let _ = Gram.Entry.clear class_info_for_class_type
+
let _ = Gram.Entry.clear class_longident
+
let _ = Gram.Entry.clear class_longident_and_param
+
let _ = Gram.Entry.clear class_name_and_param
+
let _ = Gram.Entry.clear class_sig_item
+
let _ = Gram.Entry.clear class_sig_item_quot
+
let _ = Gram.Entry.clear class_signature
+
let _ = Gram.Entry.clear class_str_item
+
let _ = Gram.Entry.clear class_str_item_quot
+
let _ = Gram.Entry.clear class_structure
+
let _ = Gram.Entry.clear class_type
+
let _ = Gram.Entry.clear class_type_declaration
+
let _ = Gram.Entry.clear class_type_longident
+
let _ = Gram.Entry.clear class_type_longident_and_param
+
let _ = Gram.Entry.clear class_type_plus
+
let _ = Gram.Entry.clear class_type_quot
+
let _ = Gram.Entry.clear comma_ctyp
+
let _ = Gram.Entry.clear comma_expr
+
let _ = Gram.Entry.clear comma_ipatt
+
let _ = Gram.Entry.clear comma_patt
+
let _ = Gram.Entry.clear comma_type_parameter
+
let _ = Gram.Entry.clear constrain
+
let _ = Gram.Entry.clear constructor_arg_list
+
let _ = Gram.Entry.clear constructor_declaration
+
let _ = Gram.Entry.clear constructor_declarations
+
let _ = Gram.Entry.clear ctyp
+
let _ = Gram.Entry.clear ctyp_quot
+
let _ = Gram.Entry.clear cvalue_binding
+
let _ = Gram.Entry.clear direction_flag
+
let _ = Gram.Entry.clear dummy
+
let _ = Gram.Entry.clear eq_expr
+
let _ = Gram.Entry.clear expr
+
let _ = Gram.Entry.clear expr_eoi
+
let _ = Gram.Entry.clear expr_quot
+
let _ = Gram.Entry.clear field_expr
+
let _ = Gram.Entry.clear fun_binding
+
let _ = Gram.Entry.clear fun_def
+
let _ = Gram.Entry.clear ident
+
let _ = Gram.Entry.clear ident_quot
+
let _ = Gram.Entry.clear implem
+
let _ = Gram.Entry.clear interf
+
let _ = Gram.Entry.clear ipatt
+
let _ = Gram.Entry.clear ipatt_tcon
+
let _ = Gram.Entry.clear label
+
let _ = Gram.Entry.clear label_declaration
+
let _ = Gram.Entry.clear label_expr
+
let _ = Gram.Entry.clear label_ipatt
+
let _ = Gram.Entry.clear label_longident
+
let _ = Gram.Entry.clear label_patt
+
let _ = Gram.Entry.clear labeled_ipatt
+
let _ = Gram.Entry.clear let_binding
+
let _ = Gram.Entry.clear meth_list
+
let _ = Gram.Entry.clear module_binding
+
let _ = Gram.Entry.clear module_binding0
+
let _ = Gram.Entry.clear module_binding_quot
+
let _ = Gram.Entry.clear module_declaration
+
let _ = Gram.Entry.clear module_expr
+
let _ = Gram.Entry.clear module_expr_quot
+
let _ = Gram.Entry.clear module_longident
+
let _ = Gram.Entry.clear module_longident_with_app
+
let _ = Gram.Entry.clear module_rec_declaration
+
let _ = Gram.Entry.clear module_type
+
let _ = Gram.Entry.clear module_type_quot
+
let _ = Gram.Entry.clear more_ctyp
+
let _ = Gram.Entry.clear name_tags
+
let _ = Gram.Entry.clear opt_as_lident
+
let _ = Gram.Entry.clear opt_class_self_patt
+
let _ = Gram.Entry.clear opt_class_self_type
+
let _ = Gram.Entry.clear opt_comma_ctyp
+
let _ = Gram.Entry.clear opt_dot_dot
+
let _ = Gram.Entry.clear opt_eq_ctyp
+
let _ = Gram.Entry.clear opt_expr
+
let _ = Gram.Entry.clear opt_meth_list
+
let _ = Gram.Entry.clear opt_mutable
+
let _ = Gram.Entry.clear opt_polyt
+
let _ = Gram.Entry.clear opt_private
+
let _ = Gram.Entry.clear opt_rec
+
let _ = Gram.Entry.clear opt_virtual
+
let _ = Gram.Entry.clear opt_when_expr
+
let _ = Gram.Entry.clear patt
+
let _ = Gram.Entry.clear patt_as_patt_opt
+
let _ = Gram.Entry.clear patt_eoi
+
let _ = Gram.Entry.clear patt_quot
+
let _ = Gram.Entry.clear patt_tcon
+
let _ = Gram.Entry.clear phrase
+
let _ = Gram.Entry.clear poly_type
+
let _ = Gram.Entry.clear row_field
+
let _ = Gram.Entry.clear sem_expr
+
let _ = Gram.Entry.clear sem_expr_for_list
+
let _ = Gram.Entry.clear sem_patt
+
let _ = Gram.Entry.clear sem_patt_for_list
+
let _ = Gram.Entry.clear semi
+
let _ = Gram.Entry.clear sequence
+
let _ = Gram.Entry.clear sig_item
+
let _ = Gram.Entry.clear sig_item_quot
+
let _ = Gram.Entry.clear sig_items
+
let _ = Gram.Entry.clear star_ctyp
+
let _ = Gram.Entry.clear str_item
+
let _ = Gram.Entry.clear str_item_quot
+
let _ = Gram.Entry.clear str_items
+
let _ = Gram.Entry.clear top_phrase
+
let _ = Gram.Entry.clear type_constraint
+
let _ = Gram.Entry.clear type_declaration
+
let _ = Gram.Entry.clear type_ident_and_parameters
+
let _ = Gram.Entry.clear type_kind
+
let _ = Gram.Entry.clear type_longident
+
let _ = Gram.Entry.clear type_longident_and_parameters
+
let _ = Gram.Entry.clear type_parameter
+
let _ = Gram.Entry.clear type_parameters
+
let _ = Gram.Entry.clear typevars
+
let _ = Gram.Entry.clear use_file
+
let _ = Gram.Entry.clear val_longident
+
let _ = Gram.Entry.clear value_let
+
let _ = Gram.Entry.clear value_val
+
let _ = Gram.Entry.clear with_constr
+
let _ = Gram.Entry.clear with_constr_quot
+
let neg_string n =
let len = String.length n
in
if (len > 0) && (n.[0] = '-')
then String.sub n 1 (len - 1)
else "-" ^ n
+
let mkumin _loc f arg =
match arg with
| Ast.ExInt (_, n) -> Ast.ExInt (_loc, neg_string n)
| _ ->
Ast.ExApp (_loc, Ast.ExId (_loc, Ast.IdLid (_loc, "~" ^ f)),
arg)
+
let mklistexp _loc last =
let rec loop top =
function
e1),
loop false el)
in loop true
+
let mkassert _loc =
function
| Ast.ExId (_, (Ast.IdUid (_, "False"))) -> Ast.ExAsf _loc
| (* this case takes care about
the special assert false node *)
e -> Ast.ExAsr (_loc, e)
+
let append_eLem el e = el @ [ e ]
+
let mk_anti ?(c = "") n s = "\\$" ^ (n ^ (c ^ (":" ^ s)))
+
let mksequence _loc =
function
| (Ast.ExSem (_, _, _) | Ast.ExAnt (_, _) as e) ->
Ast.ExSeq (_loc, e)
| e -> e
+
let mksequence' _loc =
function
| (Ast.ExSem (_, _, _) as e) -> Ast.ExSeq (_loc, e)
| e -> e
+
let module_type_app mt1 mt2 =
match (mt1, mt2) with
| (Ast.MtId (_loc, i1), Ast.MtId (_, i2)) ->
Ast.MtId (_loc, Ast.IdApp (_loc, i1, i2))
| _ -> raise Stream.Failure
+
let module_type_acc mt1 mt2 =
match (mt1, mt2) with
| (Ast.MtId (_loc, i1), Ast.MtId (_, i2)) ->
Ast.MtId (_loc, Ast.IdAcc (_loc, i1, i2))
| _ -> raise Stream.Failure
+
let bigarray_get _loc arr arg =
let coords =
match arg with
Ast.IdLid (_loc, "get")))),
arr),
Ast.ExArr (_loc, Ast.exSem_of_list coords))
+
let bigarray_set _loc var newval =
match var with
| Ast.ExApp (_,
Ast.ExArr (_loc, coords)),
newval))
| _ -> None
+
let test_not_left_brace_nor_do =
Gram.Entry.of_parser "test_not_left_brace_nor_do"
(fun strm ->
| Some (((KEYWORD "{" | KEYWORD "do"), _)) ->
raise Stream.Failure
| _ -> ())
+
let stopped_at _loc = Some (Loc.move_line 1 _loc)
+
(* FIXME be more precise *)
let symbolchar =
let list =
- [ '!'; '$'; '%'; '&'; '*'; '+'; '-'; '.'; '/'; ':'; '<'; '=';
- '>'; '?'; '@'; '^'; '|'; '~' ] in
+ [ '$'; '!'; '%'; '&'; '*'; '+'; '-'; '.'; '/'; ':'; '<'; '=';
+ '>'; '?'; '@'; '^'; '|'; '~'; '\\' ] in
let rec loop s i =
if i == (String.length s)
then true
else if List.mem s.[i] list then loop s (i + 1) else false
in loop
+
let _ =
let list = [ '!'; '?'; '~' ] in
let excl = [ "!="; "??" ]
(Stream.junk __strm;
Ast.ExId (_loc, Ast.IdLid (_loc, x)))
| _ -> raise Stream.Failure)
+
let _ =
let list_ok =
[ "<"; ">"; "<="; ">="; "="; "<>"; "=="; "!="; "$" ] in
(Stream.junk __strm;
Ast.ExId (_loc, Ast.IdLid (_loc, x)))
| _ -> raise Stream.Failure)
+
let _ =
let list = [ '@'; '^' ]
in
(Stream.junk __strm;
Ast.ExId (_loc, Ast.IdLid (_loc, x)))
| _ -> raise Stream.Failure)
+
let _ =
let list = [ '+'; '-' ]
in
(Stream.junk __strm;
Ast.ExId (_loc, Ast.IdLid (_loc, x)))
| _ -> raise Stream.Failure)
+
let _ =
- let list = [ '*'; '/'; '%' ]
+ let list = [ '*'; '/'; '%'; '\\' ]
in
Gram.Entry.setup_parser infixop3
(fun (__strm : _ Stream.t) ->
(Stream.junk __strm;
Ast.ExId (_loc, Ast.IdLid (_loc, x)))
| _ -> raise Stream.Failure)
+
let _ =
Gram.Entry.setup_parser infixop4
(fun (__strm : _ Stream.t) ->
->
(Stream.junk __strm; Ast.ExId (_loc, Ast.IdLid (_loc, x)))
| _ -> raise Stream.Failure)
+
+ let rec infix_kwds_filter (__strm : _ Stream.t) =
+ match Stream.peek __strm with
+ | Some (((KEYWORD "(", _) as tok)) ->
+ (Stream.junk __strm;
+ let xs = __strm in
+ let (__strm : _ Stream.t) = xs
+ in
+ (match Stream.peek __strm with
+ | Some
+ ((KEYWORD
+ (("mod" | "land" | "lor" | "lxor" | "lsl" | "lsr" |
+ "asr"
+ as i)),
+ _loc))
+ ->
+ (Stream.junk __strm;
+ (match Stream.peek __strm with
+ | Some ((KEYWORD ")", _)) ->
+ (Stream.junk __strm;
+ let xs = __strm
+ in
+ Stream.lcons (fun _ -> ((LIDENT i), _loc))
+ (Stream.slazy
+ (fun _ -> infix_kwds_filter xs)))
+ | _ -> raise (Stream.Error "")))
+ | _ ->
+ let xs = __strm
+ in
+ Stream.icons tok
+ (Stream.slazy (fun _ -> infix_kwds_filter xs))))
+ | Some x ->
+ (Stream.junk __strm;
+ let xs = __strm
+ in
+ Stream.icons x
+ (Stream.slazy (fun _ -> infix_kwds_filter xs)))
+ | _ -> raise Stream.Failure
+
+ let _ =
+ Token.Filter.define_filter (Gram.get_filter ())
+ (fun f strm -> infix_kwds_filter (f strm))
+
(* transmit the context *)
let _ =
Gram.Entry.setup_parser sem_expr
in
fun (__strm : _ Stream.t) ->
let a = symb __strm in kont a __strm)
+
let _ =
let _ = (a_CHAR : 'a_CHAR Gram.Entry.t)
and _ = (do_sequence : 'do_sequence Gram.Entry.t)
<:patt< ? $i$ : ($p$ = $e$) >> *)
string_list : 'string_list Gram.Entry.t =
grammar_entry_create "string_list"
+ and fun_def_cont : 'fun_def_cont Gram.Entry.t =
+ grammar_entry_create "fun_def_cont"
+ and sequence' : 'sequence' Gram.Entry.t =
+ grammar_entry_create "sequence'"
and infixop6 : 'infixop6 Gram.Entry.t =
grammar_entry_create "infixop6"
in
(Gram.extend (module_expr : 'module_expr Gram.Entry.t)
((fun () ->
(None,
- [ (None, None,
+ [ ((Some "top"), None,
[ ([ Gram.Skeyword "struct";
Gram.Snterm
(Gram.Entry.obj
(str_items : 'str_items Gram.Entry.t));
Gram.Skeyword "end" ],
(Gram.Action.mk
- (fun _ (st : 'str_items) _ (_loc : Loc.t) ->
- (Ast.MeStr (_loc, st) : 'module_expr))));
+ (fun _ (st : 'str_items) _ (_loc : Gram.Loc.t)
+ -> (Ast.MeStr (_loc, st) : 'module_expr))));
([ Gram.Skeyword "functor"; Gram.Skeyword "(";
Gram.Snterm
(Gram.Entry.obj
Gram.Skeyword ")"; Gram.Skeyword "->"; Gram.Sself ],
(Gram.Action.mk
(fun (me : 'module_expr) _ _ (t : 'module_type)
- _ (i : 'a_UIDENT) _ _ (_loc : Loc.t) ->
+ _ (i : 'a_UIDENT) _ _ (_loc : Gram.Loc.t) ->
(Ast.MeFun (_loc, i, t, me) : 'module_expr)))) ]);
- (None, None,
+ ((Some "apply"), None,
[ ([ Gram.Sself; Gram.Sself ],
(Gram.Action.mk
(fun (me2 : 'module_expr) (me1 : 'module_expr)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.MeApp (_loc, me1, me2) : 'module_expr)))) ]);
((Some "simple"), None,
[ ([ Gram.Skeyword "("; Gram.Sself; Gram.Skeyword ")" ],
(Gram.Action.mk
- (fun _ (me : 'module_expr) _ (_loc : Loc.t) ->
- (me : 'module_expr))));
+ (fun _ (me : 'module_expr) _ (_loc : Gram.Loc.t)
+ -> (me : 'module_expr))));
([ Gram.Skeyword "("; Gram.Sself; Gram.Skeyword ":";
Gram.Snterm
(Gram.Entry.obj
Gram.Skeyword ")" ],
(Gram.Action.mk
(fun _ (mt : 'module_type) _ (me : 'module_expr)
- _ (_loc : Loc.t) ->
+ _ (_loc : Gram.Loc.t) ->
(Ast.MeTyc (_loc, me, mt) : 'module_expr))));
([ Gram.Snterm
(Gram.Entry.obj
(module_longident :
'module_longident Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (i : 'module_longident) (_loc : Loc.t) ->
- (Ast.MeId (_loc, i) : 'module_expr))));
+ (fun (i : 'module_longident) (_loc : Gram.Loc.t)
+ -> (Ast.MeId (_loc, i) : 'module_expr))));
([ Gram.Stoken
(((function | QUOTATION _ -> true | _ -> false),
"QUOTATION _")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| QUOTATION x ->
(Quotation.expand _loc x Quotation.
| _ -> false),
"ANTIQUOT ((\"\" | \"mexp\" | \"anti\" | \"list\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT
((("" | "mexp" | "anti" | "list" as n)),
[ ([ Gram.Snterm
(Gram.Entry.obj (expr : 'expr Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (e : 'expr) (_loc : Loc.t) ->
+ (fun (e : 'expr) (_loc : Gram.Loc.t) ->
(Ast.StExp (_loc, e) : 'str_item))));
([ Gram.Stoken
(((function | QUOTATION _ -> true | _ -> false),
"QUOTATION _")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| QUOTATION x ->
(Quotation.expand _loc x Quotation.
| _ -> false),
"ANTIQUOT ((\"\" | \"stri\" | \"anti\" | \"list\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT
((("" | "stri" | "anti" | "list" as n)),
'class_type_declaration Gram.Entry.t)) ],
(Gram.Action.mk
(fun (ctd : 'class_type_declaration) _ _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.StClt (_loc, ctd) : 'str_item))));
([ Gram.Skeyword "class";
Gram.Snterm
(class_declaration :
'class_declaration Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (cd : 'class_declaration) _ (_loc : Loc.t)
- -> (Ast.StCls (_loc, cd) : 'str_item))));
+ (fun (cd : 'class_declaration) _
+ (_loc : Gram.Loc.t) ->
+ (Ast.StCls (_loc, cd) : 'str_item))));
([ Gram.Snterm
(Gram.Entry.obj
(value_let : 'value_let Gram.Entry.t));
(binding : 'binding Gram.Entry.t)) ],
(Gram.Action.mk
(fun (bi : 'binding) (r : 'opt_rec) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.StVal (_loc, r, bi) : 'str_item))));
([ Gram.Skeyword "type";
Gram.Snterm
(type_declaration :
'type_declaration Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (td : 'type_declaration) _ (_loc : Loc.t)
- -> (Ast.StTyp (_loc, td) : 'str_item))));
+ (fun (td : 'type_declaration) _
+ (_loc : Gram.Loc.t) ->
+ (Ast.StTyp (_loc, td) : 'str_item))));
([ Gram.Skeyword "open";
Gram.Snterm
(Gram.Entry.obj
(module_longident :
'module_longident Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (i : 'module_longident) _ (_loc : Loc.t) ->
+ (fun (i : 'module_longident) _
+ (_loc : Gram.Loc.t) ->
(Ast.StOpn (_loc, i) : 'str_item))));
([ Gram.Skeyword "module"; Gram.Skeyword "type";
Gram.Snterm
(module_type : 'module_type Gram.Entry.t)) ],
(Gram.Action.mk
(fun (mt : 'module_type) _ (i : 'a_UIDENT) _ _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.StMty (_loc, i, mt) : 'str_item))));
([ Gram.Skeyword "module"; Gram.Skeyword "rec";
Gram.Snterm
(module_binding :
'module_binding Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (mb : 'module_binding) _ _ (_loc : Loc.t)
- -> (Ast.StRecMod (_loc, mb) : 'str_item))));
+ (fun (mb : 'module_binding) _ _
+ (_loc : Gram.Loc.t) ->
+ (Ast.StRecMod (_loc, mb) : 'str_item))));
([ Gram.Skeyword "module";
Gram.Snterm
(Gram.Entry.obj
'module_binding0 Gram.Entry.t)) ],
(Gram.Action.mk
(fun (mb : 'module_binding0) (i : 'a_UIDENT) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.StMod (_loc, i, mb) : 'str_item))));
([ Gram.Skeyword "include";
Gram.Snterm
(Gram.Entry.obj
(module_expr : 'module_expr Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (me : 'module_expr) _ (_loc : Loc.t) ->
- (Ast.StInc (_loc, me) : 'str_item))));
+ (fun (me : 'module_expr) _ (_loc : Gram.Loc.t)
+ -> (Ast.StInc (_loc, me) : 'str_item))));
([ Gram.Skeyword "external";
Gram.Snterm
(Gram.Entry.obj
(string_list : 'string_list Gram.Entry.t)) ],
(Gram.Action.mk
(fun (sl : 'string_list) _ (t : 'ctyp) _
- (i : 'a_LIDENT) _ (_loc : Loc.t) ->
+ (i : 'a_LIDENT) _ (_loc : Gram.Loc.t) ->
(Ast.StExt (_loc, i, t, sl) : 'str_item))));
([ Gram.Skeyword "exception";
Gram.Snterm
(Gram.Action.mk
(fun (i : 'type_longident) _
(t : 'constructor_declaration) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.StExc (_loc, t, Ast.OSome i) :
'str_item))));
([ Gram.Skeyword "exception";
'constructor_declaration Gram.Entry.t)) ],
(Gram.Action.mk
(fun (t : 'constructor_declaration) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.StExc (_loc, t, Ast.ONone) : 'str_item)))) ]) ]))
());
Gram.extend (module_binding0 : 'module_binding0 Gram.Entry.t)
(Gram.Entry.obj
(module_expr : 'module_expr Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (me : 'module_expr) _ (_loc : Loc.t) ->
- (me : 'module_binding0))));
+ (fun (me : 'module_expr) _ (_loc : Gram.Loc.t)
+ -> (me : 'module_binding0))));
([ Gram.Skeyword ":";
Gram.Snterm
(Gram.Entry.obj
(module_expr : 'module_expr Gram.Entry.t)) ],
(Gram.Action.mk
(fun (me : 'module_expr) _ (mt : 'module_type) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.MeTyc (_loc, me, mt) : 'module_binding0))));
([ Gram.Skeyword "(";
Gram.Snterm
(Gram.Action.mk
(fun (mb : 'module_binding0) _
(mt : 'module_type) _ (m : 'a_UIDENT) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.MeFun (_loc, m, mt, mb) :
'module_binding0)))) ]) ]))
());
(module_expr : 'module_expr Gram.Entry.t)) ],
(Gram.Action.mk
(fun (me : 'module_expr) _ (mt : 'module_type) _
- (m : 'a_UIDENT) (_loc : Loc.t) ->
+ (m : 'a_UIDENT) (_loc : Gram.Loc.t) ->
(Ast.MbColEq (_loc, m, mt, me) :
'module_binding))));
([ Gram.Stoken
(((function | QUOTATION _ -> true | _ -> false),
"QUOTATION _")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| QUOTATION x ->
(Quotation.expand _loc x Quotation.
(module_expr : 'module_expr Gram.Entry.t)) ],
(Gram.Action.mk
(fun (me : 'module_expr) _ (mt : 'module_type) _
- (__camlp4_0 : Gram.Token.t) (_loc : Loc.t) ->
+ (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" as n)), m) ->
(Ast.MbColEq (_loc, mk_anti n m, mt, me) :
| _ -> false),
"ANTIQUOT (\"\", _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" as n)), s) ->
(Ast.MbAnt (_loc,
| _ -> false),
"ANTIQUOT ((\"module_binding\" | \"anti\" | \"list\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT
((("module_binding" | "anti" | "list" as
([ Gram.Sself; Gram.Skeyword "and"; Gram.Sself ],
(Gram.Action.mk
(fun (b2 : 'module_binding) _
- (b1 : 'module_binding) (_loc : Loc.t) ->
+ (b1 : 'module_binding) (_loc : Gram.Loc.t) ->
(Ast.MbAnd (_loc, b1, b2) : 'module_binding)))) ]) ]))
());
Gram.extend (module_type : 'module_type Gram.Entry.t)
((fun () ->
(None,
- [ (None, None,
+ [ ((Some "top"), None,
[ ([ Gram.Skeyword "functor"; Gram.Skeyword "(";
Gram.Snterm
(Gram.Entry.obj
Gram.Skeyword "->"; Gram.Sself ],
(Gram.Action.mk
(fun (mt : 'module_type) _ _ (t : 'module_type)
- _ (i : 'a_UIDENT) _ _ (_loc : Loc.t) ->
+ _ (i : 'a_UIDENT) _ _ (_loc : Gram.Loc.t) ->
(Ast.MtFun (_loc, i, t, mt) : 'module_type)))) ]);
- (None, None,
+ ((Some "with"), None,
[ ([ Gram.Sself; Gram.Skeyword "with";
Gram.Snterm
(Gram.Entry.obj
(with_constr : 'with_constr Gram.Entry.t)) ],
(Gram.Action.mk
(fun (wc : 'with_constr) _ (mt : 'module_type)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.MtWit (_loc, mt, wc) : 'module_type)))) ]);
- (None, None,
- [ ([ Gram.Sself; Gram.Sself ],
+ ((Some "apply"), None,
+ [ ([ Gram.Sself; Gram.Sself;
+ Gram.Snterm
+ (Gram.Entry.obj (dummy : 'dummy Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (mt2 : 'module_type) (mt1 : 'module_type)
- (_loc : Loc.t) ->
+ (fun _ (mt2 : 'module_type) (mt1 : 'module_type)
+ (_loc : Gram.Loc.t) ->
(module_type_app mt1 mt2 : 'module_type)))) ]);
- (None, None,
+ ((Some "."), None,
[ ([ Gram.Sself; Gram.Skeyword "."; Gram.Sself ],
(Gram.Action.mk
(fun (mt2 : 'module_type) _ (mt1 : 'module_type)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(module_type_acc mt1 mt2 : 'module_type)))) ]);
- (None, None,
+ ((Some "sig"), None,
[ ([ Gram.Skeyword "sig";
Gram.Snterm
(Gram.Entry.obj
(sig_items : 'sig_items Gram.Entry.t));
Gram.Skeyword "end" ],
(Gram.Action.mk
- (fun _ (sg : 'sig_items) _ (_loc : Loc.t) ->
- (Ast.MtSig (_loc, sg) : 'module_type)))) ]);
+ (fun _ (sg : 'sig_items) _ (_loc : Gram.Loc.t)
+ -> (Ast.MtSig (_loc, sg) : 'module_type)))) ]);
((Some "simple"), None,
[ ([ Gram.Skeyword "("; Gram.Sself; Gram.Skeyword ")" ],
(Gram.Action.mk
- (fun _ (mt : 'module_type) _ (_loc : Loc.t) ->
- (mt : 'module_type))));
+ (fun _ (mt : 'module_type) _ (_loc : Gram.Loc.t)
+ -> (mt : 'module_type))));
([ Gram.Skeyword "'";
Gram.Snterm
(Gram.Entry.obj
(a_ident : 'a_ident Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (i : 'a_ident) _ (_loc : Loc.t) ->
+ (fun (i : 'a_ident) _ (_loc : Gram.Loc.t) ->
(Ast.MtQuo (_loc, i) : 'module_type))));
([ Gram.Snterm
(Gram.Entry.obj
'module_longident_with_app Gram.Entry.t)) ],
(Gram.Action.mk
(fun (i : 'module_longident_with_app)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.MtId (_loc, i) : 'module_type))));
([ Gram.Stoken
(((function | QUOTATION _ -> true | _ -> false),
"QUOTATION _")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| QUOTATION x ->
(Quotation.expand _loc x Quotation.
| _ -> false),
"ANTIQUOT ((\"\" | \"mtyp\" | \"anti\" | \"list\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT
((("" | "mtyp" | "anti" | "list" as n)),
'class_type_declaration Gram.Entry.t)) ],
(Gram.Action.mk
(fun (ctd : 'class_type_declaration) _ _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.SgClt (_loc, ctd) : 'sig_item))));
([ Gram.Skeyword "class";
Gram.Snterm
(class_description :
'class_description Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (cd : 'class_description) _ (_loc : Loc.t)
- -> (Ast.SgCls (_loc, cd) : 'sig_item))));
+ (fun (cd : 'class_description) _
+ (_loc : Gram.Loc.t) ->
+ (Ast.SgCls (_loc, cd) : 'sig_item))));
([ Gram.Snterm
(Gram.Entry.obj
(value_val : 'value_val Gram.Entry.t));
(Gram.Entry.obj (ctyp : 'ctyp Gram.Entry.t)) ],
(Gram.Action.mk
(fun (t : 'ctyp) _ (i : 'a_LIDENT) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.SgVal (_loc, i, t) : 'sig_item))));
([ Gram.Skeyword "type";
Gram.Snterm
(type_declaration :
'type_declaration Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (t : 'type_declaration) _ (_loc : Loc.t) ->
+ (fun (t : 'type_declaration) _
+ (_loc : Gram.Loc.t) ->
(Ast.SgTyp (_loc, t) : 'sig_item))));
([ Gram.Skeyword "open";
Gram.Snterm
(module_longident :
'module_longident Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (i : 'module_longident) _ (_loc : Loc.t) ->
+ (fun (i : 'module_longident) _
+ (_loc : Gram.Loc.t) ->
(Ast.SgOpn (_loc, i) : 'sig_item))));
([ Gram.Skeyword "module"; Gram.Skeyword "type";
Gram.Snterm
(Gram.Entry.obj
(a_UIDENT : 'a_UIDENT Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (i : 'a_UIDENT) _ _ (_loc : Loc.t) ->
+ (fun (i : 'a_UIDENT) _ _ (_loc : Gram.Loc.t) ->
(Ast.SgMty (_loc, i, Ast.MtNil _loc) :
'sig_item))));
([ Gram.Skeyword "module"; Gram.Skeyword "type";
(module_type : 'module_type Gram.Entry.t)) ],
(Gram.Action.mk
(fun (mt : 'module_type) _ (i : 'a_UIDENT) _ _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.SgMty (_loc, i, mt) : 'sig_item))));
([ Gram.Skeyword "module"; Gram.Skeyword "rec";
Gram.Snterm
'module_rec_declaration Gram.Entry.t)) ],
(Gram.Action.mk
(fun (mb : 'module_rec_declaration) _ _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.SgRecMod (_loc, mb) : 'sig_item))));
([ Gram.Skeyword "module";
Gram.Snterm
'module_declaration Gram.Entry.t)) ],
(Gram.Action.mk
(fun (mt : 'module_declaration) (i : 'a_UIDENT)
- _ (_loc : Loc.t) ->
+ _ (_loc : Gram.Loc.t) ->
(Ast.SgMod (_loc, i, mt) : 'sig_item))));
([ Gram.Skeyword "include";
Gram.Snterm
(Gram.Entry.obj
(module_type : 'module_type Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (mt : 'module_type) _ (_loc : Loc.t) ->
- (Ast.SgInc (_loc, mt) : 'sig_item))));
+ (fun (mt : 'module_type) _ (_loc : Gram.Loc.t)
+ -> (Ast.SgInc (_loc, mt) : 'sig_item))));
([ Gram.Skeyword "external";
Gram.Snterm
(Gram.Entry.obj
(string_list : 'string_list Gram.Entry.t)) ],
(Gram.Action.mk
(fun (sl : 'string_list) _ (t : 'ctyp) _
- (i : 'a_LIDENT) _ (_loc : Loc.t) ->
+ (i : 'a_LIDENT) _ (_loc : Gram.Loc.t) ->
(Ast.SgExt (_loc, i, t, sl) : 'sig_item))));
([ Gram.Skeyword "exception";
Gram.Snterm
'constructor_declaration Gram.Entry.t)) ],
(Gram.Action.mk
(fun (t : 'constructor_declaration) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.SgExc (_loc, t) : 'sig_item))));
([ Gram.Stoken
(((function | QUOTATION _ -> true | _ -> false),
"QUOTATION _")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| QUOTATION x ->
(Quotation.expand _loc x Quotation.
| _ -> false),
"ANTIQUOT ((\"\" | \"sigi\" | \"anti\" | \"list\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT
((("" | "sigi" | "anti" | "list" as n)),
(Gram.Action.mk
(fun (mt : 'module_declaration) _
(t : 'module_type) _ (i : 'a_UIDENT) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.MtFun (_loc, i, t, mt) :
'module_declaration))));
([ Gram.Skeyword ":";
(Gram.Entry.obj
(module_type : 'module_type Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (mt : 'module_type) _ (_loc : Loc.t) ->
- (mt : 'module_declaration)))) ]) ]))
+ (fun (mt : 'module_type) _ (_loc : Gram.Loc.t)
+ -> (mt : 'module_declaration)))) ]) ]))
());
Gram.extend
(module_rec_declaration :
(module_type : 'module_type Gram.Entry.t)) ],
(Gram.Action.mk
(fun (mt : 'module_type) _ (m : 'a_UIDENT)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.MbCol (_loc, m, mt) :
'module_rec_declaration))));
([ Gram.Stoken
(((function | QUOTATION _ -> true | _ -> false),
"QUOTATION _")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| QUOTATION x ->
(Quotation.expand _loc x Quotation.
| _ -> false),
"ANTIQUOT ((\"\" | \"module_binding\" | \"anti\" | \"list\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT
((("" | "module_binding" | "anti" |
([ Gram.Sself; Gram.Skeyword "and"; Gram.Sself ],
(Gram.Action.mk
(fun (m2 : 'module_rec_declaration) _
- (m1 : 'module_rec_declaration) (_loc : Loc.t)
- ->
+ (m1 : 'module_rec_declaration)
+ (_loc : Gram.Loc.t) ->
(Ast.MbAnd (_loc, m1, m2) :
'module_rec_declaration)))) ]) ]))
());
'module_longident_with_app Gram.Entry.t)) ],
(Gram.Action.mk
(fun (i2 : 'module_longident_with_app) _
- (i1 : 'module_longident) _ (_loc : Loc.t) ->
+ (i1 : 'module_longident) _
+ (_loc : Gram.Loc.t) ->
(Ast.WcMod (_loc, i1, i2) : 'with_constr))));
([ Gram.Skeyword "type";
Gram.Snterm
(Gram.Action.mk
(fun (t2 : 'ctyp) _
(t1 : 'type_longident_and_parameters) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.WcTyp (_loc, t1, t2) : 'with_constr))));
([ Gram.Skeyword "type";
Gram.Stoken
(Gram.Entry.obj (ctyp : 'ctyp Gram.Entry.t)) ],
(Gram.Action.mk
(fun (t : 'ctyp) _ (__camlp4_0 : Gram.Token.t) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" | "typ" | "anti" as n)), s)
->
(((function | QUOTATION _ -> true | _ -> false),
"QUOTATION _")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| QUOTATION x ->
(Quotation.expand _loc x Quotation.
| _ -> false),
"ANTIQUOT ((\"\" | \"with_constr\" | \"anti\" | \"list\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT
((("" | "with_constr" | "anti" | "list"
([ Gram.Sself; Gram.Skeyword "and"; Gram.Sself ],
(Gram.Action.mk
(fun (wc2 : 'with_constr) _ (wc1 : 'with_constr)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.WcAnd (_loc, wc1, wc2) : 'with_constr)))) ]) ]))
());
Gram.extend (expr : 'expr Gram.Entry.t)
Gram.Skeyword "end" ],
(Gram.Action.mk
(fun _ (cst : 'class_structure)
- (csp : 'opt_class_self_patt) _ (_loc : Loc.t)
- -> (Ast.ExObj (_loc, csp, cst) : 'expr))));
+ (csp : 'opt_class_self_patt) _
+ (_loc : Gram.Loc.t) ->
+ (Ast.ExObj (_loc, csp, cst) : 'expr))));
([ Gram.Skeyword "while";
Gram.Snterm
(Gram.Entry.obj
(do_sequence : 'do_sequence Gram.Entry.t)) ],
(Gram.Action.mk
(fun (seq : 'do_sequence) _ (e : 'sequence) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.ExWhi (_loc, mksequence' _loc e, seq) :
'expr))));
([ Gram.Skeyword "for";
(Gram.Action.mk
(fun (seq : 'do_sequence) _ (e2 : 'sequence)
(df : 'direction_flag) (e1 : 'sequence) _
- (i : 'a_LIDENT) _ (_loc : Loc.t) ->
+ (i : 'a_LIDENT) _ (_loc : Gram.Loc.t) ->
(Ast.ExFor (_loc, i, mksequence' _loc e1,
mksequence' _loc e2, df, seq) :
'expr))));
(Gram.Entry.obj
(do_sequence : 'do_sequence Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (seq : 'do_sequence) _ (_loc : Loc.t) ->
- (mksequence _loc seq : 'expr))));
+ (fun (seq : 'do_sequence) _ (_loc : Gram.Loc.t)
+ -> (mksequence _loc seq : 'expr))));
([ Gram.Skeyword "if"; Gram.Sself;
Gram.Skeyword "then"; Gram.Sself;
Gram.Skeyword "else"; Gram.Sself ],
(Gram.Action.mk
(fun (e3 : 'expr) _ (e2 : 'expr) _ (e1 : 'expr)
- _ (_loc : Loc.t) ->
+ _ (_loc : Gram.Loc.t) ->
(Ast.ExIfe (_loc, e1, e2, e3) : 'expr))));
([ Gram.Skeyword "try";
Gram.Snterm
(match_case : 'match_case Gram.Entry.t)) ],
(Gram.Action.mk
(fun (a : 'match_case) _ (e : 'sequence) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.ExTry (_loc, mksequence' _loc e, a) :
'expr))));
([ Gram.Skeyword "match";
(match_case : 'match_case Gram.Entry.t)) ],
(Gram.Action.mk
(fun (a : 'match_case) _ (e : 'sequence) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.ExMat (_loc, mksequence' _loc e, a) :
'expr))));
([ Gram.Skeyword "fun";
- Gram.Snterm
- (Gram.Entry.obj
- (labeled_ipatt :
- 'labeled_ipatt Gram.Entry.t));
Gram.Snterm
(Gram.Entry.obj
(fun_def : 'fun_def Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (e : 'fun_def) (p : 'labeled_ipatt) _
- (_loc : Loc.t) ->
- (Ast.ExFun (_loc,
- Ast.McArr (_loc, p, Ast.ExNil _loc, e)) :
- 'expr))));
+ (fun (e : 'fun_def) _ (_loc : Gram.Loc.t) ->
+ (e : 'expr))));
([ Gram.Skeyword "fun"; Gram.Skeyword "[";
Gram.Slist0sep
(Gram.Snterm
Gram.Skeyword "]" ],
(Gram.Action.mk
(fun _ (a : 'match_case0 list) _ _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.ExFun (_loc, Ast.mcOr_of_list a) :
'expr))));
([ Gram.Skeyword "let"; Gram.Skeyword "module";
Gram.Skeyword "in"; Gram.Sself ],
(Gram.Action.mk
(fun (e : 'expr) _ (mb : 'module_binding0)
- (m : 'a_UIDENT) _ _ (_loc : Loc.t) ->
+ (m : 'a_UIDENT) _ _ (_loc : Gram.Loc.t) ->
(Ast.ExLmd (_loc, m, mb, e) : 'expr))));
([ Gram.Skeyword "let";
Gram.Snterm
Gram.Skeyword "in"; Gram.Sself ],
(Gram.Action.mk
(fun (x : 'expr) _ (bi : 'binding)
- (r : 'opt_rec) _ (_loc : Loc.t) ->
+ (r : 'opt_rec) _ (_loc : Gram.Loc.t) ->
(Ast.ExLet (_loc, r, bi, x) : 'expr)))) ]);
((Some "where"), None,
[ ([ Gram.Sself; Gram.Skeyword "where";
(let_binding : 'let_binding Gram.Entry.t)) ],
(Gram.Action.mk
(fun (lb : 'let_binding) (rf : 'opt_rec) _
- (e : 'expr) (_loc : Loc.t) ->
+ (e : 'expr) (_loc : Gram.Loc.t) ->
(Ast.ExLet (_loc, rf, lb, e) : 'expr)))) ]);
((Some ":="), (Some Camlp4.Sig.Grammar.NonA),
[ ([ Gram.Sself; Gram.Skeyword ":="; Gram.Sself;
(Gram.Entry.obj (dummy : 'dummy Gram.Entry.t)) ],
(Gram.Action.mk
(fun _ (e2 : 'expr) _ (e1 : 'expr)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(match bigarray_set _loc e1 e2 with
| Some e -> e
| None -> Ast.ExAss (_loc, e1, e2) : 'expr)))) ]);
Gram.Sself ],
(Gram.Action.mk
(fun (e2 : 'expr) (op : 'infixop6) (e1 : 'expr)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.ExApp (_loc, Ast.ExApp (_loc, op, e1),
e2) :
'expr)))) ]);
Gram.Sself ],
(Gram.Action.mk
(fun (e2 : 'expr) (op : 'infixop5) (e1 : 'expr)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.ExApp (_loc, Ast.ExApp (_loc, op, e1),
e2) :
'expr)))) ]);
Gram.Sself ],
(Gram.Action.mk
(fun (e2 : 'expr) (op : 'infixop0) (e1 : 'expr)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.ExApp (_loc, Ast.ExApp (_loc, op, e1),
e2) :
'expr)))) ]);
Gram.Sself ],
(Gram.Action.mk
(fun (e2 : 'expr) (op : 'infixop1) (e1 : 'expr)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.ExApp (_loc, Ast.ExApp (_loc, op, e1),
e2) :
'expr)))) ]);
Gram.Sself ],
(Gram.Action.mk
(fun (e2 : 'expr) (op : 'infixop2) (e1 : 'expr)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.ExApp (_loc, Ast.ExApp (_loc, op, e1),
e2) :
'expr)))) ]);
Gram.Sself ],
(Gram.Action.mk
(fun (e2 : 'expr) (op : 'infixop3) (e1 : 'expr)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.ExApp (_loc, Ast.ExApp (_loc, op, e1),
e2) :
'expr))));
([ Gram.Sself; Gram.Skeyword "mod"; Gram.Sself ],
(Gram.Action.mk
- (fun (e2 : 'expr) _ (e1 : 'expr) (_loc : Loc.t)
- ->
+ (fun (e2 : 'expr) _ (e1 : 'expr)
+ (_loc : Gram.Loc.t) ->
(Ast.ExApp (_loc,
Ast.ExApp (_loc,
Ast.ExId (_loc, Ast.IdLid (_loc, "mod")),
'expr))));
([ Gram.Sself; Gram.Skeyword "lxor"; Gram.Sself ],
(Gram.Action.mk
- (fun (e2 : 'expr) _ (e1 : 'expr) (_loc : Loc.t)
- ->
+ (fun (e2 : 'expr) _ (e1 : 'expr)
+ (_loc : Gram.Loc.t) ->
(Ast.ExApp (_loc,
Ast.ExApp (_loc,
Ast.ExId (_loc,
'expr))));
([ Gram.Sself; Gram.Skeyword "lor"; Gram.Sself ],
(Gram.Action.mk
- (fun (e2 : 'expr) _ (e1 : 'expr) (_loc : Loc.t)
- ->
+ (fun (e2 : 'expr) _ (e1 : 'expr)
+ (_loc : Gram.Loc.t) ->
(Ast.ExApp (_loc,
Ast.ExApp (_loc,
Ast.ExId (_loc, Ast.IdLid (_loc, "lor")),
'expr))));
([ Gram.Sself; Gram.Skeyword "land"; Gram.Sself ],
(Gram.Action.mk
- (fun (e2 : 'expr) _ (e1 : 'expr) (_loc : Loc.t)
- ->
+ (fun (e2 : 'expr) _ (e1 : 'expr)
+ (_loc : Gram.Loc.t) ->
(Ast.ExApp (_loc,
Ast.ExApp (_loc,
Ast.ExId (_loc,
Gram.Sself ],
(Gram.Action.mk
(fun (e2 : 'expr) (op : 'infixop4) (e1 : 'expr)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.ExApp (_loc, Ast.ExApp (_loc, op, e1),
e2) :
'expr))));
([ Gram.Sself; Gram.Skeyword "lsr"; Gram.Sself ],
(Gram.Action.mk
- (fun (e2 : 'expr) _ (e1 : 'expr) (_loc : Loc.t)
- ->
+ (fun (e2 : 'expr) _ (e1 : 'expr)
+ (_loc : Gram.Loc.t) ->
(Ast.ExApp (_loc,
Ast.ExApp (_loc,
Ast.ExId (_loc, Ast.IdLid (_loc, "lsr")),
'expr))));
([ Gram.Sself; Gram.Skeyword "lsl"; Gram.Sself ],
(Gram.Action.mk
- (fun (e2 : 'expr) _ (e1 : 'expr) (_loc : Loc.t)
- ->
+ (fun (e2 : 'expr) _ (e1 : 'expr)
+ (_loc : Gram.Loc.t) ->
(Ast.ExApp (_loc,
Ast.ExApp (_loc,
Ast.ExId (_loc, Ast.IdLid (_loc, "lsl")),
'expr))));
([ Gram.Sself; Gram.Skeyword "asr"; Gram.Sself ],
(Gram.Action.mk
- (fun (e2 : 'expr) _ (e1 : 'expr) (_loc : Loc.t)
- ->
+ (fun (e2 : 'expr) _ (e1 : 'expr)
+ (_loc : Gram.Loc.t) ->
(Ast.ExApp (_loc,
Ast.ExApp (_loc,
Ast.ExId (_loc, Ast.IdLid (_loc, "asr")),
((Some "unary minus"), (Some Camlp4.Sig.Grammar.NonA),
[ ([ Gram.Skeyword "-."; Gram.Sself ],
(Gram.Action.mk
- (fun (e : 'expr) _ (_loc : Loc.t) ->
+ (fun (e : 'expr) _ (_loc : Gram.Loc.t) ->
(mkumin _loc "-." e : 'expr))));
([ Gram.Skeyword "-"; Gram.Sself ],
(Gram.Action.mk
- (fun (e : 'expr) _ (_loc : Loc.t) ->
+ (fun (e : 'expr) _ (_loc : Gram.Loc.t) ->
(mkumin _loc "-" e : 'expr)))) ]);
((Some "apply"), (Some Camlp4.Sig.Grammar.LeftA),
[ ([ Gram.Skeyword "lazy"; Gram.Sself ],
(Gram.Action.mk
- (fun (e : 'expr) _ (_loc : Loc.t) ->
+ (fun (e : 'expr) _ (_loc : Gram.Loc.t) ->
(Ast.ExLaz (_loc, e) : 'expr))));
([ Gram.Skeyword "new";
Gram.Snterm
(class_longident :
'class_longident Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (i : 'class_longident) _ (_loc : Loc.t) ->
+ (fun (i : 'class_longident) _
+ (_loc : Gram.Loc.t) ->
(Ast.ExNew (_loc, i) : 'expr))));
([ Gram.Skeyword "assert"; Gram.Sself ],
(Gram.Action.mk
- (fun (e : 'expr) _ (_loc : Loc.t) ->
+ (fun (e : 'expr) _ (_loc : Gram.Loc.t) ->
(mkassert _loc e : 'expr))));
([ Gram.Sself; Gram.Sself ],
(Gram.Action.mk
- (fun (e2 : 'expr) (e1 : 'expr) (_loc : Loc.t) ->
+ (fun (e2 : 'expr) (e1 : 'expr)
+ (_loc : Gram.Loc.t) ->
(Ast.ExApp (_loc, e1, e2) : 'expr)))) ]);
((Some "label"), (Some Camlp4.Sig.Grammar.NonA),
[ ([ Gram.Skeyword "?";
(Gram.Entry.obj
(a_LIDENT : 'a_LIDENT Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (i : 'a_LIDENT) _ (_loc : Loc.t) ->
+ (fun (i : 'a_LIDENT) _ (_loc : Gram.Loc.t) ->
(Ast.ExOlb (_loc, i, Ast.ExNil _loc) : 'expr))));
([ Gram.Skeyword "?";
Gram.Snterm
Gram.Skeyword ":"; Gram.Sself ],
(Gram.Action.mk
(fun (e : 'expr) _ (i : 'a_LIDENT) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.ExOlb (_loc, i, e) : 'expr))));
([ Gram.Stoken
(((function | OPTLABEL _ -> true | _ -> false),
Gram.Sself ],
(Gram.Action.mk
(fun (e : 'expr) (__camlp4_0 : Gram.Token.t)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| OPTLABEL i ->
(Ast.ExOlb (_loc, i, e) : 'expr)
Gram.Sself ],
(Gram.Action.mk
(fun (e : 'expr) (__camlp4_0 : Gram.Token.t)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| LABEL i -> (Ast.ExLab (_loc, i, e) : 'expr)
| _ -> assert false)));
(Gram.Entry.obj
(a_LIDENT : 'a_LIDENT Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (i : 'a_LIDENT) _ (_loc : Loc.t) ->
+ (fun (i : 'a_LIDENT) _ (_loc : Gram.Loc.t) ->
(Ast.ExLab (_loc, i, Ast.ExNil _loc) : 'expr))));
([ Gram.Skeyword "~";
Gram.Snterm
Gram.Skeyword ":"; Gram.Sself ],
(Gram.Action.mk
(fun (e : 'expr) _ (i : 'a_LIDENT) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.ExLab (_loc, i, e) : 'expr)))) ]);
((Some "."), (Some Camlp4.Sig.Grammar.LeftA),
[ ([ Gram.Sself; Gram.Skeyword "#";
Gram.Snterm
(Gram.Entry.obj (label : 'label Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (lab : 'label) _ (e : 'expr) (_loc : Loc.t)
- -> (Ast.ExSnd (_loc, e, lab) : 'expr))));
+ (fun (lab : 'label) _ (e : 'expr)
+ (_loc : Gram.Loc.t) ->
+ (Ast.ExSnd (_loc, e, lab) : 'expr))));
([ Gram.Sself; Gram.Skeyword "."; Gram.Sself ],
(Gram.Action.mk
- (fun (e2 : 'expr) _ (e1 : 'expr) (_loc : Loc.t)
- -> (Ast.ExAcc (_loc, e1, e2) : 'expr))));
+ (fun (e2 : 'expr) _ (e1 : 'expr)
+ (_loc : Gram.Loc.t) ->
+ (Ast.ExAcc (_loc, e1, e2) : 'expr))));
([ Gram.Sself; Gram.Skeyword "."; Gram.Skeyword "{";
Gram.Snterm
(Gram.Entry.obj
Gram.Skeyword "}" ],
(Gram.Action.mk
(fun _ (e2 : 'comma_expr) _ _ (e1 : 'expr)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(bigarray_get _loc e1 e2 : 'expr))));
([ Gram.Sself; Gram.Skeyword "."; Gram.Skeyword "[";
Gram.Sself; Gram.Skeyword "]" ],
(Gram.Action.mk
(fun _ (e2 : 'expr) _ _ (e1 : 'expr)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.ExSte (_loc, e1, e2) : 'expr))));
([ Gram.Sself; Gram.Skeyword "."; Gram.Skeyword "(";
Gram.Sself; Gram.Skeyword ")" ],
(Gram.Action.mk
(fun _ (e2 : 'expr) _ _ (e1 : 'expr)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.ExAre (_loc, e1, e2) : 'expr)))) ]);
((Some "~-"), (Some Camlp4.Sig.Grammar.NonA),
[ ([ Gram.Snterm
(prefixop : 'prefixop Gram.Entry.t));
Gram.Sself ],
(Gram.Action.mk
- (fun (e : 'expr) (f : 'prefixop) (_loc : Loc.t)
- -> (Ast.ExApp (_loc, f, e) : 'expr))));
+ (fun (e : 'expr) (f : 'prefixop)
+ (_loc : Gram.Loc.t) ->
+ (Ast.ExApp (_loc, f, e) : 'expr))));
([ Gram.Skeyword "!"; Gram.Sself ],
(Gram.Action.mk
- (fun (e : 'expr) _ (_loc : Loc.t) ->
+ (fun (e : 'expr) _ (_loc : Gram.Loc.t) ->
(Ast.ExAcc (_loc, e,
Ast.ExId (_loc, Ast.IdLid (_loc, "val"))) :
'expr)))) ]);
((Some "simple"), None,
[ ([ Gram.Skeyword "begin"; Gram.Skeyword "end" ],
(Gram.Action.mk
- (fun _ _ (_loc : Loc.t) ->
+ (fun _ _ (_loc : Gram.Loc.t) ->
(Ast.ExId (_loc, Ast.IdUid (_loc, "()")) :
'expr))));
([ Gram.Skeyword "begin";
(sequence : 'sequence Gram.Entry.t));
Gram.Skeyword "end" ],
(Gram.Action.mk
- (fun _ (seq : 'sequence) _ (_loc : Loc.t) ->
- (mksequence _loc seq : 'expr))));
+ (fun _ (seq : 'sequence) _ (_loc : Gram.Loc.t)
+ -> (mksequence _loc seq : 'expr))));
([ Gram.Skeyword "("; Gram.Sself; Gram.Skeyword ")" ],
(Gram.Action.mk
- (fun _ (e : 'expr) _ (_loc : Loc.t) ->
+ (fun _ (e : 'expr) _ (_loc : Gram.Loc.t) ->
(e : 'expr))));
([ Gram.Skeyword "("; Gram.Sself;
Gram.Skeyword ":>";
Gram.Skeyword ")" ],
(Gram.Action.mk
(fun _ (t : 'ctyp) _ (e : 'expr) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.ExCoe (_loc, e, Ast.TyNil _loc, t) :
'expr))));
([ Gram.Skeyword "("; Gram.Sself; Gram.Skeyword ":";
Gram.Skeyword ")" ],
(Gram.Action.mk
(fun _ (t2 : 'ctyp) _ (t : 'ctyp) _ (e : 'expr)
- _ (_loc : Loc.t) ->
+ _ (_loc : Gram.Loc.t) ->
(Ast.ExCoe (_loc, e, t, t2) : 'expr))));
([ Gram.Skeyword "("; Gram.Sself; Gram.Skeyword ";";
Gram.Snterm
Gram.Skeyword ")" ],
(Gram.Action.mk
(fun _ (seq : 'sequence) _ (e : 'expr) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(mksequence _loc (Ast.ExSem (_loc, e, seq)) :
'expr))));
([ Gram.Skeyword "("; Gram.Sself; Gram.Skeyword ",";
Gram.Skeyword ")" ],
(Gram.Action.mk
(fun _ (el : 'comma_expr) _ (e : 'expr) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.ExTup (_loc, Ast.ExCom (_loc, e, el)) :
'expr))));
([ Gram.Skeyword "("; Gram.Sself; Gram.Skeyword ":";
Gram.Skeyword ")" ],
(Gram.Action.mk
(fun _ (t : 'ctyp) _ (e : 'expr) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.ExTyc (_loc, e, t) : 'expr))));
([ Gram.Skeyword "("; Gram.Skeyword ")" ],
(Gram.Action.mk
- (fun _ _ (_loc : Loc.t) ->
+ (fun _ _ (_loc : Gram.Loc.t) ->
(Ast.ExId (_loc, Ast.IdUid (_loc, "()")) :
'expr))));
([ Gram.Skeyword "{<";
(field_expr : 'field_expr Gram.Entry.t));
Gram.Skeyword ">}" ],
(Gram.Action.mk
- (fun _ (fel : 'field_expr) _ (_loc : Loc.t) ->
- (Ast.ExOvr (_loc, fel) : 'expr))));
+ (fun _ (fel : 'field_expr) _ (_loc : Gram.Loc.t)
+ -> (Ast.ExOvr (_loc, fel) : 'expr))));
([ Gram.Skeyword "{<"; Gram.Skeyword ">}" ],
(Gram.Action.mk
- (fun _ _ (_loc : Loc.t) ->
+ (fun _ _ (_loc : Gram.Loc.t) ->
(Ast.ExOvr (_loc, Ast.RbNil _loc) : 'expr))));
([ Gram.Skeyword "{"; Gram.Skeyword "("; Gram.Sself;
Gram.Skeyword ")"; Gram.Skeyword "with";
Gram.Skeyword "}" ],
(Gram.Action.mk
(fun _ (el : 'label_expr) _ _ (e : 'expr) _ _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.ExRec (_loc, el, e) : 'expr))));
([ Gram.Skeyword "{";
Gram.Snterm
(label_expr : 'label_expr Gram.Entry.t));
Gram.Skeyword "}" ],
(Gram.Action.mk
- (fun _ (el : 'label_expr) _ (_loc : Loc.t) ->
+ (fun _ (el : 'label_expr) _ (_loc : Gram.Loc.t)
+ ->
(Ast.ExRec (_loc, el, Ast.ExNil _loc) :
'expr))));
([ Gram.Skeyword "[|";
(sem_expr : 'sem_expr Gram.Entry.t));
Gram.Skeyword "|]" ],
(Gram.Action.mk
- (fun _ (el : 'sem_expr) _ (_loc : Loc.t) ->
+ (fun _ (el : 'sem_expr) _ (_loc : Gram.Loc.t) ->
(Ast.ExArr (_loc, el) : 'expr))));
([ Gram.Skeyword "[|"; Gram.Skeyword "|]" ],
(Gram.Action.mk
- (fun _ _ (_loc : Loc.t) ->
+ (fun _ _ (_loc : Gram.Loc.t) ->
(Ast.ExArr (_loc, Ast.ExNil _loc) : 'expr))));
([ Gram.Skeyword "[";
Gram.Snterm
Gram.Skeyword "]" ],
(Gram.Action.mk
(fun _ (mk_list : 'sem_expr_for_list) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(mk_list
(Ast.ExId (_loc, Ast.IdUid (_loc, "[]"))) :
'expr))));
(Gram.Action.mk
(fun _ (last : 'expr) _
(mk_list : 'sem_expr_for_list) _
- (_loc : Loc.t) -> (mk_list last : 'expr))));
+ (_loc : Gram.Loc.t) -> (mk_list last : 'expr))));
([ Gram.Skeyword "["; Gram.Skeyword "]" ],
(Gram.Action.mk
- (fun _ _ (_loc : Loc.t) ->
+ (fun _ _ (_loc : Gram.Loc.t) ->
(Ast.ExId (_loc, Ast.IdUid (_loc, "[]")) :
'expr))));
([ Gram.Skeyword "`";
(Gram.Entry.obj
(a_ident : 'a_ident Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (s : 'a_ident) _ (_loc : Loc.t) ->
+ (fun (s : 'a_ident) _ (_loc : Gram.Loc.t) ->
(Ast.ExVrn (_loc, s) : 'expr))));
([ Gram.Snterm
(Gram.Entry.obj
(val_longident :
'val_longident Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (i : 'val_longident) (_loc : Loc.t) ->
+ (fun (i : 'val_longident) (_loc : Gram.Loc.t) ->
(Ast.ExId (_loc, i) : 'expr))));
([ Gram.Snterm
(Gram.Entry.obj (a_CHAR : 'a_CHAR Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (s : 'a_CHAR) (_loc : Loc.t) ->
+ (fun (s : 'a_CHAR) (_loc : Gram.Loc.t) ->
(Ast.ExChr (_loc, s) : 'expr))));
([ Gram.Snterm
(Gram.Entry.obj
(a_STRING : 'a_STRING Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (s : 'a_STRING) (_loc : Loc.t) ->
+ (fun (s : 'a_STRING) (_loc : Gram.Loc.t) ->
(Ast.ExStr (_loc, s) : 'expr))));
([ Gram.Snterm
(Gram.Entry.obj
(a_FLOAT : 'a_FLOAT Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (s : 'a_FLOAT) (_loc : Loc.t) ->
+ (fun (s : 'a_FLOAT) (_loc : Gram.Loc.t) ->
(Ast.ExFlo (_loc, s) : 'expr))));
([ Gram.Snterm
(Gram.Entry.obj
(a_NATIVEINT : 'a_NATIVEINT Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (s : 'a_NATIVEINT) (_loc : Loc.t) ->
+ (fun (s : 'a_NATIVEINT) (_loc : Gram.Loc.t) ->
(Ast.ExNativeInt (_loc, s) : 'expr))));
([ Gram.Snterm
(Gram.Entry.obj
(a_INT64 : 'a_INT64 Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (s : 'a_INT64) (_loc : Loc.t) ->
+ (fun (s : 'a_INT64) (_loc : Gram.Loc.t) ->
(Ast.ExInt64 (_loc, s) : 'expr))));
([ Gram.Snterm
(Gram.Entry.obj
(a_INT32 : 'a_INT32 Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (s : 'a_INT32) (_loc : Loc.t) ->
+ (fun (s : 'a_INT32) (_loc : Gram.Loc.t) ->
(Ast.ExInt32 (_loc, s) : 'expr))));
([ Gram.Snterm
(Gram.Entry.obj (a_INT : 'a_INT Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (s : 'a_INT) (_loc : Loc.t) ->
+ (fun (s : 'a_INT) (_loc : Gram.Loc.t) ->
(Ast.ExInt (_loc, s) : 'expr))));
([ Gram.Stoken
(((function
| _ -> false),
"ANTIQUOT (\"seq\", _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("seq" as n)), s) ->
(Ast.ExSeq (_loc,
| _ -> false),
"ANTIQUOT (\"tup\", _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("tup" as n)), s) ->
(Ast.ExTup (_loc,
| _ -> false),
"ANTIQUOT (\"`bool\", _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("`bool" as n)), s) ->
- (Ast.ExAnt (_loc, mk_anti n s) : 'expr)
+ (Ast.ExId (_loc,
+ Ast.IdAnt (_loc, mk_anti n s)) :
+ 'expr)
| _ -> assert false)));
([ Gram.Stoken
(((function
| _ -> false),
"ANTIQUOT ((\"exp\" | \"\" | \"anti\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("exp" | "" | "anti" as n)), s)
->
(((function | QUOTATION _ -> true | _ -> false),
"QUOTATION _")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| QUOTATION x ->
(Quotation.expand _loc x Quotation.
(sequence : 'sequence Gram.Entry.t));
Gram.Skeyword "done" ],
(Gram.Action.mk
- (fun _ (seq : 'sequence) _ (_loc : Loc.t) ->
- (seq : 'do_sequence))));
+ (fun _ (seq : 'sequence) _ (_loc : Gram.Loc.t)
+ -> (seq : 'do_sequence))));
([ Gram.Skeyword "{";
Gram.Snterm
(Gram.Entry.obj
(sequence : 'sequence Gram.Entry.t));
Gram.Skeyword "}" ],
(Gram.Action.mk
- (fun _ (seq : 'sequence) _ (_loc : Loc.t) ->
- (seq : 'do_sequence)))) ]) ]))
+ (fun _ (seq : 'sequence) _ (_loc : Gram.Loc.t)
+ -> (seq : 'do_sequence)))) ]) ]))
());
Gram.extend (infixop5 : 'infixop5 Gram.Entry.t)
((fun () ->
[ ([ Gram.srules infixop5
[ ([ Gram.Skeyword "&&" ],
(Gram.Action.mk
- (fun (x : Gram.Token.t) (_loc : Loc.t) ->
- (Token.extract_string x : 'e__1))));
+ (fun (x : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
+ (Gram.Token.extract_string x : 'e__1))));
([ Gram.Skeyword "&" ],
(Gram.Action.mk
- (fun (x : Gram.Token.t) (_loc : Loc.t) ->
- (Token.extract_string x : 'e__1)))) ] ],
+ (fun (x : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
+ (Gram.Token.extract_string x : 'e__1)))) ] ],
(Gram.Action.mk
- (fun (x : 'e__1) (_loc : Loc.t) ->
+ (fun (x : 'e__1) (_loc : Gram.Loc.t) ->
(Ast.ExId (_loc, Ast.IdLid (_loc, x)) :
'infixop5)))) ]) ]))
());
[ ([ Gram.srules infixop6
[ ([ Gram.Skeyword "||" ],
(Gram.Action.mk
- (fun (x : Gram.Token.t) (_loc : Loc.t) ->
- (Token.extract_string x : 'e__2))));
+ (fun (x : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
+ (Gram.Token.extract_string x : 'e__2))));
([ Gram.Skeyword "or" ],
(Gram.Action.mk
- (fun (x : Gram.Token.t) (_loc : Loc.t) ->
- (Token.extract_string x : 'e__2)))) ] ],
+ (fun (x : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
+ (Gram.Token.extract_string x : 'e__2)))) ] ],
(Gram.Action.mk
- (fun (x : 'e__2) (_loc : Loc.t) ->
+ (fun (x : 'e__2) (_loc : Gram.Loc.t) ->
(Ast.ExId (_loc, Ast.IdLid (_loc, x)) :
'infixop6)))) ]) ]))
());
[ ([ Gram.Snterm
(Gram.Entry.obj (expr : 'expr Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (e : 'expr) (_loc : Loc.t) ->
+ (fun (e : 'expr) (_loc : Gram.Loc.t) ->
(fun acc ->
Ast.ExApp (_loc,
Ast.ExApp (_loc,
Gram.Skeyword ";"; Gram.Sself ],
(Gram.Action.mk
(fun (el : 'sem_expr_for_list) _ (e : 'expr)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(fun acc ->
Ast.ExApp (_loc,
Ast.ExApp (_loc,
[ ([ Gram.Snterm
(Gram.Entry.obj (expr : 'expr Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (e : 'expr) (_loc : Loc.t) ->
+ (fun (e : 'expr) (_loc : Gram.Loc.t) ->
(e : 'comma_expr))));
([ Gram.Stoken
(((function
| _ -> false),
"ANTIQUOT (\"list\", _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("list" as n)), s) ->
(Ast.ExAnt (_loc,
([ Gram.Sself; Gram.Skeyword ","; Gram.Sself ],
(Gram.Action.mk
(fun (e2 : 'comma_expr) _ (e1 : 'comma_expr)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.ExCom (_loc, e1, e2) : 'comma_expr)))) ]) ]))
());
Gram.extend (dummy : 'dummy Gram.Entry.t)
[ (None, None,
[ ([],
(Gram.Action.mk
- (fun (_loc : Loc.t) -> (() : 'dummy)))) ]) ]))
+ (fun (_loc : Gram.Loc.t) -> (() : 'dummy)))) ]) ]))
());
- Gram.extend (sequence : 'sequence Gram.Entry.t)
+ Gram.extend (sequence' : 'sequence' Gram.Entry.t)
((fun () ->
(None,
[ (None, None,
- [ ([ Gram.Snterm
- (Gram.Entry.obj (expr : 'expr Gram.Entry.t)) ],
+ [ ([ Gram.Skeyword ";";
+ Gram.Snterm
+ (Gram.Entry.obj
+ (sequence : 'sequence Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (e : 'expr) (_loc : Loc.t) ->
- (e : 'sequence))));
- ([ Gram.Snterm
- (Gram.Entry.obj (expr : 'expr Gram.Entry.t));
- Gram.Skeyword ";" ],
+ (fun (el : 'sequence) _ (_loc : Gram.Loc.t) ->
+ (fun e -> Ast.ExSem (_loc, e, el) :
+ 'sequence'))));
+ ([ Gram.Skeyword ";" ],
(Gram.Action.mk
- (fun _ (e : 'expr) (_loc : Loc.t) ->
- (e : 'sequence))));
- ([ Gram.Snterm
+ (fun _ (_loc : Gram.Loc.t) ->
+ (fun e -> e : 'sequence'))));
+ ([],
+ (Gram.Action.mk
+ (fun (_loc : Gram.Loc.t) ->
+ (fun e -> e : 'sequence')))) ]) ]))
+ ());
+ Gram.extend (sequence : 'sequence Gram.Entry.t)
+ ((fun () ->
+ (None,
+ [ (None, None,
+ [ ([ Gram.Snterm
(Gram.Entry.obj (expr : 'expr Gram.Entry.t));
- Gram.Skeyword ";"; Gram.Sself ],
+ Gram.Snterm
+ (Gram.Entry.obj
+ (sequence' : 'sequence' Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (el : 'sequence) _ (e : 'expr)
- (_loc : Loc.t) ->
- (Ast.ExSem (_loc, e, el) : 'sequence))));
+ (fun (k : 'sequence') (e : 'expr)
+ (_loc : Gram.Loc.t) -> (k e : 'sequence))));
([ Gram.Stoken
(((function
| ANTIQUOT ("list", _) -> true
| _ -> false),
"ANTIQUOT (\"list\", _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("list" as n)), s) ->
(Ast.ExAnt (_loc,
mk_anti ~c: "expr;" n s) :
'sequence)
| _ -> assert false)));
+ ([ Gram.Skeyword "let"; Gram.Skeyword "module";
+ Gram.Snterm
+ (Gram.Entry.obj
+ (a_UIDENT : 'a_UIDENT Gram.Entry.t));
+ Gram.Snterm
+ (Gram.Entry.obj
+ (module_binding0 :
+ 'module_binding0 Gram.Entry.t));
+ Gram.Skeyword ";"; Gram.Sself ],
+ (Gram.Action.mk
+ (fun (el : 'sequence) _ (mb : 'module_binding0)
+ (m : 'a_UIDENT) _ _ (_loc : Gram.Loc.t) ->
+ (Ast.ExLmd (_loc, m, mb, mksequence _loc el) :
+ 'sequence))));
+ ([ Gram.Skeyword "let"; Gram.Skeyword "module";
+ Gram.Snterm
+ (Gram.Entry.obj
+ (a_UIDENT : 'a_UIDENT Gram.Entry.t));
+ Gram.Snterm
+ (Gram.Entry.obj
+ (module_binding0 :
+ 'module_binding0 Gram.Entry.t));
+ Gram.Skeyword "in";
+ Gram.Snterm
+ (Gram.Entry.obj (expr : 'expr Gram.Entry.t));
+ Gram.Snterm
+ (Gram.Entry.obj
+ (sequence' : 'sequence' Gram.Entry.t)) ],
+ (Gram.Action.mk
+ (fun (k : 'sequence') (e : 'expr) _
+ (mb : 'module_binding0) (m : 'a_UIDENT) _ _
+ (_loc : Gram.Loc.t) ->
+ (k (Ast.ExLmd (_loc, m, mb, e)) : 'sequence))));
([ Gram.Skeyword "let";
Gram.Snterm
(Gram.Entry.obj
Gram.Snterm
(Gram.Entry.obj
(binding : 'binding Gram.Entry.t));
- Gram.srules sequence
- [ ([ Gram.Skeyword ";" ],
- (Gram.Action.mk
- (fun (x : Gram.Token.t) (_loc : Loc.t) ->
- (Token.extract_string x : 'e__3))));
- ([ Gram.Skeyword "in" ],
- (Gram.Action.mk
- (fun (x : Gram.Token.t) (_loc : Loc.t) ->
- (Token.extract_string x : 'e__3)))) ];
- Gram.Sself ],
+ Gram.Skeyword ";"; Gram.Sself ],
(Gram.Action.mk
(fun (el : 'sequence) _ (bi : 'binding)
- (rf : 'opt_rec) _ (_loc : Loc.t) ->
+ (rf : 'opt_rec) _ (_loc : Gram.Loc.t) ->
(Ast.ExLet (_loc, rf, bi, mksequence _loc el) :
- 'sequence)))) ]) ]))
+ 'sequence))));
+ ([ Gram.Skeyword "let";
+ Gram.Snterm
+ (Gram.Entry.obj
+ (opt_rec : 'opt_rec Gram.Entry.t));
+ Gram.Snterm
+ (Gram.Entry.obj
+ (binding : 'binding Gram.Entry.t));
+ Gram.Skeyword "in";
+ Gram.Snterm
+ (Gram.Entry.obj (expr : 'expr Gram.Entry.t));
+ Gram.Snterm
+ (Gram.Entry.obj
+ (sequence' : 'sequence' Gram.Entry.t)) ],
+ (Gram.Action.mk
+ (fun (k : 'sequence') (e : 'expr) _
+ (bi : 'binding) (rf : 'opt_rec) _
+ (_loc : Gram.Loc.t) ->
+ (k (Ast.ExLet (_loc, rf, bi, e)) : 'sequence)))) ]) ]))
());
Gram.extend (binding : 'binding Gram.Entry.t)
((fun () ->
(Gram.Entry.obj
(let_binding : 'let_binding Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (b : 'let_binding) (_loc : Loc.t) ->
+ (fun (b : 'let_binding) (_loc : Gram.Loc.t) ->
(b : 'binding))));
([ Gram.Sself; Gram.Skeyword "and"; Gram.Sself ],
(Gram.Action.mk
(fun (b2 : 'binding) _ (b1 : 'binding)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.BiAnd (_loc, b1, b2) : 'binding))));
([ Gram.Stoken
(((function
| _ -> false),
"ANTIQUOT ((\"\" | \"anti\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" | "anti" as n)), s) ->
(Ast.BiAnt (_loc,
(Gram.Entry.obj (expr : 'expr Gram.Entry.t)) ],
(Gram.Action.mk
(fun (e : 'expr) _ (__camlp4_0 : Gram.Token.t)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" | "anti" as n)), s) ->
(Ast.BiEq (_loc,
| _ -> false),
"ANTIQUOT ((\"binding\" | \"list\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("binding" | "list" as n)), s)
->
(fun_binding : 'fun_binding Gram.Entry.t)) ],
(Gram.Action.mk
(fun (e : 'fun_binding) (p : 'ipatt)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.BiEq (_loc, p, e) : 'let_binding)))) ]) ]))
());
Gram.extend (fun_binding : 'fun_binding Gram.Entry.t)
Gram.Snterm
(Gram.Entry.obj (expr : 'expr Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (e : 'expr) _ (t : 'ctyp) _ (_loc : Loc.t)
- ->
+ (fun (e : 'expr) _ (t : 'ctyp) _
+ (_loc : Gram.Loc.t) ->
(Ast.ExCoe (_loc, e, Ast.TyNil _loc, t) :
'fun_binding))));
([ Gram.Skeyword ":";
Gram.Snterm
(Gram.Entry.obj (expr : 'expr Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (e : 'expr) _ (t : 'ctyp) _ (_loc : Loc.t)
- -> (Ast.ExTyc (_loc, e, t) : 'fun_binding))));
+ (fun (e : 'expr) _ (t : 'ctyp) _
+ (_loc : Gram.Loc.t) ->
+ (Ast.ExTyc (_loc, e, t) : 'fun_binding))));
([ Gram.Skeyword "=";
Gram.Snterm
(Gram.Entry.obj (expr : 'expr Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (e : 'expr) _ (_loc : Loc.t) ->
+ (fun (e : 'expr) _ (_loc : Gram.Loc.t) ->
(e : 'fun_binding))));
([ Gram.Snterm
(Gram.Entry.obj
Gram.Sself ],
(Gram.Action.mk
(fun (e : 'fun_binding) (p : 'labeled_ipatt)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.ExFun (_loc,
Ast.McArr (_loc, p, Ast.ExNil _loc, e)) :
'fun_binding)))) ]) ]))
Gram.Snterm
(Gram.Entry.obj (expr : 'expr Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (e : 'expr) _ (p : 'ipatt) (_loc : Loc.t)
- ->
+ (fun (e : 'expr) _ (p : 'ipatt)
+ (_loc : Gram.Loc.t) ->
(Ast.McArr (_loc, p, Ast.ExNil _loc, e) :
'match_case))));
([ Gram.Skeyword "[";
Gram.Skeyword "|");
Gram.Skeyword "]" ],
(Gram.Action.mk
- (fun _ (l : 'match_case0 list) _ (_loc : Loc.t)
- -> (Ast.mcOr_of_list l : 'match_case)))) ]) ]))
+ (fun _ (l : 'match_case0 list) _
+ (_loc : Gram.Loc.t) ->
+ (Ast.mcOr_of_list l : 'match_case)))) ]) ]))
());
Gram.extend (match_case0 : 'match_case0 Gram.Entry.t)
((fun () ->
(Gram.Entry.obj (expr : 'expr Gram.Entry.t)) ],
(Gram.Action.mk
(fun (e : 'expr) _ (w : 'opt_when_expr)
- (p : 'patt_as_patt_opt) (_loc : Loc.t) ->
- (Ast.McArr (_loc, p, w, e) : 'match_case0))));
+ (p : 'patt_as_patt_opt) (_loc : Gram.Loc.t)
+ -> (Ast.McArr (_loc, p, w, e) : 'match_case0))));
([ Gram.Stoken
(((function
| ANTIQUOT (("" | "anti"), _) -> true
(Gram.Entry.obj (expr : 'expr Gram.Entry.t)) ],
(Gram.Action.mk
(fun (e : 'expr) _ (w : 'expr) _
- (__camlp4_0 : Gram.Token.t) (_loc : Loc.t) ->
+ (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" | "anti" as n)), s) ->
(Ast.McArr (_loc,
(Gram.Entry.obj (expr : 'expr Gram.Entry.t)) ],
(Gram.Action.mk
(fun (e : 'expr) _ (__camlp4_0 : Gram.Token.t)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" | "anti" as n)), s) ->
(Ast.McArr (_loc,
| _ -> false),
"ANTIQUOT ((\"\" | \"anti\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" | "anti" as n)), s) ->
(Ast.McAnt (_loc,
| _ -> false),
"ANTIQUOT ((\"match_case\" | \"list\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("match_case" | "list" as n)),
s) ->
[ (None, None,
[ ([],
(Gram.Action.mk
- (fun (_loc : Loc.t) ->
+ (fun (_loc : Gram.Loc.t) ->
(Ast.ExNil _loc : 'opt_when_expr))));
([ Gram.Skeyword "when";
Gram.Snterm
(Gram.Entry.obj (expr : 'expr Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (w : 'expr) _ (_loc : Loc.t) ->
+ (fun (w : 'expr) _ (_loc : Gram.Loc.t) ->
(w : 'opt_when_expr)))) ]) ]))
());
Gram.extend (patt_as_patt_opt : 'patt_as_patt_opt Gram.Entry.t)
[ ([ Gram.Snterm
(Gram.Entry.obj (patt : 'patt Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (p : 'patt) (_loc : Loc.t) ->
+ (fun (p : 'patt) (_loc : Gram.Loc.t) ->
(p : 'patt_as_patt_opt))));
([ Gram.Snterm
(Gram.Entry.obj (patt : 'patt Gram.Entry.t));
Gram.Snterm
(Gram.Entry.obj (patt : 'patt Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (p2 : 'patt) _ (p1 : 'patt) (_loc : Loc.t)
- ->
+ (fun (p2 : 'patt) _ (p1 : 'patt)
+ (_loc : Gram.Loc.t) ->
(Ast.PaAli (_loc, p1, p2) :
'patt_as_patt_opt)))) ]) ]))
());
(fun_binding : 'fun_binding Gram.Entry.t)) ],
(Gram.Action.mk
(fun (e : 'fun_binding) (i : 'label_longident)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.RbEq (_loc, i, e) : 'label_expr))));
([ Gram.Stoken
(((function
| _ -> false),
"ANTIQUOT (\"list\", _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("list" as n)), s) ->
(Ast.RbAnt (_loc,
(Gram.Entry.obj (expr : 'expr Gram.Entry.t)) ],
(Gram.Action.mk
(fun (e : 'expr) _ (__camlp4_0 : Gram.Token.t)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" | "anti" as n)), s) ->
(Ast.RbEq (_loc,
| _ -> false),
"ANTIQUOT ((\"\" | \"anti\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" | "anti" as n)), s) ->
(Ast.RbAnt (_loc,
| _ -> false),
"ANTIQUOT (\"rec_binding\", _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("rec_binding" as n)), s) ->
(Ast.RbAnt (_loc,
([ Gram.Sself; Gram.Skeyword ";"; Gram.Sself ],
(Gram.Action.mk
(fun (b2 : 'label_expr) _ (b1 : 'label_expr)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.RbSem (_loc, b1, b2) : 'label_expr)))) ]) ]))
());
Gram.extend (fun_def : 'fun_def Gram.Entry.t)
+ ((fun () ->
+ (None,
+ [ (None, None,
+ [ ([ Gram.Snterm
+ (Gram.Entry.obj
+ (labeled_ipatt :
+ 'labeled_ipatt Gram.Entry.t));
+ Gram.Snterm
+ (Gram.Entry.obj
+ (fun_def_cont : 'fun_def_cont Gram.Entry.t)) ],
+ (Gram.Action.mk
+ (fun ((w, e) : 'fun_def_cont)
+ (p : 'labeled_ipatt) (_loc : Gram.Loc.t) ->
+ (Ast.ExFun (_loc, Ast.McArr (_loc, p, w, e)) :
+ 'fun_def)))) ]) ]))
+ ());
+ Gram.extend (fun_def_cont : 'fun_def_cont Gram.Entry.t)
((fun () ->
(None,
[ (None, (Some Camlp4.Sig.Grammar.RightA),
Gram.Snterm
(Gram.Entry.obj (expr : 'expr Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (e : 'expr) _ (_loc : Loc.t) ->
- (e : 'fun_def))));
+ (fun (e : 'expr) _ (_loc : Gram.Loc.t) ->
+ (((Ast.ExNil _loc), e) : 'fun_def_cont))));
+ ([ Gram.Skeyword "when";
+ Gram.Snterm
+ (Gram.Entry.obj (expr : 'expr Gram.Entry.t));
+ Gram.Skeyword "->";
+ Gram.Snterm
+ (Gram.Entry.obj (expr : 'expr Gram.Entry.t)) ],
+ (Gram.Action.mk
+ (fun (e : 'expr) _ (w : 'expr) _
+ (_loc : Gram.Loc.t) ->
+ ((w, e) : 'fun_def_cont))));
([ Gram.Snterm
(Gram.Entry.obj
(labeled_ipatt :
'labeled_ipatt Gram.Entry.t));
Gram.Sself ],
(Gram.Action.mk
- (fun (e : 'fun_def) (p : 'labeled_ipatt)
- (_loc : Loc.t) ->
- (Ast.ExFun (_loc,
- Ast.McArr (_loc, p, Ast.ExNil _loc, e)) :
- 'fun_def)))) ]) ]))
+ (fun ((w, e) : 'fun_def_cont)
+ (p : 'labeled_ipatt) (_loc : Gram.Loc.t) ->
+ (((Ast.ExNil _loc),
+ (Ast.ExFun (_loc,
+ Ast.McArr (_loc, p, w, e)))) :
+ 'fun_def_cont)))) ]) ]))
());
Gram.extend (patt : 'patt Gram.Entry.t)
((fun () ->
(None,
- [ (None, (Some Camlp4.Sig.Grammar.LeftA),
+ [ ((Some "|"), (Some Camlp4.Sig.Grammar.LeftA),
[ ([ Gram.Sself; Gram.Skeyword "|"; Gram.Sself ],
(Gram.Action.mk
- (fun (p2 : 'patt) _ (p1 : 'patt) (_loc : Loc.t)
- -> (Ast.PaOrp (_loc, p1, p2) : 'patt)))) ]);
- (None, (Some Camlp4.Sig.Grammar.NonA),
+ (fun (p2 : 'patt) _ (p1 : 'patt)
+ (_loc : Gram.Loc.t) ->
+ (Ast.PaOrp (_loc, p1, p2) : 'patt)))) ]);
+ ((Some ".."), (Some Camlp4.Sig.Grammar.NonA),
[ ([ Gram.Sself; Gram.Skeyword ".."; Gram.Sself ],
(Gram.Action.mk
- (fun (p2 : 'patt) _ (p1 : 'patt) (_loc : Loc.t)
- -> (Ast.PaRng (_loc, p1, p2) : 'patt)))) ]);
- (None, (Some Camlp4.Sig.Grammar.LeftA),
+ (fun (p2 : 'patt) _ (p1 : 'patt)
+ (_loc : Gram.Loc.t) ->
+ (Ast.PaRng (_loc, p1, p2) : 'patt)))) ]);
+ ((Some "apply"), (Some Camlp4.Sig.Grammar.LeftA),
[ ([ Gram.Sself; Gram.Sself ],
(Gram.Action.mk
- (fun (p2 : 'patt) (p1 : 'patt) (_loc : Loc.t) ->
+ (fun (p2 : 'patt) (p1 : 'patt)
+ (_loc : Gram.Loc.t) ->
(Ast.PaApp (_loc, p1, p2) : 'patt)))) ]);
((Some "simple"), None,
[ ([ Gram.Skeyword "?"; Gram.Skeyword "(";
Gram.Skeyword ")" ],
(Gram.Action.mk
(fun _ (e : 'expr) _ (p : 'patt_tcon) _ _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.PaOlbi (_loc, "", p, e) : 'patt))));
([ Gram.Skeyword "?"; Gram.Skeyword "(";
Gram.Snterm
(patt_tcon : 'patt_tcon Gram.Entry.t));
Gram.Skeyword ")" ],
(Gram.Action.mk
- (fun _ (p : 'patt_tcon) _ _ (_loc : Loc.t) ->
- (Ast.PaOlb (_loc, "", p) : 'patt))));
+ (fun _ (p : 'patt_tcon) _ _ (_loc : Gram.Loc.t)
+ -> (Ast.PaOlb (_loc, "", p) : 'patt))));
([ Gram.Skeyword "?";
Gram.Stoken
(((function
"ANTIQUOT ((\"\" | \"lid\"), _)")) ],
(Gram.Action.mk
(fun (__camlp4_0 : Gram.Token.t) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" | "lid" as n)), i) ->
(Ast.PaOlb (_loc, mk_anti n i,
"LIDENT _")) ],
(Gram.Action.mk
(fun (__camlp4_0 : Gram.Token.t) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| LIDENT i ->
(Ast.PaOlb (_loc, i, Ast.PaNil _loc) :
Gram.Skeyword ")" ],
(Gram.Action.mk
(fun _ (f : 'eq_expr) (p : 'patt_tcon) _ _
- (__camlp4_0 : Gram.Token.t) _ (_loc : Loc.t)
- ->
+ (__camlp4_0 : Gram.Token.t) _
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" | "lid" as n)), i) ->
(f (mk_anti n i) p : 'patt)
Gram.Skeyword ")" ],
(Gram.Action.mk
(fun _ (f : 'eq_expr) (p : 'patt_tcon) _
- (__camlp4_0 : Gram.Token.t) (_loc : Loc.t) ->
+ (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| OPTLABEL i -> (f i p : 'patt)
| _ -> assert false)));
"LIDENT _")) ],
(Gram.Action.mk
(fun (__camlp4_0 : Gram.Token.t) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| LIDENT i ->
(Ast.PaLab (_loc, i, Ast.PaNil _loc) :
"ANTIQUOT ((\"\" | \"lid\"), _)")) ],
(Gram.Action.mk
(fun (__camlp4_0 : Gram.Token.t) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" | "lid" as n)), i) ->
(Ast.PaLab (_loc, mk_anti n i,
Gram.Skeyword ":"; Gram.Sself ],
(Gram.Action.mk
(fun (p : 'patt) _ (__camlp4_0 : Gram.Token.t) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" | "lid" as n)), i) ->
(Ast.PaLab (_loc, mk_anti n i, p) :
Gram.Sself ],
(Gram.Action.mk
(fun (p : 'patt) (__camlp4_0 : Gram.Token.t)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| LABEL i -> (Ast.PaLab (_loc, i, p) : 'patt)
| _ -> assert false)));
(type_longident :
'type_longident Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (i : 'type_longident) _ (_loc : Loc.t) ->
- (Ast.PaTyp (_loc, i) : 'patt))));
+ (fun (i : 'type_longident) _ (_loc : Gram.Loc.t)
+ -> (Ast.PaTyp (_loc, i) : 'patt))));
([ Gram.Skeyword "`";
Gram.Snterm
(Gram.Entry.obj
(a_ident : 'a_ident Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (s : 'a_ident) _ (_loc : Loc.t) ->
+ (fun (s : 'a_ident) _ (_loc : Gram.Loc.t) ->
(Ast.PaVrn (_loc, s) : 'patt))));
([ Gram.Stoken
(((function | QUOTATION _ -> true | _ -> false),
"QUOTATION _")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| QUOTATION x ->
(Quotation.expand _loc x Quotation.
| _ -> assert false)));
([ Gram.Skeyword "_" ],
(Gram.Action.mk
- (fun _ (_loc : Loc.t) ->
+ (fun _ (_loc : Gram.Loc.t) ->
(Ast.PaAny _loc : 'patt))));
([ Gram.Skeyword "("; Gram.Sself; Gram.Skeyword ",";
Gram.Snterm
Gram.Skeyword ")" ],
(Gram.Action.mk
(fun _ (pl : 'comma_patt) _ (p : 'patt) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.PaTup (_loc, Ast.PaCom (_loc, p, pl)) :
'patt))));
([ Gram.Skeyword "("; Gram.Sself;
Gram.Skeyword "as"; Gram.Sself; Gram.Skeyword ")" ],
(Gram.Action.mk
(fun _ (p2 : 'patt) _ (p : 'patt) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.PaAli (_loc, p, p2) : 'patt))));
([ Gram.Skeyword "("; Gram.Sself; Gram.Skeyword ":";
Gram.Snterm
Gram.Skeyword ")" ],
(Gram.Action.mk
(fun _ (t : 'ctyp) _ (p : 'patt) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.PaTyc (_loc, p, t) : 'patt))));
([ Gram.Skeyword "("; Gram.Sself; Gram.Skeyword ")" ],
(Gram.Action.mk
- (fun _ (p : 'patt) _ (_loc : Loc.t) ->
+ (fun _ (p : 'patt) _ (_loc : Gram.Loc.t) ->
(p : 'patt))));
([ Gram.Skeyword "("; Gram.Skeyword ")" ],
(Gram.Action.mk
- (fun _ _ (_loc : Loc.t) ->
+ (fun _ _ (_loc : Gram.Loc.t) ->
(Ast.PaId (_loc, Ast.IdUid (_loc, "()")) :
'patt))));
([ Gram.Skeyword "{";
(label_patt : 'label_patt Gram.Entry.t));
Gram.Skeyword "}" ],
(Gram.Action.mk
- (fun _ (pl : 'label_patt) _ (_loc : Loc.t) ->
- (Ast.PaRec (_loc, pl) : 'patt))));
+ (fun _ (pl : 'label_patt) _ (_loc : Gram.Loc.t)
+ -> (Ast.PaRec (_loc, pl) : 'patt))));
([ Gram.Skeyword "[|";
Gram.Snterm
(Gram.Entry.obj
(sem_patt : 'sem_patt Gram.Entry.t));
Gram.Skeyword "|]" ],
(Gram.Action.mk
- (fun _ (pl : 'sem_patt) _ (_loc : Loc.t) ->
+ (fun _ (pl : 'sem_patt) _ (_loc : Gram.Loc.t) ->
(Ast.PaArr (_loc, pl) : 'patt))));
([ Gram.Skeyword "[|"; Gram.Skeyword "|]" ],
(Gram.Action.mk
- (fun _ _ (_loc : Loc.t) ->
+ (fun _ _ (_loc : Gram.Loc.t) ->
(Ast.PaArr (_loc, Ast.PaNil _loc) : 'patt))));
([ Gram.Skeyword "[";
Gram.Snterm
Gram.Skeyword "]" ],
(Gram.Action.mk
(fun _ (mk_list : 'sem_patt_for_list) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(mk_list
(Ast.PaId (_loc, Ast.IdUid (_loc, "[]"))) :
'patt))));
(Gram.Action.mk
(fun _ (last : 'patt) _
(mk_list : 'sem_patt_for_list) _
- (_loc : Loc.t) -> (mk_list last : 'patt))));
+ (_loc : Gram.Loc.t) -> (mk_list last : 'patt))));
([ Gram.Skeyword "["; Gram.Skeyword "]" ],
(Gram.Action.mk
- (fun _ _ (_loc : Loc.t) ->
+ (fun _ _ (_loc : Gram.Loc.t) ->
(Ast.PaId (_loc, Ast.IdUid (_loc, "[]")) :
'patt))));
([ Gram.Skeyword "-";
(Gram.Entry.obj
(a_FLOAT : 'a_FLOAT Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (s : 'a_FLOAT) _ (_loc : Loc.t) ->
+ (fun (s : 'a_FLOAT) _ (_loc : Gram.Loc.t) ->
(Ast.PaFlo (_loc, neg_string s) : 'patt))));
([ Gram.Skeyword "-";
Gram.Snterm
(Gram.Entry.obj
(a_NATIVEINT : 'a_NATIVEINT Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (s : 'a_NATIVEINT) _ (_loc : Loc.t) ->
+ (fun (s : 'a_NATIVEINT) _ (_loc : Gram.Loc.t) ->
(Ast.PaNativeInt (_loc, neg_string s) :
'patt))));
([ Gram.Skeyword "-";
(Gram.Entry.obj
(a_INT64 : 'a_INT64 Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (s : 'a_INT64) _ (_loc : Loc.t) ->
+ (fun (s : 'a_INT64) _ (_loc : Gram.Loc.t) ->
(Ast.PaInt64 (_loc, neg_string s) : 'patt))));
([ Gram.Skeyword "-";
Gram.Snterm
(Gram.Entry.obj
(a_INT32 : 'a_INT32 Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (s : 'a_INT32) _ (_loc : Loc.t) ->
+ (fun (s : 'a_INT32) _ (_loc : Gram.Loc.t) ->
(Ast.PaInt32 (_loc, neg_string s) : 'patt))));
([ Gram.Skeyword "-";
Gram.Snterm
(Gram.Entry.obj (a_INT : 'a_INT Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (s : 'a_INT) _ (_loc : Loc.t) ->
+ (fun (s : 'a_INT) _ (_loc : Gram.Loc.t) ->
(Ast.PaInt (_loc, neg_string s) : 'patt))));
([ Gram.Snterm
(Gram.Entry.obj (a_CHAR : 'a_CHAR Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (s : 'a_CHAR) (_loc : Loc.t) ->
+ (fun (s : 'a_CHAR) (_loc : Gram.Loc.t) ->
(Ast.PaChr (_loc, s) : 'patt))));
([ Gram.Snterm
(Gram.Entry.obj
(a_STRING : 'a_STRING Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (s : 'a_STRING) (_loc : Loc.t) ->
+ (fun (s : 'a_STRING) (_loc : Gram.Loc.t) ->
(Ast.PaStr (_loc, s) : 'patt))));
([ Gram.Snterm
(Gram.Entry.obj
(a_FLOAT : 'a_FLOAT Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (s : 'a_FLOAT) (_loc : Loc.t) ->
+ (fun (s : 'a_FLOAT) (_loc : Gram.Loc.t) ->
(Ast.PaFlo (_loc, s) : 'patt))));
([ Gram.Snterm
(Gram.Entry.obj
(a_NATIVEINT : 'a_NATIVEINT Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (s : 'a_NATIVEINT) (_loc : Loc.t) ->
+ (fun (s : 'a_NATIVEINT) (_loc : Gram.Loc.t) ->
(Ast.PaNativeInt (_loc, s) : 'patt))));
([ Gram.Snterm
(Gram.Entry.obj
(a_INT64 : 'a_INT64 Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (s : 'a_INT64) (_loc : Loc.t) ->
+ (fun (s : 'a_INT64) (_loc : Gram.Loc.t) ->
(Ast.PaInt64 (_loc, s) : 'patt))));
([ Gram.Snterm
(Gram.Entry.obj
(a_INT32 : 'a_INT32 Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (s : 'a_INT32) (_loc : Loc.t) ->
+ (fun (s : 'a_INT32) (_loc : Gram.Loc.t) ->
(Ast.PaInt32 (_loc, s) : 'patt))));
([ Gram.Snterm
(Gram.Entry.obj (a_INT : 'a_INT Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (s : 'a_INT) (_loc : Loc.t) ->
+ (fun (s : 'a_INT) (_loc : Gram.Loc.t) ->
(Ast.PaInt (_loc, s) : 'patt))));
([ Gram.Snterm
(Gram.Entry.obj (ident : 'ident Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (i : 'ident) (_loc : Loc.t) ->
+ (fun (i : 'ident) (_loc : Gram.Loc.t) ->
(Ast.PaId (_loc, i) : 'patt))));
+ ([ Gram.Stoken
+ (((function
+ | ANTIQUOT ("`bool", _) -> true
+ | _ -> false),
+ "ANTIQUOT (\"`bool\", _)")) ],
+ (Gram.Action.mk
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
+ match __camlp4_0 with
+ | ANTIQUOT ((("`bool" as n)), s) ->
+ (Ast.PaId (_loc,
+ Ast.IdAnt (_loc, mk_anti n s)) :
+ 'patt)
+ | _ -> assert false)));
([ Gram.Stoken
(((function
| ANTIQUOT ("tup", _) -> true
| _ -> false),
"ANTIQUOT (\"tup\", _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("tup" as n)), s) ->
(Ast.PaTup (_loc,
| _ -> false),
"ANTIQUOT ((\"\" | \"pat\" | \"anti\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" | "pat" | "anti" as n)), s)
->
[ ([ Gram.Snterm
(Gram.Entry.obj (patt : 'patt Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (p : 'patt) (_loc : Loc.t) ->
+ (fun (p : 'patt) (_loc : Gram.Loc.t) ->
(p : 'comma_patt))));
([ Gram.Stoken
(((function
| _ -> false),
"ANTIQUOT (\"list\", _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("list" as n)), s) ->
(Ast.PaAnt (_loc,
([ Gram.Sself; Gram.Skeyword ","; Gram.Sself ],
(Gram.Action.mk
(fun (p2 : 'comma_patt) _ (p1 : 'comma_patt)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.PaCom (_loc, p1, p2) : 'comma_patt)))) ]) ]))
());
Gram.extend (sem_patt : 'sem_patt Gram.Entry.t)
[ ([ Gram.Snterm
(Gram.Entry.obj (patt : 'patt Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (p : 'patt) (_loc : Loc.t) ->
+ (fun (p : 'patt) (_loc : Gram.Loc.t) ->
(p : 'sem_patt))));
([ Gram.Stoken
(((function
| _ -> false),
"ANTIQUOT (\"list\", _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("list" as n)), s) ->
(Ast.PaAnt (_loc,
([ Gram.Sself; Gram.Skeyword ";"; Gram.Sself ],
(Gram.Action.mk
(fun (p2 : 'sem_patt) _ (p1 : 'sem_patt)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.PaSem (_loc, p1, p2) : 'sem_patt)))) ]) ]))
());
Gram.extend
[ ([ Gram.Snterm
(Gram.Entry.obj (patt : 'patt Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (p : 'patt) (_loc : Loc.t) ->
+ (fun (p : 'patt) (_loc : Gram.Loc.t) ->
(fun acc ->
Ast.PaApp (_loc,
Ast.PaApp (_loc,
Gram.Skeyword ";"; Gram.Sself ],
(Gram.Action.mk
(fun (pl : 'sem_patt_for_list) _ (p : 'patt)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(fun acc ->
Ast.PaApp (_loc,
Ast.PaApp (_loc,
(Gram.Entry.obj (patt : 'patt Gram.Entry.t)) ],
(Gram.Action.mk
(fun (p : 'patt) _ (i : 'label_longident)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.PaEq (_loc, i, p) : 'label_patt))));
([ Gram.Stoken
(((function
| _ -> false),
"ANTIQUOT (\"list\", _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("list" as n)), s) ->
(Ast.PaAnt (_loc,
(((function | QUOTATION _ -> true | _ -> false),
"QUOTATION _")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| QUOTATION x ->
(Quotation.expand _loc x Quotation.
| _ -> false),
"ANTIQUOT ((\"\" | \"pat\" | \"anti\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" | "pat" | "anti" as n)), s)
->
([ Gram.Sself; Gram.Skeyword ";"; Gram.Sself ],
(Gram.Action.mk
(fun (p2 : 'label_patt) _ (p1 : 'label_patt)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.PaSem (_loc, p1, p2) : 'label_patt)))) ]) ]))
());
Gram.extend (ipatt : 'ipatt Gram.Entry.t)
[ (None, None,
[ ([ Gram.Skeyword "_" ],
(Gram.Action.mk
- (fun _ (_loc : Loc.t) ->
+ (fun _ (_loc : Gram.Loc.t) ->
(Ast.PaAny _loc : 'ipatt))));
([ Gram.Snterm
(Gram.Entry.obj
(a_LIDENT : 'a_LIDENT Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (s : 'a_LIDENT) (_loc : Loc.t) ->
+ (fun (s : 'a_LIDENT) (_loc : Gram.Loc.t) ->
(Ast.PaId (_loc, Ast.IdLid (_loc, s)) :
'ipatt))));
([ Gram.Skeyword "("; Gram.Sself; Gram.Skeyword ",";
Gram.Skeyword ")" ],
(Gram.Action.mk
(fun _ (pl : 'comma_ipatt) _ (p : 'ipatt) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.PaTup (_loc, Ast.PaCom (_loc, p, pl)) :
'ipatt))));
([ Gram.Skeyword "("; Gram.Sself;
Gram.Skeyword "as"; Gram.Sself; Gram.Skeyword ")" ],
(Gram.Action.mk
(fun _ (p2 : 'ipatt) _ (p : 'ipatt) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.PaAli (_loc, p, p2) : 'ipatt))));
([ Gram.Skeyword "("; Gram.Sself; Gram.Skeyword ":";
Gram.Snterm
Gram.Skeyword ")" ],
(Gram.Action.mk
(fun _ (t : 'ctyp) _ (p : 'ipatt) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.PaTyc (_loc, p, t) : 'ipatt))));
([ Gram.Skeyword "("; Gram.Sself; Gram.Skeyword ")" ],
(Gram.Action.mk
- (fun _ (p : 'ipatt) _ (_loc : Loc.t) ->
+ (fun _ (p : 'ipatt) _ (_loc : Gram.Loc.t) ->
(p : 'ipatt))));
([ Gram.Skeyword "("; Gram.Skeyword ")" ],
(Gram.Action.mk
- (fun _ _ (_loc : Loc.t) ->
+ (fun _ _ (_loc : Gram.Loc.t) ->
(Ast.PaId (_loc, Ast.IdUid (_loc, "()")) :
'ipatt))));
([ Gram.Stoken
(((function | QUOTATION _ -> true | _ -> false),
"QUOTATION _")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| QUOTATION x ->
(Quotation.expand _loc x Quotation.
| _ -> false),
"ANTIQUOT (\"tup\", _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("tup" as n)), s) ->
(Ast.PaTup (_loc,
| _ -> false),
"ANTIQUOT ((\"\" | \"pat\" | \"anti\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" | "pat" | "anti" as n)), s)
->
(label_ipatt : 'label_ipatt Gram.Entry.t));
Gram.Skeyword "}" ],
(Gram.Action.mk
- (fun _ (pl : 'label_ipatt) _ (_loc : Loc.t) ->
- (Ast.PaRec (_loc, pl) : 'ipatt)))) ]) ]))
+ (fun _ (pl : 'label_ipatt) _ (_loc : Gram.Loc.t)
+ -> (Ast.PaRec (_loc, pl) : 'ipatt)))) ]) ]))
());
Gram.extend (labeled_ipatt : 'labeled_ipatt Gram.Entry.t)
((fun () ->
[ ([ Gram.Snterm
(Gram.Entry.obj (ipatt : 'ipatt Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (p : 'ipatt) (_loc : Loc.t) ->
+ (fun (p : 'ipatt) (_loc : Gram.Loc.t) ->
(p : 'labeled_ipatt)))) ]) ]))
());
Gram.extend (comma_ipatt : 'comma_ipatt Gram.Entry.t)
[ ([ Gram.Snterm
(Gram.Entry.obj (ipatt : 'ipatt Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (p : 'ipatt) (_loc : Loc.t) ->
+ (fun (p : 'ipatt) (_loc : Gram.Loc.t) ->
(p : 'comma_ipatt))));
([ Gram.Stoken
(((function
| _ -> false),
"ANTIQUOT (\"list\", _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("list" as n)), s) ->
(Ast.PaAnt (_loc,
([ Gram.Sself; Gram.Skeyword ","; Gram.Sself ],
(Gram.Action.mk
(fun (p2 : 'comma_ipatt) _ (p1 : 'comma_ipatt)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.PaCom (_loc, p1, p2) : 'comma_ipatt)))) ]) ]))
());
Gram.extend (label_ipatt : 'label_ipatt Gram.Entry.t)
(Gram.Entry.obj (ipatt : 'ipatt Gram.Entry.t)) ],
(Gram.Action.mk
(fun (p : 'ipatt) _ (i : 'label_longident)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.PaEq (_loc, i, p) : 'label_ipatt))));
([ Gram.Stoken
(((function | QUOTATION _ -> true | _ -> false),
"QUOTATION _")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| QUOTATION x ->
(Quotation.expand _loc x Quotation.
| _ -> false),
"ANTIQUOT (\"list\", _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("list" as n)), s) ->
(Ast.PaAnt (_loc,
| _ -> false),
"ANTIQUOT ((\"\" | \"pat\" | \"anti\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" | "pat" | "anti" as n)), s)
->
([ Gram.Sself; Gram.Skeyword ";"; Gram.Sself ],
(Gram.Action.mk
(fun (p2 : 'label_ipatt) _ (p1 : 'label_ipatt)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.PaSem (_loc, p1, p2) : 'label_ipatt)))) ]) ]))
());
Gram.extend (type_declaration : 'type_declaration Gram.Entry.t)
(Gram.Action.mk
(fun (cl : 'constrain list) (tk : 'opt_eq_ctyp)
((n, tpl) : 'type_ident_and_parameters)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.TyDcl (_loc, n, tpl, tk, cl) :
'type_declaration))));
([ Gram.Sself; Gram.Skeyword "and"; Gram.Sself ],
(Gram.Action.mk
(fun (t2 : 'type_declaration) _
- (t1 : 'type_declaration) (_loc : Loc.t) ->
+ (t1 : 'type_declaration) (_loc : Gram.Loc.t)
+ ->
(Ast.TyAnd (_loc, t1, t2) :
'type_declaration))));
([ Gram.Stoken
(((function | QUOTATION _ -> true | _ -> false),
"QUOTATION _")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| QUOTATION x ->
(Quotation.expand _loc x Quotation.
| _ -> false),
"ANTIQUOT (\"list\", _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("list" as n)), s) ->
(Ast.TyAnt (_loc,
| _ -> false),
"ANTIQUOT ((\"\" | \"typ\" | \"anti\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" | "typ" | "anti" as n)), s)
->
(Gram.Entry.obj (ctyp : 'ctyp Gram.Entry.t)) ],
(Gram.Action.mk
(fun (t2 : 'ctyp) _ (t1 : 'ctyp) _
- (_loc : Loc.t) -> ((t1, t2) : 'constrain)))) ]) ]))
+ (_loc : Gram.Loc.t) ->
+ ((t1, t2) : 'constrain)))) ]) ]))
());
Gram.extend (opt_eq_ctyp : 'opt_eq_ctyp Gram.Entry.t)
((fun () ->
[ (None, None,
[ ([],
(Gram.Action.mk
- (fun (_loc : Loc.t) ->
+ (fun (_loc : Gram.Loc.t) ->
(Ast.TyNil _loc : 'opt_eq_ctyp))));
([ Gram.Skeyword "=";
Gram.Snterm
(Gram.Entry.obj
(type_kind : 'type_kind Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (tk : 'type_kind) _ (_loc : Loc.t) ->
+ (fun (tk : 'type_kind) _ (_loc : Gram.Loc.t) ->
(tk : 'opt_eq_ctyp)))) ]) ]))
());
Gram.extend (type_kind : 'type_kind Gram.Entry.t)
[ ([ Gram.Snterm
(Gram.Entry.obj (ctyp : 'ctyp Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (t : 'ctyp) (_loc : Loc.t) ->
+ (fun (t : 'ctyp) (_loc : Gram.Loc.t) ->
(t : 'type_kind)))) ]) ]))
());
Gram.extend
'type_parameter Gram.Entry.t))) ],
(Gram.Action.mk
(fun (tpl : 'type_parameter list)
- (i : 'a_LIDENT) (_loc : Loc.t) ->
+ (i : 'a_LIDENT) (_loc : Gram.Loc.t) ->
((i, tpl) : 'type_ident_and_parameters)))) ]) ]))
());
Gram.extend
'type_parameters Gram.Entry.t)) ],
(Gram.Action.mk
(fun (tpl : 'type_parameters)
- (i : 'type_longident) (_loc : Loc.t) ->
+ (i : 'type_longident) (_loc : Gram.Loc.t) ->
(tpl (Ast.TyId (_loc, i)) :
'type_longident_and_parameters)))) ]) ]))
());
[ (None, None,
[ ([],
(Gram.Action.mk
- (fun (_loc : Loc.t) ->
+ (fun (_loc : Gram.Loc.t) ->
(fun t -> t : 'type_parameters))));
([ Gram.Snterm
(Gram.Entry.obj
(type_parameter :
'type_parameter Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (t : 'type_parameter) (_loc : Loc.t) ->
+ (fun (t : 'type_parameter) (_loc : Gram.Loc.t)
+ ->
(fun acc -> Ast.TyApp (_loc, acc, t) :
'type_parameters))));
([ Gram.Snterm
Gram.Sself ],
(Gram.Action.mk
(fun (t2 : 'type_parameters)
- (t1 : 'type_parameter) (_loc : Loc.t) ->
+ (t1 : 'type_parameter) (_loc : Gram.Loc.t) ->
(fun acc -> t2 (Ast.TyApp (_loc, acc, t1)) :
'type_parameters)))) ]) ]))
());
(Gram.Entry.obj
(a_ident : 'a_ident Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (i : 'a_ident) _ _ (_loc : Loc.t) ->
+ (fun (i : 'a_ident) _ _ (_loc : Gram.Loc.t) ->
(Ast.TyQuM (_loc, i) : 'type_parameter))));
([ Gram.Skeyword "+"; Gram.Skeyword "'";
Gram.Snterm
(Gram.Entry.obj
(a_ident : 'a_ident Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (i : 'a_ident) _ _ (_loc : Loc.t) ->
+ (fun (i : 'a_ident) _ _ (_loc : Gram.Loc.t) ->
(Ast.TyQuP (_loc, i) : 'type_parameter))));
([ Gram.Skeyword "'";
Gram.Snterm
(Gram.Entry.obj
(a_ident : 'a_ident Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (i : 'a_ident) _ (_loc : Loc.t) ->
+ (fun (i : 'a_ident) _ (_loc : Gram.Loc.t) ->
(Ast.TyQuo (_loc, i) : 'type_parameter))));
([ Gram.Stoken
(((function | QUOTATION _ -> true | _ -> false),
"QUOTATION _")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| QUOTATION x ->
(Quotation.expand _loc x Quotation.
| _ -> false),
"ANTIQUOT ((\"\" | \"typ\" | \"anti\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" | "typ" | "anti" as n)), s)
->
Gram.extend (ctyp : 'ctyp Gram.Entry.t)
((fun () ->
(None,
- [ (None, (Some Camlp4.Sig.Grammar.LeftA),
+ [ ((Some "=="), (Some Camlp4.Sig.Grammar.LeftA),
[ ([ Gram.Sself; Gram.Skeyword "=="; Gram.Sself ],
(Gram.Action.mk
- (fun (t2 : 'ctyp) _ (t1 : 'ctyp) (_loc : Loc.t)
- -> (Ast.TyMan (_loc, t1, t2) : 'ctyp)))) ]);
- (None, (Some Camlp4.Sig.Grammar.NonA),
+ (fun (t2 : 'ctyp) _ (t1 : 'ctyp)
+ (_loc : Gram.Loc.t) ->
+ (Ast.TyMan (_loc, t1, t2) : 'ctyp)))) ]);
+ ((Some "private"), (Some Camlp4.Sig.Grammar.NonA),
[ ([ Gram.Skeyword "private";
Gram.Snterml
(Gram.Entry.obj (ctyp : 'ctyp Gram.Entry.t),
"alias") ],
(Gram.Action.mk
- (fun (t : 'ctyp) _ (_loc : Loc.t) ->
+ (fun (t : 'ctyp) _ (_loc : Gram.Loc.t) ->
(Ast.TyPrv (_loc, t) : 'ctyp)))) ]);
((Some "alias"), (Some Camlp4.Sig.Grammar.LeftA),
[ ([ Gram.Sself; Gram.Skeyword "as"; Gram.Sself ],
(Gram.Action.mk
- (fun (t2 : 'ctyp) _ (t1 : 'ctyp) (_loc : Loc.t)
- -> (Ast.TyAli (_loc, t1, t2) : 'ctyp)))) ]);
- (None, (Some Camlp4.Sig.Grammar.LeftA),
+ (fun (t2 : 'ctyp) _ (t1 : 'ctyp)
+ (_loc : Gram.Loc.t) ->
+ (Ast.TyAli (_loc, t1, t2) : 'ctyp)))) ]);
+ ((Some "forall"), (Some Camlp4.Sig.Grammar.LeftA),
[ ([ Gram.Skeyword "!";
Gram.Snterm
(Gram.Entry.obj
Gram.Skeyword "."; Gram.Sself ],
(Gram.Action.mk
(fun (t2 : 'ctyp) _ (t1 : 'typevars) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.TyPol (_loc, t1, t2) : 'ctyp)))) ]);
((Some "arrow"), (Some Camlp4.Sig.Grammar.RightA),
[ ([ Gram.Sself; Gram.Skeyword "->"; Gram.Sself ],
(Gram.Action.mk
- (fun (t2 : 'ctyp) _ (t1 : 'ctyp) (_loc : Loc.t)
- -> (Ast.TyArr (_loc, t1, t2) : 'ctyp)))) ]);
+ (fun (t2 : 'ctyp) _ (t1 : 'ctyp)
+ (_loc : Gram.Loc.t) ->
+ (Ast.TyArr (_loc, t1, t2) : 'ctyp)))) ]);
((Some "label"), (Some Camlp4.Sig.Grammar.NonA),
[ ([ Gram.Snterm
(Gram.Entry.obj
Gram.Sself ],
(Gram.Action.mk
(fun (t : 'ctyp) (i : 'a_OPTLABEL)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.TyOlb (_loc, i, t) : 'ctyp))));
([ Gram.Skeyword "?";
Gram.Snterm
Gram.Skeyword ":"; Gram.Sself ],
(Gram.Action.mk
(fun (t : 'ctyp) _ (i : 'a_LIDENT) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.TyOlb (_loc, i, t) : 'ctyp))));
([ Gram.Snterm
(Gram.Entry.obj
(a_LABEL : 'a_LABEL Gram.Entry.t));
Gram.Sself ],
(Gram.Action.mk
- (fun (t : 'ctyp) (i : 'a_LABEL) (_loc : Loc.t)
- -> (Ast.TyLab (_loc, i, t) : 'ctyp))));
+ (fun (t : 'ctyp) (i : 'a_LABEL)
+ (_loc : Gram.Loc.t) ->
+ (Ast.TyLab (_loc, i, t) : 'ctyp))));
([ Gram.Skeyword "~";
Gram.Snterm
(Gram.Entry.obj
Gram.Skeyword ":"; Gram.Sself ],
(Gram.Action.mk
(fun (t : 'ctyp) _ (i : 'a_LIDENT) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.TyLab (_loc, i, t) : 'ctyp)))) ]);
- (None, (Some Camlp4.Sig.Grammar.LeftA),
+ ((Some "apply"), (Some Camlp4.Sig.Grammar.LeftA),
[ ([ Gram.Sself; Gram.Sself ],
(Gram.Action.mk
- (fun (t2 : 'ctyp) (t1 : 'ctyp) (_loc : Loc.t) ->
+ (fun (t2 : 'ctyp) (t1 : 'ctyp)
+ (_loc : Gram.Loc.t) ->
(let t = Ast.TyApp (_loc, t1, t2)
in
try Ast.TyId (_loc, Ast.ident_of_ctyp t)
with | Invalid_argument _ -> t :
'ctyp)))) ]);
- (None, (Some Camlp4.Sig.Grammar.LeftA),
+ ((Some "."), (Some Camlp4.Sig.Grammar.LeftA),
[ ([ Gram.Sself; Gram.Skeyword "."; Gram.Sself ],
(Gram.Action.mk
- (fun (t2 : 'ctyp) _ (t1 : 'ctyp) (_loc : Loc.t)
- ->
+ (fun (t2 : 'ctyp) _ (t1 : 'ctyp)
+ (_loc : Gram.Loc.t) ->
(try
Ast.TyId (_loc,
Ast.IdAcc (_loc, Ast.ident_of_ctyp t1,
Gram.Skeyword ">" ],
(Gram.Action.mk
(fun _ (v : 'opt_dot_dot) (ml : 'opt_meth_list)
- _ (_loc : Loc.t) ->
+ _ (_loc : Gram.Loc.t) ->
(Ast.TyObj (_loc, ml, v) : 'ctyp))));
([ Gram.Skeyword "#";
Gram.Snterm
(class_longident :
'class_longident Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (i : 'class_longident) _ (_loc : Loc.t) ->
+ (fun (i : 'class_longident) _
+ (_loc : Gram.Loc.t) ->
(Ast.TyCls (_loc, i) : 'ctyp))));
([ Gram.Skeyword "{";
Gram.Snterm
Gram.Sopt (Gram.Skeyword ";"); Gram.Skeyword "}" ],
(Gram.Action.mk
(fun _ _ (t : 'label_declaration) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.TyRec (_loc, t) : 'ctyp))));
([ Gram.Skeyword "[<";
Gram.Snterm
Gram.Skeyword "]" ],
(Gram.Action.mk
(fun _ (ntl : 'name_tags) _ (rfl : 'row_field) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.TyVrnInfSup (_loc, rfl, ntl) : 'ctyp))));
([ Gram.Skeyword "[<";
Gram.Snterm
(row_field : 'row_field Gram.Entry.t));
Gram.Skeyword "]" ],
(Gram.Action.mk
- (fun _ (rfl : 'row_field) _ (_loc : Loc.t) ->
- (Ast.TyVrnInf (_loc, rfl) : 'ctyp))));
+ (fun _ (rfl : 'row_field) _ (_loc : Gram.Loc.t)
+ -> (Ast.TyVrnInf (_loc, rfl) : 'ctyp))));
([ Gram.Skeyword "["; Gram.Skeyword "<";
Gram.Snterm
(Gram.Entry.obj
Gram.Skeyword "]" ],
(Gram.Action.mk
(fun _ (ntl : 'name_tags) _ (rfl : 'row_field) _
- _ (_loc : Loc.t) ->
+ _ (_loc : Gram.Loc.t) ->
(Ast.TyVrnInfSup (_loc, rfl, ntl) : 'ctyp))));
([ Gram.Skeyword "["; Gram.Skeyword "<";
Gram.Snterm
(row_field : 'row_field Gram.Entry.t));
Gram.Skeyword "]" ],
(Gram.Action.mk
- (fun _ (rfl : 'row_field) _ _ (_loc : Loc.t) ->
+ (fun _ (rfl : 'row_field) _ _
+ (_loc : Gram.Loc.t) ->
(Ast.TyVrnInf (_loc, rfl) : 'ctyp))));
([ Gram.Skeyword "["; Gram.Skeyword ">";
Gram.Snterm
(row_field : 'row_field Gram.Entry.t));
Gram.Skeyword "]" ],
(Gram.Action.mk
- (fun _ (rfl : 'row_field) _ _ (_loc : Loc.t) ->
+ (fun _ (rfl : 'row_field) _ _
+ (_loc : Gram.Loc.t) ->
(Ast.TyVrnSup (_loc, rfl) : 'ctyp))));
([ Gram.Skeyword "["; Gram.Skeyword ">";
Gram.Skeyword "]" ],
(Gram.Action.mk
- (fun _ _ _ (_loc : Loc.t) ->
+ (fun _ _ _ (_loc : Gram.Loc.t) ->
(Ast.TyVrnSup (_loc, Ast.TyNil _loc) : 'ctyp))));
([ Gram.Skeyword "["; Gram.Skeyword "=";
Gram.Snterm
(row_field : 'row_field Gram.Entry.t));
Gram.Skeyword "]" ],
(Gram.Action.mk
- (fun _ (rfl : 'row_field) _ _ (_loc : Loc.t) ->
+ (fun _ (rfl : 'row_field) _ _
+ (_loc : Gram.Loc.t) ->
(Ast.TyVrnEq (_loc, rfl) : 'ctyp))));
([ Gram.Skeyword "[";
Gram.Snterm
Gram.Skeyword "]" ],
(Gram.Action.mk
(fun _ (t : 'constructor_declarations) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.TySum (_loc, t) : 'ctyp))));
([ Gram.Skeyword "("; Gram.Sself; Gram.Skeyword ")" ],
(Gram.Action.mk
- (fun _ (t : 'ctyp) _ (_loc : Loc.t) ->
+ (fun _ (t : 'ctyp) _ (_loc : Gram.Loc.t) ->
(t : 'ctyp))));
([ Gram.Skeyword "("; Gram.Sself; Gram.Skeyword "*";
Gram.Snterm
Gram.Skeyword ")" ],
(Gram.Action.mk
(fun _ (tl : 'star_ctyp) _ (t : 'ctyp) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.TyTup (_loc, Ast.TySta (_loc, t, tl)) :
'ctyp))));
([ Gram.Snterm
(Gram.Entry.obj
(a_UIDENT : 'a_UIDENT Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (i : 'a_UIDENT) (_loc : Loc.t) ->
+ (fun (i : 'a_UIDENT) (_loc : Gram.Loc.t) ->
(Ast.TyId (_loc, Ast.IdUid (_loc, i)) :
'ctyp))));
([ Gram.Snterm
(Gram.Entry.obj
(a_LIDENT : 'a_LIDENT Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (i : 'a_LIDENT) (_loc : Loc.t) ->
+ (fun (i : 'a_LIDENT) (_loc : Gram.Loc.t) ->
(Ast.TyId (_loc, Ast.IdLid (_loc, i)) :
'ctyp))));
([ Gram.Stoken
(((function | QUOTATION _ -> true | _ -> false),
"QUOTATION _")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| QUOTATION x ->
(Quotation.expand _loc x Quotation.
| _ -> false),
"ANTIQUOT (\"id\", _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("id" as n)), s) ->
(Ast.TyId (_loc,
| _ -> false),
"ANTIQUOT (\"tup\", _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("tup" as n)), s) ->
(Ast.TyTup (_loc,
| _ -> false),
"ANTIQUOT ((\"\" | \"typ\" | \"anti\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" | "typ" | "anti" as n)), s)
->
| _ -> assert false)));
([ Gram.Skeyword "_" ],
(Gram.Action.mk
- (fun _ (_loc : Loc.t) ->
+ (fun _ (_loc : Gram.Loc.t) ->
(Ast.TyAny _loc : 'ctyp))));
([ Gram.Skeyword "'";
Gram.Snterm
(Gram.Entry.obj
(a_ident : 'a_ident Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (i : 'a_ident) _ (_loc : Loc.t) ->
+ (fun (i : 'a_ident) _ (_loc : Gram.Loc.t) ->
(Ast.TyQuo (_loc, i) : 'ctyp)))) ]) ]))
());
Gram.extend (star_ctyp : 'star_ctyp Gram.Entry.t)
[ ([ Gram.Snterm
(Gram.Entry.obj (ctyp : 'ctyp Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (t : 'ctyp) (_loc : Loc.t) ->
+ (fun (t : 'ctyp) (_loc : Gram.Loc.t) ->
(t : 'star_ctyp))));
([ Gram.Sself; Gram.Skeyword "*"; Gram.Sself ],
(Gram.Action.mk
(fun (t2 : 'star_ctyp) _ (t1 : 'star_ctyp)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.TySta (_loc, t1, t2) : 'star_ctyp))));
([ Gram.Stoken
(((function
| _ -> false),
"ANTIQUOT (\"list\", _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("list" as n)), s) ->
(Ast.TyAnt (_loc,
| _ -> false),
"ANTIQUOT ((\"\" | \"typ\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" | "typ" as n)), s) ->
(Ast.TyAnt (_loc, mk_anti ~c: "ctyp" n s) :
(Gram.Entry.obj
(a_UIDENT : 'a_UIDENT Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (s : 'a_UIDENT) (_loc : Loc.t) ->
+ (fun (s : 'a_UIDENT) (_loc : Gram.Loc.t) ->
(Ast.TyId (_loc, Ast.IdUid (_loc, s)) :
'constructor_declarations))));
([ Gram.Snterm
'constructor_arg_list Gram.Entry.t)) ],
(Gram.Action.mk
(fun (t : 'constructor_arg_list) _
- (s : 'a_UIDENT) (_loc : Loc.t) ->
+ (s : 'a_UIDENT) (_loc : Gram.Loc.t) ->
(Ast.TyOf (_loc,
Ast.TyId (_loc, Ast.IdUid (_loc, s)), t) :
'constructor_declarations))));
(Gram.Action.mk
(fun (t2 : 'constructor_declarations) _
(t1 : 'constructor_declarations)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.TyOr (_loc, t1, t2) :
'constructor_declarations))));
([ Gram.Stoken
(((function | QUOTATION _ -> true | _ -> false),
"QUOTATION _")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| QUOTATION x ->
(Quotation.expand _loc x Quotation.
| _ -> false),
"ANTIQUOT (\"list\", _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("list" as n)), s) ->
(Ast.TyAnt (_loc,
| _ -> false),
"ANTIQUOT ((\"\" | \"typ\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" | "typ" as n)), s) ->
(Ast.TyAnt (_loc, mk_anti ~c: "ctyp" n s) :
(Gram.Entry.obj
(a_UIDENT : 'a_UIDENT Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (s : 'a_UIDENT) (_loc : Loc.t) ->
+ (fun (s : 'a_UIDENT) (_loc : Gram.Loc.t) ->
(Ast.TyId (_loc, Ast.IdUid (_loc, s)) :
'constructor_declaration))));
([ Gram.Snterm
'constructor_arg_list Gram.Entry.t)) ],
(Gram.Action.mk
(fun (t : 'constructor_arg_list) _
- (s : 'a_UIDENT) (_loc : Loc.t) ->
+ (s : 'a_UIDENT) (_loc : Gram.Loc.t) ->
(Ast.TyOf (_loc,
Ast.TyId (_loc, Ast.IdUid (_loc, s)), t) :
'constructor_declaration))));
(((function | QUOTATION _ -> true | _ -> false),
"QUOTATION _")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| QUOTATION x ->
(Quotation.expand _loc x Quotation.
| _ -> false),
"ANTIQUOT ((\"\" | \"typ\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" | "typ" as n)), s) ->
(Ast.TyAnt (_loc, mk_anti ~c: "ctyp" n s) :
[ ([ Gram.Snterm
(Gram.Entry.obj (ctyp : 'ctyp Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (t : 'ctyp) (_loc : Loc.t) ->
+ (fun (t : 'ctyp) (_loc : Gram.Loc.t) ->
(t : 'constructor_arg_list))));
([ Gram.Sself; Gram.Skeyword "and"; Gram.Sself ],
(Gram.Action.mk
(fun (t2 : 'constructor_arg_list) _
- (t1 : 'constructor_arg_list) (_loc : Loc.t)
- ->
+ (t1 : 'constructor_arg_list)
+ (_loc : Gram.Loc.t) ->
(Ast.TyAnd (_loc, t1, t2) :
'constructor_arg_list))));
([ Gram.Stoken
| _ -> false),
"ANTIQUOT (\"list\", _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("list" as n)), s) ->
(Ast.TyAnt (_loc,
(poly_type : 'poly_type Gram.Entry.t)) ],
(Gram.Action.mk
(fun (t : 'poly_type) _ _ (s : 'a_LIDENT)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.TyCol (_loc,
Ast.TyId (_loc, Ast.IdLid (_loc, s)),
Ast.TyMut (_loc, t)) :
(poly_type : 'poly_type Gram.Entry.t)) ],
(Gram.Action.mk
(fun (t : 'poly_type) _ (s : 'a_LIDENT)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.TyCol (_loc,
Ast.TyId (_loc, Ast.IdLid (_loc, s)), t) :
'label_declaration))));
(((function | QUOTATION _ -> true | _ -> false),
"QUOTATION _")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| QUOTATION x ->
(Quotation.expand _loc x Quotation.
| _ -> false),
"ANTIQUOT (\"list\", _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("list" as n)), s) ->
(Ast.TyAnt (_loc,
| _ -> false),
"ANTIQUOT ((\"\" | \"typ\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" | "typ" as n)), s) ->
(Ast.TyAnt (_loc, mk_anti ~c: "ctyp" n s) :
([ Gram.Sself; Gram.Skeyword ";"; Gram.Sself ],
(Gram.Action.mk
(fun (t2 : 'label_declaration) _
- (t1 : 'label_declaration) (_loc : Loc.t) ->
+ (t1 : 'label_declaration) (_loc : Gram.Loc.t)
+ ->
(Ast.TySem (_loc, t1, t2) :
'label_declaration)))) ]) ]))
());
(Gram.Entry.obj
(a_UIDENT : 'a_UIDENT Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (i : 'a_UIDENT) (_loc : Loc.t) ->
+ (fun (i : 'a_UIDENT) (_loc : Gram.Loc.t) ->
(i : 'a_ident))));
([ Gram.Snterm
(Gram.Entry.obj
(a_LIDENT : 'a_LIDENT Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (i : 'a_LIDENT) (_loc : Loc.t) ->
+ (fun (i : 'a_LIDENT) (_loc : Gram.Loc.t) ->
(i : 'a_ident)))) ]) ]))
());
Gram.extend (ident : 'ident Gram.Entry.t)
Gram.Skeyword "."; Gram.Sself ],
(Gram.Action.mk
(fun (j : 'ident) _ (i : 'a_UIDENT)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.IdAcc (_loc, Ast.IdUid (_loc, i), j) :
'ident))));
([ Gram.Stoken
Gram.Skeyword "."; Gram.Sself ],
(Gram.Action.mk
(fun (i : 'ident) _ (__camlp4_0 : Gram.Token.t)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT
((("" | "id" | "anti" | "list" as n)), s)
(Gram.Entry.obj
(a_LIDENT : 'a_LIDENT Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (i : 'a_LIDENT) (_loc : Loc.t) ->
+ (fun (i : 'a_LIDENT) (_loc : Gram.Loc.t) ->
(Ast.IdLid (_loc, i) : 'ident))));
([ Gram.Snterm
(Gram.Entry.obj
(a_UIDENT : 'a_UIDENT Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (i : 'a_UIDENT) (_loc : Loc.t) ->
+ (fun (i : 'a_UIDENT) (_loc : Gram.Loc.t) ->
(Ast.IdUid (_loc, i) : 'ident))));
([ Gram.Stoken
(((function
| _ -> false),
"ANTIQUOT ((\"\" | \"id\" | \"anti\" | \"list\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT
((("" | "id" | "anti" | "list" as n)), s)
(Gram.Entry.obj
(a_UIDENT : 'a_UIDENT Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (i : 'a_UIDENT) (_loc : Loc.t) ->
+ (fun (i : 'a_UIDENT) (_loc : Gram.Loc.t) ->
(Ast.IdUid (_loc, i) : 'module_longident))));
([ Gram.Snterm
(Gram.Entry.obj
Gram.Skeyword "."; Gram.Sself ],
(Gram.Action.mk
(fun (l : 'module_longident) _ (m : 'a_UIDENT)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.IdAcc (_loc, Ast.IdUid (_loc, m), l) :
'module_longident))));
([ Gram.Stoken
| _ -> false),
"ANTIQUOT ((\"\" | \"id\" | \"anti\" | \"list\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT
((("" | "id" | "anti" | "list" as n)), s)
(Gram.Action.mk
(fun (j : 'module_longident_with_app)
(i : 'module_longident_with_app)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.IdApp (_loc, i, j) :
'module_longident_with_app)))) ]);
((Some "."), None,
(Gram.Action.mk
(fun (j : 'module_longident_with_app) _
(i : 'module_longident_with_app)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.IdAcc (_loc, i, j) :
'module_longident_with_app)))) ]);
((Some "simple"), None,
[ ([ Gram.Skeyword "("; Gram.Sself; Gram.Skeyword ")" ],
(Gram.Action.mk
(fun _ (i : 'module_longident_with_app) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(i : 'module_longident_with_app))));
([ Gram.Snterm
(Gram.Entry.obj
(a_UIDENT : 'a_UIDENT Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (i : 'a_UIDENT) (_loc : Loc.t) ->
+ (fun (i : 'a_UIDENT) (_loc : Gram.Loc.t) ->
(Ast.IdUid (_loc, i) :
'module_longident_with_app))));
([ Gram.Stoken
| _ -> false),
"ANTIQUOT ((\"\" | \"id\" | \"anti\" | \"list\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT
((("" | "id" | "anti" | "list" as n)), s)
[ ([ Gram.Sself; Gram.Sself ],
(Gram.Action.mk
(fun (j : 'type_longident) (i : 'type_longident)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.IdApp (_loc, i, j) : 'type_longident)))) ]);
((Some "."), None,
[ ([ Gram.Sself; Gram.Skeyword "."; Gram.Sself ],
(Gram.Action.mk
(fun (j : 'type_longident) _
- (i : 'type_longident) (_loc : Loc.t) ->
+ (i : 'type_longident) (_loc : Gram.Loc.t) ->
(Ast.IdAcc (_loc, i, j) : 'type_longident)))) ]);
((Some "simple"), None,
[ ([ Gram.Skeyword "("; Gram.Sself; Gram.Skeyword ")" ],
(Gram.Action.mk
- (fun _ (i : 'type_longident) _ (_loc : Loc.t) ->
- (i : 'type_longident))));
+ (fun _ (i : 'type_longident) _
+ (_loc : Gram.Loc.t) -> (i : 'type_longident))));
([ Gram.Snterm
(Gram.Entry.obj
(a_UIDENT : 'a_UIDENT Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (i : 'a_UIDENT) (_loc : Loc.t) ->
+ (fun (i : 'a_UIDENT) (_loc : Gram.Loc.t) ->
(Ast.IdUid (_loc, i) : 'type_longident))));
([ Gram.Snterm
(Gram.Entry.obj
(a_LIDENT : 'a_LIDENT Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (i : 'a_LIDENT) (_loc : Loc.t) ->
+ (fun (i : 'a_LIDENT) (_loc : Gram.Loc.t) ->
(Ast.IdLid (_loc, i) : 'type_longident))));
([ Gram.Stoken
(((function
| _ -> false),
"ANTIQUOT ((\"\" | \"id\" | \"anti\" | \"list\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT
((("" | "id" | "anti" | "list" as n)), s)
(Gram.Entry.obj
(a_LIDENT : 'a_LIDENT Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (i : 'a_LIDENT) (_loc : Loc.t) ->
+ (fun (i : 'a_LIDENT) (_loc : Gram.Loc.t) ->
(Ast.IdLid (_loc, i) : 'label_longident))));
([ Gram.Snterm
(Gram.Entry.obj
Gram.Skeyword "."; Gram.Sself ],
(Gram.Action.mk
(fun (l : 'label_longident) _ (m : 'a_UIDENT)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.IdAcc (_loc, Ast.IdUid (_loc, m), l) :
'label_longident))));
([ Gram.Stoken
| _ -> false),
"ANTIQUOT ((\"\" | \"id\" | \"anti\" | \"list\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT
((("" | "id" | "anti" | "list" as n)), s)
(type_longident :
'type_longident Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (x : 'type_longident) (_loc : Loc.t) ->
- (x : 'class_type_longident)))) ]) ]))
+ (fun (x : 'type_longident) (_loc : Gram.Loc.t)
+ -> (x : 'class_type_longident)))) ]) ]))
());
Gram.extend (val_longident : 'val_longident Gram.Entry.t)
((fun () ->
[ ([ Gram.Snterm
(Gram.Entry.obj (ident : 'ident Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (x : 'ident) (_loc : Loc.t) ->
+ (fun (x : 'ident) (_loc : Gram.Loc.t) ->
(x : 'val_longident)))) ]) ]))
());
Gram.extend (class_longident : 'class_longident Gram.Entry.t)
(label_longident :
'label_longident Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (x : 'label_longident) (_loc : Loc.t) ->
- (x : 'class_longident)))) ]) ]))
+ (fun (x : 'label_longident) (_loc : Gram.Loc.t)
+ -> (x : 'class_longident)))) ]) ]))
());
Gram.extend
(class_declaration : 'class_declaration Gram.Entry.t)
(Gram.Action.mk
(fun (ce : 'class_fun_binding)
(ci : 'class_info_for_class_expr)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.CeEq (_loc, ci, ce) :
'class_declaration))));
([ Gram.Stoken
(((function | QUOTATION _ -> true | _ -> false),
"QUOTATION _")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| QUOTATION x ->
(Quotation.expand _loc x Quotation.
| _ -> false),
"ANTIQUOT ((\"\" | \"cdcl\" | \"anti\" | \"list\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT
((("" | "cdcl" | "anti" | "list" as n)),
([ Gram.Sself; Gram.Skeyword "and"; Gram.Sself ],
(Gram.Action.mk
(fun (c2 : 'class_declaration) _
- (c1 : 'class_declaration) (_loc : Loc.t) ->
+ (c1 : 'class_declaration) (_loc : Gram.Loc.t)
+ ->
(Ast.CeAnd (_loc, c1, c2) :
'class_declaration)))) ]) ]))
());
Gram.Sself ],
(Gram.Action.mk
(fun (cfb : 'class_fun_binding)
- (p : 'labeled_ipatt) (_loc : Loc.t) ->
+ (p : 'labeled_ipatt) (_loc : Gram.Loc.t) ->
(Ast.CeFun (_loc, p, cfb) :
'class_fun_binding))));
([ Gram.Skeyword ":";
(class_expr : 'class_expr Gram.Entry.t)) ],
(Gram.Action.mk
(fun (ce : 'class_expr) _
- (ct : 'class_type_plus) _ (_loc : Loc.t) ->
+ (ct : 'class_type_plus) _ (_loc : Gram.Loc.t)
+ ->
(Ast.CeTyc (_loc, ce, ct) :
'class_fun_binding))));
([ Gram.Skeyword "=";
(Gram.Entry.obj
(class_expr : 'class_expr Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (ce : 'class_expr) _ (_loc : Loc.t) ->
+ (fun (ce : 'class_expr) _ (_loc : Gram.Loc.t) ->
(ce : 'class_fun_binding)))) ]) ]))
());
Gram.extend
'class_name_and_param Gram.Entry.t)) ],
(Gram.Action.mk
(fun ((i, ot) : 'class_name_and_param)
- (mv : 'opt_virtual) (_loc : Loc.t) ->
+ (mv : 'opt_virtual) (_loc : Gram.Loc.t) ->
(Ast.CtCon (_loc, mv, Ast.IdLid (_loc, i),
ot) :
'class_info_for_class_type)))) ]) ]))
'class_name_and_param Gram.Entry.t)) ],
(Gram.Action.mk
(fun ((i, ot) : 'class_name_and_param)
- (mv : 'opt_virtual) (_loc : Loc.t) ->
+ (mv : 'opt_virtual) (_loc : Gram.Loc.t) ->
(Ast.CeCon (_loc, mv, Ast.IdLid (_loc, i),
ot) :
'class_info_for_class_expr)))) ]) ]))
(Gram.Entry.obj
(a_LIDENT : 'a_LIDENT Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (i : 'a_LIDENT) (_loc : Loc.t) ->
+ (fun (i : 'a_LIDENT) (_loc : Gram.Loc.t) ->
((i, (Ast.TyNil _loc)) :
'class_name_and_param))));
([ Gram.Snterm
Gram.Skeyword "]" ],
(Gram.Action.mk
(fun _ (x : 'comma_type_parameter) _
- (i : 'a_LIDENT) (_loc : Loc.t) ->
+ (i : 'a_LIDENT) (_loc : Gram.Loc.t) ->
((i, x) : 'class_name_and_param)))) ]) ]))
());
Gram.extend
(type_parameter :
'type_parameter Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (t : 'type_parameter) (_loc : Loc.t) ->
- (t : 'comma_type_parameter))));
+ (fun (t : 'type_parameter) (_loc : Gram.Loc.t)
+ -> (t : 'comma_type_parameter))));
([ Gram.Stoken
(((function
| ANTIQUOT ("list", _) -> true
| _ -> false),
"ANTIQUOT (\"list\", _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("list" as n)), s) ->
(Ast.TyAnt (_loc,
([ Gram.Sself; Gram.Skeyword ","; Gram.Sself ],
(Gram.Action.mk
(fun (t2 : 'comma_type_parameter) _
- (t1 : 'comma_type_parameter) (_loc : Loc.t)
- ->
+ (t1 : 'comma_type_parameter)
+ (_loc : Gram.Loc.t) ->
(Ast.TyCom (_loc, t1, t2) :
'comma_type_parameter)))) ]) ]))
());
[ (None, None,
[ ([],
(Gram.Action.mk
- (fun (_loc : Loc.t) ->
+ (fun (_loc : Gram.Loc.t) ->
(Ast.TyNil _loc : 'opt_comma_ctyp))));
([ Gram.Skeyword "[";
Gram.Snterm
(comma_ctyp : 'comma_ctyp Gram.Entry.t));
Gram.Skeyword "]" ],
(Gram.Action.mk
- (fun _ (x : 'comma_ctyp) _ (_loc : Loc.t) ->
- (x : 'opt_comma_ctyp)))) ]) ]))
+ (fun _ (x : 'comma_ctyp) _ (_loc : Gram.Loc.t)
+ -> (x : 'opt_comma_ctyp)))) ]) ]))
());
Gram.extend (comma_ctyp : 'comma_ctyp Gram.Entry.t)
((fun () ->
[ ([ Gram.Snterm
(Gram.Entry.obj (ctyp : 'ctyp Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (t : 'ctyp) (_loc : Loc.t) ->
+ (fun (t : 'ctyp) (_loc : Gram.Loc.t) ->
(t : 'comma_ctyp))));
([ Gram.Stoken
(((function
| _ -> false),
"ANTIQUOT (\"list\", _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("list" as n)), s) ->
(Ast.TyAnt (_loc,
([ Gram.Sself; Gram.Skeyword ","; Gram.Sself ],
(Gram.Action.mk
(fun (t2 : 'comma_ctyp) _ (t1 : 'comma_ctyp)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.TyCom (_loc, t1, t2) : 'comma_ctyp)))) ]) ]))
());
Gram.extend (class_fun_def : 'class_fun_def Gram.Entry.t)
(Gram.Entry.obj
(class_expr : 'class_expr Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (ce : 'class_expr) _ (_loc : Loc.t) ->
+ (fun (ce : 'class_expr) _ (_loc : Gram.Loc.t) ->
(ce : 'class_fun_def))));
([ Gram.Snterm
(Gram.Entry.obj
Gram.Sself ],
(Gram.Action.mk
(fun (ce : 'class_fun_def) (p : 'labeled_ipatt)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.CeFun (_loc, p, ce) : 'class_fun_def)))) ]) ]))
());
Gram.extend (class_expr : 'class_expr Gram.Entry.t)
Gram.Skeyword "in"; Gram.Sself ],
(Gram.Action.mk
(fun (ce : 'class_expr) _ (bi : 'binding)
- (rf : 'opt_rec) _ (_loc : Loc.t) ->
+ (rf : 'opt_rec) _ (_loc : Gram.Loc.t) ->
(Ast.CeLet (_loc, rf, bi, ce) : 'class_expr))));
([ Gram.Skeyword "fun";
Gram.Snterm
'class_fun_def Gram.Entry.t)) ],
(Gram.Action.mk
(fun (ce : 'class_fun_def) (p : 'labeled_ipatt)
- _ (_loc : Loc.t) ->
+ _ (_loc : Gram.Loc.t) ->
(Ast.CeFun (_loc, p, ce) : 'class_expr)))) ]);
((Some "apply"), (Some Camlp4.Sig.Grammar.NonA),
[ ([ Gram.Sself;
"label") ],
(Gram.Action.mk
(fun (e : 'expr) (ce : 'class_expr)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.CeApp (_loc, ce, e) : 'class_expr)))) ]);
((Some "simple"), None,
[ ([ Gram.Skeyword "("; Gram.Sself; Gram.Skeyword ")" ],
(Gram.Action.mk
- (fun _ (ce : 'class_expr) _ (_loc : Loc.t) ->
- (ce : 'class_expr))));
+ (fun _ (ce : 'class_expr) _ (_loc : Gram.Loc.t)
+ -> (ce : 'class_expr))));
([ Gram.Skeyword "("; Gram.Sself; Gram.Skeyword ":";
Gram.Snterm
(Gram.Entry.obj
Gram.Skeyword ")" ],
(Gram.Action.mk
(fun _ (ct : 'class_type) _ (ce : 'class_expr) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.CeTyc (_loc, ce, ct) : 'class_expr))));
([ Gram.Skeyword "object";
Gram.Snterm
Gram.Skeyword "end" ],
(Gram.Action.mk
(fun _ (cst : 'class_structure)
- (csp : 'opt_class_self_patt) _ (_loc : Loc.t)
- -> (Ast.CeStr (_loc, csp, cst) : 'class_expr))));
+ (csp : 'opt_class_self_patt) _
+ (_loc : Gram.Loc.t) ->
+ (Ast.CeStr (_loc, csp, cst) : 'class_expr))));
([ Gram.Snterm
(Gram.Entry.obj
(class_longident_and_param :
'class_longident_and_param Gram.Entry.t)) ],
(Gram.Action.mk
(fun (ce : 'class_longident_and_param)
- (_loc : Loc.t) -> (ce : 'class_expr))));
+ (_loc : Gram.Loc.t) -> (ce : 'class_expr))));
([ Gram.Stoken
(((function | QUOTATION _ -> true | _ -> false),
"QUOTATION _")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| QUOTATION x ->
(Quotation.expand _loc x Quotation.
| _ -> false),
"ANTIQUOT ((\"\" | \"cexp\" | \"anti\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" | "cexp" | "anti" as n)), s)
->
(class_longident :
'class_longident Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (ci : 'class_longident) (_loc : Loc.t) ->
+ (fun (ci : 'class_longident) (_loc : Gram.Loc.t)
+ ->
(Ast.CeCon (_loc, Ast.BFalse, ci,
Ast.TyNil _loc) :
'class_longident_and_param))));
Gram.Skeyword "]" ],
(Gram.Action.mk
(fun _ (t : 'comma_ctyp) _
- (ci : 'class_longident) (_loc : Loc.t) ->
+ (ci : 'class_longident) (_loc : Gram.Loc.t)
+ ->
(Ast.CeCon (_loc, Ast.BFalse, ci, t) :
'class_longident_and_param)))) ]) ]))
());
(semi : 'semi Gram.Entry.t)) ],
(Gram.Action.mk
(fun _ (cst : 'class_str_item)
- (_loc : Loc.t) -> (cst : 'e__4)))) ]) ],
+ (_loc : Gram.Loc.t) ->
+ (cst : 'e__3)))) ]) ],
(Gram.Action.mk
- (fun (l : 'e__4 list) (_loc : Loc.t) ->
+ (fun (l : 'e__3 list) (_loc : Gram.Loc.t) ->
(Ast.crSem_of_list l : 'class_structure))));
([ Gram.Stoken
(((function
Gram.Sself ],
(Gram.Action.mk
(fun (cst : 'class_structure) _
- (__camlp4_0 : Gram.Token.t) (_loc : Loc.t) ->
+ (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT
((("" | "cst" | "anti" | "list" as n)),
| _ -> false),
"ANTIQUOT ((\"\" | \"cst\" | \"anti\" | \"list\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT
((("" | "cst" | "anti" | "list" as n)),
[ (None, None,
[ ([],
(Gram.Action.mk
- (fun (_loc : Loc.t) ->
+ (fun (_loc : Gram.Loc.t) ->
(Ast.PaNil _loc : 'opt_class_self_patt))));
([ Gram.Skeyword "(";
Gram.Snterm
Gram.Skeyword ")" ],
(Gram.Action.mk
(fun _ (t : 'ctyp) _ (p : 'patt) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.PaTyc (_loc, p, t) :
'opt_class_self_patt))));
([ Gram.Skeyword "(";
(Gram.Entry.obj (patt : 'patt Gram.Entry.t));
Gram.Skeyword ")" ],
(Gram.Action.mk
- (fun _ (p : 'patt) _ (_loc : Loc.t) ->
+ (fun _ (p : 'patt) _ (_loc : Gram.Loc.t) ->
(p : 'opt_class_self_patt)))) ]) ]))
());
Gram.extend (class_str_item : 'class_str_item Gram.Entry.t)
Gram.Snterm
(Gram.Entry.obj (expr : 'expr Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (se : 'expr) _ (_loc : Loc.t) ->
+ (fun (se : 'expr) _ (_loc : Gram.Loc.t) ->
(Ast.CrIni (_loc, se) : 'class_str_item))));
- ([ Gram.Skeyword "type";
+ ([ Gram.Snterm
+ (Gram.Entry.obj
+ (type_constraint :
+ 'type_constraint Gram.Entry.t));
Gram.Snterm
(Gram.Entry.obj (ctyp : 'ctyp Gram.Entry.t));
Gram.Skeyword "=";
(Gram.Entry.obj (ctyp : 'ctyp Gram.Entry.t)) ],
(Gram.Action.mk
(fun (t2 : 'ctyp) _ (t1 : 'ctyp) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.CrCtr (_loc, t1, t2) : 'class_str_item))));
([ Gram.Skeyword "method";
Gram.Snterm
(Gram.Action.mk
(fun (e : 'fun_binding) (topt : 'opt_polyt)
(l : 'label) (pf : 'opt_private) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.CrMth (_loc, l, pf, e, topt) :
'class_str_item))));
([ Gram.Skeyword "method";
(poly_type : 'poly_type Gram.Entry.t)) ],
(Gram.Action.mk
(fun (t : 'poly_type) _ (l : 'label) _
- (pf : 'opt_private) _ (_loc : Loc.t) ->
+ (pf : 'opt_private) _ (_loc : Gram.Loc.t) ->
(Ast.CrVir (_loc, l, pf, t) :
'class_str_item))));
([ Gram.Skeyword "method"; Gram.Skeyword "virtual";
Gram.Snterm
(Gram.Entry.obj
- (opt_private : 'opt_private Gram.Entry.t));
+ (opt_private : 'opt_private Gram.Entry.t));
+ Gram.Snterm
+ (Gram.Entry.obj (label : 'label Gram.Entry.t));
+ Gram.Skeyword ":";
+ Gram.Snterm
+ (Gram.Entry.obj
+ (poly_type : 'poly_type Gram.Entry.t)) ],
+ (Gram.Action.mk
+ (fun (t : 'poly_type) _ (l : 'label)
+ (pf : 'opt_private) _ _ (_loc : Gram.Loc.t)
+ ->
+ (Ast.CrVir (_loc, l, pf, t) :
+ 'class_str_item))));
+ ([ Gram.Snterm
+ (Gram.Entry.obj
+ (value_val : 'value_val Gram.Entry.t));
+ Gram.Skeyword "virtual";
+ Gram.Snterm
+ (Gram.Entry.obj
+ (opt_mutable : 'opt_mutable Gram.Entry.t));
Gram.Snterm
(Gram.Entry.obj (label : 'label Gram.Entry.t));
Gram.Skeyword ":";
(poly_type : 'poly_type Gram.Entry.t)) ],
(Gram.Action.mk
(fun (t : 'poly_type) _ (l : 'label)
- (pf : 'opt_private) _ _ (_loc : Loc.t) ->
- (Ast.CrVir (_loc, l, pf, t) :
+ (mf : 'opt_mutable) _ _ (_loc : Gram.Loc.t)
+ ->
+ (Ast.CrVvr (_loc, l, mf, t) :
'class_str_item))));
([ Gram.Snterm
(Gram.Entry.obj
(value_val : 'value_val Gram.Entry.t));
- Gram.Skeyword "virtual";
Gram.Snterm
(Gram.Entry.obj
(opt_mutable : 'opt_mutable Gram.Entry.t));
+ Gram.Skeyword "virtual";
Gram.Snterm
(Gram.Entry.obj (label : 'label Gram.Entry.t));
Gram.Skeyword ":";
(Gram.Entry.obj
(poly_type : 'poly_type Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (t : 'poly_type) _ (l : 'label)
- (mf : 'opt_mutable) _ _ (_loc : Loc.t) ->
+ (fun (t : 'poly_type) _ (l : 'label) _
+ (mf : 'opt_mutable) _ (_loc : Gram.Loc.t) ->
(Ast.CrVvr (_loc, l, mf, t) :
'class_str_item))));
([ Gram.Snterm
'cvalue_binding Gram.Entry.t)) ],
(Gram.Action.mk
(fun (e : 'cvalue_binding) (lab : 'label)
- (mf : 'opt_mutable) _ (_loc : Loc.t) ->
+ (mf : 'opt_mutable) _ (_loc : Gram.Loc.t) ->
(Ast.CrVal (_loc, lab, mf, e) :
'class_str_item))));
([ Gram.Skeyword "inherit";
'opt_as_lident Gram.Entry.t)) ],
(Gram.Action.mk
(fun (pb : 'opt_as_lident) (ce : 'class_expr) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.CrInh (_loc, ce, pb) : 'class_str_item))));
([ Gram.Stoken
(((function | QUOTATION _ -> true | _ -> false),
"QUOTATION _")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| QUOTATION x ->
(Quotation.expand _loc x Quotation.
| _ -> false),
"ANTIQUOT ((\"\" | \"cst\" | \"anti\" | \"list\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT
((("" | "cst" | "anti" | "list" as n)),
[ (None, None,
[ ([],
(Gram.Action.mk
- (fun (_loc : Loc.t) -> ("" : 'opt_as_lident))));
+ (fun (_loc : Gram.Loc.t) ->
+ ("" : 'opt_as_lident))));
([ Gram.Skeyword "as";
Gram.Snterm
(Gram.Entry.obj
(a_LIDENT : 'a_LIDENT Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (i : 'a_LIDENT) _ (_loc : Loc.t) ->
+ (fun (i : 'a_LIDENT) _ (_loc : Gram.Loc.t) ->
(i : 'opt_as_lident)))) ]) ]))
());
Gram.extend (opt_polyt : 'opt_polyt Gram.Entry.t)
[ (None, None,
[ ([],
(Gram.Action.mk
- (fun (_loc : Loc.t) ->
+ (fun (_loc : Gram.Loc.t) ->
(Ast.TyNil _loc : 'opt_polyt))));
([ Gram.Skeyword ":";
Gram.Snterm
(Gram.Entry.obj
(poly_type : 'poly_type Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (t : 'poly_type) _ (_loc : Loc.t) ->
+ (fun (t : 'poly_type) _ (_loc : Gram.Loc.t) ->
(t : 'opt_polyt)))) ]) ]))
());
Gram.extend (cvalue_binding : 'cvalue_binding Gram.Entry.t)
Gram.Snterm
(Gram.Entry.obj (expr : 'expr Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (e : 'expr) _ (t : 'ctyp) _ (_loc : Loc.t)
- ->
+ (fun (e : 'expr) _ (t : 'ctyp) _
+ (_loc : Gram.Loc.t) ->
(Ast.ExCoe (_loc, e, Ast.TyNil _loc, t) :
'cvalue_binding))));
([ Gram.Skeyword ":";
(Gram.Entry.obj (expr : 'expr Gram.Entry.t)) ],
(Gram.Action.mk
(fun (e : 'expr) _ (t2 : 'ctyp) _ (t : 'ctyp) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.ExCoe (_loc, e, t, t2) :
'cvalue_binding))));
([ Gram.Skeyword ":";
Gram.Snterm
(Gram.Entry.obj (expr : 'expr Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (e : 'expr) _ (t : 'ctyp) _ (_loc : Loc.t)
- -> (Ast.ExTyc (_loc, e, t) : 'cvalue_binding))));
+ (fun (e : 'expr) _ (t : 'ctyp) _
+ (_loc : Gram.Loc.t) ->
+ (Ast.ExTyc (_loc, e, t) : 'cvalue_binding))));
([ Gram.Skeyword "=";
Gram.Snterm
(Gram.Entry.obj (expr : 'expr Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (e : 'expr) _ (_loc : Loc.t) ->
+ (fun (e : 'expr) _ (_loc : Gram.Loc.t) ->
(e : 'cvalue_binding)))) ]) ]))
());
Gram.extend (label : 'label Gram.Entry.t)
(Gram.Entry.obj
(a_LIDENT : 'a_LIDENT Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (i : 'a_LIDENT) (_loc : Loc.t) ->
+ (fun (i : 'a_LIDENT) (_loc : Gram.Loc.t) ->
(i : 'label)))) ]) ]))
());
Gram.extend (class_type : 'class_type Gram.Entry.t)
Gram.Skeyword "end" ],
(Gram.Action.mk
(fun _ (csg : 'class_signature)
- (cst : 'opt_class_self_type) _ (_loc : Loc.t)
- -> (Ast.CtSig (_loc, cst, csg) : 'class_type))));
+ (cst : 'opt_class_self_type) _
+ (_loc : Gram.Loc.t) ->
+ (Ast.CtSig (_loc, cst, csg) : 'class_type))));
([ Gram.Snterm
(Gram.Entry.obj
(class_type_longident_and_param :
Entry.t)) ],
(Gram.Action.mk
(fun (ct : 'class_type_longident_and_param)
- (_loc : Loc.t) -> (ct : 'class_type))));
+ (_loc : Gram.Loc.t) -> (ct : 'class_type))));
([ Gram.Stoken
(((function | QUOTATION _ -> true | _ -> false),
"QUOTATION _")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| QUOTATION x ->
(Quotation.expand _loc x Quotation.
| _ -> false),
"ANTIQUOT ((\"\" | \"ctyp\" | \"anti\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" | "ctyp" | "anti" as n)), s)
->
(class_type_longident :
'class_type_longident Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (i : 'class_type_longident) (_loc : Loc.t)
- ->
+ (fun (i : 'class_type_longident)
+ (_loc : Gram.Loc.t) ->
(Ast.CtCon (_loc, Ast.BFalse, i,
Ast.TyNil _loc) :
'class_type_longident_and_param))));
Gram.Skeyword "]" ],
(Gram.Action.mk
(fun _ (t : 'comma_ctyp) _
- (i : 'class_type_longident) (_loc : Loc.t) ->
+ (i : 'class_type_longident)
+ (_loc : Gram.Loc.t) ->
(Ast.CtCon (_loc, Ast.BFalse, i, t) :
'class_type_longident_and_param)))) ]) ]))
());
(Gram.Entry.obj
(class_type : 'class_type Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (ct : 'class_type) (_loc : Loc.t) ->
+ (fun (ct : 'class_type) (_loc : Gram.Loc.t) ->
(ct : 'class_type_plus))));
([ Gram.Skeyword "[";
Gram.Snterm
Gram.Skeyword "]"; Gram.Skeyword "->"; Gram.Sself ],
(Gram.Action.mk
(fun (ct : 'class_type_plus) _ _ (t : 'ctyp) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.CtFun (_loc, t, ct) : 'class_type_plus)))) ]) ]))
());
Gram.extend
[ (None, None,
[ ([],
(Gram.Action.mk
- (fun (_loc : Loc.t) ->
+ (fun (_loc : Gram.Loc.t) ->
(Ast.TyNil _loc : 'opt_class_self_type))));
([ Gram.Skeyword "(";
Gram.Snterm
(Gram.Entry.obj (ctyp : 'ctyp Gram.Entry.t));
Gram.Skeyword ")" ],
(Gram.Action.mk
- (fun _ (t : 'ctyp) _ (_loc : Loc.t) ->
+ (fun _ (t : 'ctyp) _ (_loc : Gram.Loc.t) ->
(t : 'opt_class_self_type)))) ]) ]))
());
Gram.extend (class_signature : 'class_signature Gram.Entry.t)
(semi : 'semi Gram.Entry.t)) ],
(Gram.Action.mk
(fun _ (csg : 'class_sig_item)
- (_loc : Loc.t) -> (csg : 'e__5)))) ]) ],
+ (_loc : Gram.Loc.t) ->
+ (csg : 'e__4)))) ]) ],
(Gram.Action.mk
- (fun (l : 'e__5 list) (_loc : Loc.t) ->
+ (fun (l : 'e__4 list) (_loc : Gram.Loc.t) ->
(Ast.cgSem_of_list l : 'class_signature))));
([ Gram.Stoken
(((function
Gram.Sself ],
(Gram.Action.mk
(fun (csg : 'class_signature) _
- (__camlp4_0 : Gram.Token.t) (_loc : Loc.t) ->
+ (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT
((("" | "csg" | "anti" | "list" as n)),
| _ -> false),
"ANTIQUOT ((\"\" | \"csg\" | \"anti\" | \"list\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT
((("" | "csg" | "anti" | "list" as n)),
(Gram.Entry.obj (ctyp : 'ctyp Gram.Entry.t)) ],
(Gram.Action.mk
(fun (t2 : 'ctyp) _ (t1 : 'ctyp) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.CgCtr (_loc, t1, t2) : 'class_sig_item))));
([ Gram.Skeyword "method";
Gram.Snterm
(poly_type : 'poly_type Gram.Entry.t)) ],
(Gram.Action.mk
(fun (t : 'poly_type) _ (l : 'label) _
- (pf : 'opt_private) _ (_loc : Loc.t) ->
+ (pf : 'opt_private) _ (_loc : Gram.Loc.t) ->
(Ast.CgVir (_loc, l, pf, t) :
'class_sig_item))));
([ Gram.Skeyword "method";
(poly_type : 'poly_type Gram.Entry.t)) ],
(Gram.Action.mk
(fun (t : 'poly_type) _ (l : 'label)
- (pf : 'opt_private) _ (_loc : Loc.t) ->
+ (pf : 'opt_private) _ (_loc : Gram.Loc.t) ->
(Ast.CgMth (_loc, l, pf, t) :
'class_sig_item))));
([ Gram.Skeyword "method"; Gram.Skeyword "virtual";
(poly_type : 'poly_type Gram.Entry.t)) ],
(Gram.Action.mk
(fun (t : 'poly_type) _ (l : 'label)
- (pf : 'opt_private) _ _ (_loc : Loc.t) ->
+ (pf : 'opt_private) _ _ (_loc : Gram.Loc.t)
+ ->
(Ast.CgVir (_loc, l, pf, t) :
'class_sig_item))));
([ Gram.Snterm
(Gram.Action.mk
(fun (t : 'ctyp) _ (l : 'label)
(mv : 'opt_virtual) (mf : 'opt_mutable) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.CgVal (_loc, l, mf, mv, t) :
'class_sig_item))));
([ Gram.Skeyword "inherit";
(Gram.Entry.obj
(class_type : 'class_type Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (cs : 'class_type) _ (_loc : Loc.t) ->
+ (fun (cs : 'class_type) _ (_loc : Gram.Loc.t) ->
(Ast.CgInh (_loc, cs) : 'class_sig_item))));
([ Gram.Stoken
(((function | QUOTATION _ -> true | _ -> false),
"QUOTATION _")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| QUOTATION x ->
(Quotation.expand _loc x Quotation.
| _ -> false),
"ANTIQUOT ((\"\" | \"csg\" | \"anti\" | \"list\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT
((("" | "csg" | "anti" | "list" as n)),
[ (None, None,
[ ([ Gram.Skeyword "constraint" ],
(Gram.Action.mk
- (fun _ (_loc : Loc.t) -> (() : 'type_constraint))));
+ (fun _ (_loc : Gram.Loc.t) ->
+ (() : 'type_constraint))));
([ Gram.Skeyword "type" ],
(Gram.Action.mk
- (fun _ (_loc : Loc.t) -> (() : 'type_constraint)))) ]) ]))
+ (fun _ (_loc : Gram.Loc.t) ->
+ (() : 'type_constraint)))) ]) ]))
());
Gram.extend
(class_description : 'class_description Gram.Entry.t)
(Gram.Action.mk
(fun (ct : 'class_type_plus) _
(ci : 'class_info_for_class_type)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.CtCol (_loc, ci, ct) :
'class_description))));
([ Gram.Stoken
(((function | QUOTATION _ -> true | _ -> false),
"QUOTATION _")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| QUOTATION x ->
(Quotation.expand _loc x Quotation.
| _ -> false),
"ANTIQUOT ((\"\" | \"typ\" | \"anti\" | \"list\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT
((("" | "typ" | "anti" | "list" as n)),
([ Gram.Sself; Gram.Skeyword "and"; Gram.Sself ],
(Gram.Action.mk
(fun (cd2 : 'class_description) _
- (cd1 : 'class_description) (_loc : Loc.t) ->
+ (cd1 : 'class_description)
+ (_loc : Gram.Loc.t) ->
(Ast.CtAnd (_loc, cd1, cd2) :
'class_description)))) ]) ]))
());
(Gram.Action.mk
(fun (ct : 'class_type) _
(ci : 'class_info_for_class_type)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.CtEq (_loc, ci, ct) :
'class_type_declaration))));
([ Gram.Stoken
(((function | QUOTATION _ -> true | _ -> false),
"QUOTATION _")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| QUOTATION x ->
(Quotation.expand _loc x Quotation.
| _ -> false),
"ANTIQUOT ((\"\" | \"typ\" | \"anti\" | \"list\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT
((("" | "typ" | "anti" | "list" as n)),
(Gram.Action.mk
(fun (cd2 : 'class_type_declaration) _
(cd1 : 'class_type_declaration)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.CtAnd (_loc, cd1, cd2) :
'class_type_declaration)))) ]) ]))
());
[ ([ Gram.Snterm
(Gram.Entry.obj (label : 'label Gram.Entry.t));
Gram.Skeyword "=";
- Gram.Snterm
- (Gram.Entry.obj (expr : 'expr Gram.Entry.t)) ],
+ Gram.Snterml
+ (Gram.Entry.obj (expr : 'expr Gram.Entry.t),
+ "top") ],
(Gram.Action.mk
- (fun (e : 'expr) _ (l : 'label) (_loc : Loc.t)
- ->
+ (fun (e : 'expr) _ (l : 'label)
+ (_loc : Gram.Loc.t) ->
(Ast.RbEq (_loc, Ast.IdLid (_loc, l), e) :
'field_expr))));
([ Gram.Stoken
| _ -> false),
"ANTIQUOT (\"list\", _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("list" as n)), s) ->
(Ast.RbAnt (_loc,
| _ -> false),
"ANTIQUOT ((\"\" | \"bi\" | \"anti\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" | "bi" | "anti" as n)), s)
->
([ Gram.Sself; Gram.Skeyword ";"; Gram.Sself ],
(Gram.Action.mk
(fun (b2 : 'field_expr) _ (b1 : 'field_expr)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.RbSem (_loc, b1, b2) : 'field_expr)))) ]) ]))
());
Gram.extend (meth_list : 'meth_list Gram.Entry.t)
(poly_type : 'poly_type Gram.Entry.t)) ],
(Gram.Action.mk
(fun (t : 'poly_type) _ (lab : 'a_LIDENT)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.TyCol (_loc,
Ast.TyId (_loc, Ast.IdLid (_loc, lab)), t) :
'meth_list))));
(((function | QUOTATION _ -> true | _ -> false),
"QUOTATION _")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| QUOTATION x ->
(Quotation.expand _loc x Quotation.
| _ -> false),
"ANTIQUOT (\"list\", _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("list" as n)), s) ->
(Ast.TyAnt (_loc,
| _ -> false),
"ANTIQUOT ((\"\" | \"typ\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" | "typ" as n)), s) ->
(Ast.TyAnt (_loc, mk_anti ~c: "ctyp" n s) :
([ Gram.Sself; Gram.Skeyword ";"; Gram.Sself ],
(Gram.Action.mk
(fun (ml2 : 'meth_list) _ (ml1 : 'meth_list)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.TySem (_loc, ml1, ml2) : 'meth_list)))) ]) ]))
());
Gram.extend (opt_meth_list : 'opt_meth_list Gram.Entry.t)
[ (None, None,
[ ([],
(Gram.Action.mk
- (fun (_loc : Loc.t) ->
+ (fun (_loc : Gram.Loc.t) ->
(Ast.TyNil _loc : 'opt_meth_list))));
([ Gram.Snterm
(Gram.Entry.obj
(meth_list : 'meth_list Gram.Entry.t));
Gram.Sopt (Gram.Skeyword ";") ],
(Gram.Action.mk
- (fun _ (ml : 'meth_list) (_loc : Loc.t) ->
+ (fun _ (ml : 'meth_list) (_loc : Gram.Loc.t) ->
(ml : 'opt_meth_list)))) ]) ]))
());
Gram.extend (poly_type : 'poly_type Gram.Entry.t)
[ ([ Gram.Snterm
(Gram.Entry.obj (ctyp : 'ctyp Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (t : 'ctyp) (_loc : Loc.t) ->
+ (fun (t : 'ctyp) (_loc : Gram.Loc.t) ->
(t : 'poly_type)))) ]) ]))
());
Gram.extend (typevars : 'typevars Gram.Entry.t)
(Gram.Entry.obj
(a_ident : 'a_ident Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (i : 'a_ident) _ (_loc : Loc.t) ->
+ (fun (i : 'a_ident) _ (_loc : Gram.Loc.t) ->
(Ast.TyQuo (_loc, i) : 'typevars))));
([ Gram.Stoken
(((function | QUOTATION _ -> true | _ -> false),
"QUOTATION _")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| QUOTATION x ->
(Quotation.expand _loc x Quotation.
| _ -> false),
"ANTIQUOT ((\"\" | \"typ\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" | "typ" as n)), s) ->
(Ast.TyAnt (_loc, mk_anti ~c: "ctyp" n s) :
([ Gram.Sself; Gram.Sself ],
(Gram.Action.mk
(fun (t2 : 'typevars) (t1 : 'typevars)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.TyApp (_loc, t1, t2) : 'typevars)))) ]) ]))
());
Gram.extend (row_field : 'row_field Gram.Entry.t)
[ ([ Gram.Snterm
(Gram.Entry.obj (ctyp : 'ctyp Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (t : 'ctyp) (_loc : Loc.t) ->
+ (fun (t : 'ctyp) (_loc : Gram.Loc.t) ->
(t : 'row_field))));
([ Gram.Skeyword "`";
Gram.Snterm
(amp_ctyp : 'amp_ctyp Gram.Entry.t)) ],
(Gram.Action.mk
(fun (t : 'amp_ctyp) _ (i : 'a_ident) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.TyOf (_loc, Ast.TyVrn (_loc, i), t) :
'row_field))));
([ Gram.Skeyword "`";
(amp_ctyp : 'amp_ctyp Gram.Entry.t)) ],
(Gram.Action.mk
(fun (t : 'amp_ctyp) _ _ (i : 'a_ident) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.TyOfAmp (_loc, Ast.TyVrn (_loc, i), t) :
'row_field))));
([ Gram.Skeyword "`";
(Gram.Entry.obj
(a_ident : 'a_ident Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (i : 'a_ident) _ (_loc : Loc.t) ->
+ (fun (i : 'a_ident) _ (_loc : Gram.Loc.t) ->
(Ast.TyVrn (_loc, i) : 'row_field))));
([ Gram.Sself; Gram.Skeyword "|"; Gram.Sself ],
(Gram.Action.mk
(fun (t2 : 'row_field) _ (t1 : 'row_field)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.TyOr (_loc, t1, t2) : 'row_field))));
([ Gram.Stoken
(((function
| _ -> false),
"ANTIQUOT (\"list\", _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("list" as n)), s) ->
(Ast.TyAnt (_loc,
| _ -> false),
"ANTIQUOT ((\"\" | \"typ\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" | "typ" as n)), s) ->
(Ast.TyAnt (_loc, mk_anti ~c: "ctyp" n s) :
[ ([ Gram.Snterm
(Gram.Entry.obj (ctyp : 'ctyp Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (t : 'ctyp) (_loc : Loc.t) ->
+ (fun (t : 'ctyp) (_loc : Gram.Loc.t) ->
(t : 'amp_ctyp))));
([ Gram.Stoken
(((function
| _ -> false),
"ANTIQUOT (\"list\", _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("list" as n)), s) ->
(Ast.TyAnt (_loc,
([ Gram.Sself; Gram.Skeyword "&"; Gram.Sself ],
(Gram.Action.mk
(fun (t2 : 'amp_ctyp) _ (t1 : 'amp_ctyp)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.TyAmp (_loc, t1, t2) : 'amp_ctyp)))) ]) ]))
());
Gram.extend (name_tags : 'name_tags Gram.Entry.t)
(Gram.Entry.obj
(a_ident : 'a_ident Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (i : 'a_ident) _ (_loc : Loc.t) ->
+ (fun (i : 'a_ident) _ (_loc : Gram.Loc.t) ->
(Ast.TyVrn (_loc, i) : 'name_tags))));
([ Gram.Sself; Gram.Sself ],
(Gram.Action.mk
(fun (t2 : 'name_tags) (t1 : 'name_tags)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.TyApp (_loc, t1, t2) : 'name_tags))));
([ Gram.Stoken
(((function
| _ -> false),
"ANTIQUOT ((\"\" | \"typ\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" | "typ" as n)), s) ->
(Ast.TyAnt (_loc, mk_anti ~c: "ctyp" n s) :
[ (None, None,
[ ([],
(Gram.Action.mk
- (fun (_loc : Loc.t) ->
+ (fun (_loc : Gram.Loc.t) ->
(fun i p -> Ast.PaOlb (_loc, i, p) :
'eq_expr))));
([ Gram.Skeyword "=";
Gram.Snterm
(Gram.Entry.obj (expr : 'expr Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (e : 'expr) _ (_loc : Loc.t) ->
+ (fun (e : 'expr) _ (_loc : Gram.Loc.t) ->
(fun i p -> Ast.PaOlbi (_loc, i, p, e) :
'eq_expr)))) ]) ]))
());
[ ([ Gram.Snterm
(Gram.Entry.obj (patt : 'patt Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (p : 'patt) (_loc : Loc.t) ->
+ (fun (p : 'patt) (_loc : Gram.Loc.t) ->
(p : 'patt_tcon))));
([ Gram.Snterm
(Gram.Entry.obj (patt : 'patt Gram.Entry.t));
Gram.Snterm
(Gram.Entry.obj (ctyp : 'ctyp Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (t : 'ctyp) _ (p : 'patt) (_loc : Loc.t) ->
+ (fun (t : 'ctyp) _ (p : 'patt)
+ (_loc : Gram.Loc.t) ->
(Ast.PaTyc (_loc, p, t) : 'patt_tcon)))) ]) ]))
());
Gram.extend (ipatt : 'ipatt Gram.Entry.t)
Gram.Skeyword ")" ],
(Gram.Action.mk
(fun _ (e : 'expr) _ (p : 'ipatt_tcon) _ _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.PaOlbi (_loc, "", p, e) : 'ipatt))));
([ Gram.Skeyword "?"; Gram.Skeyword "(";
Gram.Snterm
(ipatt_tcon : 'ipatt_tcon Gram.Entry.t));
Gram.Skeyword ")" ],
(Gram.Action.mk
- (fun _ (p : 'ipatt_tcon) _ _ (_loc : Loc.t) ->
- (Ast.PaOlb (_loc, "", p) : 'ipatt))));
+ (fun _ (p : 'ipatt_tcon) _ _ (_loc : Gram.Loc.t)
+ -> (Ast.PaOlb (_loc, "", p) : 'ipatt))));
([ Gram.Skeyword "?";
Gram.Stoken
(((function
"ANTIQUOT ((\"\" | \"lid\"), _)")) ],
(Gram.Action.mk
(fun (__camlp4_0 : Gram.Token.t) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" | "lid" as n)), i) ->
(Ast.PaOlb (_loc, mk_anti n i,
"LIDENT _")) ],
(Gram.Action.mk
(fun (__camlp4_0 : Gram.Token.t) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| LIDENT i ->
(Ast.PaOlb (_loc, i, Ast.PaNil _loc) :
Gram.Skeyword ")" ],
(Gram.Action.mk
(fun _ (f : 'eq_expr) (p : 'ipatt_tcon) _ _
- (__camlp4_0 : Gram.Token.t) _ (_loc : Loc.t)
- ->
+ (__camlp4_0 : Gram.Token.t) _
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" | "lid" as n)), i) ->
(f (mk_anti n i) p : 'ipatt)
Gram.Skeyword ")" ],
(Gram.Action.mk
(fun _ (f : 'eq_expr) (p : 'ipatt_tcon) _
- (__camlp4_0 : Gram.Token.t) (_loc : Loc.t) ->
+ (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| OPTLABEL i -> (f i p : 'ipatt)
| _ -> assert false)));
"LIDENT _")) ],
(Gram.Action.mk
(fun (__camlp4_0 : Gram.Token.t) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| LIDENT i ->
(Ast.PaLab (_loc, i, Ast.PaNil _loc) :
"ANTIQUOT ((\"\" | \"lid\"), _)")) ],
(Gram.Action.mk
(fun (__camlp4_0 : Gram.Token.t) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" | "lid" as n)), i) ->
(Ast.PaLab (_loc, mk_anti n i,
Gram.Skeyword ":"; Gram.Sself ],
(Gram.Action.mk
(fun (p : 'ipatt) _ (__camlp4_0 : Gram.Token.t)
- _ (_loc : Loc.t) ->
+ _ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" | "lid" as n)), i) ->
(Ast.PaLab (_loc, mk_anti n i, p) :
Gram.Sself ],
(Gram.Action.mk
(fun (p : 'ipatt) (__camlp4_0 : Gram.Token.t)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| LABEL i ->
(Ast.PaLab (_loc, i, p) : 'ipatt)
[ ([ Gram.Snterm
(Gram.Entry.obj (ipatt : 'ipatt Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (p : 'ipatt) (_loc : Loc.t) ->
+ (fun (p : 'ipatt) (_loc : Gram.Loc.t) ->
(p : 'ipatt_tcon))));
([ Gram.Snterm
(Gram.Entry.obj (ipatt : 'ipatt Gram.Entry.t));
Gram.Snterm
(Gram.Entry.obj (ctyp : 'ctyp Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (t : 'ctyp) _ (p : 'ipatt) (_loc : Loc.t)
- -> (Ast.PaTyc (_loc, p, t) : 'ipatt_tcon)))) ]) ]))
+ (fun (t : 'ctyp) _ (p : 'ipatt)
+ (_loc : Gram.Loc.t) ->
+ (Ast.PaTyc (_loc, p, t) : 'ipatt_tcon)))) ]) ]))
());
Gram.extend (direction_flag : 'direction_flag Gram.Entry.t)
((fun () ->
| _ -> false),
"ANTIQUOT (\"to\", _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("to" as n)), s) ->
(Ast.BAnt (mk_anti n s) :
| _ -> assert false)));
([ Gram.Skeyword "downto" ],
(Gram.Action.mk
- (fun _ (_loc : Loc.t) ->
+ (fun _ (_loc : Gram.Loc.t) ->
(Ast.BFalse : 'direction_flag))));
([ Gram.Skeyword "to" ],
(Gram.Action.mk
- (fun _ (_loc : Loc.t) ->
+ (fun _ (_loc : Gram.Loc.t) ->
(Ast.BTrue : 'direction_flag)))) ]) ]))
());
Gram.extend (opt_private : 'opt_private Gram.Entry.t)
[ (None, None,
[ ([],
(Gram.Action.mk
- (fun (_loc : Loc.t) ->
+ (fun (_loc : Gram.Loc.t) ->
(Ast.BFalse : 'opt_private))));
([ Gram.Stoken
(((function
| _ -> false),
"ANTIQUOT (\"private\", _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("private" as n)), s) ->
(Ast.BAnt (mk_anti n s) : 'opt_private)
| _ -> assert false)));
([ Gram.Skeyword "private" ],
(Gram.Action.mk
- (fun _ (_loc : Loc.t) ->
+ (fun _ (_loc : Gram.Loc.t) ->
(Ast.BTrue : 'opt_private)))) ]) ]))
());
Gram.extend (opt_mutable : 'opt_mutable Gram.Entry.t)
[ (None, None,
[ ([],
(Gram.Action.mk
- (fun (_loc : Loc.t) ->
+ (fun (_loc : Gram.Loc.t) ->
(Ast.BFalse : 'opt_mutable))));
([ Gram.Stoken
(((function
| _ -> false),
"ANTIQUOT (\"mutable\", _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("mutable" as n)), s) ->
(Ast.BAnt (mk_anti n s) : 'opt_mutable)
| _ -> assert false)));
([ Gram.Skeyword "mutable" ],
(Gram.Action.mk
- (fun _ (_loc : Loc.t) ->
+ (fun _ (_loc : Gram.Loc.t) ->
(Ast.BTrue : 'opt_mutable)))) ]) ]))
());
Gram.extend (opt_virtual : 'opt_virtual Gram.Entry.t)
[ (None, None,
[ ([],
(Gram.Action.mk
- (fun (_loc : Loc.t) ->
+ (fun (_loc : Gram.Loc.t) ->
(Ast.BFalse : 'opt_virtual))));
([ Gram.Stoken
(((function
| _ -> false),
"ANTIQUOT (\"virtual\", _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("virtual" as n)), s) ->
(Ast.BAnt (mk_anti n s) : 'opt_virtual)
| _ -> assert false)));
([ Gram.Skeyword "virtual" ],
(Gram.Action.mk
- (fun _ (_loc : Loc.t) ->
+ (fun _ (_loc : Gram.Loc.t) ->
(Ast.BTrue : 'opt_virtual)))) ]) ]))
());
Gram.extend (opt_dot_dot : 'opt_dot_dot Gram.Entry.t)
[ (None, None,
[ ([],
(Gram.Action.mk
- (fun (_loc : Loc.t) ->
+ (fun (_loc : Gram.Loc.t) ->
(Ast.BFalse : 'opt_dot_dot))));
([ Gram.Stoken
(((function
| _ -> false),
"ANTIQUOT (\"..\", _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT (((".." as n)), s) ->
(Ast.BAnt (mk_anti n s) : 'opt_dot_dot)
| _ -> assert false)));
([ Gram.Skeyword ".." ],
(Gram.Action.mk
- (fun _ (_loc : Loc.t) ->
+ (fun _ (_loc : Gram.Loc.t) ->
(Ast.BTrue : 'opt_dot_dot)))) ]) ]))
());
Gram.extend (opt_rec : 'opt_rec Gram.Entry.t)
[ (None, None,
[ ([],
(Gram.Action.mk
- (fun (_loc : Loc.t) -> (Ast.BFalse : 'opt_rec))));
+ (fun (_loc : Gram.Loc.t) ->
+ (Ast.BFalse : 'opt_rec))));
([ Gram.Stoken
(((function
| ANTIQUOT ("rec", _) -> true
| _ -> false),
"ANTIQUOT (\"rec\", _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("rec" as n)), s) ->
(Ast.BAnt (mk_anti n s) : 'opt_rec)
| _ -> assert false)));
([ Gram.Skeyword "rec" ],
(Gram.Action.mk
- (fun _ (_loc : Loc.t) -> (Ast.BTrue : 'opt_rec)))) ]) ]))
+ (fun _ (_loc : Gram.Loc.t) ->
+ (Ast.BTrue : 'opt_rec)))) ]) ]))
());
Gram.extend (opt_expr : 'opt_expr Gram.Entry.t)
((fun () ->
[ (None, None,
[ ([],
(Gram.Action.mk
- (fun (_loc : Loc.t) ->
+ (fun (_loc : Gram.Loc.t) ->
(Ast.ExNil _loc : 'opt_expr))));
([ Gram.Snterm
(Gram.Entry.obj (expr : 'expr Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (e : 'expr) (_loc : Loc.t) ->
+ (fun (e : 'expr) (_loc : Gram.Loc.t) ->
(e : 'opt_expr)))) ]) ]))
());
Gram.extend (interf : 'interf Gram.Entry.t)
[ ([ Gram.Stoken
(((function | EOI -> true | _ -> false), "EOI")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| EOI -> (([], None) : 'interf)
| _ -> assert false)));
Gram.Sself ],
(Gram.Action.mk
(fun ((sil, stopped) : 'interf) _
- (si : 'sig_item) (_loc : Loc.t) ->
+ (si : 'sig_item) (_loc : Gram.Loc.t) ->
(((si :: sil), stopped) : 'interf))));
([ Gram.Skeyword "#";
Gram.Snterm
(Gram.Entry.obj (semi : 'semi Gram.Entry.t)) ],
(Gram.Action.mk
(fun _ (dp : 'opt_expr) (n : 'a_LIDENT) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(([ Ast.SgDir (_loc, n, dp) ],
(stopped_at _loc)) : 'interf)))) ]) ]))
());
(Gram.Entry.obj
(semi : 'semi Gram.Entry.t)) ],
(Gram.Action.mk
- (fun _ (sg : 'sig_item) (_loc : Loc.t)
- -> (sg : 'e__6)))) ]) ],
+ (fun _ (sg : 'sig_item)
+ (_loc : Gram.Loc.t) -> (sg : 'e__5)))) ]) ],
(Gram.Action.mk
- (fun (l : 'e__6 list) (_loc : Loc.t) ->
+ (fun (l : 'e__5 list) (_loc : Gram.Loc.t) ->
(Ast.sgSem_of_list l : 'sig_items))));
([ Gram.Stoken
(((function
Gram.Sself ],
(Gram.Action.mk
(fun (sg : 'sig_items) _
- (__camlp4_0 : Gram.Token.t) (_loc : Loc.t) ->
+ (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT
((("" | "sigi" | "anti" | "list" as n)),
| _ -> false),
"ANTIQUOT ((\"\" | \"sigi\" | \"anti\" | \"list\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT
((("" | "sigi" | "anti" | "list" as n)),
[ ([ Gram.Stoken
(((function | EOI -> true | _ -> false), "EOI")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| EOI -> (([], None) : 'implem)
| _ -> assert false)));
Gram.Sself ],
(Gram.Action.mk
(fun ((sil, stopped) : 'implem) _
- (si : 'str_item) (_loc : Loc.t) ->
+ (si : 'str_item) (_loc : Gram.Loc.t) ->
(((si :: sil), stopped) : 'implem))));
([ Gram.Skeyword "#";
Gram.Snterm
(Gram.Entry.obj (semi : 'semi Gram.Entry.t)) ],
(Gram.Action.mk
(fun _ (dp : 'opt_expr) (n : 'a_LIDENT) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(([ Ast.StDir (_loc, n, dp) ],
(stopped_at _loc)) : 'implem)))) ]) ]))
());
(Gram.Entry.obj
(semi : 'semi Gram.Entry.t)) ],
(Gram.Action.mk
- (fun _ (st : 'str_item) (_loc : Loc.t)
- -> (st : 'e__7)))) ]) ],
+ (fun _ (st : 'str_item)
+ (_loc : Gram.Loc.t) -> (st : 'e__6)))) ]) ],
(Gram.Action.mk
- (fun (l : 'e__7 list) (_loc : Loc.t) ->
+ (fun (l : 'e__6 list) (_loc : Gram.Loc.t) ->
(Ast.stSem_of_list l : 'str_items))));
([ Gram.Stoken
(((function
Gram.Sself ],
(Gram.Action.mk
(fun (st : 'str_items) _
- (__camlp4_0 : Gram.Token.t) (_loc : Loc.t) ->
+ (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT
((("" | "stri" | "anti" | "list" as n)),
| _ -> false),
"ANTIQUOT ((\"\" | \"stri\" | \"anti\" | \"list\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT
((("" | "stri" | "anti" | "list" as n)),
[ ([ Gram.Stoken
(((function | EOI -> true | _ -> false), "EOI")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| EOI -> (None : 'top_phrase)
| _ -> assert false)));
([ Gram.Snterm
(Gram.Entry.obj (phrase : 'phrase Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (ph : 'phrase) (_loc : Loc.t) ->
+ (fun (ph : 'phrase) (_loc : Gram.Loc.t) ->
(Some ph : 'top_phrase)))) ]) ]))
());
Gram.extend (use_file : 'use_file Gram.Entry.t)
[ ([ Gram.Stoken
(((function | EOI -> true | _ -> false), "EOI")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| EOI -> (([], None) : 'use_file)
| _ -> assert false)));
Gram.Sself ],
(Gram.Action.mk
(fun ((sil, stopped) : 'use_file) _
- (si : 'str_item) (_loc : Loc.t) ->
+ (si : 'str_item) (_loc : Gram.Loc.t) ->
(((si :: sil), stopped) : 'use_file))));
([ Gram.Skeyword "#";
Gram.Snterm
(Gram.Entry.obj (semi : 'semi Gram.Entry.t)) ],
(Gram.Action.mk
(fun _ (dp : 'opt_expr) (n : 'a_LIDENT) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(([ Ast.StDir (_loc, n, dp) ],
(stopped_at _loc)) : 'use_file)))) ]) ]))
());
Gram.Snterm
(Gram.Entry.obj (semi : 'semi Gram.Entry.t)) ],
(Gram.Action.mk
- (fun _ (st : 'str_item) (_loc : Loc.t) ->
+ (fun _ (st : 'str_item) (_loc : Gram.Loc.t) ->
(st : 'phrase))));
([ Gram.Skeyword "#";
Gram.Snterm
(Gram.Entry.obj (semi : 'semi Gram.Entry.t)) ],
(Gram.Action.mk
(fun _ (dp : 'opt_expr) (n : 'a_LIDENT) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.StDir (_loc, n, dp) : 'phrase)))) ]) ]))
());
Gram.extend (a_INT : 'a_INT Gram.Entry.t)
(((function | INT (_, _) -> true | _ -> false),
"INT (_, _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| INT (_, s) -> (s : 'a_INT)
| _ -> assert false)));
| _ -> false),
"ANTIQUOT ((\"\" | \"int\" | \"`int\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" | "int" | "`int" as n)), s)
-> (mk_anti n s : 'a_INT)
(((function | INT32 (_, _) -> true | _ -> false),
"INT32 (_, _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| INT32 (_, s) -> (s : 'a_INT32)
| _ -> assert false)));
| _ -> false),
"ANTIQUOT ((\"\" | \"int32\" | \"`int32\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" | "int32" | "`int32" as n)),
s) -> (mk_anti n s : 'a_INT32)
(((function | INT64 (_, _) -> true | _ -> false),
"INT64 (_, _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| INT64 (_, s) -> (s : 'a_INT64)
| _ -> assert false)));
| _ -> false),
"ANTIQUOT ((\"\" | \"int64\" | \"`int64\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" | "int64" | "`int64" as n)),
s) -> (mk_anti n s : 'a_INT64)
| _ -> false),
"NATIVEINT (_, _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| NATIVEINT (_, s) -> (s : 'a_NATIVEINT)
| _ -> assert false)));
| _ -> false),
"ANTIQUOT ((\"\" | \"nativeint\" | \"`nativeint\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT
((("" | "nativeint" | "`nativeint" as n)),
(((function | FLOAT (_, _) -> true | _ -> false),
"FLOAT (_, _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| FLOAT (_, s) -> (s : 'a_FLOAT)
| _ -> assert false)));
| _ -> false),
"ANTIQUOT ((\"\" | \"flo\" | \"`flo\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" | "flo" | "`flo" as n)), s)
-> (mk_anti n s : 'a_FLOAT)
(((function | CHAR (_, _) -> true | _ -> false),
"CHAR (_, _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| CHAR (_, s) -> (s : 'a_CHAR)
| _ -> assert false)));
| _ -> false),
"ANTIQUOT ((\"\" | \"chr\" | \"`chr\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" | "chr" | "`chr" as n)), s)
-> (mk_anti n s : 'a_CHAR)
(((function | UIDENT _ -> true | _ -> false),
"UIDENT _")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| UIDENT s -> (s : 'a_UIDENT)
| _ -> assert false)));
| _ -> false),
"ANTIQUOT ((\"\" | \"uid\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" | "uid" as n)), s) ->
(mk_anti n s : 'a_UIDENT)
(((function | LIDENT _ -> true | _ -> false),
"LIDENT _")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| LIDENT s -> (s : 'a_LIDENT)
| _ -> assert false)));
| _ -> false),
"ANTIQUOT ((\"\" | \"lid\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" | "lid" as n)), s) ->
(mk_anti n s : 'a_LIDENT)
(((function | LABEL _ -> true | _ -> false),
"LABEL _")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| LABEL s -> (s : 'a_LABEL)
| _ -> assert false)));
Gram.Skeyword ":" ],
(Gram.Action.mk
(fun _ (__camlp4_0 : Gram.Token.t) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" as n)), s) ->
(mk_anti n s : 'a_LABEL)
(((function | OPTLABEL _ -> true | _ -> false),
"OPTLABEL _")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| OPTLABEL s -> (s : 'a_OPTLABEL)
| _ -> assert false)));
Gram.Skeyword ":" ],
(Gram.Action.mk
(fun _ (__camlp4_0 : Gram.Token.t) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" as n)), s) ->
(mk_anti n s : 'a_OPTLABEL)
| _ -> false),
"STRING (_, _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| STRING (_, s) -> (s : 'a_STRING)
| _ -> assert false)));
| _ -> false),
"ANTIQUOT ((\"\" | \"str\" | \"`str\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" | "str" | "`str" as n)), s)
-> (mk_anti n s : 'a_STRING)
| _ -> false),
"STRING (_, _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| STRING (_, x) ->
(Ast.LCons (x, Ast.LNil) : 'string_list)
Gram.Sself ],
(Gram.Action.mk
(fun (xs : 'string_list)
- (__camlp4_0 : Gram.Token.t) (_loc : Loc.t) ->
+ (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| STRING (_, x) ->
(Ast.LCons (x, xs) : 'string_list)
| _ -> false),
"ANTIQUOT ((\"\" | \"str_list\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT (("" | "str_list"), s) ->
(Ast.LAnt (mk_anti "str_list" s) :
[ (None, None,
[ ([ Gram.Skeyword "value" ],
(Gram.Action.mk
- (fun _ (_loc : Loc.t) -> (() : 'value_let)))) ]) ]))
+ (fun _ (_loc : Gram.Loc.t) -> (() : 'value_let)))) ]) ]))
());
Gram.extend (value_val : 'value_val Gram.Entry.t)
((fun () ->
[ (None, None,
[ ([ Gram.Skeyword "value" ],
(Gram.Action.mk
- (fun _ (_loc : Loc.t) -> (() : 'value_val)))) ]) ]))
+ (fun _ (_loc : Gram.Loc.t) -> (() : 'value_val)))) ]) ]))
());
Gram.extend (semi : 'semi Gram.Entry.t)
((fun () ->
[ (None, None,
[ ([ Gram.Skeyword ";" ],
(Gram.Action.mk
- (fun _ (_loc : Loc.t) -> (() : 'semi)))) ]) ]))
+ (fun _ (_loc : Gram.Loc.t) -> (() : 'semi)))) ]) ]))
());
Gram.extend (expr_quot : 'expr_quot Gram.Entry.t)
((fun () ->
[ (None, None,
[ ([],
(Gram.Action.mk
- (fun (_loc : Loc.t) ->
+ (fun (_loc : Gram.Loc.t) ->
(Ast.ExNil _loc : 'expr_quot))));
([ Gram.Snterm
(Gram.Entry.obj (expr : 'expr Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (e : 'expr) (_loc : Loc.t) ->
+ (fun (e : 'expr) (_loc : Gram.Loc.t) ->
(e : 'expr_quot))));
([ Gram.Snterm
(Gram.Entry.obj (expr : 'expr Gram.Entry.t));
(sem_expr : 'sem_expr Gram.Entry.t)) ],
(Gram.Action.mk
(fun (e2 : 'sem_expr) _ (e1 : 'expr)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.ExSem (_loc, e1, e2) : 'expr_quot))));
([ Gram.Snterm
(Gram.Entry.obj (expr : 'expr Gram.Entry.t));
(comma_expr : 'comma_expr Gram.Entry.t)) ],
(Gram.Action.mk
(fun (e2 : 'comma_expr) _ (e1 : 'expr)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.ExCom (_loc, e1, e2) : 'expr_quot)))) ]) ]))
());
Gram.extend (patt_quot : 'patt_quot Gram.Entry.t)
[ (None, None,
[ ([],
(Gram.Action.mk
- (fun (_loc : Loc.t) ->
+ (fun (_loc : Gram.Loc.t) ->
(Ast.PaNil _loc : 'patt_quot))));
([ Gram.Snterm
(Gram.Entry.obj (patt : 'patt Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (x : 'patt) (_loc : Loc.t) ->
+ (fun (x : 'patt) (_loc : Gram.Loc.t) ->
(x : 'patt_quot))));
([ Gram.Snterm
(Gram.Entry.obj (patt : 'patt Gram.Entry.t));
Gram.Snterm
(Gram.Entry.obj (patt : 'patt Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (y : 'patt) _ (x : 'patt) (_loc : Loc.t) ->
+ (fun (y : 'patt) _ (x : 'patt)
+ (_loc : Gram.Loc.t) ->
(let i =
match x with
| Ast.PaAnt (loc, s) -> Ast.IdAnt (loc, s)
(sem_patt : 'sem_patt Gram.Entry.t)) ],
(Gram.Action.mk
(fun (y : 'sem_patt) _ (x : 'patt)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.PaSem (_loc, x, y) : 'patt_quot))));
([ Gram.Snterm
(Gram.Entry.obj (patt : 'patt Gram.Entry.t));
(comma_patt : 'comma_patt Gram.Entry.t)) ],
(Gram.Action.mk
(fun (y : 'comma_patt) _ (x : 'patt)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.PaCom (_loc, x, y) : 'patt_quot)))) ]) ]))
());
Gram.extend (ctyp_quot : 'ctyp_quot Gram.Entry.t)
[ (None, None,
[ ([],
(Gram.Action.mk
- (fun (_loc : Loc.t) ->
+ (fun (_loc : Gram.Loc.t) ->
(Ast.TyNil _loc : 'ctyp_quot))));
([ Gram.Snterm
(Gram.Entry.obj
(more_ctyp : 'more_ctyp Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (x : 'more_ctyp) (_loc : Loc.t) ->
+ (fun (x : 'more_ctyp) (_loc : Gram.Loc.t) ->
(x : 'ctyp_quot))));
([ Gram.Snterm
(Gram.Entry.obj
'constructor_arg_list Gram.Entry.t)) ],
(Gram.Action.mk
(fun (y : 'constructor_arg_list) _
- (x : 'more_ctyp) (_loc : Loc.t) ->
+ (x : 'more_ctyp) (_loc : Gram.Loc.t) ->
(Ast.TyAnd (_loc, x, y) : 'ctyp_quot))));
([ Gram.Snterm
(Gram.Entry.obj
(amp_ctyp : 'amp_ctyp Gram.Entry.t)) ],
(Gram.Action.mk
(fun (y : 'amp_ctyp) _ (x : 'more_ctyp)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.TyAmp (_loc, x, y) : 'ctyp_quot))));
([ Gram.Snterm
(Gram.Entry.obj
(star_ctyp : 'star_ctyp Gram.Entry.t)) ],
(Gram.Action.mk
(fun (y : 'star_ctyp) _ (x : 'more_ctyp)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.TySta (_loc, x, y) : 'ctyp_quot))));
([ Gram.Snterm
(Gram.Entry.obj
'label_declaration Gram.Entry.t)) ],
(Gram.Action.mk
(fun (z : 'label_declaration) _ (y : 'more_ctyp)
- _ (x : 'more_ctyp) (_loc : Loc.t) ->
+ _ (x : 'more_ctyp) (_loc : Gram.Loc.t) ->
(Ast.TySem (_loc, Ast.TyCol (_loc, x, y), z) :
'ctyp_quot))));
([ Gram.Snterm
(more_ctyp : 'more_ctyp Gram.Entry.t)) ],
(Gram.Action.mk
(fun (y : 'more_ctyp) _ (x : 'more_ctyp)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.TyCol (_loc, x, y) : 'ctyp_quot))));
([ Gram.Snterm
(Gram.Entry.obj
(row_field : 'row_field Gram.Entry.t)) ],
(Gram.Action.mk
(fun (z : 'row_field) _ (y : 'amp_ctyp) _ _
- (x : 'more_ctyp) (_loc : Loc.t) ->
+ (x : 'more_ctyp) (_loc : Gram.Loc.t) ->
(Ast.TyOr (_loc, Ast.TyOfAmp (_loc, x, y), z) :
'ctyp_quot))));
([ Gram.Snterm
(amp_ctyp : 'amp_ctyp Gram.Entry.t)) ],
(Gram.Action.mk
(fun (y : 'amp_ctyp) _ _ (x : 'more_ctyp)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.TyOfAmp (_loc, x, y) : 'ctyp_quot))));
([ Gram.Snterm
(Gram.Entry.obj
(Gram.Action.mk
(fun (z : 'constructor_declarations) _
(y : 'constructor_arg_list) _
- (x : 'more_ctyp) (_loc : Loc.t) ->
+ (x : 'more_ctyp) (_loc : Gram.Loc.t) ->
(Ast.TyOr (_loc, Ast.TyOf (_loc, x, y), z) :
'ctyp_quot))));
([ Gram.Snterm
'constructor_arg_list Gram.Entry.t)) ],
(Gram.Action.mk
(fun (y : 'constructor_arg_list) _
- (x : 'more_ctyp) (_loc : Loc.t) ->
+ (x : 'more_ctyp) (_loc : Gram.Loc.t) ->
(Ast.TyOf (_loc, x, y) : 'ctyp_quot))));
([ Gram.Snterm
(Gram.Entry.obj
'constructor_declarations Gram.Entry.t)) ],
(Gram.Action.mk
(fun (y : 'constructor_declarations) _
- (x : 'more_ctyp) (_loc : Loc.t) ->
+ (x : 'more_ctyp) (_loc : Gram.Loc.t) ->
(Ast.TyOr (_loc, x, y) : 'ctyp_quot))));
([ Gram.Snterm
(Gram.Entry.obj
'label_declaration Gram.Entry.t)) ],
(Gram.Action.mk
(fun (y : 'label_declaration) _ (x : 'more_ctyp)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.TySem (_loc, x, y) : 'ctyp_quot))));
([ Gram.Snterm
(Gram.Entry.obj
(comma_ctyp : 'comma_ctyp Gram.Entry.t)) ],
(Gram.Action.mk
(fun (y : 'comma_ctyp) _ (x : 'more_ctyp)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.TyCom (_loc, x, y) : 'ctyp_quot)))) ]) ]))
());
Gram.extend (more_ctyp : 'more_ctyp Gram.Entry.t)
(type_parameter :
'type_parameter Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (x : 'type_parameter) (_loc : Loc.t) ->
- (x : 'more_ctyp))));
+ (fun (x : 'type_parameter) (_loc : Gram.Loc.t)
+ -> (x : 'more_ctyp))));
([ Gram.Snterm
(Gram.Entry.obj
(type_kind : 'type_kind Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (x : 'type_kind) (_loc : Loc.t) ->
+ (fun (x : 'type_kind) (_loc : Gram.Loc.t) ->
(x : 'more_ctyp))));
([ Gram.Skeyword "`";
Gram.Snterm
(Gram.Entry.obj
- (a_LIDENT : 'a_LIDENT Gram.Entry.t)) ],
+ (a_ident : 'a_ident Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (x : 'a_LIDENT) _ (_loc : Loc.t) ->
+ (fun (x : 'a_ident) _ (_loc : Gram.Loc.t) ->
(Ast.TyVrn (_loc, x) : 'more_ctyp))));
([ Gram.Skeyword "mutable"; Gram.Sself ],
(Gram.Action.mk
- (fun (x : 'more_ctyp) _ (_loc : Loc.t) ->
+ (fun (x : 'more_ctyp) _ (_loc : Gram.Loc.t) ->
(Ast.TyMut (_loc, x) : 'more_ctyp)))) ]) ]))
());
Gram.extend (str_item_quot : 'str_item_quot Gram.Entry.t)
[ (None, None,
[ ([],
(Gram.Action.mk
- (fun (_loc : Loc.t) ->
+ (fun (_loc : Gram.Loc.t) ->
(Ast.StNil _loc : 'str_item_quot))));
([ Gram.Snterm
(Gram.Entry.obj
(str_item : 'str_item Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (st : 'str_item) (_loc : Loc.t) ->
+ (fun (st : 'str_item) (_loc : Gram.Loc.t) ->
(st : 'str_item_quot))));
([ Gram.Snterm
(Gram.Entry.obj
Gram.Sself ],
(Gram.Action.mk
(fun (st2 : 'str_item_quot) _ (st1 : 'str_item)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.StSem (_loc, st1, st2) : 'str_item_quot))));
([ Gram.Skeyword "#";
Gram.Snterm
(opt_expr : 'opt_expr Gram.Entry.t)) ],
(Gram.Action.mk
(fun (dp : 'opt_expr) (n : 'a_LIDENT) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.StDir (_loc, n, dp) : 'str_item_quot)))) ]) ]))
());
Gram.extend (sig_item_quot : 'sig_item_quot Gram.Entry.t)
[ (None, None,
[ ([],
(Gram.Action.mk
- (fun (_loc : Loc.t) ->
+ (fun (_loc : Gram.Loc.t) ->
(Ast.SgNil _loc : 'sig_item_quot))));
([ Gram.Snterm
(Gram.Entry.obj
(sig_item : 'sig_item Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (sg : 'sig_item) (_loc : Loc.t) ->
+ (fun (sg : 'sig_item) (_loc : Gram.Loc.t) ->
(sg : 'sig_item_quot))));
([ Gram.Snterm
(Gram.Entry.obj
Gram.Sself ],
(Gram.Action.mk
(fun (sg2 : 'sig_item_quot) _ (sg1 : 'sig_item)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.SgSem (_loc, sg1, sg2) : 'sig_item_quot))));
([ Gram.Skeyword "#";
Gram.Snterm
(opt_expr : 'opt_expr Gram.Entry.t)) ],
(Gram.Action.mk
(fun (dp : 'opt_expr) (n : 'a_LIDENT) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.SgDir (_loc, n, dp) : 'sig_item_quot)))) ]) ]))
());
Gram.extend (module_type_quot : 'module_type_quot Gram.Entry.t)
[ (None, None,
[ ([],
(Gram.Action.mk
- (fun (_loc : Loc.t) ->
+ (fun (_loc : Gram.Loc.t) ->
(Ast.MtNil _loc : 'module_type_quot))));
([ Gram.Snterm
(Gram.Entry.obj
(module_type : 'module_type Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (x : 'module_type) (_loc : Loc.t) ->
+ (fun (x : 'module_type) (_loc : Gram.Loc.t) ->
(x : 'module_type_quot)))) ]) ]))
());
Gram.extend (module_expr_quot : 'module_expr_quot Gram.Entry.t)
[ (None, None,
[ ([],
(Gram.Action.mk
- (fun (_loc : Loc.t) ->
+ (fun (_loc : Gram.Loc.t) ->
(Ast.MeNil _loc : 'module_expr_quot))));
([ Gram.Snterm
(Gram.Entry.obj
(module_expr : 'module_expr Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (x : 'module_expr) (_loc : Loc.t) ->
+ (fun (x : 'module_expr) (_loc : Gram.Loc.t) ->
(x : 'module_expr_quot)))) ]) ]))
());
Gram.extend (match_case_quot : 'match_case_quot Gram.Entry.t)
[ (None, None,
[ ([],
(Gram.Action.mk
- (fun (_loc : Loc.t) ->
+ (fun (_loc : Gram.Loc.t) ->
(Ast.McNil _loc : 'match_case_quot))));
([ Gram.Slist0sep
(Gram.Snterm
(match_case0 : 'match_case0 Gram.Entry.t)),
Gram.Skeyword "|") ],
(Gram.Action.mk
- (fun (x : 'match_case0 list) (_loc : Loc.t) ->
- (Ast.mcOr_of_list x : 'match_case_quot)))) ]) ]))
+ (fun (x : 'match_case0 list) (_loc : Gram.Loc.t)
+ -> (Ast.mcOr_of_list x : 'match_case_quot)))) ]) ]))
());
Gram.extend (binding_quot : 'binding_quot Gram.Entry.t)
((fun () ->
[ (None, None,
[ ([],
(Gram.Action.mk
- (fun (_loc : Loc.t) ->
+ (fun (_loc : Gram.Loc.t) ->
(Ast.BiNil _loc : 'binding_quot))));
([ Gram.Snterm
(Gram.Entry.obj
(binding : 'binding Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (x : 'binding) (_loc : Loc.t) ->
+ (fun (x : 'binding) (_loc : Gram.Loc.t) ->
(x : 'binding_quot)))) ]) ]))
());
Gram.extend (rec_binding_quot : 'rec_binding_quot Gram.Entry.t)
[ (None, None,
[ ([],
(Gram.Action.mk
- (fun (_loc : Loc.t) ->
+ (fun (_loc : Gram.Loc.t) ->
(Ast.RbNil _loc : 'rec_binding_quot))));
([ Gram.Snterm
(Gram.Entry.obj
(label_expr : 'label_expr Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (x : 'label_expr) (_loc : Loc.t) ->
+ (fun (x : 'label_expr) (_loc : Gram.Loc.t) ->
(x : 'rec_binding_quot)))) ]) ]))
());
Gram.extend
[ (None, None,
[ ([],
(Gram.Action.mk
- (fun (_loc : Loc.t) ->
+ (fun (_loc : Gram.Loc.t) ->
(Ast.MbNil _loc : 'module_binding_quot))));
([ Gram.Snterm
(Gram.Entry.obj
(module_expr : 'module_expr Gram.Entry.t)) ],
(Gram.Action.mk
(fun (me : 'module_expr) _ (mt : 'module_type) _
- (m : 'a_UIDENT) (_loc : Loc.t) ->
+ (m : 'a_UIDENT) (_loc : Gram.Loc.t) ->
(Ast.MbColEq (_loc, m, mt, me) :
'module_binding_quot))));
([ Gram.Snterm
(module_type : 'module_type Gram.Entry.t)) ],
(Gram.Action.mk
(fun (mt : 'module_type) _ (m : 'a_UIDENT)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.MbCol (_loc, m, mt) :
'module_binding_quot))));
([ Gram.Stoken
(module_expr : 'module_expr Gram.Entry.t)) ],
(Gram.Action.mk
(fun (me : 'module_expr) _ (mt : 'module_type) _
- (__camlp4_0 : Gram.Token.t) (_loc : Loc.t) ->
+ (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" as n)), m) ->
(Ast.MbColEq (_loc, mk_anti n m, mt, me) :
(module_type : 'module_type Gram.Entry.t)) ],
(Gram.Action.mk
(fun (mt : 'module_type) _
- (__camlp4_0 : Gram.Token.t) (_loc : Loc.t) ->
+ (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" as n)), m) ->
(Ast.MbCol (_loc, mk_anti n m, mt) :
| _ -> false),
"ANTIQUOT (\"\", _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("" as n)), s) ->
(Ast.MbAnt (_loc,
| _ -> false),
"ANTIQUOT ((\"module_binding\" | \"anti\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT
((("module_binding" | "anti" as n)), s)
([ Gram.Sself; Gram.Skeyword "and"; Gram.Sself ],
(Gram.Action.mk
(fun (b2 : 'module_binding_quot) _
- (b1 : 'module_binding_quot) (_loc : Loc.t) ->
+ (b1 : 'module_binding_quot)
+ (_loc : Gram.Loc.t) ->
(Ast.MbAnd (_loc, b1, b2) :
'module_binding_quot)))) ]) ]))
());
Gram.extend (ident_quot : 'ident_quot Gram.Entry.t)
((fun () ->
(None,
- [ (None, None,
+ [ ((Some "apply"), None,
[ ([ Gram.Sself; Gram.Sself ],
(Gram.Action.mk
(fun (j : 'ident_quot) (i : 'ident_quot)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.IdApp (_loc, i, j) : 'ident_quot)))) ]);
- (None, None,
+ ((Some "."), None,
[ ([ Gram.Sself; Gram.Skeyword "."; Gram.Sself ],
(Gram.Action.mk
(fun (j : 'ident_quot) _ (i : 'ident_quot)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.IdAcc (_loc, i, j) : 'ident_quot)))) ]);
- (None, None,
+ ((Some "simple"), None,
[ ([ Gram.Skeyword "("; Gram.Sself; Gram.Skeyword ")" ],
(Gram.Action.mk
- (fun _ (i : 'ident_quot) _ (_loc : Loc.t) ->
- (i : 'ident_quot))));
+ (fun _ (i : 'ident_quot) _ (_loc : Gram.Loc.t)
+ -> (i : 'ident_quot))));
([ Gram.Stoken
(((function
| ANTIQUOT (("" | "id" | "anti" | "list"),
Gram.Skeyword "."; Gram.Sself ],
(Gram.Action.mk
(fun (i : 'ident_quot) _
- (__camlp4_0 : Gram.Token.t) (_loc : Loc.t) ->
+ (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT
((("" | "id" | "anti" | "list" as n)), s)
(Gram.Entry.obj
(a_LIDENT : 'a_LIDENT Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (i : 'a_LIDENT) (_loc : Loc.t) ->
+ (fun (i : 'a_LIDENT) (_loc : Gram.Loc.t) ->
(Ast.IdLid (_loc, i) : 'ident_quot))));
([ Gram.Snterm
(Gram.Entry.obj
(a_UIDENT : 'a_UIDENT Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (i : 'a_UIDENT) (_loc : Loc.t) ->
+ (fun (i : 'a_UIDENT) (_loc : Gram.Loc.t) ->
(Ast.IdUid (_loc, i) : 'ident_quot))));
([ Gram.Stoken
(((function
| _ -> false),
"ANTIQUOT ((\"\" | \"id\" | \"anti\" | \"list\"), _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT
((("" | "id" | "anti" | "list" as n)), s)
[ (None, None,
[ ([],
(Gram.Action.mk
- (fun (_loc : Loc.t) ->
+ (fun (_loc : Gram.Loc.t) ->
(Ast.CeNil _loc : 'class_expr_quot))));
([ Gram.Snterm
(Gram.Entry.obj
(class_expr : 'class_expr Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (x : 'class_expr) (_loc : Loc.t) ->
+ (fun (x : 'class_expr) (_loc : Gram.Loc.t) ->
(x : 'class_expr_quot))));
([ Gram.Stoken
(((function
'opt_comma_ctyp Gram.Entry.t)) ],
(Gram.Action.mk
(fun (ot : 'opt_comma_ctyp) (i : 'ident)
- (__camlp4_0 : Gram.Token.t) (_loc : Loc.t) ->
+ (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("virtual" as n)), s) ->
(let anti =
'class_name_and_param Gram.Entry.t)) ],
(Gram.Action.mk
(fun ((i, ot) : 'class_name_and_param) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.CeCon (_loc, Ast.BTrue,
Ast.IdLid (_loc, i), ot) :
'class_expr_quot))));
([ Gram.Sself; Gram.Skeyword "="; Gram.Sself ],
(Gram.Action.mk
(fun (ce2 : 'class_expr_quot) _
- (ce1 : 'class_expr_quot) (_loc : Loc.t) ->
+ (ce1 : 'class_expr_quot) (_loc : Gram.Loc.t)
+ ->
(Ast.CeEq (_loc, ce1, ce2) :
'class_expr_quot))));
([ Gram.Sself; Gram.Skeyword "and"; Gram.Sself ],
(Gram.Action.mk
(fun (ce2 : 'class_expr_quot) _
- (ce1 : 'class_expr_quot) (_loc : Loc.t) ->
+ (ce1 : 'class_expr_quot) (_loc : Gram.Loc.t)
+ ->
(Ast.CeAnd (_loc, ce1, ce2) :
'class_expr_quot)))) ]) ]))
());
[ (None, None,
[ ([],
(Gram.Action.mk
- (fun (_loc : Loc.t) ->
+ (fun (_loc : Gram.Loc.t) ->
(Ast.CtNil _loc : 'class_type_quot))));
([ Gram.Snterm
(Gram.Entry.obj
(class_type_plus :
'class_type_plus Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (x : 'class_type_plus) (_loc : Loc.t) ->
- (x : 'class_type_quot))));
+ (fun (x : 'class_type_plus) (_loc : Gram.Loc.t)
+ -> (x : 'class_type_quot))));
([ Gram.Stoken
(((function
| ANTIQUOT ("virtual", _) -> true
'opt_comma_ctyp Gram.Entry.t)) ],
(Gram.Action.mk
(fun (ot : 'opt_comma_ctyp) (i : 'ident)
- (__camlp4_0 : Gram.Token.t) (_loc : Loc.t) ->
+ (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("virtual" as n)), s) ->
(let anti =
'class_name_and_param Gram.Entry.t)) ],
(Gram.Action.mk
(fun ((i, ot) : 'class_name_and_param) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.CtCon (_loc, Ast.BTrue,
Ast.IdLid (_loc, i), ot) :
'class_type_quot))));
([ Gram.Sself; Gram.Skeyword ":"; Gram.Sself ],
(Gram.Action.mk
(fun (ct2 : 'class_type_quot) _
- (ct1 : 'class_type_quot) (_loc : Loc.t) ->
+ (ct1 : 'class_type_quot) (_loc : Gram.Loc.t)
+ ->
(Ast.CtCol (_loc, ct1, ct2) :
'class_type_quot))));
([ Gram.Sself; Gram.Skeyword "="; Gram.Sself ],
(Gram.Action.mk
(fun (ct2 : 'class_type_quot) _
- (ct1 : 'class_type_quot) (_loc : Loc.t) ->
+ (ct1 : 'class_type_quot) (_loc : Gram.Loc.t)
+ ->
(Ast.CtEq (_loc, ct1, ct2) :
'class_type_quot))));
([ Gram.Sself; Gram.Skeyword "and"; Gram.Sself ],
(Gram.Action.mk
(fun (ct2 : 'class_type_quot) _
- (ct1 : 'class_type_quot) (_loc : Loc.t) ->
+ (ct1 : 'class_type_quot) (_loc : Gram.Loc.t)
+ ->
(Ast.CtAnd (_loc, ct1, ct2) :
'class_type_quot)))) ]) ]))
());
[ (None, None,
[ ([],
(Gram.Action.mk
- (fun (_loc : Loc.t) ->
+ (fun (_loc : Gram.Loc.t) ->
(Ast.CrNil _loc : 'class_str_item_quot))));
([ Gram.Snterm
(Gram.Entry.obj
(class_str_item :
'class_str_item Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (x : 'class_str_item) (_loc : Loc.t) ->
- (x : 'class_str_item_quot))));
+ (fun (x : 'class_str_item) (_loc : Gram.Loc.t)
+ -> (x : 'class_str_item_quot))));
([ Gram.Snterm
(Gram.Entry.obj
(class_str_item :
Gram.Sself ],
(Gram.Action.mk
(fun (x2 : 'class_str_item_quot) _
- (x1 : 'class_str_item) (_loc : Loc.t) ->
+ (x1 : 'class_str_item) (_loc : Gram.Loc.t) ->
(Ast.CrSem (_loc, x1, x2) :
'class_str_item_quot)))) ]) ]))
());
[ (None, None,
[ ([],
(Gram.Action.mk
- (fun (_loc : Loc.t) ->
+ (fun (_loc : Gram.Loc.t) ->
(Ast.CgNil _loc : 'class_sig_item_quot))));
([ Gram.Snterm
(Gram.Entry.obj
(class_sig_item :
'class_sig_item Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (x : 'class_sig_item) (_loc : Loc.t) ->
- (x : 'class_sig_item_quot))));
+ (fun (x : 'class_sig_item) (_loc : Gram.Loc.t)
+ -> (x : 'class_sig_item_quot))));
([ Gram.Snterm
(Gram.Entry.obj
(class_sig_item :
Gram.Sself ],
(Gram.Action.mk
(fun (x2 : 'class_sig_item_quot) _
- (x1 : 'class_sig_item) (_loc : Loc.t) ->
+ (x1 : 'class_sig_item) (_loc : Gram.Loc.t) ->
(Ast.CgSem (_loc, x1, x2) :
'class_sig_item_quot)))) ]) ]))
());
[ (None, None,
[ ([],
(Gram.Action.mk
- (fun (_loc : Loc.t) ->
+ (fun (_loc : Gram.Loc.t) ->
(Ast.WcNil _loc : 'with_constr_quot))));
([ Gram.Snterm
(Gram.Entry.obj
(with_constr : 'with_constr Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (x : 'with_constr) (_loc : Loc.t) ->
+ (fun (x : 'with_constr) (_loc : Gram.Loc.t) ->
(x : 'with_constr_quot)))) ]) ]))
());
Gram.extend (patt_eoi : 'patt_eoi Gram.Entry.t)
(((function | EOI -> true | _ -> false), "EOI")) ],
(Gram.Action.mk
(fun (__camlp4_0 : Gram.Token.t) (x : 'patt)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| EOI -> (x : 'patt_eoi)
| _ -> assert false))) ]) ]))
(((function | EOI -> true | _ -> false), "EOI")) ],
(Gram.Action.mk
(fun (__camlp4_0 : Gram.Token.t) (x : 'expr)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| EOI -> (x : 'expr_eoi)
| _ -> assert false))) ]) ]))
()))
+
end
+
let _ = let module M = Register.OCamlSyntaxExtension(Id)(Make) in ()
+
end
+
module Camlp4QuotationCommon =
struct
open Camlp4
+
(* -*- camlp4r -*- *)
(****************************************************************************)
(* *)
* - Nicolas Pouillard: initial version
*)
module Id =
- struct
- let name = "Camlp4QuotationCommon"
- let version =
- "$Id: Camlp4QuotationCommon.ml,v 1.1.4.5 2007/05/10 14:24:22 pouillar Exp $"
- end
+ struct let name = "Camlp4QuotationCommon"
+ let version = "$Id$"
+ end
+
module Make
(Syntax : Sig.Camlp4Syntax)
- (TheAntiquotSyntax :
- Sig.AntiquotSyntax with module Ast = Sig.Camlp4AstToAst(Syntax.Ast)) =
+ (TheAntiquotSyntax : Sig.Parser(Syntax.Ast).SIMPLE) =
struct
open Sig
+
include Syntax
+
(* Be careful an AntiquotSyntax module appears here *)
module MetaLocHere = Ast.Meta.MetaLoc
+
module MetaLoc =
struct
module Ast = Ast
+
let loc_name = ref None
+
let meta_loc_expr _loc loc =
match !loc_name with
| None -> Ast.ExId (_loc, Ast.IdLid (_loc, !Loc.name))
| Some "here" -> MetaLocHere.meta_loc_expr _loc loc
| Some x -> Ast.ExId (_loc, Ast.IdLid (_loc, x))
+
let meta_loc_patt _loc _ = Ast.PaAny _loc
+
end
+
module MetaAst = Ast.Meta.Make(MetaLoc)
+
module ME = MetaAst.Expr
+
module MP = MetaAst.Patt
+
let is_antiquot s =
let len = String.length s
in (len > 2) && ((s.[0] = '\\') && (s.[1] = '$'))
+
let handle_antiquot_in_string s term parse loc decorate =
if is_antiquot s
then
String.sub s (pos + 1) (((String.length s) - pos) - 1)
in decorate name (parse loc code))
else term
+
let antiquot_expander =
object
inherit Ast.map as super
+
method patt =
function
| (Ast.PaAnt (_loc, s) | Ast.PaStr (_loc, s) as p) ->
p)
| _ -> p)
| p -> super#patt p
+
method expr =
function
| (Ast.ExAnt (_loc, s) | Ast.ExStr (_loc, s) as e) ->
Ast.IdLid (_loc, "escaped"))),
e)
| "`bool" ->
- Ast.ExIfe (_loc, e,
- ME.meta_expr _loc
- (Ast.ExId (_loc, Ast.IdUid (_loc, "True"))),
- ME.meta_expr _loc
- (Ast.ExId (_loc, Ast.IdUid (_loc, "False"))))
+ Ast.ExApp (_loc,
+ Ast.ExApp (_loc,
+ Ast.ExId (_loc,
+ Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
+ Ast.IdUid (_loc, "IdUid"))),
+ mloc _loc),
+ Ast.ExIfe (_loc, e, Ast.ExStr (_loc, "True"),
+ Ast.ExStr (_loc, "False")))
| "liststr_item" ->
Ast.ExApp (_loc,
Ast.ExId (_loc,
e)
| _ -> e)
| e -> super#expr e
+
end
+
let add_quotation name entry mexpr mpatt =
let entry_eoi = Gram.Entry.mk (Gram.Entry.name entry) in
let parse_quot_string entry loc s =
(((function | EOI -> true | _ -> false), "EOI")) ],
(Gram.Action.mk
(fun (__camlp4_0 : Gram.Token.t) (x : 'entry)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| EOI -> (x : 'entry_eoi)
| _ -> assert false))) ]) ]))
Quotation.add name Quotation.DynAst.expr_tag expand_expr;
Quotation.add name Quotation.DynAst.patt_tag expand_patt;
Quotation.add name Quotation.DynAst.str_item_tag expand_str_item)
+
let _ =
add_quotation "sig_item" sig_item_quot ME.meta_sig_item MP.
meta_sig_item
+
let _ =
add_quotation "str_item" str_item_quot ME.meta_str_item MP.
meta_str_item
+
let _ = add_quotation "ctyp" ctyp_quot ME.meta_ctyp MP.meta_ctyp
+
let _ = add_quotation "patt" patt_quot ME.meta_patt MP.meta_patt
+
let _ = add_quotation "expr" expr_quot ME.meta_expr MP.meta_expr
+
let _ =
add_quotation "module_type" module_type_quot ME.meta_module_type
MP.meta_module_type
+
let _ =
add_quotation "module_expr" module_expr_quot ME.meta_module_expr
MP.meta_module_expr
+
let _ =
add_quotation "class_type" class_type_quot ME.meta_class_type MP.
meta_class_type
+
let _ =
add_quotation "class_expr" class_expr_quot ME.meta_class_expr MP.
meta_class_expr
+
let _ =
add_quotation "class_sig_item" class_sig_item_quot ME.
meta_class_sig_item MP.meta_class_sig_item
+
let _ =
add_quotation "class_str_item" class_str_item_quot ME.
meta_class_str_item MP.meta_class_str_item
+
let _ =
add_quotation "with_constr" with_constr_quot ME.meta_with_constr
MP.meta_with_constr
+
let _ =
add_quotation "binding" binding_quot ME.meta_binding MP.
meta_binding
+
let _ =
add_quotation "rec_binding" rec_binding_quot ME.meta_rec_binding
MP.meta_rec_binding
+
let _ =
add_quotation "match_case" match_case_quot ME.meta_match_case MP.
meta_match_case
+
let _ =
add_quotation "module_binding" module_binding_quot ME.
meta_module_binding MP.meta_module_binding
+
let _ = add_quotation "ident" ident_quot ME.meta_ident MP.meta_ident
+
end
+
end
+
module Q =
struct
open Camlp4
+
(* -*- camlp4r -*- *)
(****************************************************************************)
(* *)
* - Nicolas Pouillard: refactoring
*)
module Id =
- struct
- let name = "Camlp4QuotationExpander"
- let version =
- "$Id: Camlp4QuotationExpander.ml,v 1.1 2007/02/07 10:09:22 ertai Exp $"
- end
+ struct let name = "Camlp4QuotationExpander"
+ let version = "$Id$"
+ end
+
module Make (Syntax : Sig.Camlp4Syntax) =
struct
module M = Camlp4QuotationCommon.Make(Syntax)(Syntax.AntiquotSyntax)
+
include M
+
end
+
let _ = let module M = Register.OCamlSyntaxExtension(Id)(Make) in ()
+
end
+
module Rp =
struct
open Camlp4
+
(* -*- camlp4r -*- *)
(****************************************************************************)
(* *)
* - Nicolas Pouillard: refactoring
*)
module Id : Sig.Id =
- struct
- let name = "Camlp4OCamlRevisedParserParser"
- let version =
- "$Id: Camlp4OCamlRevisedParserParser.ml,v 1.1.4.2 2007/04/05 18:06:36 pouillar Exp $"
+ struct let name = "Camlp4OCamlRevisedParserParser"
+ let version = "$Id$"
+
end
+
module Make (Syntax : Sig.Camlp4Syntax) =
struct
open Sig
+
include Syntax
+
type spat_comp =
| SpTrm of Loc.t * Ast.patt * Ast.expr option
- | SpNtr of Loc.t * Ast.patt * Ast.expr | SpStr of Loc.t * Ast.patt
+ | SpNtr of Loc.t * Ast.patt * Ast.expr
+ | SpStr of Loc.t * Ast.patt
+
type sexp_comp =
| SeTrm of Loc.t * Ast.expr | SeNtr of Loc.t * Ast.expr
+
let stream_expr = Gram.Entry.mk "stream_expr"
+
let stream_begin = Gram.Entry.mk "stream_begin"
+
let stream_end = Gram.Entry.mk "stream_end"
+
let stream_quot = Gram.Entry.mk "stream_quot"
+
let parser_case = Gram.Entry.mk "parser_case"
+
let parser_case_list = Gram.Entry.mk "parser_case_list"
+
let strm_n = "__strm"
+
let peek_fun _loc =
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Stream"),
Ast.IdLid (_loc, "peek")))
+
let junk_fun _loc =
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Stream"),
Ast.IdLid (_loc, "junk")))
+
(* Parsers. *)
(* In syntax generated, many cases are optimisations. *)
let rec pattern_eq_expression p e =
| (Ast.PaApp (_, p1, p2), Ast.ExApp (_, e1, e2)) ->
(pattern_eq_expression p1 e1) && (pattern_eq_expression p2 e2)
| _ -> false
+
let is_raise e =
match e with
| Ast.ExApp (_, (Ast.ExId (_, (Ast.IdLid (_, "raise")))), _) ->
true
| _ -> false
+
let is_raise_failure e =
match e with
| Ast.ExApp (_, (Ast.ExId (_, (Ast.IdLid (_, "raise")))),
(Ast.IdUid (_, "Failure")))))))
-> true
| _ -> false
+
let rec handle_failure e =
match e with
| Ast.ExTry (_, _,
| Ast.ExId (_, (Ast.IdLid (_, _))) -> false
| Ast.ExApp (_, x, _) -> is_constr_apply x
| _ -> false
+
let rec subst v e =
let _loc = Ast.loc_of_expr e
in
Ast.BiEq (_loc, Ast.PaId (_loc, Ast.IdLid (_loc, v')),
if v = v' then e else subst v e)
| _ -> raise Not_found
+
let stream_pattern_component skont ckont =
function
| SpTrm (_loc, p, None) ->
Ast.BiEq (_loc, p,
Ast.ExId (_loc, Ast.IdLid (_loc, strm_n))),
skont))
+
let rec stream_pattern _loc epo e ekont =
function
| [] ->
in stream_pattern _loc epo e ekont spcl in
let ckont = ekont err
in stream_pattern_component skont ckont spc
+
let stream_patterns_term _loc ekont tspel =
let pel =
List.fold_right
Ast.ExId (_loc, Ast.IdLid (_loc, strm_n))),
Ast.McOr (_loc, pel,
Ast.McArr (_loc, Ast.PaAny _loc, Ast.ExNil _loc, ekont ())))
+
let rec group_terms =
function
| ((SpTrm (_loc, p, w), None) :: spcl, epo, e) :: spel ->
let (tspel, spel) = group_terms spel
in (((p, w, _loc, spcl, epo, e) :: tspel), spel)
| spel -> ([], spel)
+
let rec parser_cases _loc =
function
| [] ->
| (tspel, spel) ->
stream_patterns_term _loc
(fun _ -> parser_cases _loc spel) tspel)
+
let cparser _loc bpo pc =
let e = parser_cases _loc pc in
let e =
Ast.IdLid (_loc, "t"))),
Ast.TyAny _loc))
in Ast.ExFun (_loc, Ast.McArr (_loc, p, Ast.ExNil _loc, e))
+
let cparser_match _loc me bpo pc =
let pc = parser_cases _loc pc in
let e =
Ast.TyAny _loc)),
me),
e)
+
(* streams *)
let rec not_computing =
function
| Ast.ExApp (_, x, y) ->
(is_cons_apply_not_computing x) && (not_computing y)
| _ -> false
+
let slazy _loc e =
match e with
| Ast.ExApp (_, f, (Ast.ExId (_, (Ast.IdUid (_, "()"))))) ->
| _ ->
Ast.ExFun (_loc,
Ast.McArr (_loc, Ast.PaAny _loc, Ast.ExNil _loc, e))
+
let rec cstream gloc =
function
| [] ->
Ast.IdLid (_loc, "lapp"))),
slazy _loc e),
cstream gloc secl)
+
(* Syntax extensions in Revised Syntax grammar *)
let _ =
let _ = (expr : 'expr Gram.Entry.t)
(Gram.Action.mk
(fun (pcl : 'parser_case_list)
(po : 'parser_ipatt option) _ _
- (e : 'sequence) _ (_loc : Loc.t) ->
+ (e : 'sequence) _ (_loc : Gram.Loc.t) ->
(cparser_match _loc e po pcl : 'expr))));
([ Gram.Skeyword "parser";
Gram.Sopt
'parser_case_list Gram.Entry.t)) ],
(Gram.Action.mk
(fun (pcl : 'parser_case_list)
- (po : 'parser_ipatt option) _ (_loc : Loc.t)
- -> (cparser _loc po pcl : 'expr)))) ]) ]))
+ (po : 'parser_ipatt option) _
+ (_loc : Gram.Loc.t) ->
+ (cparser _loc po pcl : 'expr)))) ]) ]))
());
Gram.extend (parser_case_list : 'parser_case_list Gram.Entry.t)
((fun () ->
(Gram.Entry.obj
(parser_case : 'parser_case Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (pc : 'parser_case) (_loc : Loc.t) ->
+ (fun (pc : 'parser_case) (_loc : Gram.Loc.t) ->
([ pc ] : 'parser_case_list))));
([ Gram.Skeyword "[";
Gram.Slist0sep
Gram.Skeyword "]" ],
(Gram.Action.mk
(fun _ (pcl : 'parser_case list) _
- (_loc : Loc.t) -> (pcl : 'parser_case_list)))) ]) ]))
+ (_loc : Gram.Loc.t) ->
+ (pcl : 'parser_case_list)))) ]) ]))
());
Gram.extend (parser_case : 'parser_case Gram.Entry.t)
((fun () ->
(Gram.Entry.obj (expr : 'expr Gram.Entry.t)) ],
(Gram.Action.mk
(fun (e : 'expr) _ (po : 'parser_ipatt option) _
- (sp : 'stream_patt) _ (_loc : Loc.t) ->
+ (sp : 'stream_patt) _ (_loc : Gram.Loc.t) ->
((sp, po, e) : 'parser_case)))) ]) ]))
());
Gram.extend (stream_begin : 'stream_begin Gram.Entry.t)
[ (None, None,
[ ([ Gram.Skeyword "[:" ],
(Gram.Action.mk
- (fun _ (_loc : Loc.t) -> (() : 'stream_begin)))) ]) ]))
+ (fun _ (_loc : Gram.Loc.t) ->
+ (() : 'stream_begin)))) ]) ]))
());
Gram.extend (stream_end : 'stream_end Gram.Entry.t)
((fun () ->
[ (None, None,
[ ([ Gram.Skeyword ":]" ],
(Gram.Action.mk
- (fun _ (_loc : Loc.t) -> (() : 'stream_end)))) ]) ]))
+ (fun _ (_loc : Gram.Loc.t) -> (() : 'stream_end)))) ]) ]))
());
Gram.extend (stream_quot : 'stream_quot Gram.Entry.t)
((fun () ->
[ (None, None,
[ ([ Gram.Skeyword "`" ],
(Gram.Action.mk
- (fun _ (_loc : Loc.t) -> (() : 'stream_quot)))) ]) ]))
+ (fun _ (_loc : Gram.Loc.t) ->
+ (() : 'stream_quot)))) ]) ]))
());
Gram.extend (stream_expr : 'stream_expr Gram.Entry.t)
((fun () ->
[ ([ Gram.Snterm
(Gram.Entry.obj (expr : 'expr Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (e : 'expr) (_loc : Loc.t) ->
+ (fun (e : 'expr) (_loc : Gram.Loc.t) ->
(e : 'stream_expr)))) ]) ]))
());
Gram.extend (stream_patt : 'stream_patt Gram.Entry.t)
[ (None, None,
[ ([],
(Gram.Action.mk
- (fun (_loc : Loc.t) -> ([] : 'stream_patt))));
+ (fun (_loc : Gram.Loc.t) -> ([] : 'stream_patt))));
([ Gram.Snterm
(Gram.Entry.obj
(stream_patt_comp :
'stream_patt_comp_err_list Gram.Entry.t)) ],
(Gram.Action.mk
(fun (sp : 'stream_patt_comp_err_list) _
- (spc : 'stream_patt_comp) (_loc : Loc.t) ->
- ((spc, None) :: sp : 'stream_patt))));
+ (spc : 'stream_patt_comp) (_loc : Gram.Loc.t)
+ -> ((spc, None) :: sp : 'stream_patt))));
([ Gram.Snterm
(Gram.Entry.obj
(stream_patt_comp :
'stream_patt_comp Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (spc : 'stream_patt_comp) (_loc : Loc.t) ->
+ (fun (spc : 'stream_patt_comp)
+ (_loc : Gram.Loc.t) ->
([ (spc, None) ] : 'stream_patt)))) ]) ]))
());
Gram.extend
'stream_expr Gram.Entry.t)) ],
(Gram.Action.mk
(fun (e : 'stream_expr) _
- (_loc : Loc.t) -> (e : 'e__8)))) ]) ],
+ (_loc : Gram.Loc.t) -> (e : 'e__7)))) ]) ],
(Gram.Action.mk
- (fun (eo : 'e__8 option)
- (spc : 'stream_patt_comp) (_loc : Loc.t) ->
- ((spc, eo) : 'stream_patt_comp_err)))) ]) ]))
+ (fun (eo : 'e__7 option)
+ (spc : 'stream_patt_comp) (_loc : Gram.Loc.t)
+ -> ((spc, eo) : 'stream_patt_comp_err)))) ]) ]))
());
Gram.extend
(stream_patt_comp_err_list :
Gram.Skeyword ";"; Gram.Sself ],
(Gram.Action.mk
(fun (sp : 'stream_patt_comp_err_list) _
- (spc : 'stream_patt_comp_err) (_loc : Loc.t)
- -> (spc :: sp : 'stream_patt_comp_err_list))));
+ (spc : 'stream_patt_comp_err)
+ (_loc : Gram.Loc.t) ->
+ (spc :: sp : 'stream_patt_comp_err_list))));
([ Gram.Snterm
(Gram.Entry.obj
(stream_patt_comp_err :
Gram.Skeyword ";" ],
(Gram.Action.mk
(fun _ (spc : 'stream_patt_comp_err)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
([ spc ] : 'stream_patt_comp_err_list))));
([ Gram.Snterm
(Gram.Entry.obj
'stream_patt_comp_err Gram.Entry.t)) ],
(Gram.Action.mk
(fun (spc : 'stream_patt_comp_err)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
([ spc ] : 'stream_patt_comp_err_list)))) ]) ]))
());
Gram.extend (stream_patt_comp : 'stream_patt_comp Gram.Entry.t)
[ ([ Gram.Snterm
(Gram.Entry.obj (patt : 'patt Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (p : 'patt) (_loc : Loc.t) ->
+ (fun (p : 'patt) (_loc : Gram.Loc.t) ->
(SpStr (_loc, p) : 'stream_patt_comp))));
([ Gram.Snterm
(Gram.Entry.obj (patt : 'patt Gram.Entry.t));
(stream_expr : 'stream_expr Gram.Entry.t)) ],
(Gram.Action.mk
(fun (e : 'stream_expr) _ (p : 'patt)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(SpNtr (_loc, p, e) : 'stream_patt_comp))));
([ Gram.Snterm
(Gram.Entry.obj
'stream_expr Gram.Entry.t)) ],
(Gram.Action.mk
(fun (e : 'stream_expr) _
- (_loc : Loc.t) -> (e : 'e__9)))) ]) ],
+ (_loc : Gram.Loc.t) -> (e : 'e__8)))) ]) ],
(Gram.Action.mk
- (fun (eo : 'e__9 option) (p : 'patt) _
- (_loc : Loc.t) ->
+ (fun (eo : 'e__8 option) (p : 'patt) _
+ (_loc : Gram.Loc.t) ->
(SpTrm (_loc, p, eo) : 'stream_patt_comp)))) ]) ]))
());
Gram.extend (parser_ipatt : 'parser_ipatt Gram.Entry.t)
[ (None, None,
[ ([ Gram.Skeyword "_" ],
(Gram.Action.mk
- (fun _ (_loc : Loc.t) ->
+ (fun _ (_loc : Gram.Loc.t) ->
(Ast.PaAny _loc : 'parser_ipatt))));
([ Gram.Snterm
(Gram.Entry.obj
(a_LIDENT : 'a_LIDENT Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (i : 'a_LIDENT) (_loc : Loc.t) ->
+ (fun (i : 'a_LIDENT) (_loc : Gram.Loc.t) ->
(Ast.PaId (_loc, Ast.IdLid (_loc, i)) :
'parser_ipatt)))) ]) ]))
());
(stream_end : 'stream_end Gram.Entry.t)) ],
(Gram.Action.mk
(fun _ (sel : 'stream_expr_comp_list) _
- (_loc : Loc.t) -> (cstream _loc sel : 'expr))));
+ (_loc : Gram.Loc.t) ->
+ (cstream _loc sel : 'expr))));
([ Gram.Snterm
(Gram.Entry.obj
(stream_begin : 'stream_begin Gram.Entry.t));
(Gram.Entry.obj
(stream_end : 'stream_end Gram.Entry.t)) ],
(Gram.Action.mk
- (fun _ _ (_loc : Loc.t) ->
+ (fun _ _ (_loc : Gram.Loc.t) ->
(cstream _loc [] : 'expr)))) ]) ]))
());
Gram.extend
(stream_expr_comp :
'stream_expr_comp Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (se : 'stream_expr_comp) (_loc : Loc.t) ->
+ (fun (se : 'stream_expr_comp)
+ (_loc : Gram.Loc.t) ->
([ se ] : 'stream_expr_comp_list))));
([ Gram.Snterm
(Gram.Entry.obj
'stream_expr_comp Gram.Entry.t));
Gram.Skeyword ";" ],
(Gram.Action.mk
- (fun _ (se : 'stream_expr_comp) (_loc : Loc.t)
- -> ([ se ] : 'stream_expr_comp_list))));
+ (fun _ (se : 'stream_expr_comp)
+ (_loc : Gram.Loc.t) ->
+ ([ se ] : 'stream_expr_comp_list))));
([ Gram.Snterm
(Gram.Entry.obj
(stream_expr_comp :
Gram.Skeyword ";"; Gram.Sself ],
(Gram.Action.mk
(fun (sel : 'stream_expr_comp_list) _
- (se : 'stream_expr_comp) (_loc : Loc.t) ->
- (se :: sel : 'stream_expr_comp_list)))) ]) ]))
+ (se : 'stream_expr_comp) (_loc : Gram.Loc.t)
+ -> (se :: sel : 'stream_expr_comp_list)))) ]) ]))
());
Gram.extend (stream_expr_comp : 'stream_expr_comp Gram.Entry.t)
((fun () ->
(Gram.Entry.obj
(stream_expr : 'stream_expr Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (e : 'stream_expr) (_loc : Loc.t) ->
+ (fun (e : 'stream_expr) (_loc : Gram.Loc.t) ->
(SeNtr (_loc, e) : 'stream_expr_comp))));
([ Gram.Snterm
(Gram.Entry.obj
(Gram.Entry.obj
(stream_expr : 'stream_expr Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (e : 'stream_expr) _ (_loc : Loc.t) ->
+ (fun (e : 'stream_expr) _ (_loc : Gram.Loc.t) ->
(SeTrm (_loc, e) : 'stream_expr_comp)))) ]) ]))
()))
+
end
- (*
- Gram.Entry.clear stream_expr;
- Gram.Entry.clear stream_expr;
- stream_expr:
- [ [ e = expr LEVEL "stream_expr" -> e ] ]
- ;
- stream_begin:
- [ [ "[<" -> () ] ]
- ;
- stream_end:
- [ [ ">]" -> () ] ]
- ;
- stream_quot:
- [ [ "'" -> () ] ]
- ;
- *)
+
module M = Register.OCamlSyntaxExtension(Id)(Make)
+
end
+
module G =
struct
open Camlp4
+
(* -*- camlp4r -*- *)
(****************************************************************************)
(* *)
* - Nicolas Pouillard: refactoring
*)
module Id =
- struct
- let name = "Camlp4GrammarParser"
- let version =
- "$Id: Camlp4GrammarParser.ml,v 1.1.4.4 2007/04/20 14:57:28 pouillar Exp $"
- end
+ struct let name = "Camlp4GrammarParser"
+ let version = "$Id$"
+ end
+
module Make (Syntax : Sig.Camlp4Syntax) =
struct
open Sig
+
include Syntax
+
module MetaLoc = Ast.Meta.MetaGhostLoc
+
module MetaAst = Ast.Meta.Make(MetaLoc)
+
module PP = Camlp4.Printers.OCaml.Make(Syntax)
+
let pp = new PP.printer ~comments: false ()
+
let string_of_patt patt =
let buf = Buffer.create 42 in
let () = Format.bprintf buf "%a@?" pp#patt patt in
let str = Buffer.contents buf
in if str = "" then assert false else str
+
let split_ext = ref false
+
type loc = Loc.t
+
type 'e name = { expr : 'e; tvar : string; loc : loc }
+
type styp =
- | STlid of loc * string | STapp of loc * styp * styp
- | STquo of loc * string | STself of loc * string | STtok of loc
- | STstring_tok of loc | STany of loc | STtyp of Ast.ctyp
+ | STlid of loc * string
+ | STapp of loc * styp * styp
+ | STquo of loc * string
+ | STself of loc * string
+ | STtok of loc
+ | STstring_tok of loc
+ | STtyp of Ast.ctyp
+
type (** The first is the match function expr,
the second is the string description.
The description string will be used for
('e, 'p) text =
| TXmeta of loc * string * (('e, 'p) text) list * 'e * styp
| TXlist of loc * bool * ('e, 'p) symbol * (('e, 'p) symbol) option
- | TXnext of loc | TXnterm of loc * 'e name * string option
+ | TXnext of loc
+ | TXnterm of loc * 'e name * string option
| TXopt of loc * ('e, 'p) text
| TXrules of loc * (((('e, 'p) text) list) * 'e) list
- | TXself of loc | TXkwd of loc * string
+ | TXself of loc
+ | TXkwd of loc * string
| TXtok of loc * 'e * string
and ('e, 'p) entry =
{ name : 'e name; pos : 'e option; levels : (('e, 'p) level) list
{ used : string list; text : ('e, 'p) text; styp : styp;
pattern : 'p option
}
+
type used = | Unused | UsedScanned | UsedNotScanned
+
let _loc = Loc.ghost
+
let gm = "Camlp4Grammar__"
+
let mark_used modif ht n =
try
let rll = Hashtbl.find_all ht n
else ())
rll
with | Not_found -> ()
+
let rec mark_symbol modif ht symb =
List.iter (fun e -> mark_used modif ht e) symb.used
+
let check_use nl el =
let ht = Hashtbl.create 301 in
let modif = ref false
("Unused local entry \"" ^ (s ^ "\""))
else ())
ht)
+
let new_type_var =
let i = ref 0 in fun () -> (incr i; "e__" ^ (string_of_int !i))
+
let used_of_rule_list rl =
List.fold_left
(fun nl r -> List.fold_left (fun nl s -> s.used @ nl) nl r.prod)
[] rl
+
let retype_rule_list_without_patterns _loc rl =
try
- (* ...; [ "foo" ]; ... ==> ...; (x = [ "foo" ] -> Token.extract_string x); ... *)
+ (* ...; [ "foo" ]; ... ==> ...; (x = [ "foo" ] -> Gram.Token.extract_string x); ... *)
(* ...; [ symb ]; ... ==> ...; (x = [ symb ] -> x); ... *)
(* ...; ([] -> a); ... *)
List.map
Some
(Ast.ExApp (_loc,
Ast.ExId (_loc,
- Ast.IdAcc (_loc, Ast.IdUid (_loc, "Token"),
- Ast.IdLid (_loc, "extract_string"))),
+ Ast.IdAcc (_loc, Ast.IdUid (_loc, gm),
+ Ast.IdAcc (_loc, Ast.IdUid (_loc, "Token"),
+ Ast.IdLid (_loc, "extract_string")))),
Ast.ExId (_loc, Ast.IdLid (_loc, "x"))));
}
| { prod = [ ({ pattern = None } as s) ]; action = None } ->
| _ -> raise Exit)
rl
with | Exit -> rl
+
let meta_action = ref false
+
let mklistexp _loc =
let rec loop top =
function
e1),
loop false el)
in loop true
+
let mklistpat _loc =
let rec loop top =
function
p1),
loop false pl)
in loop true
+
let rec expr_fa al =
function
| Ast.ExApp (_, f, a) -> expr_fa (a :: al) f
| f -> (f, al)
+
let rec make_ctyp styp tvar =
match styp with
| STlid (_loc, s) -> Ast.TyId (_loc, Ast.IdLid (_loc, s))
(Stream.Error
("'" ^ (x ^ "' illegal in anonymous entry level")))
else Ast.TyQuo (_loc, tvar)
- | STany _loc -> Ast.TyAny _loc
| STtok _loc ->
Ast.TyId (_loc,
Ast.IdAcc (_loc,
Ast.IdLid (_loc, "t")))
| STstring_tok _loc -> Ast.TyId (_loc, Ast.IdLid (_loc, "string"))
| STtyp t -> t
+
let make_ctyp_patt styp tvar patt =
let styp =
match styp with | STstring_tok _loc -> STtok _loc | t -> t
| Ast.TyAny _ -> patt
| t ->
let _loc = Ast.loc_of_patt patt in Ast.PaTyc (_loc, patt, t)
+
let make_ctyp_expr styp tvar expr =
match make_ctyp styp tvar with
| Ast.TyAny _ -> expr
| t -> let _loc = Ast.loc_of_expr expr in Ast.ExTyc (_loc, expr, t)
+
let text_of_action _loc psl rtvar act tvar =
let locid = Ast.PaId (_loc, Ast.IdLid (_loc, !Loc.name)) in
let act =
Ast.McArr (_loc,
Ast.PaTyc (_loc, locid,
Ast.TyId (_loc,
- Ast.IdAcc (_loc, Ast.IdUid (_loc, "Loc"),
+ Ast.IdAcc (_loc,
+ Ast.IdAcc (_loc, Ast.IdUid (_loc, gm),
+ Ast.IdUid (_loc, "Loc")),
Ast.IdLid (_loc, "t")))),
Ast.ExNil _loc, e2)) in
let (txt, _) =
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Action"),
Ast.IdLid (_loc, "mk")))),
txt)
+
let srules loc t rl tvar =
List.map
(fun r ->
let sl = List.map (fun s -> s.text) r.prod in
let ac = text_of_action loc r.prod t r.action tvar in (sl, ac))
rl
+
let rec make_expr entry tvar =
function
| TXmeta (_loc, n, tl, e, t) ->
Ast.ExTup (_loc, Ast.ExCom (_loc, sl, ac))),
txt))
(Ast.ExId (_loc, Ast.IdUid (_loc, "[]"))) rl
+
let expr_of_delete_rule _loc n sl =
let sl =
List.fold_right
e))
sl (Ast.ExId (_loc, Ast.IdUid (_loc, "[]")))
in ((n.expr), sl)
+
let rec tvar_of_ident =
function
| Ast.IdLid (_, x) | Ast.IdUid (_, x) -> x
| Ast.IdAcc (_, (Ast.IdUid (_, x)), xs) ->
x ^ ("__" ^ (tvar_of_ident xs))
| _ -> failwith "internal error in the Grammar extension"
+
let mk_name _loc i =
{ expr = Ast.ExId (_loc, i); tvar = tvar_of_ident i; loc = _loc; }
+
let slist loc min sep symb = TXlist (loc, min, symb, sep)
- let sstoken _loc s =
- let n = mk_name _loc (Ast.IdLid (_loc, "a_" ^ s))
- in TXnterm (_loc, n, None)
- let mk_symbol p s t =
- { used = []; text = s; styp = t; pattern = Some p; }
- let sslist _loc min sep s =
- let rl =
- let r1 =
- let prod =
- let n = mk_name _loc (Ast.IdLid (_loc, "a_list"))
- in
- [ mk_symbol (Ast.PaId (_loc, Ast.IdLid (_loc, "a")))
- (TXnterm (_loc, n, None)) (STquo (_loc, "a_list")) ] in
- let act = Ast.ExId (_loc, Ast.IdLid (_loc, "a"))
- in { prod = prod; action = Some act; } in
- let r2 =
- let prod =
- [ mk_symbol (Ast.PaId (_loc, Ast.IdLid (_loc, "a")))
- (slist _loc min sep s)
- (STapp (_loc, STlid (_loc, "list"), s.styp)) ] in
- let act =
- Ast.ExApp (_loc,
- Ast.ExId (_loc,
- Ast.IdAcc (_loc, Ast.IdUid (_loc, "Qast"),
- Ast.IdUid (_loc, "List"))),
- Ast.ExId (_loc, Ast.IdLid (_loc, "a")))
- in { prod = prod; action = Some act; }
- in [ r1; r2 ] in
- let used =
- match sep with | Some symb -> symb.used @ s.used | None -> s.used in
- let used = "a_list" :: used in
- let text = TXrules (_loc, srules _loc "a_list" rl "") in
- let styp = STquo (_loc, "a_list")
- in { used = used; text = text; styp = styp; pattern = None; }
- let ssopt _loc s =
- let rl =
- let r1 =
- let prod =
- let n = mk_name _loc (Ast.IdLid (_loc, "a_opt"))
- in
- [ mk_symbol (Ast.PaId (_loc, Ast.IdLid (_loc, "a")))
- (TXnterm (_loc, n, None)) (STquo (_loc, "a_opt")) ] in
- let act = Ast.ExId (_loc, Ast.IdLid (_loc, "a"))
- in { prod = prod; action = Some act; } in
- let r2 =
- let s =
- match s.text with
- | TXkwd (_loc, _) | TXtok (_loc, _, _) ->
- let rl =
- [ {
- prod =
- [ {
- (s)
- with
- pattern =
- Some
- (Ast.PaId (_loc, Ast.IdLid (_loc, "x")));
- } ];
- action =
- Some
- (Ast.ExApp (_loc,
- Ast.ExId (_loc,
- Ast.IdAcc (_loc, Ast.IdUid (_loc, "Qast"),
- Ast.IdUid (_loc, "Str"))),
- Ast.ExApp (_loc,
- Ast.ExId (_loc,
- Ast.IdAcc (_loc,
- Ast.IdUid (_loc, "Token"),
- Ast.IdLid (_loc, "extract_string"))),
- Ast.ExId (_loc, Ast.IdLid (_loc, "x")))));
- } ] in
- let t = new_type_var ()
- in
- {
- used = [];
- text = TXrules (_loc, srules _loc t rl "");
- styp = STquo (_loc, t);
- pattern = None;
- }
- | _ -> s in
- let prod =
- [ mk_symbol (Ast.PaId (_loc, Ast.IdLid (_loc, "a")))
- (TXopt (_loc, s.text))
- (STapp (_loc, STlid (_loc, "option"), s.styp)) ] in
- let act =
- Ast.ExApp (_loc,
- Ast.ExId (_loc,
- Ast.IdAcc (_loc, Ast.IdUid (_loc, "Qast"),
- Ast.IdUid (_loc, "Option"))),
- Ast.ExId (_loc, Ast.IdLid (_loc, "a")))
- in { prod = prod; action = Some act; }
- in [ r1; r2 ] in
- let used = "a_opt" :: s.used in
- let text = TXrules (_loc, srules _loc "a_opt" rl "") in
- let styp = STquo (_loc, "a_opt")
- in { used = used; text = text; styp = styp; pattern = None; }
+
+ (*
+ value sstoken _loc s =
+ let n = mk_name _loc <:ident< $lid:"a_" ^ s$ >> in
+ TXnterm _loc n None
+ ;
+
+ value mk_symbol p s t =
+ {used = []; text = s; styp = t; pattern=Some p};
+
+ value sslist _loc min sep s =
+ let rl =
+ let r1 =
+ let prod =
+ let n = mk_name _loc <:ident< a_list >> in
+ [mk_symbol <:patt< a >> (TXnterm _loc n None) (STquo _loc "a_list")]
+ in
+ let act = <:expr< a >> in
+ {prod = prod; action = Some act}
+ in
+ let r2 =
+ let prod =
+ [mk_symbol <:patt< a >> (slist _loc min sep s)
+ (STapp _loc (STlid _loc "list") s.styp)]
+ in
+ let act = <:expr< Qast.List a >> in
+ {prod = prod; action = Some act}
+ in
+ [r1; r2]
+ in
+ let used =
+ match sep with
+ [ Some symb -> symb.used @ s.used
+ | None -> s.used ]
+ in
+ let used = ["a_list" :: used] in
+ let text = TXrules _loc (srules _loc "a_list" rl "") in
+ let styp = STquo _loc "a_list" in
+ {used = used; text = text; styp = styp; pattern = None}
+ ;
+
+ value ssopt _loc s =
+ let rl =
+ let r1 =
+ let prod =
+ let n = mk_name _loc <:ident< a_opt >> in
+ [mk_symbol <:patt< a >> (TXnterm _loc n None) (STquo _loc "a_opt")]
+ in
+ let act = <:expr< a >> in
+ {prod = prod; action = Some act}
+ in
+ let r2 =
+ let s =
+ match s.text with
+ [ TXkwd _loc _ | TXtok _loc _ _ ->
+ let rl =
+ [{prod = [{ (s) with pattern = Some <:patt< x >> }];
+ action = Some <:expr< Qast.Str (Token.extract_string x) >>}]
+ in
+ let t = new_type_var () in
+ {used = []; text = TXrules _loc (srules _loc t rl "");
+ styp = STquo _loc t; pattern = None}
+ | _ -> s ]
+ in
+ let prod =
+ [mk_symbol <:patt< a >> (TXopt _loc s.text)
+ (STapp _loc (STlid _loc "option") s.styp)]
+ in
+ let act = <:expr< Qast.Option a >> in
+ {prod = prod; action = Some act}
+ in
+ [r1; r2]
+ in
+ let used = ["a_opt" :: s.used] in
+ let text = TXrules _loc (srules _loc "a_opt" rl "") in
+ let styp = STquo _loc "a_opt" in
+ {used = used; text = text; styp = styp; pattern = None}
+ ;
+ *)
let text_of_entry _loc e =
let ent =
let x = e.name in
in txt)
e.levels (Ast.ExId (_loc, Ast.IdUid (_loc, "[]")))
in (ent, pos, txt)
+
let let_in_of_extend _loc gram gl el args =
match gl with
| None -> args
xs
(Ast.BiEq (_loc, Ast.PaAny _loc, expr_of_name x))
in Ast.ExLet (_loc, Ast.BFalse, globals, e)))
+
class subst gmod =
object inherit Ast.map as super
+
method ident =
function
| Ast.IdUid (_, x) when x = gm -> gmod
| x -> super#ident x
+
end
+
let subst_gmod ast gmod = (new subst gmod)#expr ast
+
let text_of_functorial_extend _loc gmod gram gl el =
let args =
let el =
List.fold_left (fun acc x -> Ast.ExSem (_loc, acc, x)) e
el)
in subst_gmod (let_in_of_extend _loc gram gl el args) gmod
+
let wildcarder =
object (self)
inherit Ast.map as super
+
method patt =
function
| Ast.PaId (_loc, (Ast.IdLid (_, _))) -> Ast.PaAny _loc
| Ast.PaAli (_, p, _) -> self#patt p
| p -> super#patt p
+
end
+
let mk_tok _loc p t =
let p' = wildcarder#patt p in
let match_fun =
let descr = string_of_patt p' in
let text = TXtok (_loc, match_fun, descr)
in { used = []; text = text; styp = t; pattern = Some p; }
+
let symbol = Gram.Entry.mk "symbol"
+
let check_not_tok s =
match s with
| { text = TXtok (_loc, _, _) } ->
("Deprecated syntax, use a sub rule. " ^
"LIST0 STRING becomes LIST0 [ x = STRING -> x ]"))
| _ -> ()
+
let _ = Camlp4_config.antiquotations := true
+
let _ =
let _ = (expr : 'expr Gram.Entry.t)
and _ = (symbol : 'symbol Gram.Entry.t) in
[ (None, None,
[ ([ Gram.Skeyword "GEXTEND" ],
(Gram.Action.mk
- (fun _ (_loc : Loc.t) ->
+ (fun _ (_loc : Gram.Loc.t) ->
(Loc.raise _loc
(Stream.Error
"Deprecated syntax, use EXTEND MyGramModule ... END instead") :
'expr))));
([ Gram.Skeyword "GDELETE_RULE" ],
(Gram.Action.mk
- (fun _ (_loc : Loc.t) ->
+ (fun _ (_loc : Gram.Loc.t) ->
(Loc.raise _loc
(Stream.Error
"Deprecated syntax, use DELETE_RULE MyGramModule ... END instead") :
'delete_rule_body Gram.Entry.t));
Gram.Skeyword "END" ],
(Gram.Action.mk
- (fun _ (e : 'delete_rule_body) _ (_loc : Loc.t)
- -> (e : 'expr))));
+ (fun _ (e : 'delete_rule_body) _
+ (_loc : Gram.Loc.t) -> (e : 'expr))));
([ Gram.Skeyword "EXTEND";
Gram.Snterm
(Gram.Entry.obj
(extend_body : 'extend_body Gram.Entry.t));
Gram.Skeyword "END" ],
(Gram.Action.mk
- (fun _ (e : 'extend_body) _ (_loc : Loc.t) ->
- (e : 'expr)))) ]) ]))
+ (fun _ (e : 'extend_body) _ (_loc : Gram.Loc.t)
+ -> (e : 'expr)))) ]) ]))
());
Gram.extend (extend_header : 'extend_header Gram.Entry.t)
((fun () ->
(Gram.Entry.obj
(qualuid : 'qualuid Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (g : 'qualuid) (_loc : Loc.t) ->
+ (fun (g : 'qualuid) (_loc : Gram.Loc.t) ->
((None, g) : 'extend_header))));
([ Gram.Skeyword "(";
Gram.Snterm
Gram.Skeyword ")" ],
(Gram.Action.mk
(fun _ (t : 't_qualid) _ (i : 'qualid) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(((Some i), t) : 'extend_header)))) ]) ]))
());
Gram.extend (extend_body : 'extend_body Gram.Entry.t)
(semi_sep :
'semi_sep Gram.Entry.t)) ],
(Gram.Action.mk
- (fun _ (e : 'entry) (_loc : Loc.t) ->
- (e : 'e__10)))) ]) ],
+ (fun _ (e : 'entry)
+ (_loc : Gram.Loc.t) -> (e : 'e__9)))) ]) ],
(Gram.Action.mk
- (fun (el : 'e__10 list)
+ (fun (el : 'e__9 list)
(global_list : 'global option)
- ((gram, g) : 'extend_header) (_loc : Loc.t)
- ->
+ ((gram, g) : 'extend_header)
+ (_loc : Gram.Loc.t) ->
(text_of_functorial_extend _loc g gram
global_list el :
'extend_body)))) ]) ]))
(semi_sep : 'semi_sep Gram.Entry.t))) ],
(Gram.Action.mk
(fun (sl : 'symbol list) _ (n : 'name)
- (g : 'qualuid) (_loc : Loc.t) ->
+ (g : 'qualuid) (_loc : Gram.Loc.t) ->
(let (e, b) = expr_of_delete_rule _loc n sl
in
subst_gmod
"UIDENT \"GLOBAL\"")) ],
(Gram.Action.mk
(fun (__camlp4_0 : Gram.Token.t)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
- | UIDENT "GLOBAL" -> (() : 'e__11)
+ | UIDENT "GLOBAL" -> (() : 'e__10)
| _ -> assert false)));
([ Gram.Stoken
(((function
"LIDENT ((_))")) ],
(Gram.Action.mk
(fun (__camlp4_0 : Gram.Token.t)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
- | LIDENT ((_)) -> (() : 'e__11)
+ | LIDENT ((_)) -> (() : 'e__10)
| _ -> assert false))) ] ],
(Gram.Action.mk
- (fun _ (_loc : Loc.t) ->
+ (fun _ (_loc : Gram.Loc.t) ->
(Loc.raise _loc
(Stream.Error
"Deprecated syntax, the grammar module is expected") :
(((function | UIDENT ((_)) -> true | _ -> false),
"UIDENT _")) ],
(Gram.Action.mk
- (fun (i : Gram.Token.t) (_loc : Loc.t) ->
+ (fun (i : Gram.Token.t) (_loc : Gram.Loc.t) ->
(let i = Gram.Token.extract_string i
in Ast.IdUid (_loc, i) : 'qualuid))));
([ Gram.Stoken
Gram.Skeyword "."; Gram.Sself ],
(Gram.Action.mk
(fun (xs : 'qualuid) _ (x : Gram.Token.t)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(let x = Gram.Token.extract_string x
in Ast.IdAcc (_loc, Ast.IdUid (_loc, x), xs) :
'qualuid)))) ]) ]))
"UIDENT \"GLOBAL\"")) ],
(Gram.Action.mk
(fun (__camlp4_0 : Gram.Token.t)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
- | UIDENT "GLOBAL" -> (() : 'e__12)
+ | UIDENT "GLOBAL" -> (() : 'e__11)
| _ -> assert false)));
([ Gram.Stoken
(((function
"LIDENT ((_))")) ],
(Gram.Action.mk
(fun (__camlp4_0 : Gram.Token.t)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
- | LIDENT ((_)) -> (() : 'e__12)
+ | LIDENT ((_)) -> (() : 'e__11)
| _ -> assert false))) ] ],
(Gram.Action.mk
- (fun _ (_loc : Loc.t) ->
+ (fun _ (_loc : Gram.Loc.t) ->
(Loc.raise _loc
(Stream.Error
"Deprecated syntax, the grammar module is expected") :
(((function | UIDENT ((_)) -> true | _ -> false),
"UIDENT _")) ],
(Gram.Action.mk
- (fun (i : Gram.Token.t) (_loc : Loc.t) ->
+ (fun (i : Gram.Token.t) (_loc : Gram.Loc.t) ->
(let i = Gram.Token.extract_string i
in Ast.IdUid (_loc, i) : 'qualuid))));
([ Gram.Stoken
Gram.Skeyword "."; Gram.Sself ],
(Gram.Action.mk
(fun (xs : 'qualuid) _ (x : Gram.Token.t)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(let x = Gram.Token.extract_string x
in Ast.IdAcc (_loc, Ast.IdUid (_loc, x), xs) :
'qualuid)))) ]) ]))
(((function | LIDENT ((_)) -> true | _ -> false),
"LIDENT _")) ],
(Gram.Action.mk
- (fun (i : Gram.Token.t) (_loc : Loc.t) ->
+ (fun (i : Gram.Token.t) (_loc : Gram.Loc.t) ->
(let i = Gram.Token.extract_string i
in Ast.IdLid (_loc, i) : 'qualid))));
([ Gram.Stoken
(((function | UIDENT ((_)) -> true | _ -> false),
"UIDENT _")) ],
(Gram.Action.mk
- (fun (i : Gram.Token.t) (_loc : Loc.t) ->
+ (fun (i : Gram.Token.t) (_loc : Gram.Loc.t) ->
(let i = Gram.Token.extract_string i
in Ast.IdUid (_loc, i) : 'qualid))));
([ Gram.Stoken
Gram.Skeyword "."; Gram.Sself ],
(Gram.Action.mk
(fun (xs : 'qualid) _ (x : Gram.Token.t)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(let x = Gram.Token.extract_string x
in Ast.IdAcc (_loc, Ast.IdUid (_loc, x), xs) :
'qualid)))) ]) ]))
| _ -> false),
"LIDENT _ | UIDENT _")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| LIDENT _ | UIDENT _ ->
(Loc.raise _loc
"LIDENT \"t\"")) ],
(Gram.Action.mk
(fun (__camlp4_0 : Gram.Token.t) _
- (x : Gram.Token.t) (_loc : Loc.t) ->
+ (x : Gram.Token.t) (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| LIDENT "t" ->
(let x = Gram.Token.extract_string x
Gram.Skeyword "."; Gram.Sself ],
(Gram.Action.mk
(fun (xs : 't_qualid) _ (x : Gram.Token.t)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(let x = Gram.Token.extract_string x
in Ast.IdAcc (_loc, Ast.IdUid (_loc, x), xs) :
't_qualid)))) ]) ]))
(semi_sep : 'semi_sep Gram.Entry.t)) ],
(Gram.Action.mk
(fun _ (sl : 'name list) _
- (__camlp4_0 : Gram.Token.t) (_loc : Loc.t) ->
+ (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| UIDENT "GLOBAL" -> (sl : 'global)
| _ -> assert false))) ]) ]))
(level_list : 'level_list Gram.Entry.t)) ],
(Gram.Action.mk
(fun (ll : 'level_list) (pos : 'position option)
- _ (n : 'name) (_loc : Loc.t) ->
+ _ (n : 'name) (_loc : Gram.Loc.t) ->
({ name = n; pos = pos; levels = ll; } :
'entry)))) ]) ]))
());
(Gram.Entry.obj (string : 'string Gram.Entry.t)) ],
(Gram.Action.mk
(fun (n : 'string) (__camlp4_0 : Gram.Token.t)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| UIDENT "LEVEL" ->
(Ast.ExApp (_loc,
(Gram.Entry.obj (string : 'string Gram.Entry.t)) ],
(Gram.Action.mk
(fun (n : 'string) (__camlp4_0 : Gram.Token.t)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| UIDENT "AFTER" ->
(Ast.ExApp (_loc,
(Gram.Entry.obj (string : 'string Gram.Entry.t)) ],
(Gram.Action.mk
(fun (n : 'string) (__camlp4_0 : Gram.Token.t)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| UIDENT "BEFORE" ->
(Ast.ExApp (_loc,
| _ -> false),
"UIDENT \"LAST\"")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| UIDENT "LAST" ->
(Ast.ExId (_loc,
| _ -> false),
"UIDENT \"FIRST\"")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| UIDENT "FIRST" ->
(Ast.ExId (_loc,
Gram.Skeyword "|");
Gram.Skeyword "]" ],
(Gram.Action.mk
- (fun _ (ll : 'level list) _ (_loc : Loc.t) ->
- (ll : 'level_list)))) ]) ]))
+ (fun _ (ll : 'level list) _ (_loc : Gram.Loc.t)
+ -> (ll : 'level_list)))) ]) ]))
());
Gram.extend (level : 'level Gram.Entry.t)
((fun () ->
| _ -> false),
"STRING _")) ],
(Gram.Action.mk
- (fun (x : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (x : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
(let x =
Gram.Token.extract_string x
- in x : 'e__13)))) ]);
+ in x : 'e__12)))) ]);
Gram.Sopt
(Gram.Snterm
(Gram.Entry.obj
(rule_list : 'rule_list Gram.Entry.t)) ],
(Gram.Action.mk
(fun (rules : 'rule_list) (ass : 'assoc option)
- (lab : 'e__13 option) (_loc : Loc.t) ->
+ (lab : 'e__12 option) (_loc : Gram.Loc.t) ->
({ label = lab; assoc = ass; rules = rules; } :
'level)))) ]) ]))
());
| _ -> false),
"UIDENT \"NONA\"")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| UIDENT "NONA" ->
(Ast.ExId (_loc,
| _ -> false),
"UIDENT \"RIGHTA\"")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| UIDENT "RIGHTA" ->
(Ast.ExId (_loc,
| _ -> false),
"UIDENT \"LEFTA\"")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| UIDENT "LEFTA" ->
(Ast.ExId (_loc,
Gram.Skeyword "|");
Gram.Skeyword "]" ],
(Gram.Action.mk
- (fun _ (rules : 'rule list) _ (_loc : Loc.t) ->
+ (fun _ (rules : 'rule list) _
+ (_loc : Gram.Loc.t) ->
(retype_rule_list_without_patterns _loc rules :
'rule_list))));
([ Gram.Skeyword "["; Gram.Skeyword "]" ],
(Gram.Action.mk
- (fun _ _ (_loc : Loc.t) -> ([] : 'rule_list)))) ]) ]))
+ (fun _ _ (_loc : Gram.Loc.t) ->
+ ([] : 'rule_list)))) ]) ]))
());
Gram.extend (rule : 'rule Gram.Entry.t)
((fun () ->
(Gram.Entry.obj
(semi_sep : 'semi_sep Gram.Entry.t))) ],
(Gram.Action.mk
- (fun (psl : 'psymbol list) (_loc : Loc.t) ->
- ({ prod = psl; action = None; } : 'rule))));
+ (fun (psl : 'psymbol list) (_loc : Gram.Loc.t)
+ -> ({ prod = psl; action = None; } : 'rule))));
([ Gram.Slist0sep
(Gram.Snterm
(Gram.Entry.obj
(Gram.Entry.obj (expr : 'expr Gram.Entry.t)) ],
(Gram.Action.mk
(fun (act : 'expr) _ (psl : 'psymbol list)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
({ prod = psl; action = Some act; } : 'rule)))) ]) ]))
());
Gram.extend (psymbol : 'psymbol Gram.Entry.t)
[ ([ Gram.Snterm
(Gram.Entry.obj (symbol : 'symbol Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (s : 'symbol) (_loc : Loc.t) ->
+ (fun (s : 'symbol) (_loc : Gram.Loc.t) ->
(s : 'psymbol))));
([ Gram.Snterm
(Gram.Entry.obj
(Gram.Entry.obj (symbol : 'symbol Gram.Entry.t)) ],
(Gram.Action.mk
(fun (s : 'symbol) _ (p : 'pattern)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(match s.pattern with
| Some
(Ast.PaApp (_,
(Gram.Action.mk
(fun (s : Gram.Token.t)
(__camlp4_0 : Gram.Token.t)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| UIDENT "LEVEL" ->
(let s =
Gram.Token.extract_string s
- in s : 'e__14)
+ in s : 'e__13)
| _ -> assert false))) ]) ],
(Gram.Action.mk
- (fun (lev : 'e__14 option) (i : Gram.Token.t)
- (_loc : Loc.t) ->
+ (fun (lev : 'e__13 option) (i : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
(let i = Gram.Token.extract_string i in
let name =
mk_name _loc (Ast.IdLid (_loc, i)) in
(Gram.Entry.obj (symbol : 'symbol Gram.Entry.t)) ],
(Gram.Action.mk
(fun (s : 'symbol) _ (p : Gram.Token.t)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(let p = Gram.Token.extract_string p
in
match s.pattern with
Gram.Sself ],
(Gram.Action.mk
(fun (s : 'symbol) (__camlp4_0 : Gram.Token.t)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| UIDENT "OPT" ->
(let () = check_not_tok s in
(Gram.Action.mk
(fun (t : 'symbol)
(__camlp4_0 : Gram.Token.t)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
- | UIDENT "SEP" -> (t : 'e__16)
+ | UIDENT "SEP" -> (t : 'e__15)
| _ -> assert false))) ]) ],
(Gram.Action.mk
- (fun (sep : 'e__16 option) (s : 'symbol)
- (__camlp4_0 : Gram.Token.t) (_loc : Loc.t) ->
+ (fun (sep : 'e__15 option) (s : 'symbol)
+ (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| UIDENT "LIST1" ->
(let () = check_not_tok s in
(Gram.Action.mk
(fun (t : 'symbol)
(__camlp4_0 : Gram.Token.t)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
- | UIDENT "SEP" -> (t : 'e__15)
+ | UIDENT "SEP" -> (t : 'e__14)
| _ -> assert false))) ]) ],
(Gram.Action.mk
- (fun (sep : 'e__15 option) (s : 'symbol)
- (__camlp4_0 : Gram.Token.t) (_loc : Loc.t) ->
+ (fun (sep : 'e__14 option) (s : 'symbol)
+ (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| UIDENT "LIST0" ->
(let () = check_not_tok s in
(None, None,
[ ([ Gram.Skeyword "("; Gram.Sself; Gram.Skeyword ")" ],
(Gram.Action.mk
- (fun _ (s_t : 'symbol) _ (_loc : Loc.t) ->
+ (fun _ (s_t : 'symbol) _ (_loc : Gram.Loc.t) ->
(s_t : 'symbol))));
([ Gram.Snterm
(Gram.Entry.obj (name : 'name Gram.Entry.t));
(Gram.Action.mk
(fun (s : Gram.Token.t)
(__camlp4_0 : Gram.Token.t)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| UIDENT "LEVEL" ->
(let s =
Gram.Token.extract_string s
- in s : 'e__18)
+ in s : 'e__17)
| _ -> assert false))) ]) ],
(Gram.Action.mk
- (fun (lev : 'e__18 option) (n : 'name)
- (_loc : Loc.t) ->
+ (fun (lev : 'e__17 option) (n : 'name)
+ (_loc : Gram.Loc.t) ->
({
used = [ n.tvar ];
text = TXnterm (_loc, n, lev);
(Gram.Action.mk
(fun (s : Gram.Token.t)
(__camlp4_0 : Gram.Token.t)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| UIDENT "LEVEL" ->
(let s =
Gram.Token.extract_string s
- in s : 'e__17)
+ in s : 'e__16)
| _ -> assert false))) ]) ],
(Gram.Action.mk
- (fun (lev : 'e__17 option) (il : 'qualid) _
- (i : Gram.Token.t) (_loc : Loc.t) ->
+ (fun (lev : 'e__16 option) (il : 'qualid) _
+ (i : Gram.Token.t) (_loc : Gram.Loc.t) ->
(let i = Gram.Token.extract_string i in
let n =
mk_name _loc
(((function | STRING ((_)) -> true | _ -> false),
"STRING _")) ],
(Gram.Action.mk
- (fun (s : Gram.Token.t) (_loc : Loc.t) ->
+ (fun (s : Gram.Token.t) (_loc : Gram.Loc.t) ->
(let s = Gram.Token.extract_string s
in
{
"ANTIQUOT (\"\", _)")) ],
(Gram.Action.mk
(fun (__camlp4_0 : Gram.Token.t)
- (x : Gram.Token.t) (_loc : Loc.t) ->
+ (x : Gram.Token.t) (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ("", s) ->
(let x = Gram.Token.extract_string x in
"STRING _")) ],
(Gram.Action.mk
(fun (s : Gram.Token.t) (x : Gram.Token.t)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(let s = Gram.Token.extract_string s in
let x = Gram.Token.extract_string x
in
(((function | UIDENT ((_)) -> true | _ -> false),
"UIDENT _")) ],
(Gram.Action.mk
- (fun (x : Gram.Token.t) (_loc : Loc.t) ->
+ (fun (x : Gram.Token.t) (_loc : Gram.Loc.t) ->
(let x = Gram.Token.extract_string x
in
mk_tok _loc
Gram.Snterm
(Gram.Entry.obj (patt : 'patt Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (p : 'patt) _ (_loc : Loc.t) ->
+ (fun (p : 'patt) _ (_loc : Gram.Loc.t) ->
(mk_tok _loc p (STtok _loc) : 'symbol))));
([ Gram.Skeyword "[";
Gram.Slist0sep
Gram.Skeyword "|");
Gram.Skeyword "]" ],
(Gram.Action.mk
- (fun _ (rl : 'rule list) _ (_loc : Loc.t) ->
+ (fun _ (rl : 'rule list) _ (_loc : Gram.Loc.t)
+ ->
(let rl =
retype_rule_list_without_patterns _loc rl in
let t = new_type_var ()
| _ -> false),
"UIDENT \"NEXT\"")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| UIDENT "NEXT" ->
({
| _ -> false),
"UIDENT \"SELF\"")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| UIDENT "SELF" ->
({
Gram.Skeyword ")" ],
(Gram.Action.mk
(fun _ (p2 : 'comma_patt) _ (p1 : 'pattern) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.PaTup (_loc, Ast.PaCom (_loc, p1, p2)) :
'pattern))));
([ Gram.Skeyword "("; Gram.Sself; Gram.Skeyword ")" ],
(Gram.Action.mk
- (fun _ (p : 'pattern) _ (_loc : Loc.t) ->
+ (fun _ (p : 'pattern) _ (_loc : Gram.Loc.t) ->
(p : 'pattern))));
([ Gram.Skeyword "_" ],
(Gram.Action.mk
- (fun _ (_loc : Loc.t) ->
+ (fun _ (_loc : Gram.Loc.t) ->
(Ast.PaAny _loc : 'pattern))));
([ Gram.Stoken
(((function | LIDENT ((_)) -> true | _ -> false),
"LIDENT _")) ],
(Gram.Action.mk
- (fun (i : Gram.Token.t) (_loc : Loc.t) ->
+ (fun (i : Gram.Token.t) (_loc : Gram.Loc.t) ->
(let i = Gram.Token.extract_string i
in Ast.PaId (_loc, Ast.IdLid (_loc, i)) :
'pattern)))) ]) ]))
(Gram.Entry.obj
(pattern : 'pattern Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (p : 'pattern) (_loc : Loc.t) ->
+ (fun (p : 'pattern) (_loc : Gram.Loc.t) ->
(p : 'comma_patt))));
([ Gram.Sself; Gram.Skeyword ","; Gram.Sself ],
(Gram.Action.mk
(fun (p2 : 'comma_patt) _ (p1 : 'comma_patt)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.PaCom (_loc, p1, p2) : 'comma_patt)))) ]) ]))
());
Gram.extend (name : 'name Gram.Entry.t)
[ ([ Gram.Snterm
(Gram.Entry.obj (qualid : 'qualid Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (il : 'qualid) (_loc : Loc.t) ->
+ (fun (il : 'qualid) (_loc : Gram.Loc.t) ->
(mk_name _loc il : 'name)))) ]) ]))
());
Gram.extend (string : 'string Gram.Entry.t)
| _ -> false),
"ANTIQUOT (\"\", _)")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ("", s) ->
(AntiquotSyntax.parse_expr _loc s :
(((function | STRING ((_)) -> true | _ -> false),
"STRING _")) ],
(Gram.Action.mk
- (fun (s : Gram.Token.t) (_loc : Loc.t) ->
+ (fun (s : Gram.Token.t) (_loc : Gram.Loc.t) ->
(let s = Gram.Token.extract_string s
in Ast.ExStr (_loc, s) : 'string)))) ]) ]))
());
[ (None, None,
[ ([ Gram.Skeyword ";" ],
(Gram.Action.mk
- (fun _ (_loc : Loc.t) -> (() : 'semi_sep)))) ]) ]))
+ (fun _ (_loc : Gram.Loc.t) -> (() : 'semi_sep)))) ]) ]))
()))
- let _ =
- Gram.extend (symbol : 'symbol Gram.Entry.t)
- ((fun () ->
- ((Some (Camlp4.Sig.Grammar.Level "top")),
- [ (None, (Some Camlp4.Sig.Grammar.NonA),
- [ ([ Gram.Stoken
- (((function | UIDENT "SOPT" -> true | _ -> false),
- "UIDENT \"SOPT\""));
- Gram.Sself ],
- (Gram.Action.mk
- (fun (s : 'symbol) (__camlp4_0 : Gram.Token.t)
- (_loc : Loc.t) ->
- match __camlp4_0 with
- | UIDENT "SOPT" -> (ssopt _loc s : 'symbol)
- | _ -> assert false)));
- ([ Gram.srules symbol
- [ ([ Gram.Stoken
- (((function
- | UIDENT "SLIST1" -> true
- | _ -> false),
- "UIDENT \"SLIST1\"")) ],
- (Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t)
- (_loc : Loc.t) ->
- match __camlp4_0 with
- | UIDENT "SLIST1" -> (true : 'e__19)
- | _ -> assert false)));
- ([ Gram.Stoken
- (((function
- | UIDENT "SLIST0" -> true
- | _ -> false),
- "UIDENT \"SLIST0\"")) ],
- (Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t)
- (_loc : Loc.t) ->
- match __camlp4_0 with
- | UIDENT "SLIST0" -> (false : 'e__19)
- | _ -> assert false))) ];
- Gram.Sself;
- Gram.Sopt
- (Gram.srules symbol
- [ ([ Gram.Stoken
- (((function
- | UIDENT "SEP" -> true
- | _ -> false),
- "UIDENT \"SEP\""));
- Gram.Snterm
- (Gram.Entry.obj
- (symbol : 'symbol Gram.Entry.t)) ],
- (Gram.Action.mk
- (fun (t : 'symbol)
- (__camlp4_0 : Gram.Token.t)
- (_loc : Loc.t) ->
- match __camlp4_0 with
- | UIDENT "SEP" -> (t : 'e__20)
- | _ -> assert false))) ]) ],
- (Gram.Action.mk
- (fun (sep : 'e__20 option) (s : 'symbol)
- (min : 'e__19) (_loc : Loc.t) ->
- (sslist _loc min sep s : 'symbol)))) ]) ]))
- ())
+
+ (*
+ EXTEND Gram
+ symbol: LEVEL "top"
+ [ NONA
+ [ min = [ UIDENT "SLIST0" -> False | UIDENT "SLIST1" -> True ];
+ s = SELF; sep = OPT [ UIDENT "SEP"; t = symbol -> t ] ->
+ sslist _loc min sep s
+ | UIDENT "SOPT"; s = SELF ->
+ ssopt _loc s ] ]
+ ;
+ END;
+ *)
let sfold _loc n foldfun f e s =
let styp = STquo (_loc, new_type_var ()) in
let e =
styp = styp;
pattern = None;
}
+
let sfoldsep _loc n foldfun f e s sep =
let styp = STquo (_loc, new_type_var ()) in
let e =
styp = styp;
pattern = None;
}
+
let _ =
let _ = (symbol : 'symbol Gram.Entry.t) in
let grammar_entry_create = Gram.Entry.mk in
(fun (sep : 'symbol) (__camlp4_1 : Gram.Token.t)
(s : 'symbol) (e : 'simple_expr)
(f : 'simple_expr)
- (__camlp4_0 : Gram.Token.t) (_loc : Loc.t) ->
+ (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match (__camlp4_1, __camlp4_0) with
| (UIDENT "SEP", UIDENT "FOLD1") ->
(sfoldsep _loc "FOLD1 SEP" "sfold1sep" f
(fun (sep : 'symbol) (__camlp4_1 : Gram.Token.t)
(s : 'symbol) (e : 'simple_expr)
(f : 'simple_expr)
- (__camlp4_0 : Gram.Token.t) (_loc : Loc.t) ->
+ (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match (__camlp4_1, __camlp4_0) with
| (UIDENT "SEP", UIDENT "FOLD0") ->
(sfoldsep _loc "FOLD0 SEP" "sfold0sep" f
(Gram.Action.mk
(fun (s : 'symbol) (e : 'simple_expr)
(f : 'simple_expr)
- (__camlp4_0 : Gram.Token.t) (_loc : Loc.t) ->
+ (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| UIDENT "FOLD1" ->
(sfold _loc "FOLD1" "sfold1" f e s :
(Gram.Action.mk
(fun (s : 'symbol) (e : 'simple_expr)
(f : 'simple_expr)
- (__camlp4_0 : Gram.Token.t) (_loc : Loc.t) ->
+ (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| UIDENT "FOLD0" ->
(sfold _loc "FOLD0" "sfold0" f e s :
(Gram.Entry.obj (expr : 'expr Gram.Entry.t));
Gram.Skeyword ")" ],
(Gram.Action.mk
- (fun _ (e : 'expr) _ (_loc : Loc.t) ->
+ (fun _ (e : 'expr) _ (_loc : Gram.Loc.t) ->
(e : 'simple_expr))));
([ Gram.Snterm
(Gram.Entry.obj
(a_LIDENT : 'a_LIDENT Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (i : 'a_LIDENT) (_loc : Loc.t) ->
+ (fun (i : 'a_LIDENT) (_loc : Gram.Loc.t) ->
(Ast.ExId (_loc, Ast.IdLid (_loc, i)) :
'simple_expr)))) ]) ]))
()))
+
let _ =
Options.add "-split_ext" (Arg.Set split_ext)
"Split EXTEND by functions to turn around a PowerPC problem."
+
let _ =
Options.add "-split_gext" (Arg.Set split_ext)
"Old name for the option -split_ext."
+
let _ =
Options.add "-meta_action" (Arg.Set meta_action) "Undocumented"
+
end
+
(* FIXME *)
module M = Register.OCamlSyntaxExtension(Id)(Make)
+
end
+
module M =
struct
open Camlp4
+
(* -*- camlp4r -*- *)
(****************************************************************************)
(* *)
* - Christopher Conway: extra feature (-D<uident>=)
*)
module Id =
- struct
- let name = "Camlp4MacroParser"
- let version =
- "$Id: Camlp4MacroParser.ml,v 1.1.4.5 2007/04/26 19:51:49 pouillar Exp $"
- end
+ struct let name = "Camlp4MacroParser"
+ let version = "$Id$"
+ end
+
(*
Added statements:
*)
open Camlp4
+
module Make (Syntax : Sig.Camlp4Syntax) =
struct
open Sig
+
include Syntax
+
type 'a item_or_def =
- | SdStr of 'a | SdDef of string * ((string list) * Ast.expr) option
+ | SdStr of 'a
+ | SdDef of string * ((string list) * Ast.expr) option
| SdUnd of string
| SdITE of string * ('a item_or_def) list * ('a item_or_def) list
| SdLazy of 'a Lazy.t
+
let rec list_remove x =
function
| (y, _) :: l when y = x -> l
| d :: l -> d :: (list_remove x l)
| [] -> []
+
let defined = ref []
+
let is_defined i = List.mem_assoc i !defined
+
let bad_patt _loc =
Loc.raise _loc
(Failure
"this macro cannot be used in a pattern (see its definition)")
+
let substp _loc env =
let rec loop =
function
in Ast.PaRec (_loc, substbi bi)
| _ -> bad_patt _loc
in loop
+
class reloc _loc =
- object inherit Ast.map as super method _Loc_t = fun _ -> _loc end
+ object inherit Ast.map as super
+ method loc = fun _ -> _loc
+ end
+
+ (* method _Loc_t _ = _loc; *)
class subst _loc env =
object inherit reloc _loc as super
+
method expr =
function
| (Ast.ExId (_, (Ast.IdLid (_, x))) |
as e) ->
(try List.assoc x env with | Not_found -> super#expr e)
| e -> super#expr e
+
method patt =
function
| (Ast.PaId (_, (Ast.IdLid (_, x))) |
(try substp _loc [] (List.assoc x env)
with | Not_found -> super#patt p)
| p -> super#patt p
+
end
+
let incorrect_number loc l1 l2 =
Loc.raise loc
(Failure
(Printf.sprintf "expected %d parameters; found %d"
(List.length l2) (List.length l1)))
+
let define eo x =
((match eo with
| Some (([], e)) ->
"$UIDENT x")) ],
(Gram.Action.mk
(fun (__camlp4_0 : Gram.Token.t)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| UIDENT ((_)) ->
((new reloc _loc)#expr e : 'expr)
"$UIDENT x")) ],
(Gram.Action.mk
(fun (__camlp4_0 : Gram.Token.t)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| UIDENT ((_)) ->
(let p = substp _loc [] e
(Gram.Action.mk
(fun (param : 'expr)
(__camlp4_0 : Gram.Token.t)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| UIDENT ((_)) ->
(let el =
(Gram.Action.mk
(fun (param : 'patt)
(__camlp4_0 : Gram.Token.t)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| UIDENT ((_)) ->
(let pl =
()))
| None -> ());
defined := (x, eo) :: !defined)
+
let undef x =
try
- let eo = List.assoc x !defined
- in
- ((match eo with
+ ((let eo = List.assoc x !defined
+ in
+ match eo with
| Some (([], _)) ->
(Gram.delete_rule expr
[ Gram.Stoken
"$UIDENT x"));
Gram.Sself ])
| None -> ());
- defined := list_remove x !defined)
+ defined := list_remove x !defined)
with | Not_found -> ()
+
let parse_def s =
match Gram.parse_string expr (Loc.mk "<command line>") s with
| Ast.ExId (_, (Ast.IdUid (_, n))) -> define None n
(Ast.ExId (_, (Ast.IdUid (_, n)))))),
e) -> define (Some (([], e))) n
| _ -> invalid_arg s
+
(* This is a list of directories to search for INCLUDE statements. *)
let include_dirs = ref []
+
(* Add something to the above, make sure it ends with a slash. *)
let add_include_dir str =
if str <> ""
else str ^ "/"
in include_dirs := !include_dirs @ [ str ])
else ()
+
let parse_include_file rule =
let dir_ok file dir = Sys.file_exists (dir ^ file)
in
let ch = open_in file in
let st = Stream.of_channel ch
in Gram.parse rule (Loc.mk file) st
+
let rec execute_macro nil cons =
function
| SdStr i -> i
| hd :: tl -> (* The evaluation order is important here *)
let il1 = execute_macro nil cons hd in
let il2 = execute_macro_list nil cons tl in cons il1 il2
+
let _ =
let _ = (expr : 'expr Gram.Entry.t)
and _ = (sig_item : 'sig_item Gram.Entry.t)
(Gram.Entry.obj
(macro_def : 'macro_def Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (x : 'macro_def) (_loc : Loc.t) ->
+ (fun (x : 'macro_def) (_loc : Gram.Loc.t) ->
(execute_macro (Ast.StNil _loc)
(fun a b -> Ast.StSem (_loc, a, b)) x :
'str_item)))) ]) ]))
(macro_def_sig :
'macro_def_sig Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (x : 'macro_def_sig) (_loc : Loc.t) ->
+ (fun (x : 'macro_def_sig) (_loc : Gram.Loc.t) ->
(execute_macro (Ast.SgNil _loc)
(fun a b -> Ast.SgSem (_loc, a, b)) x :
'sig_item)))) ]) ]))
(((function | STRING ((_)) -> true | _ -> false),
"STRING _")) ],
(Gram.Action.mk
- (fun (fname : Gram.Token.t) _ (_loc : Loc.t) ->
+ (fun (fname : Gram.Token.t) _
+ (_loc : Gram.Loc.t) ->
(let fname = Gram.Token.extract_string fname
in
SdLazy
'else_macro_def Gram.Entry.t)) ],
(Gram.Action.mk
(fun (st1 : 'else_macro_def) (st2 : 'smlist) _
- (i : 'uident) _ (_loc : Loc.t) ->
+ (i : 'uident) _ (_loc : Gram.Loc.t) ->
(SdITE (i, st1, st2) : 'macro_def))));
([ Gram.Skeyword "IFDEF";
Gram.Snterm
'else_macro_def Gram.Entry.t)) ],
(Gram.Action.mk
(fun (st2 : 'else_macro_def) (st1 : 'smlist) _
- (i : 'uident) _ (_loc : Loc.t) ->
+ (i : 'uident) _ (_loc : Gram.Loc.t) ->
(SdITE (i, st1, st2) : 'macro_def))));
([ Gram.Skeyword "UNDEF";
Gram.Snterm
(Gram.Entry.obj (uident : 'uident Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (i : 'uident) _ (_loc : Loc.t) ->
+ (fun (i : 'uident) _ (_loc : Gram.Loc.t) ->
(SdUnd i : 'macro_def))));
([ Gram.Skeyword "DEFINE";
Gram.Snterm
'opt_macro_value Gram.Entry.t)) ],
(Gram.Action.mk
(fun (def : 'opt_macro_value) (i : 'uident) _
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(SdDef (i, def) : 'macro_def)))) ]) ]))
());
Gram.extend (macro_def_sig : 'macro_def_sig Gram.Entry.t)
(((function | STRING ((_)) -> true | _ -> false),
"STRING _")) ],
(Gram.Action.mk
- (fun (fname : Gram.Token.t) _ (_loc : Loc.t) ->
+ (fun (fname : Gram.Token.t) _
+ (_loc : Gram.Loc.t) ->
(let fname = Gram.Token.extract_string fname
in
SdLazy
'else_macro_def_sig Gram.Entry.t)) ],
(Gram.Action.mk
(fun (sg1 : 'else_macro_def_sig) (sg2 : 'sglist)
- _ (i : 'uident) _ (_loc : Loc.t) ->
+ _ (i : 'uident) _ (_loc : Gram.Loc.t) ->
(SdITE (i, sg1, sg2) : 'macro_def_sig))));
([ Gram.Skeyword "IFDEF";
Gram.Snterm
'else_macro_def_sig Gram.Entry.t)) ],
(Gram.Action.mk
(fun (sg2 : 'else_macro_def_sig) (sg1 : 'sglist)
- _ (i : 'uident) _ (_loc : Loc.t) ->
+ _ (i : 'uident) _ (_loc : Gram.Loc.t) ->
(SdITE (i, sg1, sg2) : 'macro_def_sig))));
([ Gram.Skeyword "UNDEF";
Gram.Snterm
(Gram.Entry.obj (uident : 'uident Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (i : 'uident) _ (_loc : Loc.t) ->
+ (fun (i : 'uident) _ (_loc : Gram.Loc.t) ->
(SdUnd i : 'macro_def_sig))));
([ Gram.Skeyword "DEFINE";
Gram.Snterm
(Gram.Entry.obj (uident : 'uident Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (i : 'uident) _ (_loc : Loc.t) ->
+ (fun (i : 'uident) _ (_loc : Gram.Loc.t) ->
(SdDef (i, None) : 'macro_def_sig)))) ]) ]))
());
Gram.extend (else_macro_def : 'else_macro_def Gram.Entry.t)
[ ([ Gram.Snterm
(Gram.Entry.obj (endif : 'endif Gram.Entry.t)) ],
(Gram.Action.mk
- (fun _ (_loc : Loc.t) -> ([] : 'else_macro_def))));
+ (fun _ (_loc : Gram.Loc.t) ->
+ ([] : 'else_macro_def))));
([ Gram.Skeyword "ELSE";
Gram.Snterm
(Gram.Entry.obj (smlist : 'smlist Gram.Entry.t));
Gram.Snterm
(Gram.Entry.obj (endif : 'endif Gram.Entry.t)) ],
(Gram.Action.mk
- (fun _ (st : 'smlist) _ (_loc : Loc.t) ->
+ (fun _ (st : 'smlist) _ (_loc : Gram.Loc.t) ->
(st : 'else_macro_def)))) ]) ]))
());
Gram.extend
[ ([ Gram.Snterm
(Gram.Entry.obj (endif : 'endif Gram.Entry.t)) ],
(Gram.Action.mk
- (fun _ (_loc : Loc.t) ->
+ (fun _ (_loc : Gram.Loc.t) ->
([] : 'else_macro_def_sig))));
([ Gram.Skeyword "ELSE";
Gram.Snterm
Gram.Snterm
(Gram.Entry.obj (endif : 'endif Gram.Entry.t)) ],
(Gram.Action.mk
- (fun _ (st : 'sglist) _ (_loc : Loc.t) ->
+ (fun _ (st : 'sglist) _ (_loc : Gram.Loc.t) ->
(st : 'else_macro_def_sig)))) ]) ]))
());
Gram.extend (else_expr : 'else_expr Gram.Entry.t)
[ ([ Gram.Snterm
(Gram.Entry.obj (endif : 'endif Gram.Entry.t)) ],
(Gram.Action.mk
- (fun _ (_loc : Loc.t) ->
+ (fun _ (_loc : Gram.Loc.t) ->
(Ast.ExId (_loc, Ast.IdUid (_loc, "()")) :
'else_expr))));
([ Gram.Skeyword "ELSE";
Gram.Snterm
(Gram.Entry.obj (endif : 'endif Gram.Entry.t)) ],
(Gram.Action.mk
- (fun _ (e : 'expr) _ (_loc : Loc.t) ->
+ (fun _ (e : 'expr) _ (_loc : Gram.Loc.t) ->
(e : 'else_expr)))) ]) ]))
());
Gram.extend (smlist : 'smlist Gram.Entry.t)
(Gram.Entry.obj
(semi : 'semi Gram.Entry.t)) ],
(Gram.Action.mk
- (fun _ (si : 'str_item) (_loc : Loc.t)
- -> (SdStr si : 'e__21))));
+ (fun _ (si : 'str_item)
+ (_loc : Gram.Loc.t) ->
+ (SdStr si : 'e__18))));
([ Gram.Snterm
(Gram.Entry.obj
(macro_def :
(Gram.Entry.obj
(semi : 'semi Gram.Entry.t)) ],
(Gram.Action.mk
- (fun _ (d : 'macro_def) (_loc : Loc.t)
- -> (d : 'e__21)))) ]) ],
+ (fun _ (d : 'macro_def)
+ (_loc : Gram.Loc.t) -> (d : 'e__18)))) ]) ],
(Gram.Action.mk
- (fun (sml : 'e__21 list) (_loc : Loc.t) ->
+ (fun (sml : 'e__18 list) (_loc : Gram.Loc.t) ->
(sml : 'smlist)))) ]) ]))
());
Gram.extend (sglist : 'sglist Gram.Entry.t)
(Gram.Entry.obj
(semi : 'semi Gram.Entry.t)) ],
(Gram.Action.mk
- (fun _ (si : 'sig_item) (_loc : Loc.t)
- -> (SdStr si : 'e__22))));
+ (fun _ (si : 'sig_item)
+ (_loc : Gram.Loc.t) ->
+ (SdStr si : 'e__19))));
([ Gram.Snterm
(Gram.Entry.obj
(macro_def_sig :
(semi : 'semi Gram.Entry.t)) ],
(Gram.Action.mk
(fun _ (d : 'macro_def_sig)
- (_loc : Loc.t) -> (d : 'e__22)))) ]) ],
+ (_loc : Gram.Loc.t) -> (d : 'e__19)))) ]) ],
(Gram.Action.mk
- (fun (sgl : 'e__22 list) (_loc : Loc.t) ->
+ (fun (sgl : 'e__19 list) (_loc : Gram.Loc.t) ->
(sgl : 'sglist)))) ]) ]))
());
Gram.extend (endif : 'endif Gram.Entry.t)
[ (None, None,
[ ([ Gram.Skeyword "ENDIF" ],
(Gram.Action.mk
- (fun _ (_loc : Loc.t) -> (() : 'endif))));
+ (fun _ (_loc : Gram.Loc.t) -> (() : 'endif))));
([ Gram.Skeyword "END" ],
(Gram.Action.mk
- (fun _ (_loc : Loc.t) -> (() : 'endif)))) ]) ]))
+ (fun _ (_loc : Gram.Loc.t) -> (() : 'endif)))) ]) ]))
());
Gram.extend (opt_macro_value : 'opt_macro_value Gram.Entry.t)
((fun () ->
[ (None, None,
[ ([],
(Gram.Action.mk
- (fun (_loc : Loc.t) -> (None : 'opt_macro_value))));
+ (fun (_loc : Gram.Loc.t) ->
+ (None : 'opt_macro_value))));
([ Gram.Skeyword "=";
Gram.Snterm
(Gram.Entry.obj (expr : 'expr Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (e : 'expr) _ (_loc : Loc.t) ->
+ (fun (e : 'expr) _ (_loc : Gram.Loc.t) ->
(Some (([], e)) : 'opt_macro_value))));
([ Gram.Skeyword "(";
Gram.Slist1sep
| _ -> false),
"LIDENT _")) ],
(Gram.Action.mk
- (fun (x : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (x : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
(let x =
Gram.Token.extract_string x
- in x : 'e__23)))) ],
+ in x : 'e__20)))) ],
Gram.Skeyword ",");
Gram.Skeyword ")"; Gram.Skeyword "=";
Gram.Snterm
(Gram.Entry.obj (expr : 'expr Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (e : 'expr) _ _ (pl : 'e__23 list) _
- (_loc : Loc.t) ->
+ (fun (e : 'expr) _ _ (pl : 'e__20 list) _
+ (_loc : Gram.Loc.t) ->
(Some ((pl, e)) : 'opt_macro_value)))) ]) ]))
());
Gram.extend (expr : 'expr Gram.Entry.t)
Gram.Skeyword "IN"; Gram.Sself ],
(Gram.Action.mk
(fun (body : 'expr) _ (def : 'expr) _
- (i : Gram.Token.t) _ (_loc : Loc.t) ->
+ (i : Gram.Token.t) _ (_loc : Gram.Loc.t) ->
(let i = Gram.Token.extract_string i
in (new subst _loc [ (i, def) ])#expr body :
'expr))));
(else_expr : 'else_expr Gram.Entry.t)) ],
(Gram.Action.mk
(fun (e2 : 'else_expr) (e1 : 'expr) _
- (i : 'uident) _ (_loc : Loc.t) ->
+ (i : 'uident) _ (_loc : Gram.Loc.t) ->
(if is_defined i then e2 else e1 : 'expr))));
([ Gram.Skeyword "IFDEF";
Gram.Snterm
(else_expr : 'else_expr Gram.Entry.t)) ],
(Gram.Action.mk
(fun (e2 : 'else_expr) (e1 : 'expr) _
- (i : 'uident) _ (_loc : Loc.t) ->
+ (i : 'uident) _ (_loc : Gram.Loc.t) ->
(if is_defined i then e1 else e2 : 'expr)))) ]) ]))
());
Gram.extend (expr : 'expr Gram.Entry.t)
| _ -> false),
"LIDENT \"__LOCATION__\"")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| LIDENT "__LOCATION__" ->
(let (a, b, c, d, e, f, g, h) =
| _ -> false),
"LIDENT \"__FILE__\"")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| LIDENT "__FILE__" ->
(Ast.ExStr (_loc,
(Gram.Entry.obj (endif : 'endif Gram.Entry.t)) ],
(Gram.Action.mk
(fun _ (p2 : 'patt) _ (p1 : 'patt) _
- (i : 'uident) _ (_loc : Loc.t) ->
+ (i : 'uident) _ (_loc : Gram.Loc.t) ->
(if is_defined i then p2 else p1 : 'patt))));
([ Gram.Skeyword "IFDEF";
Gram.Snterm
(Gram.Entry.obj (endif : 'endif Gram.Entry.t)) ],
(Gram.Action.mk
(fun _ (p2 : 'patt) _ (p1 : 'patt) _
- (i : 'uident) _ (_loc : Loc.t) ->
+ (i : 'uident) _ (_loc : Gram.Loc.t) ->
(if is_defined i then p1 else p2 : 'patt)))) ]) ]))
());
Gram.extend (uident : 'uident Gram.Entry.t)
(((function | UIDENT ((_)) -> true | _ -> false),
"UIDENT _")) ],
(Gram.Action.mk
- (fun (i : Gram.Token.t) (_loc : Loc.t) ->
+ (fun (i : Gram.Token.t) (_loc : Gram.Loc.t) ->
(let i = Gram.Token.extract_string i in i :
'uident)))) ]) ]))
()))
+
let _ =
Options.add "-D" (Arg.String parse_def)
"<string> Define for IFDEF instruction."
+
let _ =
Options.add "-U" (Arg.String undef)
"<string> Undefine for IFDEF instruction."
+
let _ =
Options.add "-I" (Arg.String add_include_dir)
"<string> Add a directory to INCLUDE search path."
+
end
+
let _ = let module M = Register.OCamlSyntaxExtension(Id)(Make) in ()
+
module MakeNothing (AstFilters : Camlp4.Sig.AstFilters) =
struct
open AstFilters
+
open Ast
+
let remove_nothings =
function
| Ast.ExApp (_, e, (Ast.ExId (_, (Ast.IdUid (_, "NOTHING"))))) |
(Ast.ExNil _), e)))
-> e
| e -> e
+
let _ =
register_str_item_filter (Ast.map_expr remove_nothings)#str_item
+
end
+
let _ = let module M = Camlp4.Register.AstFilter(Id)(MakeNothing) in ()
+
end
+
module D =
struct
open Camlp4
+
(* -*- camlp4r -*- *)
(****************************************************************************)
(* *)
* - Nicolas Pouillard: initial version
*)
module Id =
- struct
- let name = "Camlp4DebugParser"
- let version =
- "$Id: Camlp4DebugParser.ml,v 1.1 2007/02/07 10:09:22 ertai Exp $"
- end
+ struct let name = "Camlp4DebugParser"
+ let version = "$Id$"
+ end
+
module Make (Syntax : Sig.Camlp4Syntax) =
struct
open Sig
+
include Syntax
+
module StringSet = Set.Make(String)
+
let debug_mode =
try
let str = Sys.getenv "STATIC_CAMLP4_DEBUG" in
then (fun _ -> true)
else (fun x -> StringSet.mem x sections)
with | Not_found -> (fun _ -> false)
+
let rec apply accu =
function
| [] -> accu
| x :: xs ->
let _loc = Ast.loc_of_expr x
in apply (Ast.ExApp (_loc, accu, x)) xs
+
let mk_debug_mode _loc =
function
| None ->
Ast.IdAcc (_loc, Ast.IdUid (_loc, m),
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Debug"),
Ast.IdLid (_loc, "mode"))))
+
let mk_debug _loc m fmt section args =
let call =
apply
Ast.ExApp (_loc, mk_debug_mode _loc m,
Ast.ExStr (_loc, section)),
call, Ast.ExId (_loc, Ast.IdUid (_loc, "()")))
+
let _ =
let _ = (expr : 'expr Gram.Entry.t) in
let grammar_entry_create = Gram.Entry.mk in
(Gram.Action.mk
(fun (x : 'end_or_in) (args : 'expr list)
(fmt : Gram.Token.t) (section : Gram.Token.t)
- (m : 'start_debug) (_loc : Loc.t) ->
+ (m : 'start_debug) (_loc : Gram.Loc.t) ->
(let fmt = Gram.Token.extract_string fmt in
let section =
Gram.Token.extract_string section
Gram.Snterm
(Gram.Entry.obj (expr : 'expr Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (e : 'expr) _ (_loc : Loc.t) ->
+ (fun (e : 'expr) _ (_loc : Gram.Loc.t) ->
(Some e : 'end_or_in))));
([ Gram.Skeyword "end" ],
(Gram.Action.mk
- (fun _ (_loc : Loc.t) -> (None : 'end_or_in)))) ]) ]))
+ (fun _ (_loc : Gram.Loc.t) ->
+ (None : 'end_or_in)))) ]) ]))
());
Gram.extend (start_debug : 'start_debug Gram.Entry.t)
((fun () ->
| _ -> false),
"LIDENT \"camlp4_debug\"")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| LIDENT "camlp4_debug" ->
(Some "Camlp4" : 'start_debug)
| _ -> false),
"LIDENT \"debug\"")) ],
(Gram.Action.mk
- (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
- ->
+ (fun (__camlp4_0 : Gram.Token.t)
+ (_loc : Gram.Loc.t) ->
match __camlp4_0 with
| LIDENT "debug" -> (None : 'start_debug)
| _ -> assert false))) ]) ]))
()))
+
end
+
let _ = let module M = Register.OCamlSyntaxExtension(Id)(Make) in ()
+
end
+
module L =
struct
open Camlp4
+
(* -*- camlp4r -*- *)
(****************************************************************************)
(* *)
* - Nicolas Pouillard: revised syntax version
*)
module Id =
- struct
- let name = "Camlp4ListComprenhsion"
- let version =
- "$Id: Camlp4ListComprehension.ml,v 1.1 2007/02/27 15:50:57 pouillar Exp $"
- end
+ struct let name = "Camlp4ListComprenhsion"
+ let version = "$Id$"
+ end
+
module Make (Syntax : Sig.Camlp4Syntax) =
struct
open Sig
+
include Syntax
+
let rec loop n =
function
| [] -> None
| [ (x, _) ] -> if n = 1 then Some x else None
| _ :: l -> loop (n - 1) l
+
let stream_peek_nth n strm = loop n (Stream.npeek n strm)
+
(* usual trick *)
let test_patt_lessminus =
Gram.Entry.of_parser "test_patt_lessminus"
skip_patt ((ignore_upto ")" (n + 1)) + 1)
| Some (KEYWORD "{") ->
skip_patt ((ignore_upto "}" (n + 1)) + 1)
- | Some (KEYWORD ("as" | "::" | ";" | "," | "_")) |
+ | Some (KEYWORD ("as" | "::" | "," | "_")) |
Some (LIDENT _ | UIDENT _) -> skip_patt (n + 1)
| Some _ | None -> raise Stream.Failure
and ignore_upto end_kwd n =
| Some _ -> ignore_upto end_kwd (n + 1)
| None -> raise Stream.Failure
in skip_patt 1)
+
let map _loc p e l =
match (p, e) with
| (Ast.PaId (_, (Ast.IdLid (_, x))),
Ast.ExId (_loc, Ast.IdLid (_loc, "l")))))))),
l),
Ast.ExId (_loc, Ast.IdUid (_loc, "[]")))
+
let filter _loc p b l =
if Ast.is_irrefut_patt p
then
Ast.McArr (_loc, Ast.PaAny _loc, Ast.ExNil _loc,
Ast.ExId (_loc, Ast.IdUid (_loc, "False")))))),
l)
+
let concat _loc l =
Ast.ExApp (_loc,
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "List"),
Ast.IdLid (_loc, "concat"))),
l)
+
let rec compr _loc e =
function
| [ `gen ((p, l)) ] -> map _loc p e l
| `gen ((p, l)) :: ((`gen ((_, _)) :: _ as is)) ->
concat _loc (map _loc p (compr _loc e is) l)
| _ -> raise Stream.Failure
+
let _ =
Gram.delete_rule expr
[ Gram.Skeyword "[";
(Gram.Entry.obj
(sem_expr_for_list : 'sem_expr_for_list Gram.Entry.t));
Gram.Skeyword "]" ]
+
let is_revised =
try
(Gram.delete_rule expr
Gram.Skeyword "]" ];
true)
with | Not_found -> false
+
let comprehension_or_sem_expr_for_list =
Gram.Entry.mk "comprehension_or_sem_expr_for_list"
+
let _ =
let _ = (expr : 'expr Gram.Entry.t)
and _ =
Gram.Skeyword "]" ],
(Gram.Action.mk
(fun _ (e : 'comprehension_or_sem_expr_for_list)
- _ (_loc : Loc.t) -> (e : 'expr)))) ]) ]))
+ _ (_loc : Gram.Loc.t) -> (e : 'expr)))) ]) ]))
());
Gram.extend
(comprehension_or_sem_expr_for_list :
(Gram.Entry.obj (expr : 'expr Gram.Entry.t),
"top") ],
(Gram.Action.mk
- (fun (e : 'expr) (_loc : Loc.t) ->
+ (fun (e : 'expr) (_loc : Gram.Loc.t) ->
(Ast.ExApp (_loc,
Ast.ExApp (_loc,
Ast.ExId (_loc, Ast.IdUid (_loc, "::")),
Gram.Skeyword ";") ],
(Gram.Action.mk
(fun (l : 'item list) _ (e : 'expr)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(compr _loc e l :
'comprehension_or_sem_expr_for_list))));
([ Gram.Snterml
"top");
Gram.Skeyword ";" ],
(Gram.Action.mk
- (fun _ (e : 'expr) (_loc : Loc.t) ->
+ (fun _ (e : 'expr) (_loc : Gram.Loc.t) ->
(Ast.ExApp (_loc,
Ast.ExApp (_loc,
Ast.ExId (_loc, Ast.IdUid (_loc, "::")),
'sem_expr_for_list Gram.Entry.t)) ],
(Gram.Action.mk
(fun (mk : 'sem_expr_for_list) _ (e : 'expr)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.ExApp (_loc,
Ast.ExApp (_loc,
Ast.ExId (_loc, Ast.IdUid (_loc, "::")),
(Gram.Entry.obj (expr : 'expr Gram.Entry.t),
"top") ],
(Gram.Action.mk
- (fun (e : 'expr) (_loc : Loc.t) ->
+ (fun (e : 'expr) (_loc : Gram.Loc.t) ->
(`cond e : 'item))));
([ Gram.Snterm
(Gram.Entry.obj
(Gram.Entry.obj (expr : 'expr Gram.Entry.t),
"top") ],
(Gram.Action.mk
- (fun (e : 'expr) _ (p : 'patt) _ (_loc : Loc.t)
- -> (`gen ((p, e)) : 'item)))) ]) ]))
+ (fun (e : 'expr) _ (p : 'patt) _
+ (_loc : Gram.Loc.t) ->
+ (`gen ((p, e)) : 'item)))) ]) ]))
()))
+
let _ =
if is_revised
then
(Gram.Entry.obj (expr : 'expr Gram.Entry.t)) ],
(Gram.Action.mk
(fun (last : 'expr) _ (e : 'expr)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.ExApp (_loc,
Ast.ExApp (_loc,
Ast.ExId (_loc,
(Gram.Action.mk
(fun (last : 'expr) _
(mk : 'sem_expr_for_list) _ (e : 'expr)
- (_loc : Loc.t) ->
+ (_loc : Gram.Loc.t) ->
(Ast.ExApp (_loc,
Ast.ExApp (_loc,
Ast.ExId (_loc,
'comprehension_or_sem_expr_for_list)))) ]) ]))
()))
else ()
+
end
+
let _ = let module M = Register.OCamlSyntaxExtension(Id)(Make) in ()
+
end
+
module P =
struct
(****************************************************************************)
* - Nicolas Pouillard: initial version
*)
let _ = Camlp4.Register.enable_dump_ocaml_ast_printer ()
+
end
+
module B =
struct
(* camlp4r *)
* - Daniel de Rauglaudre: initial version
* - Nicolas Pouillard: refactoring
*)
- (* $Id: Camlp4Bin.ml,v 1.14.2.3 2007/03/30 15:50:12 pouillar Exp $ *)
+ (* $Id$ *)
open Camlp4
+
open PreCast.Syntax
+
open PreCast
+
open Format
+
module CleanAst = Camlp4.Struct.CleanAst.Make(Ast)
+
module SSet = Set.Make(String)
+
let pa_r = "Camlp4OCamlRevisedParser"
+
let pa_rr = "Camlp4OCamlReloadedParser"
+
let pa_o = "Camlp4OCamlParser"
+
let pa_rp = "Camlp4OCamlRevisedParserParser"
+
let pa_op = "Camlp4OCamlParserParser"
+
let pa_g = "Camlp4GrammarParser"
+
let pa_m = "Camlp4MacroParser"
+
let pa_qb = "Camlp4QuotationCommon"
+
let pa_q = "Camlp4QuotationExpander"
+
let pa_rq = "Camlp4OCamlRevisedQuotationExpander"
+
let pa_oq = "Camlp4OCamlOriginalQuotationExpander"
+
let pa_l = "Camlp4ListComprehension"
+
open Register
+
let dyn_loader =
ref (fun _ -> raise (Match_failure ("./camlp4/Camlp4Bin.ml", 45, 24)))
+
let rcall_callback = ref (fun () -> ())
+
let loaded_modules = ref SSet.empty
+
let add_to_loaded_modules name =
loaded_modules := SSet.add name !loaded_modules
+
let rewrite_and_load n x =
let dyn_loader = !dyn_loader () in
let find_in_path = DynLoader.find_in_path dyn_loader in
load [ "Camlp4ExceptionTracer" ]
| (("Filters" | ""), ("prof" | "camlp4profiler.cmo")) ->
load [ "Camlp4Profiler" ]
- | (("Filters" | ""), ("map" | "camlp4mapgenerator.cmo")) ->
- load [ "Camlp4MapGenerator" ]
+ | (* map is now an alias of fold since fold handles map too *)
+ (("Filters" | ""), ("map" | "camlp4mapgenerator.cmo")) ->
+ load [ "Camlp4FoldGenerator" ]
| (("Filters" | ""), ("fold" | "camlp4foldgenerator.cmo")) ->
load [ "Camlp4FoldGenerator" ]
| (("Filters" | ""), ("meta" | "camlp4metagenerator.cmo")) ->
let y = "Camlp4" ^ (n ^ ("/" ^ (x ^ ".cmo")))
in real_load (try find_in_path y with | Not_found -> x));
!rcall_callback ())
+
let print_warning = eprintf "%a:\n%s@." Loc.print
+
let rec parse_file dyn_loader name pa getdir =
let directive_handler =
Some
let phr =
try pa ?directive_handler loc cs with | x -> (clear (); raise x)
in (clear (); phr))
+
let output_file = ref None
+
let process dyn_loader name pa pr clean fold_filters getdir =
let ast = parse_file dyn_loader name pa getdir in
let ast = fold_filters (fun t filter -> filter t) ast in
let ast = clean ast
in pr ?input_file: (Some name) ?output_file: !output_file ast
+
let gind =
function
| Ast.SgDir (loc, n, (Ast.ExStr (_, s))) -> Some ((loc, n, s))
| _ -> None
+
let gimd =
function
| Ast.StDir (loc, n, (Ast.ExStr (_, s))) -> Some ((loc, n, s))
| _ -> None
+
let process_intf dyn_loader name =
process dyn_loader name CurrentParser.parse_interf CurrentPrinter.
print_interf (new CleanAst.clean_ast)#sig_item AstFilters.
fold_interf_filters gind
+
let process_impl dyn_loader name =
process dyn_loader name CurrentParser.parse_implem CurrentPrinter.
print_implem (new CleanAst.clean_ast)#str_item AstFilters.
fold_implem_filters gimd
+
let just_print_the_version () =
(printf "%s@." Camlp4_config.version; exit 0)
+
let print_version () =
(eprintf "Camlp4 version %s@." Camlp4_config.version; exit 0)
+
let print_stdlib () =
(printf "%s@." Camlp4_config.camlp4_standard_library; exit 0)
+
let usage ini_sl ext_sl =
(eprintf
"\
(eprintf "Options added by loaded object files:@.";
Options.print_usage_list ext_sl)
else ())
+
let warn_noassert () =
eprintf
"\
camlp4 warning: option -noassert is obsolete
You should give the -noassert option to the ocaml compiler instead.@."
+
type file_kind =
- | Intf of string | Impl of string | Str of string
- | ModuleImpl of string | IncludeDir of string
+ | Intf of string
+ | Impl of string
+ | Str of string
+ | ModuleImpl of string
+ | IncludeDir of string
+
let search_stdlib = ref true
+
let print_loaded_modules = ref false
+
let (task, do_task) =
let t = ref None in
let task f x =
(if !t = None then (fun _ -> f x) else (fun usage -> usage ())) in
let do_task usage = match !t with | Some f -> f usage | None -> ()
in (task, do_task)
+
let input_file x =
let dyn_loader = !dyn_loader ()
in
in
(output_string o s;
close_out o;
- task (process_impl dyn_loader) f)
+ task (process_impl dyn_loader) f;
+ at_exit (fun () -> Sys.remove f))
| ModuleImpl file_name -> rewrite_and_load "" file_name
| IncludeDir dir -> DynLoader.include_dir dyn_loader dir);
!rcall_callback ())
+
let initial_spec_list =
[ ("-I", (Arg.String (fun x -> input_file (IncludeDir x))),
"<directory> Add directory in search patch for object files.");
"<name> Load the filter Camlp4Filters/<name>.cmo");
("-ignore", (Arg.String ignore), "ignore the next argument");
("--", (Arg.Unit ignore), "Deprecated, does nothing") ]
+
let _ = Options.init initial_spec_list
+
let anon_fun name =
input_file
(if Filename.check_suffix name ".mli"
if Filename.check_suffix name ".cma"
then ModuleImpl name
else raise (Arg.Bad ("don't know what to do with " ^ name)))
+
let main argv =
let usage () =
(usage initial_spec_list (Options.ext_spec_list ()); exit 0)
exit 2)
| Arg.Help _ -> usage ()
| exc -> (eprintf "@[<v0>%a@]@." ErrorHandler.print exc; exit 2)
+
let _ = main Sys.argv
+
end
+
--- /dev/null
+Camlp4/Sig
Camlp4
-Linenum
-Misc
-Warnings
-Location
-Config
+Camlp4_import
Camlp4_config
-Myocamlbuild_config
-Longident
Camlp4Parsers/Camlp4AstLoader
Camlp4Parsers/Camlp4DebugParser
Camlp4
-Linenum
-Misc
-Warnings
-Location
-Config
+Camlp4_import
Camlp4_config
-Myocamlbuild_config
-Longident
-"apply_operator.ml" or "type_quotation.ml": camlp4rf, use_camlp4
+<{apply_operator,type_quotation,global_handler,expression_closure{,_filter}}.ml> or <free_vars_test.*>: camlp4rf, use_camlp4
"lambda_quot.ml": camlp4rf, use_camlp4_full
"lambda_quot_o.ml": camlp4of, use_camlp4_full
-"macros.ml" or "dirac.ml" or "puzzle.ml" or <arith.*>: camlp4of, use_camlp4
+"macros.ml" or <arith.*> or "gen_match_case.ml": camlp4of, use_camlp4
"test_macros.ml": pp(camlp4of ./macros.cmo)
"lambda_test.ml": pp(camlp4of ./lambda_quot_o.cmo)
<parse_files.*>: camlp4of, use_camlp4_full, use_dynlink
-<{free_vars_test,poly_rec}.*>: camlp4rf, use_camlp4
+"test_type_quotation.ml": pp(camlp4of ./type_quotation.cmo)
+"apply_operator_test.ml": pp(camlp4o ./apply_operator.cmo)
+"expression_closure_test.ml": pp(camlp4o ./expression_closure_filter.cmo)
+"gen_type_N.ml": camlp4orf, use_camlp4
+"syb_fold.ml": pp(camlp4o -filter fold), use_camlp4
+"syb_map.ml": pp(camlp4o -filter map), use_camlp4
+"ex_str.ml": camlp4of, use_camlp4, use_camlp4_full
+"ex_str_test.ml": pp(camlp4o ./ex_str.cmo)
--- /dev/null
+apply_operator.cmo
+type_quotation.cmo
+lambda_quot.cmo
+lambda_quot_o.cmo
+macros.cmo
+parse_files.byte
+parse_files.native
+arith.cmo
+expression_closure.cmo
+expression_closure_filter.cmo
+global_handler.cmo
AstFilters.register_str_item_filter
(Ast.map_expr
(fun
- [ <:expr@loc< \& $e1$ $e2$ >> -> <:expr@loc< $e1$ $e2$ >>
+ [ <:expr@loc< $e1$ & $e2$ >> -> <:expr@loc< $e1$ $e2$ >>
| e -> e ]))#str_item;
-f& g& h x
+let ( & ) = ();; (* To force it to be inlined. If not it's not well typed. *)
+
+fun f g h x -> f& g& h x
--- /dev/null
+(* Please keep me in sync with brion.inria.fr/gallium/index.php/Arithmetic_Example *)
+
+ open Camlp4.PreCast;;
+ module ArithGram = MakeGram(Lexer);;
+
+ type t = Local of string * t * t
+ | Binop of t * (int -> int -> int) * t
+ | Int of int
+ | Var of string;;
+
+ let expression = ArithGram.Entry.mk "expression";;
+
+ EXTEND ArithGram
+ GLOBAL: expression;
+
+ expression: (* A grammar entry for expressions *)
+ [ "top"
+ [ "let"; `LIDENT s; "="; e1 = SELF; "in"; e2 = SELF -> Local(s,e1,e2) ]
+ | "plus"
+ [ e1 = SELF; "+"; e2 = SELF -> Binop(e1, ( + ), e2)
+ | e1 = SELF; "-"; e2 = SELF -> Binop(e1, ( - ), e2) ]
+ | "times"
+ [ e1 = SELF; "*"; e2 = SELF -> Binop(e1, ( * ), e2)
+ | e1 = SELF; "/"; e2 = SELF -> Binop(e1, ( / ), e2) ]
+ | "simple"
+ [ `INT(i, _) -> Int(i)
+ | `LIDENT s -> Var(s)
+ | "("; e = expression; ")" -> e ]
+ ];
+
+ END;;
+
+ let parse_arith s =
+ ArithGram.parse_string expression (Loc.mk "<string>") s;;
+
+ let rec eval env =
+ function
+ | Local(x, e1, e2) ->
+ let v1 = eval env e1 in
+ eval ((x, v1) :: env) e2
+ | Binop(e1, op, e2) ->
+ op (eval env e1) (eval env e2)
+ | Int(i) -> i
+ | Var(x) -> List.assoc x env;;
+
+ let calc s =
+ Format.printf "%s ==> %d@." s (eval [] (parse_arith s));;
+
+ calc "42 * let x = 21 in x + x";;
--- /dev/null
+(*
+ * No debugging code at all:
+ * $ camlp4o -parser Camlp4DebugParser debug_extension.ml
+ * true
+ * Debugging code for lexing:
+ * $ STATIC_CAMLP4_DEBUG='lexing' camlp4o -parser Camlp4DebugParser debug_extension.ml
+ * let () =
+ * if Camlp4.Debug.mode "lexing"
+ * then Debug.printf "lexing" "TOKEN: Int %d" (2 * 21)
+ * else ()
+ * in true
+ *
+ * Debugging code for lexing and parsing:
+ * $ STATIC_CAMLP4_DEBUG='lexing:parsing' camlp4o -parser Camlp4DebugParser debug_extension.ml
+ * let () =
+ * if Camlp4.Debug.mode "lexing"
+ * then Debug.printf "lexing" "TOKEN: Int %d" (2 * 21)
+ * else () in
+ * let () =
+ * if Camlp4.Debug.mode "parsing"
+ * then Debug.printf "parsing" "RULE: ..."
+ * else ()
+ * in true
+ *
+ * Debugging code for any section:
+ * $ STATIC_CAMLP4_DEBUG='*' camlp4o -parser Camlp4DebugParser debug_extension.ml
+ * ... same output as above ...
+ *
+ * When you program is compiled you can use the CAMLP4_DEBUG variable to
+ * activate some debugging sections.
+ *
+ * CAMLP4_DEBUG_FILE manage where messages goes (default is stderr).
+ *)
+
+camlp4_debug lexing "TOKEN: Int %d" (2 * 21) in
+camlp4_debug parsing "RULE: ..." in
+true
--- /dev/null
+open Camlp4.PreCast;;
+module Caml =
+ Camlp4OCamlParser.Make
+ (Camlp4OCamlRevisedParser.Make
+ (Camlp4.OCamlInitSyntax.Make(Ast)(Gram)(Quotation)));;
+
+let quotexpander str =
+ "[1; 2; 3]" (* ... do some real code on str *)
+
+let patt_quotexpander loc _loc_name_opt str =
+ Gram.parse_string Caml.patt loc (quotexpander str)
+
+let expr_quotexpander loc _loc_name_opt str =
+ Gram.parse_string Caml.expr loc (quotexpander str)
+
+let str_item_quotexpander loc loc_name_opt str =
+ <:str_item@loc< $exp: expr_quotexpander loc loc_name_opt str$ >>
+
+let () =
+ Syntax.Quotation.add "" Syntax.Quotation.DynAst.expr_tag expr_quotexpander;
+ Syntax.Quotation.add "" Syntax.Quotation.DynAst.str_item_tag str_item_quotexpander;
+ Syntax.Quotation.add "" Syntax.Quotation.DynAst.patt_tag patt_quotexpander
--- /dev/null
+function <<foo>> -> <<bar>>
--- /dev/null
+(* x and y are free *)
+close_expr(x y);;
+
+(* bind x *)
+let x a = a + 42;;
+
+(* y is free *)
+close_expr(x y);;
+
+(* bind y locally so the expr is closed *)
+close_expr(let y = x 2 in x y);;
+
+(* bind y locally but outside, z is free *)
+let y = x 2 in close_expr(x (z y));;
fv << fun y -> fun x -> x y >> <<>>;
fv << let x = 42 and y = 44 in x y z >> << z >>;
fv << let z = g in let x = 42 and y = 44 in x y z >> << g >>;
-fv << let rec f x = g (x + 1) and g y = f (y - 1) in fun x -> g x * f x >> << \+ \- \* >>;
-fv << let rec f x = g (x + 1) and g y = f (g (y - 1)) in fun x -> g x * f x >> << \+ \- \* >>;
+fv << let rec f x = g (x + 1) and g y = f (y - 1) in fun x -> g x * f x >> << (+) (-) ( * ) >>;
+fv << let rec f x = g (x + 1) and g y = f (g (y - 1)) in fun x -> g x * f x >> << (+) (-) ( * ) >>;
fv << let i = 42 in let module M = struct value f x = y x; end in M.h >> << y >>;
fv << fun [ { x = A z; y = y } as q -> x z y a q ] >> << x a >>;
-fv << let module M = struct value a = 42; value b = a + 1; end in () >> <<\+>>;
+fv << let module M = struct value a = 42; value b = a + 1; end in () >> <<(+)>>;
-fv << let module M = struct value rec a = 42; value b = a + 1; end in () >> <<\+>>;
+fv << let module M = struct value rec a = 42; value b = a + 1; end in () >> <<(+)>>;
fv << let rec f x = x and g = x in y >> << x y >>;
fv << let f x = x in x >> << x >>;
--- /dev/null
+open Camlp4.PreCast;;
+
+let gen patts exprs =
+ let cases =
+ List.fold_right2 begin fun patt expr acc ->
+ let _loc = Loc.merge (Ast.loc_of_patt patt) (Ast.loc_of_expr expr) in
+ <:match_case< $patt$ -> $expr$ | $acc$ >>
+ end patts exprs <:match_case@here<>>
+ in
+ let _loc = Ast.loc_of_match_case cases in
+ <:expr< function $cases$ >>
+;;
--- /dev/null
+open Camlp4.PreCast;;
+
+let data_constructor_arguments _loc n t =
+ let rec self n =
+ if n <= 0 then <:ctyp<>> else <:ctyp< $t$ and $self (n-1)$ >>
+ in self n
+;;
+
+let data_constructor _loc n t =
+ <:ctyp< $uid:"C"^string_of_int n$ of $data_constructor_arguments _loc n t$ >>
+;;
+
+let gen_type _loc n t =
+ let rec self n =
+ if n <= 0 then <:ctyp<>>
+ else <:ctyp< $self (n-1)$ | $data_constructor _loc n t$ >>
+ in <:ctyp< [ $self n$ ] >>
+;;
+
+let filter =
+ function
+ | <:ctyp@_loc< gen_type $lid:x$ >> | <:ctyp@_loc< $lid:x$ gen_type >> ->
+ Scanf.sscanf x "%[^0-9]%d" begin fun _ n ->
+ gen_type _loc n <:ctyp< $lid:x$ >>
+ end
+ | t -> t
+;;
+
+AstFilters.register_str_item_filter (Ast.map_ctyp filter)#str_item;;
+
+IFDEF TEST THEN
+ type t7 = gen_type t7;;
+ENDIF;;
value global_handler_ref = ref <:expr@ghost<>>;
-value find_global_handler = object
- inherit Ast.map as super;
- method str_item st = do {
- match st with
- [ <:str_item< value global_handler = $f$ >> -> global_handler_ref.val := f
- | _ -> () ];
- super#str_item st
- };
-end;
+value find_global_handler =
+ Ast.map_str_item begin
+ fun
+ [ <:str_item@_loc< value global_handler = $f$ >> ->
+ (global_handler_ref.val := f; <:str_item<>>)
+ | st -> st ]
+ end;
-AstFilters.register_str_item_filter
- (fun st ->
- let _ = find_global_handler#str_item st in
- <:str_item@ghost< try let module Main = struct $st$ end in ()
- with e -> $global_handler_ref.val$ e >>);
+AstFilters.register_str_item_filter begin fun st ->
+ let _ = find_global_handler#str_item st in
+ <:str_item@ghost< try let module Main = struct $st$ end in ()
+ with e -> $global_handler_ref.val$ e >>
+end;
--- /dev/null
+(* Please keep me in sync with brion.inria.fr/gallium/index.php/Lambda_calculus_quotations *)
+
+open Camlp4.PreCast;;
+module CamlSyntax = Camlp4OCamlParser.Make(Camlp4OCamlRevisedParser.Make(Syntax));;
+
+let expr_of_string = CamlSyntax.Gram.parse_string CamlSyntax.expr_eoi;;
+
+module LambdaGram = MakeGram(Lexer);;
+
+let term = LambdaGram.Entry.mk "term";;
+let term_eoi = LambdaGram.Entry.mk "lambda term quotation";;
+
+Camlp4_config.antiquotations := true;;
+
+EXTEND LambdaGram
+ GLOBAL: term term_eoi;
+ term:
+ [ "top"
+ [ "fun"; v = var; "->"; t = term -> <:expr< `Lam($v$, $t$) >> ]
+ | "app"
+ [ t1 = SELF; t2 = SELF -> <:expr< `App($t1$, $t2$) >> ]
+ | "simple"
+ [ `ANTIQUOT((""|"term"), a) -> expr_of_string _loc a
+ | v = var -> <:expr< `Var($v$) >>
+ | "("; t = term; ")" -> t ]
+ ];
+ var:
+ [[ v = LIDENT -> <:expr< $str:v$ >>
+ | `ANTIQUOT((""|"var"), a) -> expr_of_string _loc a
+ ]];
+ term_eoi:
+ [[ t = term; `EOI -> t ]];
+END;;
+
+let expand_lambda_quot_expr loc _loc_name_opt quotation_contents =
+ LambdaGram.parse_string term_eoi loc quotation_contents;;
+
+Syntax.Quotation.add "lam" Syntax.Quotation.DynAst.expr_tag expand_lambda_quot_expr;;
+
+Syntax.Quotation.default := "lam";;
let succ = << fun n -> fun s -> fun z -> s n >>
let one = << $succ$ $zero$ >>
let iota = << fun x -> z >>
-let rho = << fun m -> fun r -> (s m (m r iota r)) >>
+let rho = << fun m -> fun r -> (s m (m r $iota$ r)) >>
let rec_nat =
<< fun n -> fun s -> fun z -> n $rho$ $iota$ $rho$ >>
let plus = << fun n -> fun m -> $rec_nat$ n (fun n -> fun p -> $succ$ p) m >>
open Camlp4.PreCast;;
-module CamlGram = MakeGram(Lexer);;
-
module Caml =
Camlp4.Printers.OCaml.Make
(Camlp4OCamlParser.Make
--- /dev/null
+type variable = string
+ and term =
+ | Var of variable
+ | Lam of variable * term
+ | App of term * term
+ | Const of constant
+ and constant =
+ | CInt of int
+ | CString of string
+;;
+
+class fold = Camlp4Filters.GenerateFold.generated;;
+(* class fold = Camlp4FoldGenerator.generated;; *)
+
+module VarSet = Set.Make(String);;
+
+(* Compute free variables with the fold class *)
+let free_variables_v1 =
+ let o =
+ object (self)
+ inherit fold as super
+ val fv = VarSet.empty
+ method fv = fv
+ method empty_fv = {< fv = VarSet.empty >}
+ method term t =
+ match t with
+ | Var(v) -> {< fv = VarSet.add v fv >}
+ | Lam(v, t) ->
+ let fv1 = VarSet.remove v (self#empty_fv#term t)#fv in
+ {< fv = VarSet.union fv fv1 >}
+ | _ -> super#term t
+ end
+ in fun t -> VarSet.elements (o#term t)#fv
+;;
+
+(* Let's try to abstract that a little *)
+
+let fold_term f t init =
+ let o =
+ object (self)
+ inherit fold as super
+ val acc = init
+ method get = acc
+ method reset = {< acc = init >}
+ method term t =
+ {< acc = f t acc (fun t -> (self#reset#term t)#get)
+ (fun t -> (super#term t)#get) >}
+ end
+ in
+ (o#term t)#get
+;;
+
+(* A nicer version of free_variables *)
+let free_variables_v2 t =
+ VarSet.elements begin
+ fold_term begin fun t fv self next ->
+ match t with
+ | Var(v) -> VarSet.add v fv
+ | Lam(v, t) -> VarSet.union fv (VarSet.remove v (self t))
+ | _ -> next t
+ end t VarSet.empty
+ end
+;;
+
+let term1 =
+ App(
+ App(Var"x1",
+ Lam("x",
+ App(Var"x", App(Var"y", (Lam("y", Lam("z", (App(Var"y", App(Var"x4",Var"z")))))))))),
+ Var"x3")
+
+;;
+
+let fv1 = free_variables_v1 term1;;
+let fv2 = free_variables_v2 term1;;
+
+(* Low cost syntax *)
+let ( ^-> ) v t = Lam(v, t)
+let ( @ ) t1 t2 = App(t1, t2)
+let ( ! ) s = Var s
+
+let term2 =
+ !"x1" @
+ ("x" ^-> !"x" @ !"y" @ ("y" ^-> ("z" ^-> !"y" @ !"x4" @ !"z"))) @
+ !"x3"
+
+;;
+
+let fv1' = free_variables_v1 term2;;
+let fv2' = free_variables_v2 term2;;
--- /dev/null
+type variable = string
+ and term =
+ | Var of variable
+ | Lam of variable * term
+ | App of term * term
+ | Const of constant
+ and constant =
+ | CInt of int
+ | CString of string
+ and program =
+ | Def of string * term
+ | Seq of program list
+;;
+
+class map = Camlp4Filters.GenerateMap.generated;;
+(* class map = Camlp4MapGenerator.generated;; *)
+
+let map_term f = object
+ inherit map as super
+ method term t = f (super#term t)
+end;;
+
+let map_term' f = object (self)
+ inherit map as super
+ method term t = f t self#term super#term
+end;;
+
+(* Suppress calls to the identity function... *)
+let suppress_id =
+ map_term begin function
+ | App(Lam(v, Var(v')), t) when v = v' -> t
+ | x -> x
+ end;;
+
+(* Substitute blindly all occurences of v by t *)
+let raw_subst v t =
+ map_term' begin fun t' _ next ->
+ match t' with
+ | Var(v') when v = v' -> t
+ | x -> next x
+ end;;
+
+let id = Lam("x", Var"x");;
+let _42 = Const(CInt 42);;
+let prog =
+ Seq[Def("foo", App(id, _42)); Def("bar", App(id, id))];;
+
+let prog2 = suppress_id#program prog;;
+let term3 = suppress_id#term (App(id, _42));;
+
+let term4 = (raw_subst "x" _42)#term (App(Var"succ", Var"x"));;
--- /dev/null
+test_macros.cmo
+lambda_test.cmo
+free_vars_test.byte
+free_vars_test.native
+global_handler_test.cmo
+apply_operator_test.cmo
+test_type_quotation.cmo
+expression_closure_test.cmo
# #
#########################################################################
-# $Id: Makefile.msvc,v 1.21.2.2 2007/05/12 13:50:20 pouillar Exp $
+# $Id: Makefile.msvc,v 1.21.2.3 2007/10/25 09:31:54 xleroy Exp $
# Configuration for Windows, Visual C++ compiler
BYTECCCOMPOPTS=/Ox /MT
### Additional link-time options for $(BYTECC). (For static linking.)
-BYTECCLINKOPTS=/MT
+BYTECCLINKOPTS=/MT /F16777216
### Additional compile-time options for $(BYTECC). (For building a DLL.)
DLLCCCOMPOPTS=/Ox /MD -DCAML_DLL
NATIVECCCOMPOPTS=/Ox /MT
### Additional link-time options for $(NATIVECC)
-NATIVECCLINKOPTS=/MT
+NATIVECCLINKOPTS=/MT /F16777216
### Build partially-linked object file
PARTIALLD=link /lib /nologo
# #
#########################################################################
-# $Id: Makefile.msvc64,v 1.6 2007/03/01 09:50:58 xleroy Exp $
+# $Id: Makefile.msvc64,v 1.6.2.1 2007/10/25 09:31:54 xleroy Exp $
# Configuration for Windows, Visual C++ compiler
BYTECCDBGCOMPOPTS=-DDEBUG /Zi /W3 /Wp64
### Additional link-time options for $(BYTECC). (For static linking.)
-BYTECCLINKOPTS=/MT
+BYTECCLINKOPTS=/MT /F33554432
### Additional compile-time options for $(BYTECC). (For building a DLL.)
DLLCCCOMPOPTS=/Ox /MD -DCAML_DLL
NATIVECCCOMPOPTS=/Ox /MT
### Additional link-time options for $(NATIVECC)
-NATIVECCLINKOPTS=/MT
+NATIVECCLINKOPTS=/MT /F33554432
### Build partially-linked object file
PARTIALLD=link /lib /nologo /machine:AMD64
/* */
/***********************************************************************/
-/* $Id: stackov.c,v 1.4 2003/07/23 07:57:17 xleroy Exp $ */
+/* $Id: stackov.c,v 1.4.18.1 2007/11/06 12:26:15 xleroy Exp $ */
#include <stdio.h>
#include <signal.h>
int main(int argc, char ** argv)
{
- struct sigaltstack stk;
+ stack_t stk;
struct sigaction act;
stk.ss_sp = sig_alt_stack;
# #
#########################################################################
-# $Id: configure,v 1.244.4.2 2007/05/03 12:49:56 xleroy Exp $
+# $Id: configure,v 1.244.4.7 2008/01/04 13:26:38 doligez Exp $
configure_options="$*"
prefix=/usr/local
# Further machine-specific hacks
case "$host" in
- ia64-*-linux*|alpha*-*-linux*|x86_64-*-linux*)
+ ia64-*-linux*|alpha*-*-linux*|x86_64-*-linux*|sparc64-*-linux*)
echo "Will use mmap() instead of malloc() for allocation of major heap chunks."
echo "#define USE_MMAP_INSTEAD_OF_MALLOC" >> s.h;;
esac
hppa2.0*-*-hpux*) arch=hppa; system=hpux;;
hppa*-*-linux*) arch=hppa; system=linux;;
hppa*-*-gnu*) arch=hppa; system=gnu;;
- powerpc-*-linux*) arch=power; model=ppc; system=elf;;
+ powerpc*-*-linux*) arch=power; model=ppc; system=elf;;
powerpc-*-netbsd*) arch=power; model=ppc; system=elf;;
powerpc-*-rhapsody*) arch=power; model=ppc; system=rhapsody;;
powerpc-*-darwin*) arch=power; system=rhapsody
x86_64-*-openbsd*) arch=amd64; system=openbsd;;
esac
+# Some platforms exist both in 32-bit and 64-bit variants, not distinguished
+# by $host. Turn off native code compilation on platforms where 64-bit mode
+# is not supported. (PR#4441)
+
+if $arch64; then
+ case "$arch,$model" in
+ sparc,default|mips,default|hppa,default|power,ppc)
+ arch=none; model=default; system=unknown;;
+ esac
+fi
+
if test -z "$ccoption"; then
case "$arch,$system,$cc" in
alpha,digital,gcc*) nativecc=cc;;
esac
asflags=''
-aspp='$(AS)'
+aspp=''
asppflags=''
asppprofflags='-DPROFILING'
case "$arch,$model,$system" in
- alpha,*,digital) asflags='-O2'; asppflags='-O2 -DSYS_$(SYSTEM)';
+ alpha,*,digital) aspp='as'; asflags='-O2'; asppflags='-O2 -DSYS_$(SYSTEM)';
asppprofflags='-pg -DPROFILING';;
alpha,*,linux) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';;
alpha,*,gnu) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';;
alpha,*,freebsd) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';;
alpha,*,netbsd) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';;
alpha,*,openbsd) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';;
- mips,*,irix) asflags='-n32 -O2'; asppflags="$asflags";;
+ mips,*,irix) aspp='as'; asflags='-n32 -O2'; asppflags="$asflags";;
sparc,*,bsd) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';;
sparc,*,linux) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';;
sparc,*,gnu) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';;
sparc,*,*) case "$cc" in
gcc*) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';;
- *) asppflags='-P -DSYS_$(SYSTEM)';;
+ *) aspp='as'; asppflags='-P -DSYS_$(SYSTEM)';;
esac;;
i386,*,solaris) aspp='/usr/ccs/bin/as'; asppflags='-P -DSYS_$(SYSTEM)';;
i386,*,*) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';;
/usr/x386/lib \
/usr/XFree86/lib/X11 \
\
+ /usr/lib64 \
/usr/lib \
/usr/local/lib \
/usr/unsupported/lib \
if test -f $dir/libX11.a || \
test -f $dir/libX11.so || \
test -f $dir/libX11.dll.a || \
+ test -f $dir/libX11.dylib || \
test -f $dir/libX11.sa; then
if test $dir = /usr/lib; then
x11_link="-lX11"
(* *)
(***********************************************************************)
-(* $Id: main.ml,v 1.19 2006/12/09 13:49:10 ertai Exp $ *)
+(* $Id: main.ml,v 1.19.6.1 2007/09/24 07:45:31 garrigue Exp $ *)
open Primitives
open Misc
current_prompt := debugger_prompt;
printf "\tObjective Caml Debugger version %s@.@." Config.version;
Config.load_path := !default_load_path;
+ Clflags.recursive_types := true; (* Allow recursive types. *)
toplevel_loop (); (* Toplevel. *)
kill_program ();
exit 0
- O'Caml emacs mode, snapshot of $Date: 2002/08/05 02:05:42 $
+ O'Caml emacs mode, snapshot of $Date: 2007/10/29 07:16:43 $
The files in this archive define a caml-mode for emacs, for editing
Objective Caml and Objective Label programs, as well as an
Changes log:
-----------
+Version 3.10.1:
+---------------
+* use caml-font.el from Olivier Andrieu
+ old version is left as caml-font-old.el for compatibility
+
+Version 3.07:
+-------------
+* support for showing type information <Damien Doligez>
Version 3.05:
-------------
Comments and bug reports to
- Jacques Garrigue <garrigue@kurims.kyoto-u.ac.jp>
+ Jacques Garrigue <garrigue@math.nagoya-u.ac.jp>
--- /dev/null
+;(***********************************************************************)
+;(* *)
+;(* Objective Caml *)
+;(* *)
+;(* Jacques Garrigue and Ian T Zimmerman *)
+;(* *)
+;(* Copyright 1997 Institut National de Recherche en Informatique et *)
+;(* en Automatique. All rights reserved. This file is distributed *)
+;(* under the terms of the GNU General Public License. *)
+;(* *)
+;(***********************************************************************)
+
+;(* $Id: caml-font-old.el,v 1.1.2.1 2007/10/29 07:16:43 garrigue Exp $ *)
+
+;; useful colors
+
+(cond
+ ((x-display-color-p)
+ (require 'font-lock)
+ (cond
+ ((not (boundp 'font-lock-type-face))
+ ; make the necessary faces
+ (make-face 'Firebrick)
+ (set-face-foreground 'Firebrick "Firebrick")
+ (make-face 'RosyBrown)
+ (set-face-foreground 'RosyBrown "RosyBrown")
+ (make-face 'Purple)
+ (set-face-foreground 'Purple "Purple")
+ (make-face 'MidnightBlue)
+ (set-face-foreground 'MidnightBlue "MidnightBlue")
+ (make-face 'DarkGoldenRod)
+ (set-face-foreground 'DarkGoldenRod "DarkGoldenRod")
+ (make-face 'DarkOliveGreen)
+ (set-face-foreground 'DarkOliveGreen "DarkOliveGreen4")
+ (make-face 'CadetBlue)
+ (set-face-foreground 'CadetBlue "CadetBlue")
+ ; assign them as standard faces
+ (setq font-lock-comment-face 'Firebrick)
+ (setq font-lock-string-face 'RosyBrown)
+ (setq font-lock-keyword-face 'Purple)
+ (setq font-lock-function-name-face 'MidnightBlue)
+ (setq font-lock-variable-name-face 'DarkGoldenRod)
+ (setq font-lock-type-face 'DarkOliveGreen)
+ (setq font-lock-reference-face 'CadetBlue)))
+ ; extra faces for documention
+ (make-face 'Stop)
+ (set-face-foreground 'Stop "White")
+ (set-face-background 'Stop "Red")
+ (make-face 'Doc)
+ (set-face-foreground 'Doc "Red")
+ (setq font-lock-stop-face 'Stop)
+ (setq font-lock-doccomment-face 'Doc)
+))
+
+; The same definition is in caml.el:
+; we don't know in which order they will be loaded.
+(defvar caml-quote-char "'"
+ "*Quote for character constants. \"'\" for Objective Caml, \"`\" for Caml-Light.")
+
+(defconst caml-font-lock-keywords
+ (list
+;stop special comments
+ '("\\(^\\|[^\"]\\)\\((\\*\\*/\\*\\*)\\)"
+ 2 font-lock-stop-face)
+;doccomments
+ '("\\(^\\|[^\"]\\)\\((\\*\\*[^*]*\\([^)*][^*]*\\*+\\)*)\\)"
+ 2 font-lock-doccomment-face)
+;comments
+ '("\\(^\\|[^\"]\\)\\((\\*[^*]*\\*+\\([^)*][^*]*\\*+\\)*)\\)"
+ 2 font-lock-comment-face)
+;character literals
+ (cons (concat caml-quote-char "\\(\\\\\\([ntbr" caml-quote-char "\\]\\|"
+ "[0-9][0-9][0-9]\\)\\|.\\)" caml-quote-char
+ "\\|\"[^\"\\]*\\(\\\\\\(.\\|\n\\)[^\"\\]*\\)*\"")
+ 'font-lock-string-face)
+;modules and constructors
+ '("`?\\<[A-Z][A-Za-z0-9_']*\\>" . font-lock-function-name-face)
+;definition
+ (cons (concat
+ "\\<\\(a\\(nd\\|s\\)\\|c\\(onstraint\\|lass\\)"
+ "\\|ex\\(ception\\|ternal\\)\\|fun\\(ct\\(ion\\|or\\)\\)?"
+ "\\|in\\(herit\\|itializer\\)?\\|let"
+ "\\|m\\(ethod\\|utable\\|odule\\)"
+ "\\|of\\|p\\(arser\\|rivate\\)\\|rec\\|type"
+ "\\|v\\(al\\|irtual\\)\\)\\>")
+ 'font-lock-type-face)
+;blocking
+ '("\\<\\(begin\\|end\\|object\\|s\\(ig\\|truct\\)\\)\\>"
+ . font-lock-keyword-face)
+;control
+ (cons (concat
+ "\\<\\(do\\(ne\\|wnto\\)?\\|else\\|for\\|i\\(f\\|gnore\\)"
+ "\\|lazy\\|match\\|new\\|or\\|t\\(hen\\|o\\|ry\\)"
+ "\\|w\\(h\\(en\\|ile\\)\\|ith\\)\\)\\>"
+ "\\|\|\\|->\\|&\\|#")
+ 'font-lock-reference-face)
+ '("\\<raise\\>" . font-lock-comment-face)
+;labels (and open)
+ '("\\(\\([~?]\\|\\<\\)[a-z][a-zA-Z0-9_']*:\\)[^:=]" 1
+ font-lock-variable-name-face)
+ '("\\<\\(assert\\|open\\|include\\)\\>\\|[~?][ (]*[a-z][a-zA-Z0-9_']*"
+ . font-lock-variable-name-face)))
+
+(defconst inferior-caml-font-lock-keywords
+ (append
+ (list
+;inferior
+ '("^[#-]" . font-lock-comment-face))
+ caml-font-lock-keywords))
+
+;; font-lock commands are similar for caml-mode and inferior-caml-mode
+(defun caml-mode-font-hook ()
+ (cond
+ ((fboundp 'global-font-lock-mode)
+ (make-local-variable 'font-lock-defaults)
+ (setq font-lock-defaults
+ '(caml-font-lock-keywords nil nil ((?' . "w") (?_ . "w")))))
+ (t
+ (setq font-lock-keywords caml-font-lock-keywords)))
+ (make-local-variable 'font-lock-keywords-only)
+ (setq font-lock-keywords-only t)
+ (font-lock-mode 1))
+
+(add-hook 'caml-mode-hook 'caml-mode-font-hook)
+
+(defun inferior-caml-mode-font-hook ()
+ (cond
+ ((fboundp 'global-font-lock-mode)
+ (make-local-variable 'font-lock-defaults)
+ (setq font-lock-defaults
+ '(inferior-caml-font-lock-keywords
+ nil nil ((?' . "w") (?_ . "w")))))
+ (t
+ (setq font-lock-keywords inferior-caml-font-lock-keywords)))
+ (make-local-variable 'font-lock-keywords-only)
+ (setq font-lock-keywords-only t)
+ (font-lock-mode 1))
+
+(add-hook 'inferior-caml-mode-hooks 'inferior-caml-mode-font-hook)
+
+(provide 'caml-font)
-;(***********************************************************************)
-;(* *)
-;(* Objective Caml *)
-;(* *)
-;(* Jacques Garrigue and Ian T Zimmerman *)
-;(* *)
-;(* Copyright 1997 Institut National de Recherche en Informatique et *)
-;(* en Automatique. All rights reserved. This file is distributed *)
-;(* under the terms of the GNU General Public License. *)
-;(* *)
-;(***********************************************************************)
+;; caml-font: font-lock support for OCaml files
+;;
+;; rewrite and clean-up.
+;; Changes:
+;; - fontify strings and comments using syntactic font lock
+;; - define a `font-lock-syntactic-face-function' to fontify ocamldoc comments
+;; - fontify infix operators like mod, land, lsl, etc.
+;; - fontify line number directives
+;; - fontify "failwith" and "invalid_arg" like "raise"
+;; - fontify '\x..' character constants
+;; - use the regexp-opt function to build regexps (more readable)
+;; - use backquote and comma in sexp (more readable)
+;; - drop the `caml-quote-char' variable (I don't use caml-light :))
+;; - stop doing weird things with faces
-;(* $Id: caml-font.el,v 1.19 2004/08/20 17:04:35 doligez Exp $ *)
-;; useful colors
+(require 'font-lock)
-(cond
- ((x-display-color-p)
- (require 'font-lock)
- (cond
- ((not (boundp 'font-lock-type-face))
- ; make the necessary faces
- (make-face 'Firebrick)
- (set-face-foreground 'Firebrick "Firebrick")
- (make-face 'RosyBrown)
- (set-face-foreground 'RosyBrown "RosyBrown")
- (make-face 'Purple)
- (set-face-foreground 'Purple "Purple")
- (make-face 'MidnightBlue)
- (set-face-foreground 'MidnightBlue "MidnightBlue")
- (make-face 'DarkGoldenRod)
- (set-face-foreground 'DarkGoldenRod "DarkGoldenRod")
- (make-face 'DarkOliveGreen)
- (set-face-foreground 'DarkOliveGreen "DarkOliveGreen4")
- (make-face 'CadetBlue)
- (set-face-foreground 'CadetBlue "CadetBlue")
- ; assign them as standard faces
- (setq font-lock-comment-face 'Firebrick)
- (setq font-lock-string-face 'RosyBrown)
- (setq font-lock-keyword-face 'Purple)
- (setq font-lock-function-name-face 'MidnightBlue)
- (setq font-lock-variable-name-face 'DarkGoldenRod)
- (setq font-lock-type-face 'DarkOliveGreen)
- (setq font-lock-reference-face 'CadetBlue)))
- ; extra faces for documention
- (make-face 'Stop)
- (set-face-foreground 'Stop "White")
- (set-face-background 'Stop "Red")
- (make-face 'Doc)
- (set-face-foreground 'Doc "Red")
- (setq font-lock-stop-face 'Stop)
- (setq font-lock-doccomment-face 'Doc)
-))
+(defvar caml-font-stop-face
+ (progn
+ (make-face 'caml-font-stop-face)
+ (set-face-foreground 'caml-font-stop-face "White")
+ (set-face-background 'caml-font-stop-face "Red")
+ 'caml-font-stop-face))
-; The same definition is in caml.el:
-; we don't know in which order they will be loaded.
-(defvar caml-quote-char "'"
- "*Quote for character constants. \"'\" for Objective Caml, \"`\" for Caml-Light.")
+(defvar caml-font-doccomment-face
+ (progn
+ (make-face 'caml-font-doccomment-face)
+ (set-face-foreground 'caml-font-doccomment-face "Red")
+ 'caml-font-doccomment-face))
+
+(unless (facep 'font-lock-preprocessor-face)
+ (defvar font-lock-preprocessor-face
+ (copy-face 'font-lock-builtin-face
+ 'font-lock-preprocessor-face)))
(defconst caml-font-lock-keywords
- (list
-;stop special comments
- '("\\(^\\|[^\"]\\)\\((\\*\\*/\\*\\*)\\)"
- 2 font-lock-stop-face)
-;doccomments
- '("\\(^\\|[^\"]\\)\\((\\*\\*[^*]*\\([^)*][^*]*\\*+\\)*)\\)"
- 2 font-lock-doccomment-face)
-;comments
- '("\\(^\\|[^\"]\\)\\((\\*[^*]*\\*+\\([^)*][^*]*\\*+\\)*)\\)"
- 2 font-lock-comment-face)
+ `(
;character literals
- (cons (concat caml-quote-char "\\(\\\\\\([ntbr" caml-quote-char "\\]\\|"
- "[0-9][0-9][0-9]\\)\\|.\\)" caml-quote-char
- "\\|\"[^\"\\]*\\(\\\\\\(.\\|\n\\)[^\"\\]*\\)*\"")
- 'font-lock-string-face)
+ ("'\\(.\\|\\\\\\([ntbr\"'\\\\]\\|[0-9]\\{3\\}\\|x[0-9A-Fa-f]\\{2\\}\\)\\)'"
+ . font-lock-string-face)
;modules and constructors
- '("`?\\<[A-Z][A-Za-z0-9_']*\\>" . font-lock-function-name-face)
+ ("`?\\<[A-Z][A-Za-z0-9_']*\\>" . font-lock-function-name-face)
;definition
- (cons (concat
- "\\<\\(a\\(nd\\|s\\)\\|c\\(onstraint\\|lass\\)"
- "\\|ex\\(ception\\|ternal\\)\\|fun\\(ct\\(ion\\|or\\)\\)?"
- "\\|in\\(herit\\|itializer\\)?\\|let"
- "\\|m\\(ethod\\|utable\\|odule\\)"
- "\\|of\\|p\\(arser\\|rivate\\)\\|rec\\|type"
- "\\|v\\(al\\|irtual\\)\\)\\>")
- 'font-lock-type-face)
+ (,(regexp-opt '("and" "as" "constraint" "class"
+ "exception" "external" "fun" "function" "functor"
+ "in" "inherit" "initializer" "let"
+ "method" "mutable" "module" "of" "private" "rec"
+ "type" "val" "virtual")
+ 'words)
+ . font-lock-type-face)
;blocking
- '("\\<\\(begin\\|end\\|object\\|s\\(ig\\|truct\\)\\)\\>"
- . font-lock-keyword-face)
+ (,(regexp-opt '("begin" "end" "object" "sig" "struct") 'words)
+ . font-lock-keyword-face)
+;linenums
+ ("# *[0-9]+" . font-lock-preprocessor-face)
+;infix operators
+ (,(regexp-opt '("asr" "land" "lor" "lsl" "lsr" "lxor" "mod") 'words)
+ . font-lock-builtin-face)
;control
- (cons (concat
- "\\<\\(do\\(ne\\|wnto\\)?\\|else\\|for\\|i\\(f\\|gnore\\)"
- "\\|lazy\\|match\\|new\\|or\\|t\\(hen\\|o\\|ry\\)"
- "\\|w\\(h\\(en\\|ile\\)\\|ith\\)\\)\\>"
- "\\|\|\\|->\\|&\\|#")
- 'font-lock-reference-face)
- '("\\<raise\\>" . font-lock-comment-face)
+ (,(concat "[|#&]\\|->\\|"
+ (regexp-opt '("do" "done" "dowto" "else" "for" "if" "ignore"
+ "lazy" "match" "new" "or" "then" "to" "try"
+ "when" "while" "with")
+ 'words))
+ . font-lock-constant-face)
+ ("\\<raise\\|failwith\\|invalid_arg\\>"
+ . font-lock-comment-face)
;labels (and open)
- '("\\(\\([~?]\\|\\<\\)[a-z][a-zA-Z0-9_']*:\\)[^:=]" 1
- font-lock-variable-name-face)
- '("\\<\\(assert\\|open\\|include\\)\\>\\|[~?][ (]*[a-z][a-zA-Z0-9_']*"
- . font-lock-variable-name-face)))
+ ("\\(\\([~?]\\|\\<\\)[a-z][a-zA-Z0-9_']*:\\)[^:=]"
+ 1 font-lock-variable-name-face)
+ ("\\<\\(assert\\|open\\|include\\)\\>\\|[~?][ (]*[a-z][a-zA-Z0-9_']*"
+ . font-lock-variable-name-face)))
-(defconst inferior-caml-font-lock-keywords
- (append
- (list
-;inferior
- '("^[#-]" . font-lock-comment-face))
- caml-font-lock-keywords))
-;; font-lock commands are similar for caml-mode and inferior-caml-mode
-(add-hook 'caml-mode-hook
- '(lambda ()
- (cond
- ((fboundp 'global-font-lock-mode)
- (make-local-variable 'font-lock-defaults)
- (setq font-lock-defaults
- '(caml-font-lock-keywords nil nil ((?' . "w") (?_ . "w")))))
- (t
- (setq font-lock-keywords caml-font-lock-keywords)))
- (make-local-variable 'font-lock-keywords-only)
- (setq font-lock-keywords-only t)
- (font-lock-mode 1)))
+(defun caml-font-syntactic-face (s)
+ (let ((in-string (nth 3 s))
+ (in-comment (nth 4 s))
+ (start (nth 8 s)))
+ (cond
+ (in-string 'font-lock-string-face)
+ (in-comment
+ (goto-char start)
+ (cond
+ ((looking-at "(\\*\\*/\\*\\*)") 'caml-font-stop-face)
+ ((looking-at "(\\*\\*[^*]") 'caml-font-doccomment-face)
+ (t 'font-lock-comment-face))))))
-(defun inferior-caml-mode-font-hook ()
- (cond
- ((fboundp 'global-font-lock-mode)
- (make-local-variable 'font-lock-defaults)
- (setq font-lock-defaults
- '(inferior-caml-font-lock-keywords
- nil nil ((?' . "w") (?_ . "w")))))
- (t
- (setq font-lock-keywords inferior-caml-font-lock-keywords)))
- (make-local-variable 'font-lock-keywords-only)
- (setq font-lock-keywords-only t)
+
+;; font-lock commands are similar for caml-mode and inferior-caml-mode
+(defun caml-font-set-font-lock ()
+ (setq font-lock-defaults
+ '(caml-font-lock-keywords
+ nil nil nil nil
+ (font-lock-syntactic-face-function . caml-font-syntactic-face)))
(font-lock-mode 1))
+(add-hook 'caml-mode-hook 'caml-font-set-font-lock)
-(add-hook 'inferior-caml-mode-hooks 'inferior-caml-mode-font-hook)
+
+
+(defconst inferior-caml-font-lock-keywords
+ `(("^[#-]" . font-lock-comment-face)
+ ,@caml-font-lock-keywords))
+
+(defun inferior-caml-set-font-lock ()
+ (setq font-lock-defaults
+ '(inferior-caml-font-lock-keywords
+ nil nil nil nil
+ (font-lock-syntactic-face-function . caml-font-syntactic-face)))
+ (font-lock-mode 1))
+(add-hook 'inferior-caml-mode-hooks 'inferior-caml-set-font-lock)
(provide 'caml-font)
;(* *)
;(***********************************************************************)
-;(* $Id: caml-types.el,v 1.33 2007/02/09 13:31:15 doligez Exp $ *)
+;(* $Id: caml-types.el,v 1.33.4.1 2007/06/25 14:40:23 doligez Exp $ *)
; An emacs-lisp complement to the "-dtypes" option of ocamlc and ocamlopt.
(target-line (1+ (count-lines (point-min)
(caml-line-beginning-position))))
(target-bol (caml-line-beginning-position))
- (target-cnum (point))
- (type-file (concat (file-name-sans-extension (buffer-file-name))
- ".annot")))
- (caml-types-preprocess type-file)
+ (target-cnum (point)))
+ (caml-types-preprocess (buffer-file-name))
(setq caml-types-buffer (get-buffer-create caml-types-buffer-name))
(let* ((targ-loc (vector target-file target-line target-bol target-cnum))
(node (caml-types-find-location targ-loc ()
(delete-overlay caml-types-expr-ovl)
)))
-(defun caml-types-preprocess (type-file)
- (let* ((type-date (nth 5 (file-attributes type-file)))
- (target-file (file-name-nondirectory (buffer-file-name)))
+(defun caml-types-preprocess (target-path)
+ (let* ((type-path (caml-types-locate-type-file target-path))
+ (type-date (nth 5 (file-attributes (file-chase-links type-path))))
(target-date (nth 5 (file-attributes target-file))))
(unless (and caml-types-annotation-tree
type-date
caml-types-annotation-date
(not (caml-types-date< caml-types-annotation-date type-date)))
(if (and type-date target-date (caml-types-date< type-date target-date))
- (error (format "%s is more recent than %s" target-file type-file)))
+ (error (format "`%s' is more recent than `%s'" target-path type-path)))
(message "Reading annotation file...")
- (let* ((type-buf (caml-types-find-file type-file))
+ (let* ((type-buf (caml-types-find-file type-path))
(tree (with-current-buffer type-buf
(widen)
(goto-char (point-min))
- (caml-types-build-tree target-file))))
+ (caml-types-build-tree
+ (file-name-nondirectory target-path)))))
(setq caml-types-annotation-tree tree
caml-types-annotation-date type-date)
(kill-buffer type-buf)
(message ""))
)))
+(defun caml-types-locate-type-file (target-path)
+ (let ((sibling (concat (file-name-sans-extension target-path) ".annot")))
+ (if (file-exists-p sibling)
+ sibling
+ (defun parent-dir (d) (file-name-directory (directory-file-name d)))
+ (let ((project-dir (file-name-directory sibling))
+ type-path)
+ (while (not (file-exists-p
+ (setq type-path
+ (expand-file-name
+ (file-relative-name sibling project-dir)
+ (expand-file-name "_build" project-dir)))))
+ (if (equal project-dir (parent-dir project-dir))
+ (error (concat "No annotation file. "
+ "You should compile with option \"-dtypes\".")))
+ (setq project-dir (parent-dir project-dir)))
+ type-path))))
+
(defun caml-types-date< (date1 date2)
(or (< (car date1) (car date2))
(and (= (car date1) (car date2))
(with-current-buffer buf (toggle-read-only 1))
)
(t
- (error "No annotation file. You should compile with option \"-dtypes\"."))
+ (error (format "Can't read the annotation file `%s'" name)))
)
buf))
(set-buffer (window-buffer (caml-event-window event)))
(let* ((target-buf (current-buffer))
(target-file (file-name-nondirectory (buffer-file-name)))
- (type-file (concat (file-name-sans-extension (buffer-file-name))
- ".annot"))
(target-line) (target-bol)
target-pos
Left Right limits cnum node mes type
(select-window window)
(unwind-protect
(progn
- (caml-types-preprocess type-file)
+ (caml-types-preprocess (buffer-file-name))
(setq target-tree caml-types-annotation-tree)
(setq caml-types-buffer (get-buffer-create caml-types-buffer-name))
;; (message "Drag the mouse to explore types")
flag ["ocaml"; "pp"; "camlp4boot"] (convert_command_for_windows_shell (S[ocamlrun; P hot_camlp4boot]));;
flag ["ocaml"; "pp"; "camlp4boot"; "native"] (S[A"-D"; A"OPT"]);;
-flag ["ocaml"; "pp"; "camlp4boot"; "ocamldep"] (S[A"-D"; A"OPT"]);;
+flag ["ocaml"; "pp"; "camlp4boot"; "pp:dep"] (S[A"-D"; A"OPT"]);;
+flag ["ocaml"; "pp"; "camlp4boot"; "pp:doc"] (S[A"-printer"; A"o"]);;
let exn_tracer = Pathname.pwd/"camlp4"/"boot"/"Camlp4ExceptionTracer.cmo" in
if Pathname.exists exn_tracer then
flag ["ocaml"; "pp"; "camlp4boot"; "exntracer"] (P exn_tracer);
let camlp4_arch =
dir "" [
dir "stdlib" [];
- dir "utils" [];
- dir "parsing" [];
dir "camlp4" [
dir "build" [];
dir_pack "Camlp4" [
Pathname.define_context "" ["stdlib"];;
Pathname.define_context "utils" [Pathname.current_dir_name; "stdlib"];;
-Pathname.define_context "camlp4" ["camlp4/build"; "utils"; "stdlib"];;
-Pathname.define_context "camlp4/boot" ["camlp4/build"; "utils"; "parsing"; "camlp4"; "stdlib"];;
-Pathname.define_context "camlp4/Camlp4Parsers" ["camlp4"; "camlp4/build"; "stdlib"];;
-Pathname.define_context "camlp4/Camlp4Printers" ["camlp4"; "camlp4/build"; "stdlib"];;
-Pathname.define_context "camlp4/Camlp4Filters" ["camlp4"; "camlp4/build"; "stdlib"];;
-Pathname.define_context "camlp4/Camlp4Top" ["typing"; "stdlib"];;
+Pathname.define_context "camlp4" ["camlp4"; "stdlib"];;
+Pathname.define_context "camlp4/boot" ["camlp4"; "stdlib"];;
+Pathname.define_context "camlp4/Camlp4Parsers" ["camlp4"; "stdlib"];;
+Pathname.define_context "camlp4/Camlp4Printers" ["camlp4"; "stdlib"];;
+Pathname.define_context "camlp4/Camlp4Filters" ["camlp4"; "stdlib"];;
+Pathname.define_context "camlp4/Camlp4Top" ["camlp4"; "stdlib"];;
+Pathname.define_context "parsing" ["parsing"; "utils"; "stdlib"];;
Pathname.define_context "typing" ["typing"; "parsing"; "utils"; "stdlib"];;
Pathname.define_context "ocamldoc" ["typing"; "parsing"; "utils"; "tools"; "bytecomp"; "stdlib"];;
Pathname.define_context "bytecomp" ["bytecomp"; "parsing"; "typing"; "utils"; "stdlib"];;
;;
rule "byte stdlib in partial mode"
- ~prod:"byte_stdlib_partial_mode"
+ ~stamp:"byte_stdlib_partial_mode"
~deps:["stdlib/stdlib.mllib"; "stdlib/stdlib.cma";
"stdlib/std_exit.cmo"; "stdlib/libcamlrun"-.-C.a;
"stdlib/camlheader"; "stdlib/camlheader_ur"]
"stdlib/stdlib.mllib" "stdlib/stdlib.cma" env build
in
import_stdlib_contents build ["cmi"];
- touch "byte_stdlib_partial_mode"
+ Nop
end;;
rule "native stdlib in partial mode"
- ~prod:"native_stdlib_partial_mode"
+ ~stamp:"native_stdlib_partial_mode"
~deps:["stdlib/stdlib.mllib"; "stdlib/stdlib.cmxa";
"stdlib/stdlib"-.-C.a; "stdlib/std_exit.cmx";
"stdlib/std_exit"-.-C.o; "stdlib/libasmrun"-.-C.a;
"stdlib/stdlib.mllib" "stdlib/stdlib.cmxa" env build
in
import_stdlib_contents build ["cmi"];
- touch "native_stdlib_partial_mode"
+ Nop
end;;
rule "C files"
"otherlibs/bigarray/bigarray.mli"; "otherlibs/num/num.mli"] in
rule "Standard library manual"
~prod:"ocamldoc/stdlib_man/Pervasives.3o"
+ ~stamp:"ocamldoc/stdlib_man.stamp" (* Depend on this file if you want to depends on all files of stdlib_man/* *)
~deps:stdlib_mlis
begin fun _ _ ->
Seq[Cmd(S[A"mkdir"; A"-p"; P"ocamldoc/stdlib_man"]);
let camlp4lib_cma = p4 "camlp4lib.cma"
let camlp4lib_cmxa = p4 "camlp4lib.cmxa"
+let camlp4lib_lib = p4 ("camlp4lib"-.-C.a)
let special_modules =
if Sys.file_exists "./boot/Profiler.cmo" then [camlp4Profiler] else []
+;;
+
+let camlp4_import_list =
+ ["utils/misc.ml";
+ "utils/terminfo.ml";
+ "parsing/linenum.ml";
+ "utils/warnings.ml";
+ "parsing/location.ml";
+ "parsing/longident.ml";
+ "parsing/asttypes.mli";
+ "parsing/parsetree.mli";
+ "typing/outcometree.mli";
+ "myocamlbuild_config.ml";
+ "utils/config.mlbuild"]
+;;
+
+rule "camlp4/Camlp4_import.ml"
+ ~deps:camlp4_import_list
+ ~prod:"camlp4/Camlp4_import.ml"
+ begin fun _ _ ->
+ Echo begin
+ List.fold_right begin fun path acc ->
+ let modname = module_name_of_pathname path in
+ "module " :: modname :: " = struct\n" :: Pathname.read path :: "\nend;;\n" :: acc
+ end camlp4_import_list [],
+ "camlp4/Camlp4_import.ml"
+ end
+ end;;
let mk_camlp4_top_lib name modules =
let name = "camlp4"/name in
let byte = name-.-"byte" in
let native = name-.-"native" in
let unix_cma, unix_cmxa, include_unix =
- if link_unix then A"unix.cma", A"unix.cmxa", S[A"-I"; P unix_dir] else N,N,N in
+ if link_unix
+ then A"unix.cma", A"unix.cmxa", S[A"-I"; P unix_dir]
+ else N,N,N in
+ let dep_unix_byte, dep_unix_native =
+ if link_unix && not partial
+ then [unix_dir/"unix.cma"],
+ [unix_dir/"unix.cmxa"; unix_dir/"unix"-.-C.a]
+ else [],[] in
let deps = special_modules @ modules @ [camlp4_bin] in
let cmos = add_extensions ["cmo"] deps in
let cmxs = add_extensions ["cmx"] deps in
+ let objs = add_extensions [C.o] deps in
rule byte
- ~deps:(camlp4lib_cma::cmos)
+ ~deps:(camlp4lib_cma::cmos @ dep_unix_byte)
~prod:(add_exe byte)
~insert:(`before "ocaml: cmo* -> byte")
begin fun _ _ ->
P camlp4lib_cma; A"-linkall"; atomize cmos; A"-o"; Px (add_exe byte)])
end;
rule native
- ~deps:(camlp4lib_cmxa::cmxs)
+ ~deps:(camlp4lib_cmxa :: camlp4lib_lib :: (cmxs @ objs @ dep_unix_native))
~prod:(add_exe native)
~insert:(`before "ocaml: cmx* & o* -> native")
begin fun _ _ ->
List.iter Outcome.ignore_good (build (List.map (fun i -> [i]) includes));
end;;
+dep ["ocaml"; "file:camlp4/Camlp4/Sig.ml"]
+ ["camlp4/Camlp4/Camlp4Ast.partial.ml"];;
+
rule "camlp4: ml4 -> ml"
~prod:"%.ml"
~dep:"%.ml4"
Pathname.define_context "otherlibs/labltk/browser"
["otherlibs/labltk/browser"; "otherlibs/labltk/labltk"; "otherlibs/labltk/support"; "parsing"; "utils"; "typing"; "stdlib"];;
-file_rule "otherlibs/labltk/compiler/copyright"
+rule "otherlibs/labltk/compiler/copyright"
~dep:"otherlibs/labltk/compiler/copyright"
~prod:"otherlibs/labltk/compiler/copyright.ml"
- ~cache:(fun _ _ -> "0.1")
- begin fun _ oc ->
- Printf.fprintf oc "let copyright = \"%a\";;\n\
- let write ~w = w copyright;;"
- fp_cat "otherlibs/labltk/compiler/copyright"
+ begin fun _ _ ->
+ Echo(["let copyright = \"";
+ Pathname.read "otherlibs/labltk/compiler/copyright";
+ "\";;\nlet write ~w = w copyright;;"],
+ "otherlibs/labltk/compiler/copyright.ml")
end;;
copy_rule "labltk tkcompiler" "otherlibs/labltk/compiler/maincompile.byte" "otherlibs/labltk/compiler/tkcompiler";;
end;;
let labltk_installdir = C.libdir/"labltk" in
-file_rule "labltk"
+rule "labltk"
~prod:"otherlibs/labltk/lib/labltk"
- ~cache:(fun _ _ -> labltk_installdir)
- begin fun _ oc ->
- Printf.fprintf oc
- "#!/bin/sh\n\
- exec %s -I %s $*\n" (labltk_installdir/"labltktop") labltk_installdir
+ begin fun _ _ ->
+ Echo(["#!/bin/sh\n";
+ Printf.sprintf "exec %s -I %s $*\n" (labltk_installdir/"labltktop") labltk_installdir],
+ "otherlibs/labltk/lib/labltk")
end;;
use_lib "otherlibs/labltk/browser/main" "toplevel/toplevellib";;
$(BUILDDIR)/ocamlbuildlightlib.cmxa \
$(BUILDDIR)/ocamlbuildlightlib.a \
$(BUILDDIR)/ocamlbuildlightlib.cma \
+ $(BUILDDIR)/ocamlbuild_unix_plugin.cmx \
+ $(BUILDDIR)/ocamlbuild_unix_plugin.o \
+ $(BUILDDIR)/ocamlbuild_unix_plugin.cmo \
+ $(BUILDDIR)/ocamlbuild_unix_plugin.cmi \
+ $(BUILDDIR)/ocamlbuild_executor.cmi \
+ $(BUILDDIR)/ocamlbuild_executor.cmo \
+ $(BUILDDIR)/ocamlbuild_executor.cmx \
+ $(BUILDDIR)/ocamlbuild_executor.o \
$(BUILDDIR)/ocamlbuild_pack.cmi \
+ $(BUILDDIR)/ocamlbuild_pack.cmo \
$(BUILDDIR)/ocamlbuild_pack.cmx \
+ $(BUILDDIR)/ocamlbuild_pack.o \
$(BUILDDIR)/ocamlbuild.cmi \
$(BUILDDIR)/ocamlbuild_plugin.cmi \
$(BUILDDIR)/ocamlbuild.cmx \
To do:
+* Add rules for producing .recdepends from .ml, .mli, .mllib, .mlpack
+* Produce a dependency subgraph when failing on circular deps (e.g. "A: B C\nB: D")
* Executor: exceptional conditions and Not_found
* Fix report
* Design a nice, friendly, future-proof plugin (myocamlbuild) API
* Display: should display nothing (even when finish is called) when no real
event as occured.
* Have some option to draw tags/rules that applies on a target (it's -show-tags).
+* rm sanitize.sh during -clean
+* rm sanitize.sh when running ocamlbuild
+* Export my_unix_with_unix and executor (and change its name)
(* *)
(***********************************************************************)
-(* $Id: command.ml,v 1.1.4.1 2007/03/23 16:34:48 pouillar Exp $ *)
+(* $Id: command.ml,v 1.1.4.5 2007/12/18 08:55:22 ertai Exp $ *)
(* Original author: Nicolas Pouillard *)
(* Command *)
open Log
type tags = Tags.t
+type pathname = string
let jobs = ref 1
type t =
| Seq of t list
| Cmd of spec
+| Echo of string list * pathname
| Nop
and spec =
| N (* nop or nil *)
| S of spec list
| A of string
-| P of string (* Pathname.t *)
-| Px of string (* Pathname.t *)
+| P of pathname
+| Px of pathname
| Sh of string
| T of Tags.t
| V of string
[ `N
| `S of vspec list
| `A of string
- | `P of string (* Pathname.t *)
- | `Px of string (* Pathname.t *)
+ | `P of pathname
+ | `Px of pathname
| `Sh of string
| `Quote of vspec ]
let target = if !rtarget = "" then s else !rtarget in
s, target, !rtags
-let string_print_of_command_spec spec =
+let string_print_of_command_spec spec quiet pretend =
let s, target, tags = string_target_and_tags_of_command_spec spec in
- (s, (fun quiet pretend () -> if not quiet then Log.event ~pretend s target tags))
+ fun () -> if not quiet then Log.event ~pretend s target tags; s
(* ***)
+let print_escaped_string f = Format.fprintf f "%S"
+
let rec print f =
function
| Cmd spec -> Format.pp_print_string f (string_of_command_spec spec)
| Seq seq -> List.print print f seq
| Nop -> Format.pp_print_string f "nop"
+ | Echo(texts, dest_path) ->
+ Format.fprintf f "@[<2>Echo(%a,@ %a)@]"
+ (List.print print_escaped_string) texts print_escaped_string dest_path
let to_string x = sbprintf "%a" print x
+let add_parallel_stat, dump_parallel_stats =
+ let xmin = ref max_int in
+ let xmax = ref 0 in
+ let xsum = ref 0 in
+ let xsumall = ref 0 in
+ let xcount = ref 0 in
+ let xcountall = ref 0 in
+ let add_parallel_stat x =
+ if x > 0 then begin
+ incr xcountall;
+ xsumall := x + !xsumall;
+ end;
+ if x > 1 then begin
+ incr xcount;
+ xsum := x + !xsum;
+ xmax := max !xmax x;
+ xmin := min !xmin x;
+ end
+ in
+ let dump_parallel_stats () =
+ if !jobs <> 1 then
+ if !xcount = 0 then
+ dprintf 1 "# No parallelism done"
+ else
+ let xaverage = float_of_int !xsumall /. float_of_int !xcountall in
+ let xaveragepara = float_of_int !xsum /. float_of_int !xcount in
+ dprintf 1 "# Parallel statistics: { count(total): %d(%d), max: %d, min: %d, average(total): %.3f(%.3f) }"
+ !xcount !xcountall !xmax !xmin xaveragepara xaverage
+ in
+ add_parallel_stat, dump_parallel_stats
+
+module Primitives = struct
+ let do_echo texts dest_path =
+ with_output_file dest_path begin fun oc ->
+ List.iter (output_string oc) texts
+ end
+ let echo x y () = (* no print here yet *) do_echo x y; ""
+end
+
let rec list_rev_iter f =
function
| [] -> ()
| x :: xs -> list_rev_iter f xs; f x
-let spec_list_of_cmd cmd =
+let flatten_commands quiet pretend cmd =
let rec loop acc =
function
| [] -> acc
| Nop :: xs -> loop acc xs
- | Cmd spec :: xs -> loop (string_print_of_command_spec spec :: acc) xs
+ | Cmd spec :: xs -> loop (string_print_of_command_spec spec quiet pretend :: acc) xs
+ | Echo(texts, dest_path) :: xs -> loop (Primitives.echo texts dest_path :: acc) xs
| Seq l :: xs -> loop (loop acc l) xs
in List.rev (loop [] [cmd])
let execute_many ?(quiet=false) ?(pretend=false) cmds =
+ add_parallel_stat (List.length cmds);
let degraded = !*My_unix.is_degraded || Sys.os_type = "Win32" in
let jobs = !jobs in
if jobs < 0 then invalid_arg "jobs < 0";
None
else
begin
- let konts =
- List.map
- begin fun cmd ->
- let specs = spec_list_of_cmd cmd in
- List.map
- begin fun (cmd, print) ->
- (cmd, (print quiet pretend))
- end
- specs
- end
- cmds
- in
+ let konts = List.map (flatten_commands quiet pretend) cmds in
if pretend then
begin
- List.iter
- begin fun l ->
- List.iter
- begin fun (_, f) -> f () end
- l
- end
- konts;
+ List.iter (List.iter (fun f -> ignore (f ()))) konts;
None
end
else
match acc_exn with
| None ->
begin try
- List.iter begin fun (cmd, print) ->
- print ();
+ List.iter begin fun action ->
+ let cmd = action () in
let rc = sys_command cmd in
if rc <> 0 then begin
if not quiet then
eprintf "Exit code %d while executing this \
- command:@\n%s" rc cmd;
+ command:@\n%s" rc cmd;
raise (Exit_with_code rc)
end
end cmds;
| Some(_, exn) -> raise exn
| _ -> ()
+let iter_tags f x =
+ let rec spec x =
+ match x with
+ | N | A _ | Sh _ | P _ | Px _ | V _ | Quote _ -> ()
+ | S l -> List.iter spec l
+ | T tags -> f tags
+ in
+ let rec cmd x =
+ match x with
+ | Nop | Echo _ -> ()
+ | Cmd(s) -> spec s
+ | Seq(s) -> List.iter cmd s in
+ cmd x
+
let rec reduce x =
let rec self x acc =
match x with
| [x] -> x
| xs -> S xs
-let to_string_for_digest = to_string
+let digest =
+ let list = List.fold_right in
+ let text x acc = Digest.string x :: acc in
+ let rec cmd =
+ function
+ | Cmd spec -> fun acc -> string_of_command_spec spec :: acc
+ | Seq seq -> list cmd seq
+ | Nop -> fun acc -> acc
+ | Echo(texts, dest_path) -> list text (dest_path :: texts)
+ in
+ fun x ->
+ match cmd x [] with
+ | [x] -> x
+ | xs -> Digest.string ("["^String.concat ";" xs^"]")
+
(*
let to_string_for_digest x =
let rec cmd_of_spec =
(* *)
(***********************************************************************)
-(* $Id: command.mli,v 1.1.4.1 2007/03/23 16:34:48 pouillar Exp $ *)
+(* $Id: command.mli,v 1.1.4.4 2007/12/18 08:55:22 ertai Exp $ *)
(* Original author: Nicolas Pouillard *)
(* Command *)
(** Provides an abstract type for easily building complex shell commands without making
quotation mistakes. *)
-include Signatures.COMMAND with type tags = Tags.t
+include Signatures.COMMAND with type tags = Tags.t and type pathname = string
(** {6 For system use only, not for the casual user} *)
val string_target_and_tags_of_command_spec : spec -> string * string * Tags.t
-(** Same as [to_string]. *)
-val to_string_for_digest : t -> string
+val iter_tags : (Tags.t -> unit) -> t -> unit
+
+(** Digest the given command. *)
+val digest : t -> Digest.t
(** Maximum number of parallel jobs. *)
val jobs : int ref
(** Hook here the function that maps a set of tags to appropriate command
options. It also build the dependencies that matches the tags. *)
val tag_handler : (Tags.t -> spec) ref
+
+(** For system use only *)
+val dump_parallel_stats : unit -> unit
(* *)
(***********************************************************************)
-(* $Id: configuration.ml,v 1.1 2007/02/07 08:59:13 ertai Exp $ *)
+(* $Id: configuration.ml,v 1.1.4.1 2007/11/28 16:03:10 ertai Exp $ *)
(* Original author: Nicolas Pouillard *)
open My_std
open Log
let flags_of_filename x = snd (tags_and_flags_of_filename x)
let has_tag tag = Tags.mem tag (tags_of_filename "")
+
+let tag_file file tags =
+ if tags <> [] then parse_string (Printf.sprintf "%S: %s" file (String.concat ", " tags));;
+
+let tag_any tags =
+ if tags <> [] then parse_string (Printf.sprintf "true: %s" (String.concat ", " tags));;
(* *)
(***********************************************************************)
-(* $Id: configuration.mli,v 1.1 2007/02/07 08:59:13 ertai Exp $ *)
+(* $Id: configuration.mli,v 1.1.4.1 2007/11/28 16:03:10 ertai Exp $ *)
(* Original author: Nicolas Pouillard *)
(* Configuration *)
val flags_of_filename : string -> Command.spec
val has_tag : string -> bool
+
+(** [tag_file filename tag_list] Tag the given filename with all given tags. *)
+val tag_file : Pathname.t -> Tags.elt list -> unit
+
+(** [tag_any tag_list] Tag anything with all given tags. *)
+val tag_any : Tags.elt list -> unit
--- /dev/null
+(***********************************************************************)
+(* ocamlbuild *)
+(* *)
+(* Nicolas Pouillard, Berke Durak, projet Gallium, INRIA Rocquencourt *)
+(* *)
+(* Copyright 2007 Institut National de Recherche en Informatique et *)
+(* en Automatique. All rights reserved. This file is distributed *)
+(* under the terms of the Q Public License version 1.0. *)
+(* *)
+(***********************************************************************)
+
+(* Original author: Nicolas Pouillard *)
+
+open My_std
+open Pathname.Operators
+
+let digests = Hashtbl.create 103
+
+let get = Hashtbl.find digests
+
+let put = Hashtbl.replace digests
+
+let _digests = lazy (Pathname.pwd / !Options.build_dir / (Pathname.mk "_digests"))
+
+let finalize () =
+ with_output_file !*_digests begin fun oc ->
+ Hashtbl.iter begin fun name digest ->
+ Printf.fprintf oc "%S: %S\n" name digest
+ end digests
+ end
+
+let init () =
+ Shell.chdir !Options.build_dir;
+ if Pathname.exists !*_digests then
+ with_input_file !*_digests begin fun ic ->
+ try while true do
+ let l = input_line ic in
+ Scanf.sscanf l "%S: %S" put
+ done with End_of_file -> ()
+ end;
+ My_unix.at_exit_once finalize
--- /dev/null
+(***********************************************************************)
+(* ocamlbuild *)
+(* *)
+(* Nicolas Pouillard, Berke Durak, projet Gallium, INRIA Rocquencourt *)
+(* *)
+(* Copyright 2007 Institut National de Recherche en Informatique et *)
+(* en Automatique. All rights reserved. This file is distributed *)
+(* under the terms of the Q Public License version 1.0. *)
+(* *)
+(***********************************************************************)
+
+(* Original author: Nicolas Pouillard *)
+
+val init : unit -> unit
+
+val get : string -> string
+val put : string -> string -> unit
(* *)
(***********************************************************************)
-(* $Id: display.ml,v 1.1 2007/02/07 08:59:13 ertai Exp $ *)
+(* $Id: display.ml,v 1.1.4.1 2007/11/26 13:28:35 ertai Exp $ *)
(* Original author: Berke Durak *)
(* Display *)
open My_std;;
| Some fn ->
let oc = open_out_gen [Open_text; Open_wronly; Open_creat; Open_trunc] 0o644 fn in
let f = Format.formatter_of_out_channel oc in
- Format.fprintf f "*** Starting build.\n";
+ Format.fprintf f "### Starting build.\n";
Some (f, oc)
in
+++ /dev/null
-<*caml.o>: output_obj
+++ /dev/null
-let x = X.x
-
-let rec fib n = if n <= 1 then 1 else fib (n - 1) + fib (n - 2)
-
-let () = Callback.register "fib" fib
+++ /dev/null
- /* -*- C -*- */
-#include <caml/mlvalues.h>
-#include <caml/callback.h>
-int fib(int n)
-{
- return Int_val(caml_callback(*caml_named_value("fib"), Val_int(n)));
-}
+++ /dev/null
- /* -*- C -*- */
-#include <stdio.h>
-#include <caml/callback.h>
-extern int fib(int);
-int main(int argc, char** argv)
-{
- caml_startup(argv);
- printf("fib(12) = %d\n", fib(12));
- return 0;
-}
+++ /dev/null
-open Ocamlbuild_plugin;;
-open Command;;
-
-let cc = A"cc";;
-let ar = A"ar";;
-
-dispatch begin function
-| After_rules ->
- let libasmrun = !*Ocamlbuild_pack.Ocaml_utils.stdlib_dir/"libasmrun.a" in
-
- flag ["ocaml"; "link"; "output_obj"] (A"-output-obj");
-
- rule "output C obj"
- ~deps:["%.cmx"; "%.o"]
- ~prod:"%caml.o"
- (Ocamlbuild_pack.Ocaml_compiler.native_link "%.cmx" "%caml.o");
-
- rule "build C lib"
- ~deps:["%wrap.o"; "%caml.o"]
- ~prod:"lib%.a"
- begin fun env _ ->
- let wrap_o = env "%wrap.o" and caml_o = env "%caml.o"
- and lib_a = env "lib%.a" in
- Seq[cp libasmrun lib_a;
- Cmd(S[ar; A"r"; Px lib_a; P caml_o; P wrap_o])]
- end;
- rule "build main"
- ~deps:["libfib.a"; "main.o"]
- ~prod:"main"
- begin fun _ _ ->
- Cmd(S[cc; P"main.o"; P"libfib.a"; A"-o"; Px"main"])
- end;
-| _ -> ()
-end
-
+++ /dev/null
-let x = 42
+++ /dev/null
-(***********************************************************************)
-(* ocamlbuild *)
-(* *)
-(* Nicolas Pouillard, Berke Durak, projet Gallium, INRIA Rocquencourt *)
-(* *)
-(* Copyright 2007 Institut National de Recherche en Informatique et *)
-(* en Automatique. All rights reserved. This file is distributed *)
-(* under the terms of the Q Public License version 1.0. *)
-(* *)
-(***********************************************************************)
-
-(* $Id: executor.ml,v 1.2.4.1 2007/03/05 15:11:23 pouillar Exp $ *)
-(* Original author: Berke Durak *)
-(* Executor *)
-
-open Unix;;
-
-module Exit_codes = struct
- let rc_subcommand_failed = 10
- let rc_subcommand_got_signal = 11
- let rc_io_error = 12
- let rc_exceptional_condition = 13
-end;;
-
-type task = (string * (unit -> unit));;
-
-type job = {
- job_id : int * int;
- job_command : string;
- job_next : (string * (unit -> unit)) list;
- job_result : bool ref; (* Result of this sequence group *)
- job_stdout : in_channel;
- job_stdin : out_channel;
- job_stderr : in_channel;
- job_buffer : Buffer.t;
- mutable job_dying : bool;
-};;
-
-module JS = Set.Make(struct type t = job let compare = compare end);;
-module FDM = Map.Make(struct type t = file_descr let compare = compare end);;
-
-let sf = Printf.sprintf;;
-let fp = Printf.fprintf;;
-
-(*** print_unix_status *)
-(* FIXME never called *)
-let print_unix_status oc = function
- | WEXITED x -> fp oc "exit %d" x
- | WSIGNALED i -> fp oc "signal %d" i
- | WSTOPPED i -> fp oc "stop %d" i
-;;
-(* ***)
-(*** exit *)
-let exit rc =
- raise (Ocamlbuild_pack.My_std.Exit_with_code rc)
-;;
-(* ***)
-(*** print_job_id *)
-let print_job_id oc (x,y) = fp oc "%d.%d" x y;;
-(* ***)
-(*** output_lines *)
-let output_lines prefix oc buffer =
- let u = Buffer.contents buffer in
- let m = String.length u in
- let output_line i j =
- output_string oc prefix;
- output oc u i (j - i);
- output_char oc '\n'
- in
- let rec loop i =
- if i = m then
- ()
- else
- begin
- try
- let j = String.index_from u i '\n' in
- output_line i j;
- loop (j + 1)
- with
- | Not_found ->
- output_line i m
- end
- in
- loop 0
-;;
-(* ***)
-(*** execute *)
-(* XXX: Add test for non reentrancy *)
-let execute
- ?(max_jobs=max_int)
- ?(ticker=ignore)
- ?(period=0.1)
- ?(display=(fun f -> f Pervasives.stdout))
- (commands : task list list)
- =
- let batch_id = ref 0 in
- let env = environment () in
- let jobs = ref JS.empty in
- let jobs_active = ref 0 in
- let jobs_to_terminate = Queue.create () in
- let commands_to_execute = Queue.create () in
- let all_ok = ref true in
- let results =
- List.map (fun tasks ->
- let result = ref false in
- Queue.add (tasks, result) commands_to_execute;
- result)
- commands
- in
- let outputs = ref FDM.empty in
- let doi = descr_of_in_channel in
- let doo = descr_of_out_channel in
- (*** compute_fds *)
- let compute_fds =
- let fds = ref ([], [], []) in
- let prev_jobs = ref JS.empty in
- fun () ->
- if not (!prev_jobs == !jobs) then
- begin
- prev_jobs := !jobs;
- fds :=
- JS.fold
- begin fun job (rfds, wfds, xfds) ->
- let ofd = doi job.job_stdout
- and ifd = doo job.job_stdin
- and efd = doi job.job_stderr
- in
- (ofd :: efd :: rfds, wfds, ofd :: ifd :: efd :: xfds)
- end
- !jobs
- ([], [], [])
- end;
- !fds
- in
- (* ***)
- (*** add_job *)
- let add_job (cmd, action) rest result id =
- (*display begin fun oc -> fp oc "Job %a is %s\n%!" print_job_id id cmd; end;*)
- action ();
- let (stdout', stdin', stderr') = open_process_full cmd env in
- incr jobs_active;
- set_nonblock (doi stdout');
- set_nonblock (doi stderr');
- let job =
- { job_id = id;
- job_command = cmd;
- job_next = rest;
- job_result = result;
- job_stdout = stdout';
- job_stdin = stdin';
- job_stderr = stderr';
- job_buffer = Buffer.create 1024;
- job_dying = false }
- in
- outputs := FDM.add (doi stdout') job (FDM.add (doi stderr') job !outputs);
- jobs := JS.add job !jobs;
- in
- (* ***)
- (*** add_some_jobs *)
- let add_some_jobs () =
- let (tasks, result) = Queue.take commands_to_execute in
- match tasks with
- | [] -> result := false
- | task :: rest ->
- let b_id = !batch_id in
- incr batch_id;
- add_job task rest result (b_id, 0)
- in
- (* ***)
- (*** terminate *)
- let terminate ?(continue=true) job =
- if not job.job_dying then
- begin
- job.job_dying <- true;
- Queue.add (job, continue) jobs_to_terminate
- end
- else
- ()
- in
- (* ***)
- (*** add_more_jobs_if_possible *)
- let add_more_jobs_if_possible () =
- while !jobs_active < max_jobs && not (Queue.is_empty commands_to_execute) do
- add_some_jobs ()
- done
- in
- (* ***)
- (*** do_read *)
- let do_read =
- let u = String.create 4096 in
- fun ?(loop=false) fd job ->
- (*if job.job_dying then
- ()
- else*)
- try
- let rec iteration () =
- let m =
- try
- read fd u 0 (String.length u)
- with
- | Unix.Unix_error(_,_,_) -> 0
- in
- if m = 0 then
- if job.job_dying then
- ()
- else
- terminate job
- else
- begin
- Buffer.add_substring job.job_buffer u 0 m;
- if loop then
- iteration ()
- else
- ()
- end
- in
- iteration ()
- with
- | x ->
- display
- begin fun oc ->
- fp oc "Exception %s while reading output of command %S\n%!" job.job_command
- (Printexc.to_string x);
- end;
- exit Exit_codes.rc_io_error
- in
- (* ***)
- (*** process_jobs_to_terminate *)
- let process_jobs_to_terminate () =
- while not (Queue.is_empty jobs_to_terminate) do
- ticker ();
- let (job, continue) = Queue.take jobs_to_terminate in
-
- (*display begin fun oc -> fp oc "Terminating job %a\n%!" print_job_id job.job_id; end;*)
-
- decr jobs_active;
- do_read ~loop:true (doi job.job_stdout) job;
- do_read ~loop:true (doi job.job_stderr) job;
- outputs := FDM.remove (doi job.job_stdout) (FDM.remove (doi job.job_stderr) !outputs);
- jobs := JS.remove job !jobs;
- let status = close_process_full (job.job_stdout, job.job_stdin, job.job_stderr) in
-
- let shown = ref false in
-
- let show_command () =
- if !shown then
- ()
- else
- display
- begin fun oc ->
- shown := true;
- fp oc "+ %s\n" job.job_command;
- output_lines "" oc job.job_buffer
- end
- in
- if Buffer.length job.job_buffer > 0 then show_command ();
- begin
- match status with
- | Unix.WEXITED 0 ->
- begin
- if continue then
- begin
- match job.job_next with
- | [] -> job.job_result := true
- | task :: rest ->
- let (b_id, s_id) = job.job_id in
- add_job task rest job.job_result (b_id, s_id + 1)
- end
- else
- all_ok := false;
- end
- | Unix.WEXITED rc ->
- show_command ();
- display (fun oc -> fp oc "Command exited with code %d.\n" rc);
- all_ok := false;
- exit Exit_codes.rc_subcommand_failed
- | Unix.WSTOPPED s | Unix.WSIGNALED s ->
- show_command ();
- all_ok := false;
- display (fun oc -> fp oc "Command got signal %d.\n" s);
- exit Exit_codes.rc_subcommand_got_signal
- end
- done
- in
- (* ***)
- (*** terminate_all_jobs *)
- let terminate_all_jobs () =
- JS.iter (terminate ~continue:false) !jobs
- in
- (* ***)
- (*** loop *)
- let rec loop () =
- (*display (fun oc -> fp oc "Total %d jobs\n" !jobs_active);*)
- process_jobs_to_terminate ();
- add_more_jobs_if_possible ();
- if JS.is_empty !jobs then
- ()
- else
- begin
- let (rfds, wfds, xfds) = compute_fds () in
- ticker ();
- let (chrfds, chwfds, chxfds) = select rfds wfds xfds period in
- List.iter
- begin fun (fdlist, hook) ->
- List.iter
- begin fun fd ->
- try
- let job = FDM.find fd !outputs in
- ticker ();
- hook fd job
- with
- | Not_found -> () (* XXX *)
- end
- fdlist
- end
- [chrfds, do_read ~loop:false;
- chwfds, (fun _ _ -> ());
- chxfds,
- begin fun _ _job ->
- (*display (fun oc -> fp oc "Exceptional condition on command %S\n%!" job.job_command);
- exit Exit_codes.rc_exceptional_condition*)
- () (* FIXME *)
- end];
- loop ()
- end
- in
- try
- loop ();
- None
- with
- | x ->
- begin
- try
- terminate_all_jobs ()
- with
- | x' ->
- display (fun oc -> fp oc "Extra exception %s\n%!" (Printexc.to_string x'))
- end;
- Some(List.map (!) results, x)
-;;
-(* ***)
+++ /dev/null
-(***********************************************************************)
-(* ocamlbuild *)
-(* *)
-(* Nicolas Pouillard, Berke Durak, projet Gallium, INRIA Rocquencourt *)
-(* *)
-(* Copyright 2007 Institut National de Recherche en Informatique et *)
-(* en Automatique. All rights reserved. This file is distributed *)
-(* under the terms of the Q Public License version 1.0. *)
-(* *)
-(***********************************************************************)
-
-(* $Id: executor.mli,v 1.1 2007/02/07 08:59:13 ertai Exp $ *)
-(* Original author: Berke Durak *)
-(* Executor *)
-
-(** UNIX-specific module for running tasks in parallel and properly multiplexing their outputs. *)
-
-(** [execute ~ticker ~period ~display commands] will execute the commands in [commands]
- in parallel, correctly multiplexing their outputs. A command is a pair [(cmd, action)]
- where [cmd] is a shell command string, and [action] is a thunk that is to be called just
- before [cmd] is about to be executed. If specified, it will call [ticker] at least every [period]
- seconds. If specified, it will call [display f] when it wishes to print something;
- [display] should then call [f] with then channel on which [f] should print.
- Note that [f] must be idempotent as it may well be called twice, once for the log file,
- once for the actual output.
- If one of the commands fails, it will exit with an appropriate error code,
- calling [cleanup] before.
-*)
-val execute :
- ?max_jobs:int ->
- ?ticker:(unit -> unit) ->
- ?period:float ->
- ?display:((out_channel -> unit) -> unit) ->
- ((string * (unit -> unit)) list list) ->
- (bool list * exn) option
--- /dev/null
+let rc_ok = 0
+let rc_usage = 1
+let rc_failure = 2
+let rc_invalid_argument = 3
+let rc_system_error = 4
+let rc_hygiene = 1
+let rc_circularity = 5
+let rc_solver_failed = 6
+let rc_ocamldep_error = 7
+let rc_lexing_error = 8
+let rc_build_error = 9
+let rc_executor_subcommand_failed = 10
+let rc_executor_subcommand_got_signal = 11
+let rc_executor_io_error = 12
+let rc_executor_excetptional_condition = 13
--- /dev/null
+val rc_ok : int
+val rc_usage : int
+val rc_failure : int
+val rc_invalid_argument : int
+val rc_system_error : int
+val rc_hygiene : int
+val rc_circularity : int
+val rc_solver_failed : int
+val rc_ocamldep_error : int
+val rc_lexing_error : int
+val rc_build_error : int
+val rc_executor_subcommand_failed : int
+val rc_executor_subcommand_got_signal : int
+val rc_executor_io_error : int
+val rc_executor_excetptional_condition : int
(* *)
(***********************************************************************)
-(* $Id: fda.ml,v 1.3 2007/02/22 15:56:23 ertai Exp $ *)
+(* $Id: fda.ml,v 1.3.2.1 2007/11/22 18:28:43 ertai Exp $ *)
(* Original author: Berke Durak *)
(* FDA *)
?sanitize:
begin
if !Options.sanitize then
- Some(!Options.sanitization_script)
+ Some(Pathname.concat !Options.build_dir !Options.sanitization_script)
else
None
end
(* *)
(***********************************************************************)
-(* $Id: glob.ml,v 1.2 2007/03/01 14:40:11 pouillar Exp $ *)
+(* $Id: glob.ml,v 1.2.2.1 2007/11/21 21:02:05 ertai Exp $ *)
(* Original author: Berke Durak *)
(* Glob *)
open My_std;;
end
;;
(* ***)
-(*** fast_pattern, globber *)
-type fast_pattern =
+(*** fast_pattern_contents, fast_pattern, globber *)
+type fast_pattern_contents =
| Brute of int ref * pattern
| Machine of NFA.machine
;;
-
-type globber = fast_pattern ref atom Bool.boolean;;
+type fast_pattern = fast_pattern_contents ref;;
+type globber = fast_pattern atom Bool.boolean;;
+(* ***)
+(*** fast_pattern_of_pattern *)
+let fast_pattern_of_pattern p = ref (Brute(ref 0, p));;
(* ***)
(*** add_dir *)
let add_dir dir x =
let a =
match add_dir dir x with
| Constant u -> Constant u
- | Pattern p -> Pattern(ref (Brute(ref 0, p)))
+ | Pattern p -> Pattern(fast_pattern_of_pattern p)
in
continuation (Atom a)
end
(* *)
(***********************************************************************)
-(* $Id: glob.mli,v 1.1 2007/02/07 08:59:13 ertai Exp $ *)
+(* $Id: glob.mli,v 1.1.4.1 2007/11/21 21:02:05 ertai Exp $ *)
(* Original author: Berke Durak *)
(* Glob *)
+(** The type representing fast patterns. Do not attempt to compare them, as they get on-the-fly optimizations. *)
+type fast_pattern
+
(** A self-contained module implementing extended shell glob patterns who have an expressive power
equal to boolean combinations of regular expressions. *)
-include Signatures.GLOB
+include Signatures.GLOB with type globber = fast_pattern Glob_ast.atom Bool.boolean
+
+val fast_pattern_of_pattern : Glob_ast.pattern -> fast_pattern
(* *)
(***********************************************************************)
-(* $Id: glob_lexer.mll,v 1.1 2007/02/07 08:59:13 ertai Exp $ *)
+(* $Id: glob_lexer.mll,v 1.1.4.3 2007/11/21 21:02:58 ertai Exp $ *)
(* Original author: Berke Durak *)
(* Glob *)
{
let cl = Or(parse_class [] lexbuf) in
parse_pattern eof_chars (concat_patterns p (Class cl)) lexbuf
}
+(* Random thought... **/* seems to be equal to True *)
| "/**/" (* / | /\Sigma^*/ *)
{ let q = Union[slash; Concat(slash, Concat(Star any, slash)) ] in
parse_pattern eof_chars (concat_patterns p q) lexbuf }
| "**" { raise (Parse_error("Ambiguous ** pattern not allowed unless surrounded by one or more slashes")) }
| '*' { parse_pattern eof_chars (concat_patterns p (Star not_slash)) lexbuf }
| '/' { parse_pattern eof_chars (concat_patterns p slash) lexbuf }
-| '?' { parse_pattern eof_chars (concat_patterns p (Class True)) lexbuf }
+| '?' { parse_pattern eof_chars (concat_patterns p not_slash) lexbuf }
| _ as c
{ if List.mem c eof_chars then
(p,c)
| "\"" { Buffer.contents b }
| "\\\"" { Buffer.add_char b '"'; parse_string b lexbuf }
| [^'"' '\\']+ as u { Buffer.add_string b u; parse_string b lexbuf }
+| _ as c { raise (Parse_error(sf "Unexpected character %C in string" c)) }
and parse_class cl = parse
| ']' { cl }
(* *)
(***********************************************************************)
-(* $Id: hygiene.ml,v 1.4 2007/02/22 16:51:39 ertai Exp $ *)
+(* $Id: hygiene.ml,v 1.4.2.1 2007/11/22 18:28:43 ertai Exp $ *)
(* Original author: Berke Durak *)
(* Hygiene *)
open My_std
let check ?sanitize laws entry =
let penalties = ref [] in
let microbes = ref SS.empty in
+ let () =
+ match sanitize with
+ | Some fn -> if sys_file_exists fn then sys_remove fn
+ | None -> ()
+ in
let remove path name =
if sanitize <> None then
microbes := SS.add (filename_concat path name) !microbes
let fp = Printf.fprintf in
fp oc "#!/bin/sh\n\
# File generated by ocamlbuild\n\
- \n";
+ \n\
+ cd %s\n\
+ \n" (Shell.quote_filename_if_needed Pathname.pwd);
SS.iter
begin fun fn ->
fp oc "rm -f %s\n" (Shell.quote_filename_if_needed fn)
(* *)
(***********************************************************************)
-(* $Id: lexers.mli,v 1.2 2007/02/16 10:35:10 ertai Exp $ *)
+(* $Id: lexers.mli,v 1.2.2.2 2007/11/21 21:02:58 ertai Exp $ *)
(* Original author: Nicolas Pouillard *)
exception Error of string
val blank_sep_strings : Lexing.lexbuf -> string list
val comma_sep_strings : Lexing.lexbuf -> string list
val comma_or_blank_sep_strings : Lexing.lexbuf -> string list
+
+(* Parse a colon separated string.
+ Note: successive colons are ignored.
+ Example: "aaa:bbb:::ccc" -> ["aaa"; "bbb"; "ccc"] *)
val colon_sep_strings : Lexing.lexbuf -> string list
+
val conf_lines : string option -> int -> string -> Lexing.lexbuf -> conf
-val meta_path : Lexing.lexbuf -> (string * bool) list
+val path_scheme : bool -> Lexing.lexbuf ->
+ [ `Word of string
+ | `Var of (string * Glob.globber)
+ ] list
(* *)
(***********************************************************************)
-(* $Id: lexers.mll,v 1.2 2007/02/16 10:35:10 ertai Exp $ *)
+(* $Id: lexers.mll,v 1.2.2.3 2007/11/26 13:27:56 ertai Exp $ *)
(* Original author: Nicolas Pouillard *)
{
exception Error of string
+open Glob_ast
type conf_values =
{ plus_tags : string list;
type conf = (Glob.globber * conf_values) list
let empty = { plus_flags = []; minus_flags = []; plus_tags = []; minus_tags = [] }
-
}
let newline = ('\n' | '\r' | "\r\n")
let tag = normal+ | ( normal+ ':' normal+ )
let flag_name = normal+
let flag_value = normal_flag_value+
+let variable = [ 'a'-'z' 'A'-'Z' '_' '-' '0'-'9' ]*
+let pattern = ([^ '(' ')' '\\' ] | '\\' [ '(' ')' ])*
rule ocamldep_output = parse
| ([^ ':' '\n' '\r' ]+ as k) ':' { let x = (k, space_sep_strings_nl lexbuf) in x :: ocamldep_output lexbuf }
and blank_sep_strings = parse
| blank* '#' not_newline* newline { blank_sep_strings lexbuf }
+ | blank* '#' not_newline* eof { [] }
| blank* (not_blank+ as word) { word :: blank_sep_strings lexbuf }
| blank* eof { [] }
| _ { raise (Error "Expecting blank-separated strings") }
| eof { [] }
| _ { raise (Error "Expecting colon-separated strings (1)") }
and colon_sep_strings_aux = parse
- | ':' ([^ ':']+ as word) { word :: colon_sep_strings_aux lexbuf }
+ | ':'+ ([^ ':']+ as word) { word :: colon_sep_strings_aux lexbuf }
| eof { [] }
| _ { raise (Error "Expecting colon-separated strings (2)") }
and conf_lines dir pos err = parse
| space* '#' not_newline* newline { conf_lines dir (pos + 1) err lexbuf }
+ | space* '#' not_newline* eof { [] }
| space* newline { conf_lines dir (pos + 1) err lexbuf }
| space* eof { [] }
| space* (not_newline_nor_colon+ as k) space* ':' space*
| (newline | eof) { x }
| (_ | eof) { raise (Error(Printf.sprintf "Bad values in configuration line at line %d (from %s)" pos err)) }
-and meta_path = parse
+and path_scheme patt_allowed = parse
| ([^ '%' ]+ as prefix)
- { (prefix, false) :: meta_path lexbuf }
- | "%(" ([ 'a'-'z' 'A'-'Z' '_' '-' '0'-'9' ]* as var) ')'
- { (var, true) :: meta_path lexbuf }
+ { `Word prefix :: path_scheme patt_allowed lexbuf }
+ | "%(" (variable as var) ')'
+ { `Var (var, Bool.True) :: path_scheme patt_allowed lexbuf }
+ | "%(" (variable as var) ':' (pattern as patt) ')'
+ { if patt_allowed then
+ let patt = My_std.String.implode (unescape (Lexing.from_string patt)) in
+ `Var (var, Glob.parse patt) :: path_scheme patt_allowed lexbuf
+ else raise (Error(
+ Printf.sprintf "Patterns are not allowed in this pathname (%%(%s:%s) only in ~prod)"
+ var patt)) }
| '%'
- { ("", true) :: meta_path lexbuf }
+ { `Var ("", Bool.True) :: path_scheme patt_allowed lexbuf }
| eof
{ [] }
+ | _ { raise (Error("Bad pathanme scheme")) }
+
+and unescape = parse
+ | '\\' (['(' ')'] as c) { c :: unescape lexbuf }
+ | _ as c { c :: unescape lexbuf }
+ | eof { [] }
(* *)
(***********************************************************************)
-(* $Id: log.ml,v 1.1 2007/02/07 08:59:14 ertai Exp $ *)
+(* $Id: log.ml,v 1.1.4.1 2007/11/22 18:53:12 ertai Exp $ *)
(* Original author: Nicolas Pouillard *)
open My_std
let level = ref 1
let classic_display = ref false
-let log_file = ref (lazy None)
+let internal_display = ref None
+let failsafe_display = lazy (Display.create ~mode:`Classic ~log_level:!level ())
-let internal_display = lazy begin
+let ( !- ) r =
+ match !r with
+ | None -> !*failsafe_display
+ | Some x -> x
+
+let init log_file =
let mode =
if !classic_display || !*My_unix.is_degraded || !level <= 0 || not (My_unix.stdout_isatty ()) then
`Classic
else
`Sophisticated
in
- Display.create ~mode ?log_file:!*(!log_file) ~log_level:!level ()
-end
+ internal_display := Some (Display.create ~mode ?log_file ~log_level:!level ())
-let raw_dprintf log_level = Display.dprintf ~log_level !*internal_display
+let raw_dprintf log_level = Display.dprintf ~log_level !-internal_display
let dprintf log_level fmt = raw_dprintf log_level ("@[<2>"^^fmt^^"@]@.")
let eprintf fmt = dprintf (-1) fmt
-let update () = Display.update !*internal_display
-let event ?pretend x = Display.event !*internal_display ?pretend x
-let display x = Display.display !*internal_display x
+let update () = Display.update !-internal_display
+let event ?pretend x = Display.event !-internal_display ?pretend x
+let display x = Display.display !-internal_display x
let finish ?how () =
- if Lazy.lazy_is_val internal_display then
- Display.finish ?how !*internal_display
+ match !internal_display with
+ | None -> ()
+ | Some d -> Display.finish ?how d
(*let () = My_unix.at_exit_once finish*)
(* *)
(***********************************************************************)
-(* $Id: log.mli,v 1.1 2007/02/07 08:59:14 ertai Exp $ *)
+(* $Id: log.mli,v 1.1.4.1 2007/11/22 18:53:12 ertai Exp $ *)
(* Original author: Nicolas Pouillard *)
(* Log *)
(** Turn it to true to have a classic display of commands. *)
val classic_display : bool ref
-(** The optional log file. *)
-val log_file : string option Lazy.t ref
-
(** See {Display.event}. *)
val event : ?pretend:bool -> string -> string -> Tags.t -> unit
(**/**)
-val internal_display : Display.display Lazy.t
+(** Initialize the Log module given a log file name. *)
+val init : string option -> unit
+
val finish : ?how:[`Success|`Error|`Quiet] -> unit -> unit
val display : (out_channel -> unit) -> unit
val update : unit -> unit
(* *)
(***********************************************************************)
-(* $Id: main.ml,v 1.8.2.1 2007/04/12 13:19:02 pouillar Exp $ *)
+(* $Id: main.ml,v 1.8.2.14 2007/12/18 08:58:02 ertai Exp $ *)
(* Original author: Berke Durak *)
open My_std
open Log
let clean () =
Shell.rm_rf !Options.build_dir;
- begin
- match !Options.internal_log_file with
- | None -> ()
- | Some fn -> Shell.rm_f fn
+ if !Options.make_links then begin
+ let entry =
+ Slurp.map (fun _ _ _ -> true)
+ (Slurp.slurp Filename.current_dir_name)
+ in
+ Slurp.force (Resource.clean_up_links entry)
end;
- let entry =
- Slurp.map (fun _ _ _ -> true)
- (Slurp.slurp Filename.current_dir_name)
- in
- Slurp.force (Pathname.clean_up_links entry);
raise Exit_silently
;;
let flags = Flags.get_flags () in
let pp fmt = Log.raw_dprintf (-1) fmt in
List.iter begin fun rule ->
- pp "%a@\n@\n" Rule.pretty_print rule
+ pp "%a@\n@\n" (Rule.pretty_print Resource.print_pattern) rule
end rules;
List.iter begin fun (tags, flag) ->
let sflag = Command.string_of_command_spec flag in
Options.init ();
if !Options.must_clean then clean ();
Hooks.call_hook Hooks.After_options;
- Tools.default_tags := Tags.of_list !Options.tags;
Plugin.execute_plugin_if_needed ();
if !Options.targets = []
let target_dirs = List.union [] (List.map Pathname.dirname !Options.targets) in
Configuration.parse_string
- "true: traverse
- <**/*.ml> or <**/*.mli> or <**/*.mlpack> or <**/*.ml.depends>: ocaml
+ "<**/*.ml> or <**/*.mli> or <**/*.mlpack> or <**/*.ml.depends>: ocaml
<**/*.byte>: ocaml, byte, program
<**/*.odoc>: ocaml, doc
<**/*.native>: ocaml, native, program
<**/*.cmx>: ocaml, native
";
+ Configuration.tag_any !Options.tags;
+ if !Options.recursive
+ || Sys.file_exists (* authorized since we're not in build *) "_tags"
+ || Sys.file_exists (* authorized since we're not in build *) "myocamlbuild.ml"
+ then Configuration.tag_any ["traverse"];
+
let newpwd = Sys.getcwd () in
Sys.chdir Pathname.pwd;
let entry_include_dirs = ref [] in
if name = "_tags" then
ignore (Configuration.parse_file ?dir path_name);
- (String.length name > 0 && name.[0] <> '_' && not (List.mem name !Options.exclude_dirs))
+ (String.length name > 0 && name.[0] <> '_' && name <> !Options.build_dir && not (List.mem name !Options.exclude_dirs))
&& begin
if path_name <> Filename.current_dir_name && Pathname.is_directory path_name then
let tags = tags_of_pathname path_name in
show_documentation ();
raise Exit_silently
end;
- Resource.Cache.init ();
+ Digest_cache.init ();
Sys.catch_break true;
let targets =
List.map begin fun starget ->
+ let starget = Resource.import starget in
let target = path_and_context_of_string starget in
let ext = Pathname.get_extension starget in
(target, starget, ext)
(target, ext)
end targets in
+ Command.dump_parallel_stats ();
+
Log.finish ();
Shell.chdir Pathname.pwd;
(sbprintf "@[<2>Circular dependencies: %S already seen in@ %a@]@." p pp_l seen))
;;
-module Exit_codes =
- struct
- let rc_ok = 0
- let rc_usage = 1
- let rc_failure = 2
- let rc_invalid_argument = 3
- let rc_system_error = 4
- let rc_hygiene = 1
- let rc_circularity = 5
- let rc_solver_failed = 6
- let rc_ocamldep_error = 7
- let rc_lexing_error = 8
- let rc_build_error = 9
- let rc_executor_reserved_1 = 10 (* Redefined in Executor *)
- let rc_executor_reserved_2 = 11
- let rc_executor_reserved_3 = 12
- let rc_executor_reserved_4 = 13
- end
-
open Exit_codes;;
let main () =
This is likely to be a bug, please report this to the ocamlbuild\n\
developers." s;
exit rc_invalid_argument
- | Ocamldep.Error msg ->
+ | Ocaml_utils.Ocamldep_error msg ->
Log.eprintf "Ocamldep error: %s" msg;
exit rc_ocamldep_error
| Lexers.Error msg ->
(* *)
(***********************************************************************)
-(* $Id: my_std.ml,v 1.2.2.2 2007/03/13 10:28:53 pouillar Exp $ *)
+(* $Id: my_std.ml,v 1.2.2.7 2007/12/18 08:56:11 ertai Exp $ *)
(* Original author: Nicolas Pouillard *)
open Format
s'.[i] <- s.[sl - i - 1]
done;
s';;
+
+ let implode l =
+ match l with
+ | [] -> ""
+ | cs ->
+ let r = create (List.length cs) in
+ let pos = ref 0 in
+ List.iter begin fun c ->
+ unsafe_set r !pos c;
+ incr pos
+ end cs;
+ r
+
+ let explode s =
+ let sl = String.length s in
+ let rec go pos =
+ if pos >= sl then [] else unsafe_get s pos :: go (pos + 1)
+ in go 0
end
module StringSet = Set.Make(String)
let sys_command =
match Sys.os_type with
| "Win32" -> fun cmd ->
+ if cmd = "" then 0 else
let cmd = "bash -c "^Filename.quote cmd in
(* FIXME fix Filename.quote for windows *)
let cmd = String.subst "\"&\"\"&\"" "&&" cmd in
Sys.command cmd
- | _ -> Sys.command
+ | _ -> fun cmd -> if cmd = "" then 0 else Sys.command cmd
(* FIXME warning fix and use Filename.concat *)
let filename_concat x y =
if x = Filename.current_dir_name || x = "" then y else
- if y = "" && x.[String.length x - 1] = '/' then x
+ if x.[String.length x - 1] = '/' then
+ if y = "" then x
+ else x ^ y
else x ^ "/" ^ y
(* let reslash =
let copy_chan ic oc =
let m = in_channel_length ic in
let m = (m lsr 12) lsl 12 in
- let m = max 16384 (min 16777216 m) in
+ let m = max 16384 (min Sys.max_string_length m) in
let buf = String.create m in
let rec loop () =
let len = input ic buf 0 m in
let ( & ) f x = f x
+let ( |> ) x f = f x
+
let print_string_list = List.print String.print
module Digest = struct
(* *)
(***********************************************************************)
-(* $Id: my_unix.ml,v 1.2.2.1 2007/03/13 10:28:53 pouillar Exp $ *)
+(* $Id: my_unix.ml,v 1.2.2.2 2007/11/28 16:11:27 ertai Exp $ *)
(* Original author: Nicolas Pouillard *)
open My_std
open Format
?ticker:(unit -> unit) ->
?period:float ->
?display:((out_channel -> unit) -> unit) ->
- ((string * (unit -> unit)) list list) ->
+ ((unit -> string) list list) ->
(bool list * exn) option;
mutable report_error : Format.formatter -> exn -> unit;
mutable at_exit_once : (unit -> unit) -> unit;
(* *)
(***********************************************************************)
-(* $Id: my_unix.mli,v 1.1 2007/02/07 08:59:14 ertai Exp $ *)
+(* $Id: my_unix.mli,v 1.1.4.2 2007/11/28 16:11:27 ertai Exp $ *)
(* Original author: Nicolas Pouillard *)
type file_kind =
| FK_dir
val readlink : string -> string
val run_and_read : string -> string
-(** See [Executor.execute] *)
+(** See [Ocamlbuild_executor.execute] *)
val execute_many :
?max_jobs:int ->
?ticker:(unit -> unit) ->
?period:float ->
?display:((out_channel -> unit) -> unit) ->
- ((string * (unit -> unit)) list list) ->
+ ((unit -> string) list list) ->
(bool list * exn) option
val report_error : Format.formatter -> exn -> unit
?ticker:(unit -> unit) ->
?period:float ->
?display:((out_channel -> unit) -> unit) ->
- ((string * (unit -> unit)) list list) ->
+ ((unit -> string) list list) ->
(bool list * exn) option;
mutable report_error : Format.formatter -> exn -> unit;
mutable at_exit_once : (unit -> unit) -> unit;
+++ /dev/null
-(***********************************************************************)
-(* ocamlbuild *)
-(* *)
-(* Nicolas Pouillard, Berke Durak, projet Gallium, INRIA Rocquencourt *)
-(* *)
-(* Copyright 2007 Institut National de Recherche en Informatique et *)
-(* en Automatique. All rights reserved. This file is distributed *)
-(* under the terms of the Q Public License version 1.0. *)
-(* *)
-(***********************************************************************)
-
-(* $Id: my_unix_with_unix.ml,v 1.1.4.1 2007/03/04 15:36:20 pouillar Exp $ *)
-(* Original author: Nicolas Pouillard *)
-open Format
-open Ocamlbuild_pack
-open My_unix
-
-let report_error f =
- function
- | Unix.Unix_error(err, fun_name, arg) ->
- fprintf f "%s: %S failed" Sys.argv.(0) fun_name;
- if String.length arg > 0 then
- fprintf f " on %S" arg;
- fprintf f ": %s" (Unix.error_message err)
- | exn -> raise exn
-
-let mkstat unix_stat x =
- let st =
- try unix_stat x
- with Unix.Unix_error _ as e -> raise (Sys_error (My_std.sbprintf "%a" report_error e))
- in
- { stat_key = sprintf "(%d,%d)" st.Unix.st_dev st.Unix.st_ino;
- stat_file_kind =
- match st.Unix.st_kind with
- | Unix.S_LNK -> FK_link
- | Unix.S_DIR -> FK_dir
- | Unix.S_CHR | Unix.S_BLK | Unix.S_FIFO | Unix.S_SOCK -> FK_other
- | Unix.S_REG -> FK_file }
-
-let is_link s = (Unix.lstat s).Unix.st_kind = Unix.S_LNK
-
-let at_exit_once callback =
- let pid = Unix.getpid () in
- at_exit begin fun () ->
- if pid = Unix.getpid () then callback ()
- end
-
-let run_and_open s kont =
- let ic = Unix.open_process_in s in
- let close () =
- match Unix.close_process_in ic with
- | Unix.WEXITED 0 -> ()
- | Unix.WEXITED _ | Unix.WSIGNALED _ | Unix.WSTOPPED _ ->
- failwith (Printf.sprintf "Error while running: %s" s) in
- try
- let res = kont ic in close (); res
- with e -> (close (); raise e)
-
-let stdout_isatty () =
- Unix.isatty Unix.stdout
-
-let setup () =
- implem.is_degraded <- false;
- implem.stdout_isatty <- stdout_isatty;
- implem.gettimeofday <- Unix.gettimeofday;
- implem.report_error <- report_error;
- implem.execute_many <- Executor.execute;
- implem.readlink <- Unix.readlink;
- implem.run_and_open <- run_and_open;
- implem.at_exit_once <- at_exit_once;
- implem.is_link <- is_link;
- implem.stat <- mkstat Unix.stat;
- implem.lstat <- mkstat Unix.lstat;
+++ /dev/null
-(***********************************************************************)
-(* ocamlbuild *)
-(* *)
-(* Nicolas Pouillard, Berke Durak, projet Gallium, INRIA Rocquencourt *)
-(* *)
-(* Copyright 2007 Institut National de Recherche en Informatique et *)
-(* en Automatique. All rights reserved. This file is distributed *)
-(* under the terms of the Q Public License version 1.0. *)
-(* *)
-(***********************************************************************)
-
-(* $Id: my_unix_with_unix.mli,v 1.1 2007/02/07 08:59:14 ertai Exp $ *)
-(* Original author: Nicolas Pouillard *)
-val setup : unit -> unit
(* *)
(***********************************************************************)
-(* $Id: ocaml_compiler.ml,v 1.5.2.3 2007/04/27 07:20:50 pouillar Exp $ *)
+(* $Id: ocaml_compiler.ml,v 1.5.2.6 2007/11/28 16:07:39 ertai Exp $ *)
(* Original author: Nicolas Pouillard *)
open My_std
open Format
let prepare_compile build ml =
let dir = Pathname.dirname ml in
let include_dirs = Pathname.include_dirs_of dir in
- let modules = Ocamldep.module_dependencies_of ml in
+ let modules = path_dependencies_of ml in
let results =
build (List.map (fun (_, x) -> expand_module include_dirs x ["cmi"]) modules) in
List.iter2 begin fun (mandatory, name) res ->
let key = (tag, cmx, extensions) in
let dir = Pathname.dirname cmx in
let include_dirs = Pathname.include_dirs_of dir in
- if Hashtbl.mem cache_prepare_link key then () else
+ let ml = Pathname.update_extensions "ml" cmx in
+ let mli = Pathname.update_extensions "mli" cmx in
+ let modules =
+ List.union
+ (if Pathname.exists (ml-.-"depends") then path_dependencies_of ml else [])
+ (if Pathname.exists (mli-.-"depends") then path_dependencies_of mli else [])
+ in
+ if modules <> [] && not (Hashtbl.mem cache_prepare_link key) then
let () = Hashtbl.add cache_prepare_link key true in
- let modules = Ocamldep.module_dependencies_of (Pathname.update_extensions "ml" cmx) in
let modules' = List.map (fun (_, x) -> expand_module include_dirs x extensions) modules in
List.iter2 begin fun (mandatory, _) result ->
match mandatory, result with
let _ = Rule.build_deps_of_tags build tags in
let dir =
let dir1 = Pathname.remove_extensions cmX in
- if Pathname.exists_in_source_dir dir1 then dir1
+ if Resource.exists_in_source_dir dir1 then dir1
else Pathname.dirname cmX in
let include_dirs = Pathname.include_dirs_of dir in
let extension_keys = List.map fst extensions in
link contents_list cmX env build
let byte_library_link_modules =
- link_modules [("cmo",[]); ("cmi",[])] "cmo" "cma" "cma" byte_lib_linker byte_lib_linker_tags
+ link_modules [("cmo",[])] "cmo" "cma" "cma" byte_lib_linker byte_lib_linker_tags
let byte_library_link_mllib = link_from_file byte_library_link_modules
let byte_toplevel_link_modules =
- link_modules [("cmo",[]); ("cmi",[])] "cmo" "cma" "cma" ocamlmktop
+ link_modules [("cmo",[])] "cmo" "cma" "cma" ocamlmktop
(fun tags -> tags++"ocaml"++"link"++"byte"++"toplevel")
let byte_toplevel_link_mltop = link_from_file byte_toplevel_link_modules
let byte_debug_library_link_modules =
- link_modules [("d.cmo",[]); ("cmi",[])] "d.cmo" "d.cma" "d.cma" byte_lib_linker
+ link_modules [("d.cmo",[])] "d.cmo" "d.cma" "d.cma" byte_lib_linker
(fun tags -> byte_lib_linker_tags tags++"debug")
let byte_debug_library_link_mllib = link_from_file byte_debug_library_link_modules
let native_profile_pack_mlpack = link_from_file native_profile_pack_modules
let native_library_link_modules x =
- link_modules [("cmx",[!Options.ext_obj]); ("cmi",[])] "cmx" "cmxa"
+ link_modules [("cmx",[!Options.ext_obj])] "cmx" "cmxa"
!Options.ext_lib native_lib_linker native_lib_linker_tags x
let native_library_link_mllib = link_from_file native_library_link_modules
let native_profile_library_link_modules x =
- link_modules [("p.cmx",["p" -.- !Options.ext_obj]); ("cmi",[])] "p.cmx" "p.cmxa"
+ link_modules [("p.cmx",["p" -.- !Options.ext_obj])] "p.cmx" "p.cmxa"
("p" -.- !Options.ext_lib) native_lib_linker
(fun tags -> native_lib_linker_tags tags++"profile") x
(* *)
(***********************************************************************)
-(* $Id: ocaml_dependencies.ml,v 1.1 2007/02/07 08:59:14 ertai Exp $ *)
+(* $Id: ocaml_dependencies.ml,v 1.1.4.1 2007/11/28 16:07:39 ertai Exp $ *)
(* Original author: Nicolas Pouillard *)
open My_std
open Log
if pack_mode then
if Filename.check_suffix x ".cmi" then
let caml_obj = Pathname.update_extensions caml_obj_ext x in
- if Pathname.exists_in_build_dir caml_obj then
+ if Resource.exists_in_build_dir caml_obj then
caml_obj
else
x
(* *)
(***********************************************************************)
-(* $Id: ocaml_specific.ml,v 1.6.2.8 2007/05/10 13:32:07 pouillar Exp $ *)
+(* $Id: ocaml_specific.ml,v 1.6.2.21 2007/11/28 16:19:10 ertai Exp $ *)
(* Original author: Nicolas Pouillard *)
open My_std
open Format
rule "target files"
~dep:"%.itarget"
- ~prod:"%.otarget"
+ ~stamp:"%.otarget"
begin fun env build ->
- let itarget = env "%.itarget" and otarget = env "%.otarget" in
+ let itarget = env "%.itarget" in
let dir = Pathname.dirname itarget in
List.iter ignore_good
(build (List.map (fun x -> [dir/x]) (string_list_of_file itarget)));
- touch otarget
+ Nop
end;;
rule "ocaml: mli -> cmi"
~dep:"%.cmo"
(Ocaml_compiler.byte_library_link "%.cmo" "%.cma");;
-rule "ocaml C stubs (short): clib & (o|obj)* -> (a|lib) & (so|dll)"
- ~prods:["lib%(libname)"-.-ext_lib; "dll%(libname)"-.-ext_dll]
- ~dep:"lib%(libname).clib"
- (C_tools.link_C_library "lib%(libname).clib" ("lib%(libname)"-.-ext_lib) "%(libname)");;
-
rule "ocaml C stubs: clib & (o|obj)* -> (a|lib) & (so|dll)"
- ~prods:["%(path)/lib%(libname)"-.-ext_lib; "%(path)/dll%(libname)"-.-ext_dll]
- ~dep:"%(path)/lib%(libname).clib"
- (C_tools.link_C_library "%(path)/lib%(libname).clib" ("%(path)/lib%(libname)"-.-ext_lib) "%(path)/%(libname)");;
+ ~prods:["%(path:<**/>)lib%(libname:<*> and not <*.*>)"-.-ext_lib;
+ "%(path:<**/>)dll%(libname:<*> and not <*.*>)"-.-ext_dll]
+ ~dep:"%(path)lib%(libname).clib"
+ (C_tools.link_C_library "%(path)lib%(libname).clib" ("%(path)lib%(libname)"-.-ext_lib) "%(path)%(libname)");;
rule "ocaml: mllib & p.cmx* & p.o* -> p.cmxa & p.a"
~tags:["ocaml"; "native"; "profile"; "library"]
~deps:["%.cmx"; x_o]
(Ocaml_compiler.native_library_link "%.cmx" "%.cmxa");;
-Ocamldep.depends "ocaml dependencies ml"
+rule "ocaml dependencies ml"
~prod:"%.ml.depends"
- ~dep:"%.ml" ();;
+ ~dep:"%.ml"
+ (Ocaml_tools.ocamldep_command "%.ml" "%.ml.depends");;
-Ocamldep.depends "ocaml dependencies mli"
+rule "ocaml dependencies mli"
~prod:"%.mli.depends"
- ~dep:"%.mli" ();;
+ ~dep:"%.mli"
+ (Ocaml_tools.ocamldep_command "%.mli" "%.mli.depends");;
rule "ocamllex"
~tags:["ocaml"] (* FIXME "lexer" *)
~deps:["%.mli"; "%.mli.depends"]
(Ocaml_tools.document_ocaml_interf "%.mli" "%.odoc");;
+rule "ocaml: ml -> odoc"
+ ~tags:["ocaml"; "doc"]
+ ~prod:"%.odoc"
+ ~deps:["%.ml"; "%.ml.depends"]
+ (Ocaml_tools.document_ocaml_implem "%.ml" "%.odoc");;
+
rule "ocamldoc: document ocaml project odocl & *odoc -> docdir (html)"
~prod:"%.docdir/index.html"
+ ~stamp:"%.docdir/html.stamp" (* Depend on this file if you want to depends on all files of %.docdir *)
~dep:"%.odocl"
(Ocaml_tools.document_ocaml_project
~ocamldoc:Ocaml_tools.ocamldoc_l_dir "%.odocl" "%.docdir/index.html" "%.docdir");;
rule "ocamldoc: document ocaml project odocl & *odoc -> docdir (man)"
~prod:"%.docdir/man"
+ ~stamp:"%.docdir/man.stamp" (* Depend on this file if you want to depends on all files of %.docdir/man *)
~dep:"%.odocl"
(Ocaml_tools.document_ocaml_project
~ocamldoc:Ocaml_tools.ocamldoc_l_dir "%.odocl" "%.docdir/man" "%.docdir");;
~deps:["%.mly"; "%.mly.depends"]
(Ocaml_tools.menhir "%.mly");
- Ocamldep.depends "ocaml: menhir dependencies"
+ rule "ocaml: menhir dependencies"
~prod:"%.mly.depends"
~dep:"%.mly"
- ~ocamldep_command:Ocamldep.menhir_ocamldep_command ();
+ (Ocaml_tools.menhir_ocamldep_command "%.mly" "%.mly.depends");
+
+ (* Automatic handling of menhir modules, given a
+ description file %.mlypack *)
+ rule "ocaml: modular menhir (mlypack)"
+ ~prods:["%.mli" ; "%.ml"]
+ ~deps:["%.mlypack"]
+ (Ocaml_tools.menhir_modular "%" "%.mlypack" "%.mlypack.depends");
+
+ rule "ocaml: menhir modular dependencies"
+ ~prod:"%.mlypack.depends"
+ ~dep:"%.mlypack"
+ (Ocaml_tools.menhir_modular_ocamldep_command "%.mlypack" "%.mlypack.depends")
+
end else
rule "ocamlyacc"
~tags:["ocaml"] (* FIXME "parser" *)
flag ["ocaml"; "ocamlyacc"] (atomize !Options.ocaml_yaccflags);;
flag ["ocaml"; "menhir"] (atomize !Options.ocaml_yaccflags);;
+(* Tell menhir to explain conflicts *)
+flag [ "ocaml" ; "menhir" ; "explain" ] (S[A "--explain"]);;
+
flag ["ocaml"; "ocamllex"] (atomize !Options.ocaml_lexflags);;
+(* Tell ocamllex to generate ml code *)
+flag [ "ocaml" ; "ocamllex" ; "generate_ml" ] (S[A "-ml"]);;
+
flag ["ocaml"; "byte"; "link"] begin
S (List.map (fun x -> A (x^".cma")) !Options.ocaml_libs)
end;;
flag ["ocaml"; "pp"; camlp4] (A camlp4)
end camlp4s;;
-camlp4_flags ["camlp4o"; "camlp4r"; "camlp4of"; "camlp4rf"; "camlp4orf"];;
+camlp4_flags ["camlp4o"; "camlp4r"; "camlp4of"; "camlp4rf"; "camlp4orf"; "camlp4oof"];;
let camlp4_flags' camlp4s =
List.iter begin fun (camlp4, flags) ->
camlp4_flags' ["camlp4orr", S[A"camlp4of"; A"-parser"; A"reloaded"];
"camlp4rrr", S[A"camlp4rf"; A"-parser"; A"reloaded"]];;
+flag ["ocaml"; "pp"; "camlp4:no_quot"] (A"-no_quot");;
+
ocaml_lib ~extern:true ~native:false "dynlink";;
ocaml_lib ~extern:true "unix";;
ocaml_lib ~extern:true "str";;
flag ["ocaml"; "compile"; "profile"; "native"] (A "-p");;
flag ["ocaml"; "compile"; "thread"] (A "-thread");;
flag ["ocaml"; "doc"; "thread"] (S[A"-I"; A"+threads"]);;
-flag ["ocaml"; "link"; "thread"; "native"] (S[A "threads.cmxa"; A "-thread"]);;
-flag ["ocaml"; "link"; "thread"; "byte"] (S[A "threads.cma"; A "-thread"]);;
+flag ["ocaml"; "link"; "thread"; "native"; "program"] (S[A "threads.cmxa"; A "-thread"]);;
+flag ["ocaml"; "link"; "thread"; "byte"; "program"] (S[A "threads.cma"; A "-thread"]);;
flag ["ocaml"; "compile"; "nopervasives"] (A"-nopervasives");;
flag ["ocaml"; "compile"; "nolabels"] (A"-nolabels");;
(** Ocamlbuild plugin for it's own building *)
let install_lib = lazy (try Sys.getenv "INSTALL_LIB" with Not_found -> !*stdlib_dir/"ocamlbuild" (* not My_std.getenv since it's lazy*)) in
let install_bin = lazy (My_std.getenv ~default:"/usr/local/bin" "INSTALL_BIN") in
-file_rule "ocamlbuild_where.ml"
+rule "ocamlbuild_where.ml"
~prod:"%ocamlbuild_where.ml"
- ~cache:(fun _ _ -> Printf.sprintf "lib:%S, bin:%S" !*install_lib !*install_bin)
- begin fun _ oc ->
- Printf.fprintf oc "let bindir = ref %S;;\n" !*install_bin;
- Printf.fprintf oc "let libdir = ref %S;;\n" !*install_lib
+ begin fun env _ ->
+ Echo(
+ ["let bindir = ref \""; String.escaped !*install_bin; "\";;\n";
+ "let libdir = ref (try Filename.concat (Sys.getenv \"OCAMLLIB\") \"ocamlbuild\" with Not_found -> \"";
+ String.escaped !*install_lib; "\");;\n"],
+ env "%ocamlbuild_where.ml")
end;;
ocaml_lib "ocamlbuildlib";;
ocaml_lib "ocamlbuildlightlib";;
(* *)
(***********************************************************************)
-(* $Id: ocaml_tools.ml,v 1.2.4.3 2007/04/04 18:08:59 pouillar Exp $ *)
+(* $Id: ocaml_tools.ml,v 1.2.4.9 2007/11/22 18:49:38 ertai Exp $ *)
(* Original author: Nicolas Pouillard *)
open My_std
open Pathname.Operators
open Command
open Ocaml_utils
+let add_suffix s = List.map (fun x -> x -.- s) ;;
+
+let ocamldep_command' tags spec =
+ let tags' = tags++"ocaml"++"ocamldep" in
+ S [!Options.ocamldep; T tags'; ocaml_ppflags (tags++"pp:dep");
+ spec; A "-modules"]
+
+let menhir_ocamldep_command' tags ~menhir_spec ~ocamldep_spec out =
+ let menhir = if !Options.ocamlyacc = N then V"MENHIR" else !Options.ocamlyacc in
+ Cmd(S[menhir; T tags; A"--raw-depend";
+ A"--ocamldep"; Quote (ocamldep_command' tags ocamldep_spec);
+ menhir_spec ; Sh ">"; Px out])
+
+let menhir_ocamldep_command arg out env _build =
+ let arg = env arg and out = env out in
+ let tags = tags_of_pathname arg++"ocaml"++"menhir_ocamldep" in
+ let ocamldep_spec = flags_of_pathname arg in
+ menhir_ocamldep_command' tags ~menhir_spec:(P arg) ~ocamldep_spec out
+
+let import_mlypack build mlypack =
+ let tags1 = tags_of_pathname mlypack in
+ let files = string_list_of_file mlypack in
+ let include_dirs = Pathname.include_dirs_of (Pathname.dirname mlypack) in
+ let files_alternatives =
+ List.map begin fun module_name ->
+ expand_module include_dirs module_name ["mly"]
+ end files
+ in
+ let files = List.map Outcome.good (build files_alternatives) in
+ let tags2 =
+ List.fold_right
+ (fun file -> Tags.union (tags_of_pathname file))
+ files tags1
+ in
+ (tags2, files)
+
+let menhir_modular_ocamldep_command mlypack out env build =
+ let mlypack = env mlypack and out = env out in
+ let (tags,files) = import_mlypack build mlypack in
+ let tags = tags++"ocaml"++"menhir_ocamldep" in
+ let menhir_base = Pathname.remove_extensions mlypack in
+ let menhir_spec = S[A "--base" ; P menhir_base ; atomize_paths files] in
+ let ocamldep_spec = N in
+ menhir_ocamldep_command' tags ~menhir_spec ~ocamldep_spec out
+
+let menhir_modular menhir_base mlypack mlypack_depends env build =
+ let menhir = if !Options.ocamlyacc = N then V"MENHIR" else !Options.ocamlyacc in
+ let menhir_base = env menhir_base in
+ let mlypack = env mlypack in
+ let mlypack_depends = env mlypack_depends in
+ let (tags,files) = import_mlypack build mlypack in
+ let () = List.iter Outcome.ignore_good (build [[mlypack_depends]]) in
+ Ocaml_compiler.prepare_compile build mlypack;
+ let tags = tags++"ocaml"++"parser"++"menhir" in
+ Cmd(S[menhir ;
+ A "--ocamlc"; Quote(S[!Options.ocamlc; ocaml_include_flags mlypack]);
+ T tags ; A "--infer" ; flags_of_pathname mlypack ;
+ A "--base" ; Px menhir_base ; atomize_paths files])
+
+let ocamldep_command arg out env _build =
+ let arg = env arg and out = env out in
+ let spec = flags_of_pathname arg in
+ let tags = tags_of_pathname arg in
+ Cmd(S[ocamldep_command' tags spec; P arg; Sh ">"; Px out])
+
let ocamlyacc mly env _build =
let mly = env mly in
let ocamlyacc = if !Options.ocamlyacc = N then V"OCAMLYACC" else !Options.ocamlyacc in
let ocamldoc_c tags arg odoc =
let tags = tags++"ocaml" in
Cmd (S [!Options.ocamldoc; A"-dump"; Px odoc; T(tags++"doc");
- ocaml_ppflags tags; flags_of_pathname arg;
+ ocaml_ppflags (tags++"pp:doc"); flags_of_pathname arg;
ocaml_include_flags arg; P arg])
let ocamldoc_l_dir tags deps _docout docdir =
Ocaml_compiler.prepare_compile build mli;
ocamldoc_c (tags_of_pathname mli++"interf") mli odoc
+let document_ocaml_implem ml odoc env build =
+ let ml = env ml and odoc = env odoc in
+ Ocaml_compiler.prepare_compile build ml;
+ ocamldoc_c (tags_of_pathname ml++"implem") ml odoc
+
let document_ocaml_project ?(ocamldoc=ocamldoc_l_file) odocl docout docdir env build =
let odocl = env odocl and docout = env docout and docdir = env docdir in
let contents = string_list_of_file odocl in
(* *)
(***********************************************************************)
-(* $Id: ocaml_tools.mli,v 1.2 2007/02/08 16:53:39 ertai Exp $ *)
+(* $Id: ocaml_tools.mli,v 1.2.4.3 2007/11/21 20:46:46 ertai Exp $ *)
(* Original author: Nicolas Pouillard *)
val ocamldoc_c : Tags.t -> string -> string -> Command.t
val ocamldoc_l_dir : Tags.t -> string list -> string -> string -> Command.t
val ocamldoc_l_file : Tags.t -> string list -> string -> string -> Command.t
+val ocamldep_command : string -> string -> Rule.action
+val menhir_ocamldep_command : string -> string -> Rule.action
+val menhir_modular_ocamldep_command : string -> string -> Rule.action
+val menhir_modular : string -> string -> string -> Rule.action
val ocamlyacc : string -> Rule.action
val ocamllex : string -> Rule.action
val menhir : string -> Rule.action
val infer_interface : string -> string -> Rule.action
val document_ocaml_interf : string -> string -> Rule.action
+val document_ocaml_implem : string -> string -> Rule.action
val document_ocaml_project :
?ocamldoc:(Tags.t -> string list -> string -> string -> Command.t) ->
string -> string -> string -> Rule.action
(* *)
(***********************************************************************)
-(* $Id: ocaml_utils.ml,v 1.3.2.2 2007/03/13 10:28:53 pouillar Exp $ *)
+(* $Id: ocaml_utils.ml,v 1.3.2.3 2007/11/21 18:29:37 ertai Exp $ *)
(* Original author: Nicolas Pouillard *)
open My_std
open Format
Pathname.exists x'
let non_dependencies = ref []
-let non_dependency m1 m2 = non_dependencies := (m1, m2) :: !non_dependencies
-
-let module_importance modpath x =
- if List.mem (modpath, x) !non_dependencies
+let non_dependency m1 m2 =
+ (* non_dependency was not supposed to accept pathnames without extension. *)
+ if String.length (Pathname.get_extensions m1) = 0 then
+ invalid_arg "non_dependency: no extension";
+ non_dependencies := (m1, m2) :: !non_dependencies
+
+let path_importance path x =
+ if List.mem (path, x) !non_dependencies
|| (List.mem x !Options.ignore_list) then begin
- let () = dprintf 3 "This module (%s) is ignored by %s" x modpath in
+ let () = dprintf 3 "This module (%s) is ignored by %s" x path in
`ignored
end
else if ignore_stdlib x then `just_try else `mandatory
| Some dir -> flag ["ocaml"; tag_name; "compile"] (S[A"-I"; P dir])
let cmi_of = Pathname.update_extensions "cmi"
+
+exception Ocamldep_error of string
+
+let read_path_dependencies =
+ let path_dependencies = Hashtbl.create 103 in
+ let read path =
+ let module_name = module_name_of_pathname path in
+ let depends = path-.-"depends" in
+ with_input_file depends begin fun ic ->
+ let ocamldep_output =
+ try Lexers.ocamldep_output (Lexing.from_channel ic)
+ with Lexers.Error msg -> raise (Ocamldep_error(Printf.sprintf "Ocamldep.ocamldep: bad output (%s)" msg)) in
+ let deps =
+ List.fold_right begin fun (path, deps) acc ->
+ let module_name' = module_name_of_pathname path in
+ if module_name' = module_name
+ then List.union deps acc
+ else raise (Ocamldep_error(Printf.sprintf "Ocamldep.ocamldep: multiple files in ocamldep output (%s not expected)" path))
+ end ocamldep_output [] in
+ let deps =
+ if !Options.nostdlib && not (Tags.mem "nopervasives" (tags_of_pathname path)) then
+ "Pervasives" :: deps
+ else deps in
+ let deps' = List.fold_right begin fun dep acc ->
+ match path_importance path dep with
+ | `ignored -> acc
+ | (`just_try | `mandatory) as importance -> (importance, dep) :: acc
+ end deps [] in
+ Hashtbl.replace path_dependencies path
+ (List.union (try Hashtbl.find path_dependencies path with Not_found -> []) deps');
+ deps'
+ end
+ in read
+
+let path_dependencies_of = memo read_path_dependencies
(* *)
(***********************************************************************)
-(* $Id: ocaml_utils.mli,v 1.3 2007/02/26 16:27:45 ertai Exp $ *)
+(* $Id: ocaml_utils.mli,v 1.3.2.1 2007/11/21 18:29:37 ertai Exp $ *)
(* Original author: Nicolas Pouillard *)
val stdlib_dir : Pathname.t Lazy.t
val module_name_of_filename : Pathname.t -> string
val use_lib : Pathname.t -> Pathname.t -> unit
val cmi_of : Pathname.t -> Pathname.t
val ocaml_add_include_flag : string -> Command.spec list -> Command.spec list
-val module_importance : string -> string -> [ `ignored | `mandatory | `just_try ]
+
+exception Ocamldep_error of string
+
+(* Takes a path and returns a list of modules *)
+val path_dependencies_of : Pathname.t -> ([ `mandatory | `just_try ] * string) list
val info_libraries : (string, string * bool) Hashtbl.t
+# Works with rslide revision 8
+# http://gallium.inria.fr/~pouillar/rslide/rslide
documentclass :beamer, :t, :compress, :red
usepackage :inputenc, :utf8
beamer_footline 50, 0
extend do
- module ::Rslide::Tags
- class CodeCaml < Code
- end
- class CodeTags < Code
- end
+ def code_caml *a, &b
+ latex_only.small.code_inline(*a, &b)
+ html_only.code(*a, &b)
end
+ def code_tags *a, &b
+ latex_only.small.code_inline(*a, &b)
+ html_only.code(*a, &b)
+ end
+end
+
+html_only do
+ paragraph.huge1 "Warning: this presentation has a degraded style compared to the Beamer/PDF version"
end
maketitle
end
end
-slide "How difficult is it to compile regular projects by hand?" do
+slide "How difficult is it to build regular projects by hand?" do
box "OCaml has subtle compilation rules" do
* Interfaces (_.mli_) can be absent, yet buildable (_.mly_)
* Native and bytecode suffixes and settings differ
end
code_tags do
: "funny.ml": rectypes
- <**/*.ml*>: warn_A, warn_error_A, debug, dtypes
- <**/*.cmx>: inline(9)
+ ~<**/*.ml*>~: warn_A, warn_error_A, debug, dtypes
+ ~<**/*.cmx>~: inline(9)
"foo.ml" or "bar.ml": warn_v, warn_error_v
"vendor.ml": -warn_A, -warn_error_A
<main.{byte,native}>: use_unix
h1 "Writing an ocamlbuild plugin"
slide "Not a specific language, but plain OCaml code" do
- * Plugins are compiled on the fly
- * Dynamic configuration is feasible
+ list do
+ * Plugins are compiled on the fly
+ * Dynamic configuration is feasible
+ end
box "With a plugin one can:" do
* Extend rules (add new ones, override old ones)
* Add flags and dependencies based on tags
end
slide "A status bar for your visual comfort" do
- * Compilation tools echo commands and their output
- * This creates a long and boring output that scrolls too fast
- * Here you can keep an eye on what is going on!
- * It succinctly displays time, number of targets, and tags
- * Command outputs are correctly multiplexed
- * A trace of the commands executed is kept in a log file
- * This log file can be used as the basis of a shell script
- example do
+ list do
+ * Compilation tools echo commands and their output
+ * This creates a long and boring output that scrolls too fast
+ * Here you can keep an eye on what is going on!
+ * It succinctly displays time, number of targets, and tags
+ * Command outputs are correctly multiplexed
+ * A trace of the commands executed is kept in a log file
+ * This log file can be used as the basis of a shell script
+ end
+ latex_only.example do
invisible_join do
count = 0
mod = 1
end
slide "Hygiene and sterilization" do
- * ocamlbuild has a Hygiene Squad (HS) that checks your source tree for cleanliness
+ > ocamlbuild has a Hygiene Squad (HS) that checks your source tree for cleanliness
box "It has preconceived but useful cleanliness notions", '<1->' do
* Files dirty by default: _.cmi_, _.cmo_, _.cma_, _.cmx_...
* _ocamllex_/_ocamlyacc_ files: _.ml_ *if* _.mll_, _.ml_&_.mli_ *if* _.mly_...
slide "Conclusion", '<+->' do
* ocamlbuild is not perfect but already damn useful
- * It will be in 3.10, so feel free to use it
- * Try it now! It's in the CVS!
+ * Try it now! It's in OCaml 3.10!
end
(* *)
(***********************************************************************)
-(* $Id: ocamlbuild.ml,v 1.1 2007/02/07 08:59:14 ertai Exp $ *)
+(* $Id: ocamlbuild.ml,v 1.1.4.1 2007/11/22 18:34:13 ertai Exp $ *)
(* Original author: Nicolas Pouillard *)
-My_unix_with_unix.setup ();
+Ocamlbuild_unix_plugin.setup ();
Ocamlbuild_pack.Main.main ()
-Executor
-My_unix_with_unix
Ocamlbuild_pack
Ocamlbuild_plugin
+Ocamlbuild_unix_plugin
Ocaml_compiler
Ocamldep
Ocaml_dependencies
+Ocamlbuild_plugin
--- /dev/null
+(***********************************************************************)
+(* ocamlbuild *)
+(* *)
+(* Nicolas Pouillard, Berke Durak, projet Gallium, INRIA Rocquencourt *)
+(* *)
+(* Copyright 2007 Institut National de Recherche en Informatique et *)
+(* en Automatique. All rights reserved. This file is distributed *)
+(* under the terms of the Q Public License version 1.0. *)
+(* *)
+(***********************************************************************)
+
+(* $Id: ocamlbuild_executor.ml,v 1.1.2.3 2007/11/28 17:21:00 ertai Exp $ *)
+(* Original author: Berke Durak *)
+(* Ocamlbuild_executor *)
+
+open Unix;;
+
+type error =
+ | Subcommand_failed
+ | Subcommand_got_signal
+ | Io_error
+ | Exceptionl_condition
+
+type task = unit -> string;;
+
+type job = {
+ job_id : int * int;
+ job_command : string;
+ job_next : task list;
+ job_result : bool ref; (* Result of this sequence group *)
+ job_stdout : in_channel;
+ job_stdin : out_channel;
+ job_stderr : in_channel;
+ job_buffer : Buffer.t;
+ mutable job_dying : bool;
+};;
+
+module JS = Set.Make(struct type t = job let compare = compare end);;
+module FDM = Map.Make(struct type t = file_descr let compare = compare end);;
+
+let sf = Printf.sprintf;;
+let fp = Printf.fprintf;;
+
+(*** print_unix_status *)
+(* FIXME never called *)
+let print_unix_status oc = function
+ | WEXITED x -> fp oc "exit %d" x
+ | WSIGNALED i -> fp oc "signal %d" i
+ | WSTOPPED i -> fp oc "stop %d" i
+;;
+(* ***)
+(*** print_job_id *)
+let print_job_id oc (x,y) = fp oc "%d.%d" x y;;
+(* ***)
+(*** output_lines *)
+let output_lines prefix oc buffer =
+ let u = Buffer.contents buffer in
+ let m = String.length u in
+ let output_line i j =
+ output_string oc prefix;
+ output oc u i (j - i);
+ output_char oc '\n'
+ in
+ let rec loop i =
+ if i = m then
+ ()
+ else
+ begin
+ try
+ let j = String.index_from u i '\n' in
+ output_line i j;
+ loop (j + 1)
+ with
+ | Not_found ->
+ output_line i m
+ end
+ in
+ loop 0
+;;
+(* ***)
+(*** execute *)
+(* XXX: Add test for non reentrancy *)
+let execute
+ ?(max_jobs=max_int)
+ ?(ticker=ignore)
+ ?(period=0.1)
+ ?(display=(fun f -> f Pervasives.stdout))
+ ~exit
+ (commands : task list list)
+ =
+ let batch_id = ref 0 in
+ let env = environment () in
+ let jobs = ref JS.empty in
+ let jobs_active = ref 0 in
+ let jobs_to_terminate = Queue.create () in
+ let commands_to_execute = Queue.create () in
+ let all_ok = ref true in
+ let results =
+ List.map (fun tasks ->
+ let result = ref false in
+ Queue.add (tasks, result) commands_to_execute;
+ result)
+ commands
+ in
+ let outputs = ref FDM.empty in
+ let doi = descr_of_in_channel in
+ let doo = descr_of_out_channel in
+ (*** compute_fds *)
+ let compute_fds =
+ let fds = ref ([], [], []) in
+ let prev_jobs = ref JS.empty in
+ fun () ->
+ if not (!prev_jobs == !jobs) then
+ begin
+ prev_jobs := !jobs;
+ fds :=
+ JS.fold
+ begin fun job (rfds, wfds, xfds) ->
+ let ofd = doi job.job_stdout
+ and ifd = doo job.job_stdin
+ and efd = doi job.job_stderr
+ in
+ (ofd :: efd :: rfds, wfds, ofd :: ifd :: efd :: xfds)
+ end
+ !jobs
+ ([], [], [])
+ end;
+ !fds
+ in
+ (* ***)
+ (*** add_job *)
+ let add_job cmd rest result id =
+ (*display begin fun oc -> fp oc "Job %a is %s\n%!" print_job_id id cmd; end;*)
+ let (stdout', stdin', stderr') = open_process_full cmd env in
+ incr jobs_active;
+ set_nonblock (doi stdout');
+ set_nonblock (doi stderr');
+ let job =
+ { job_id = id;
+ job_command = cmd;
+ job_next = rest;
+ job_result = result;
+ job_stdout = stdout';
+ job_stdin = stdin';
+ job_stderr = stderr';
+ job_buffer = Buffer.create 1024;
+ job_dying = false }
+ in
+ outputs := FDM.add (doi stdout') job (FDM.add (doi stderr') job !outputs);
+ jobs := JS.add job !jobs;
+ in
+ (* ***)
+ (*** skip_empty_tasks *)
+ let rec skip_empty_tasks = function
+ | [] -> None
+ | task :: tasks ->
+ let cmd = task () in
+ if cmd = "" then skip_empty_tasks tasks else Some(cmd, tasks)
+ in
+ (* ***)
+ (*** add_some_jobs *)
+ let add_some_jobs () =
+ let (tasks, result) = Queue.take commands_to_execute in
+ match skip_empty_tasks tasks with
+ | None -> result := false
+ | Some(cmd, rest) ->
+ let b_id = !batch_id in
+ incr batch_id;
+ add_job cmd rest result (b_id, 0)
+ in
+ (* ***)
+ (*** terminate *)
+ let terminate ?(continue=true) job =
+ if not job.job_dying then
+ begin
+ job.job_dying <- true;
+ Queue.add (job, continue) jobs_to_terminate
+ end
+ else
+ ()
+ in
+ (* ***)
+ (*** add_more_jobs_if_possible *)
+ let add_more_jobs_if_possible () =
+ while !jobs_active < max_jobs && not (Queue.is_empty commands_to_execute) do
+ add_some_jobs ()
+ done
+ in
+ (* ***)
+ (*** do_read *)
+ let do_read =
+ let u = String.create 4096 in
+ fun ?(loop=false) fd job ->
+ (*if job.job_dying then
+ ()
+ else*)
+ try
+ let rec iteration () =
+ let m =
+ try
+ read fd u 0 (String.length u)
+ with
+ | Unix.Unix_error(_,_,_) -> 0
+ in
+ if m = 0 then
+ if job.job_dying then
+ ()
+ else
+ terminate job
+ else
+ begin
+ Buffer.add_substring job.job_buffer u 0 m;
+ if loop then
+ iteration ()
+ else
+ ()
+ end
+ in
+ iteration ()
+ with
+ | x ->
+ display
+ begin fun oc ->
+ fp oc "Exception %s while reading output of command %S\n%!" job.job_command
+ (Printexc.to_string x);
+ end;
+ exit Io_error
+ in
+ (* ***)
+ (*** process_jobs_to_terminate *)
+ let process_jobs_to_terminate () =
+ while not (Queue.is_empty jobs_to_terminate) do
+ ticker ();
+ let (job, continue) = Queue.take jobs_to_terminate in
+
+ (*display begin fun oc -> fp oc "Terminating job %a\n%!" print_job_id job.job_id; end;*)
+
+ decr jobs_active;
+ do_read ~loop:true (doi job.job_stdout) job;
+ do_read ~loop:true (doi job.job_stderr) job;
+ outputs := FDM.remove (doi job.job_stdout) (FDM.remove (doi job.job_stderr) !outputs);
+ jobs := JS.remove job !jobs;
+ let status = close_process_full (job.job_stdout, job.job_stdin, job.job_stderr) in
+
+ let shown = ref false in
+
+ let show_command () =
+ if !shown then
+ ()
+ else
+ display
+ begin fun oc ->
+ shown := true;
+ fp oc "+ %s\n" job.job_command;
+ output_lines "" oc job.job_buffer
+ end
+ in
+ if Buffer.length job.job_buffer > 0 then show_command ();
+ begin
+ match status with
+ | Unix.WEXITED 0 ->
+ begin
+ if continue then
+ begin
+ match skip_empty_tasks job.job_next with
+ | None -> job.job_result := true
+ | Some(cmd, rest) ->
+ let (b_id, s_id) = job.job_id in
+ add_job cmd rest job.job_result (b_id, s_id + 1)
+ end
+ else
+ all_ok := false;
+ end
+ | Unix.WEXITED rc ->
+ show_command ();
+ display (fun oc -> fp oc "Command exited with code %d.\n" rc);
+ all_ok := false;
+ exit Subcommand_failed
+ | Unix.WSTOPPED s | Unix.WSIGNALED s ->
+ show_command ();
+ all_ok := false;
+ display (fun oc -> fp oc "Command got signal %d.\n" s);
+ exit Subcommand_got_signal
+ end
+ done
+ in
+ (* ***)
+ (*** terminate_all_jobs *)
+ let terminate_all_jobs () =
+ JS.iter (terminate ~continue:false) !jobs
+ in
+ (* ***)
+ (*** loop *)
+ let rec loop () =
+ (*display (fun oc -> fp oc "Total %d jobs\n" !jobs_active);*)
+ process_jobs_to_terminate ();
+ add_more_jobs_if_possible ();
+ if JS.is_empty !jobs then
+ ()
+ else
+ begin
+ let (rfds, wfds, xfds) = compute_fds () in
+ ticker ();
+ let (chrfds, chwfds, chxfds) = select rfds wfds xfds period in
+ List.iter
+ begin fun (fdlist, hook) ->
+ List.iter
+ begin fun fd ->
+ try
+ let job = FDM.find fd !outputs in
+ ticker ();
+ hook fd job
+ with
+ | Not_found -> () (* XXX *)
+ end
+ fdlist
+ end
+ [chrfds, do_read ~loop:false;
+ chwfds, (fun _ _ -> ());
+ chxfds,
+ begin fun _ _job ->
+ (*display (fun oc -> fp oc "Exceptional condition on command %S\n%!" job.job_command);
+ exit Exceptional_condition*)
+ () (* FIXME *)
+ end];
+ loop ()
+ end
+ in
+ try
+ loop ();
+ None
+ with
+ | x ->
+ begin
+ try
+ terminate_all_jobs ()
+ with
+ | x' ->
+ display (fun oc -> fp oc "Extra exception %s\n%!" (Printexc.to_string x'))
+ end;
+ Some(List.map (!) results, x)
+;;
+(* ***)
--- /dev/null
+(***********************************************************************)
+(* ocamlbuild *)
+(* *)
+(* Nicolas Pouillard, Berke Durak, projet Gallium, INRIA Rocquencourt *)
+(* *)
+(* Copyright 2007 Institut National de Recherche en Informatique et *)
+(* en Automatique. All rights reserved. This file is distributed *)
+(* under the terms of the Q Public License version 1.0. *)
+(* *)
+(***********************************************************************)
+
+(* $Id: ocamlbuild_executor.mli,v 1.1.2.3 2007/11/28 17:21:00 ertai Exp $ *)
+(* Original author: Berke Durak *)
+(* Ocamlbuild_executor *)
+
+(** UNIX-specific module for running tasks in parallel and properly multiplexing their outputs. *)
+
+type error =
+ | Subcommand_failed
+ | Subcommand_got_signal
+ | Io_error
+ | Exceptionl_condition
+
+(** [execute ~ticker ~period ~display ~exit commands] will execute the commands
+ in [commands] in parallel, correctly multiplexing their outputs.
+
+ A command is a function that given a unit [()] returns the shell command
+ string to execute, commands are functions in order to do some job just
+ before executing the command. These functions will be called once. If
+ specified, it will call [ticker] at least every [period] seconds. If
+ specified, it will call [display f] when it wishes to print something;
+ [display] should then call [f] with then channel on which [f] should
+ print.
+
+ Note that if the shell command to execute is the empty string [""], it's
+ considered as a no-op.
+
+ Note that [f] must be idempotent as it may well be called twice, once for
+ the log file, once for the actual output.
+
+ If one of the commands fails, it will exit with an appropriate error code,
+ calling [cleanup] before.
+
+ All exits are done trough the call to the given [exit] function, if not
+ supplied Pervasives.exit is used.
+*)
+val execute :
+ ?max_jobs:int ->
+ ?ticker:(unit -> unit) ->
+ ?period:float ->
+ ?display:((out_channel -> unit) -> unit) ->
+ exit:(error -> unit) ->
+ ((unit -> string) list list) ->
+ (bool list * exn) option
Ocaml_utils
Ocaml_tools
Ocaml_compiler
-Ocamldep
Ocaml_dependencies
+Exit_codes
+Digest_cache
(* *)
(***********************************************************************)
-(* $Id: ocamlbuild_plugin.ml,v 1.2 2007/02/26 16:27:45 ertai Exp $ *)
+(* $Id: ocamlbuild_plugin.ml,v 1.2.2.5 2007/11/28 17:03:54 ertai Exp $ *)
(* Original author: Nicolas Pouillard *)
open Ocamlbuild_pack
include Tags.Operators
module Rule = Ocamlbuild_pack.Rule
module Options = Ocamlbuild_pack.Options
+type command = Command.t = Seq of command list | Cmd of spec | Echo of string list * string | Nop
+and spec = Command.spec =
+ | N | S of spec list | A of string | P of string | Px of string
+ | Sh of string | T of Tags.t | V of string | Quote of spec
include Rule.Common_commands
type env = Pathname.t -> Pathname.t
type builder = Pathname.t list list -> (Pathname.t, exn) Ocamlbuild_pack.My_std.Outcome.t list
type action = env -> builder -> Command.t
let rule = Rule.rule
let dep = Rule.dep
-let file_rule = Rule.file_rule
let copy_rule = Rule.copy_rule
-let custom_rule = Rule.custom_rule
let ocaml_lib = Ocamlbuild_pack.Ocaml_utils.ocaml_lib
let flag = Ocamlbuild_pack.Flags.flag
let non_dependency = Ocamlbuild_pack.Ocaml_utils.non_dependency
let expand_module = Ocamlbuild_pack.Ocaml_utils.expand_module
let tags_of_pathname = Ocamlbuild_pack.Tools.tags_of_pathname
let hide_package_contents = Ocamlbuild_pack.Ocaml_compiler.hide_package_contents
-let tag_file file tags =
- Ocamlbuild_pack.Configuration.parse_string (Printf.sprintf "%S: %s" file (String.concat ", " tags));;
-let tag_any tags =
- Ocamlbuild_pack.Configuration.parse_string (Printf.sprintf "true: %s" (String.concat ", " tags));;
+let tag_file = Ocamlbuild_pack.Configuration.tag_file
+let tag_any = Ocamlbuild_pack.Configuration.tag_any
type hook = Ocamlbuild_pack.Hooks.message =
| Before_hygiene
| After_hygiene
--- /dev/null
+(***********************************************************************)
+(* ocamlbuild *)
+(* *)
+(* Nicolas Pouillard, Berke Durak, projet Gallium, INRIA Rocquencourt *)
+(* *)
+(* Copyright 2007 Institut National de Recherche en Informatique et *)
+(* en Automatique. All rights reserved. This file is distributed *)
+(* under the terms of the Q Public License version 1.0. *)
+(* *)
+(***********************************************************************)
+
+(* $Id: ocamlbuild_unix_plugin.ml,v 1.1.2.1 2007/11/22 18:34:13 ertai Exp $ *)
+(* Original author: Nicolas Pouillard *)
+open Format
+open Ocamlbuild_pack
+open My_unix
+
+let report_error f =
+ function
+ | Unix.Unix_error(err, fun_name, arg) ->
+ fprintf f "%s: %S failed" Sys.argv.(0) fun_name;
+ if String.length arg > 0 then
+ fprintf f " on %S" arg;
+ fprintf f ": %s" (Unix.error_message err)
+ | exn -> raise exn
+
+let mkstat unix_stat x =
+ let st =
+ try unix_stat x
+ with Unix.Unix_error _ as e -> raise (Sys_error (My_std.sbprintf "%a" report_error e))
+ in
+ { stat_key = sprintf "(%d,%d)" st.Unix.st_dev st.Unix.st_ino;
+ stat_file_kind =
+ match st.Unix.st_kind with
+ | Unix.S_LNK -> FK_link
+ | Unix.S_DIR -> FK_dir
+ | Unix.S_CHR | Unix.S_BLK | Unix.S_FIFO | Unix.S_SOCK -> FK_other
+ | Unix.S_REG -> FK_file }
+
+let is_link s = (Unix.lstat s).Unix.st_kind = Unix.S_LNK
+
+let at_exit_once callback =
+ let pid = Unix.getpid () in
+ at_exit begin fun () ->
+ if pid = Unix.getpid () then callback ()
+ end
+
+let run_and_open s kont =
+ let ic = Unix.open_process_in s in
+ let close () =
+ match Unix.close_process_in ic with
+ | Unix.WEXITED 0 -> ()
+ | Unix.WEXITED _ | Unix.WSIGNALED _ | Unix.WSTOPPED _ ->
+ failwith (Printf.sprintf "Error while running: %s" s) in
+ try
+ let res = kont ic in close (); res
+ with e -> (close (); raise e)
+
+let stdout_isatty () =
+ Unix.isatty Unix.stdout
+
+let execute_many =
+ let exit = function
+ | Ocamlbuild_executor.Subcommand_failed -> exit Exit_codes.rc_executor_subcommand_failed
+ | Ocamlbuild_executor.Subcommand_got_signal -> exit Exit_codes.rc_executor_subcommand_got_signal
+ | Ocamlbuild_executor.Io_error -> exit Exit_codes.rc_executor_io_error
+ | Ocamlbuild_executor.Exceptionl_condition -> exit Exit_codes.rc_executor_excetptional_condition
+ in
+ Ocamlbuild_executor.execute ~exit
+
+let setup () =
+ implem.is_degraded <- false;
+ implem.stdout_isatty <- stdout_isatty;
+ implem.gettimeofday <- Unix.gettimeofday;
+ implem.report_error <- report_error;
+ implem.execute_many <- execute_many;
+ implem.readlink <- Unix.readlink;
+ implem.run_and_open <- run_and_open;
+ implem.at_exit_once <- at_exit_once;
+ implem.is_link <- is_link;
+ implem.stat <- mkstat Unix.stat;
+ implem.lstat <- mkstat Unix.lstat;
--- /dev/null
+(***********************************************************************)
+(* ocamlbuild *)
+(* *)
+(* Nicolas Pouillard, Berke Durak, projet Gallium, INRIA Rocquencourt *)
+(* *)
+(* Copyright 2007 Institut National de Recherche en Informatique et *)
+(* en Automatique. All rights reserved. This file is distributed *)
+(* under the terms of the Q Public License version 1.0. *)
+(* *)
+(***********************************************************************)
+
+(* $Id: ocamlbuild_unix_plugin.mli,v 1.1.2.1 2007/11/22 18:34:13 ertai Exp $ *)
+(* Original author: Nicolas Pouillard *)
+val setup : unit -> unit
-Executor
-My_unix_with_unix
Ocamlbuild_pack
Ocamlbuild_plugin
+Ocamlbuild_unix_plugin
+Ocamlbuild_executor
+++ /dev/null
-(***********************************************************************)
-(* ocamlbuild *)
-(* *)
-(* Nicolas Pouillard, Berke Durak, projet Gallium, INRIA Rocquencourt *)
-(* *)
-(* Copyright 2007 Institut National de Recherche en Informatique et *)
-(* en Automatique. All rights reserved. This file is distributed *)
-(* under the terms of the Q Public License version 1.0. *)
-(* *)
-(***********************************************************************)
-
-(* $Id: ocamldep.ml,v 1.2.4.2 2007/04/04 18:08:59 pouillar Exp $ *)
-(* Original author: Nicolas Pouillard *)
-open My_std
-open Log
-open Command
-open Tags.Operators
-open Tools
-open Ocaml_utils
-open Pathname.Operators
-
-exception Error of string
-
-let ocamldep_command arg =
- let tags = tags_of_pathname arg++"ocaml"++"ocamldep" in
- S [!Options.ocamldep; T tags; ocaml_ppflags tags;
- flags_of_pathname arg; A "-modules"]
-
-let menhir_ocamldep_command arg out =
- let menhir = if !Options.ocamlyacc = N then V"MENHIR" else !Options.ocamlyacc in
- let tags = tags_of_pathname arg++"ocaml"++"menhir_ocamldep" in
- S [menhir; T tags; A"--raw-depend";
- A"--ocamldep"; Quote (ocamldep_command arg);
- P arg; Sh ">"; Px out]
-
-let ocamldep_command arg out =
- S[ocamldep_command arg; P arg; Sh ">"; Px out]
-
-let module_dependencies = Hashtbl.create 103
-let module_dependencies_of module_path =
- try Hashtbl.find module_dependencies module_path with Not_found -> []
-let register_module_dependencies module_path deps =
- let deps' = List.fold_right begin fun dep acc ->
- match module_importance module_path dep with
- | `ignored -> acc
- | (`just_try | `mandatory) as importance -> (importance, dep) :: acc
- end deps [] in
- Hashtbl.replace module_dependencies module_path
- (List.union (module_dependencies_of module_path) deps')
-
-let depends name ?tags ~prod ~dep ?insert ?(ocamldep_command=ocamldep_command) () =
- Rule.custom_rule name ?tags ~prod ~dep ?insert
- ~cache: begin fun env build ->
- let cmd = ocamldep_command (env dep) (env prod) in
- let str, _, tags = Command.string_target_and_tags_of_command_spec cmd in
- let _ = Rule.build_deps_of_tags build (tags++"dont_link_with") in
- str
- end
- begin fun env ~cached ->
- let arg = env dep in
- let out = env prod in
- let cmd = Cmd (ocamldep_command arg out) in
- let () = dprintf 6 "ocamldep: %a %a" Pathname.print arg Command.print cmd in
- if not (Pathname.exists arg) then
- raise (Error(sbprintf "Ocamldep.ocamldep: no input file (%a)" Pathname.print arg))
- else begin
- Command.execute ~pretend:cached cmd;
- with_input_file out begin fun ic ->
- let ocamldep_output =
- try Lexers.ocamldep_output (Lexing.from_channel ic)
- with Lexers.Error msg -> raise (Error(Printf.sprintf "Ocamldep.ocamldep: bad output (%s)" msg)) in
- let ocamldep_output =
- List.fold_right begin fun (_, deps) acc ->
- List.union deps acc
- end ocamldep_output [] in
- let ocamldep_output =
- if !Options.nostdlib && not (Tags.mem "nopervasives" (tags_of_pathname arg)) then
- "Pervasives" :: ocamldep_output
- else ocamldep_output in
- register_module_dependencies arg ocamldep_output
- end
- end
- end
+++ /dev/null
-(***********************************************************************)
-(* ocamlbuild *)
-(* *)
-(* Nicolas Pouillard, Berke Durak, projet Gallium, INRIA Rocquencourt *)
-(* *)
-(* Copyright 2007 Institut National de Recherche en Informatique et *)
-(* en Automatique. All rights reserved. This file is distributed *)
-(* under the terms of the Q Public License version 1.0. *)
-(* *)
-(***********************************************************************)
-
-(* $Id: ocamldep.mli,v 1.2.4.1 2007/03/23 16:34:48 pouillar Exp $ *)
-(* Original author: Nicolas Pouillard *)
-exception Error of string
-val ocamldep_command : Pathname.t -> Pathname.t -> Command.spec
-val menhir_ocamldep_command : Pathname.t -> Pathname.t -> Command.spec
-val module_dependencies_of : Pathname.t -> ([ `mandatory | `just_try ] * string) list
-val register_module_dependencies : Pathname.t -> string list -> unit
-val depends :
- string ->
- ?tags:string list ->
- prod:string ->
- dep:string ->
- ?insert:[`top | `before of string | `after of string | `bottom] ->
- ?ocamldep_command:(Pathname.t -> Pathname.t -> Command.spec) ->
- unit -> unit
(* *)
(***********************************************************************)
-(* $Id: options.ml,v 1.7.2.4 2007/04/12 13:19:02 pouillar Exp $ *)
+(* $Id: options.ml,v 1.7.2.13 2007/11/28 16:09:46 ertai Exp $ *)
(* Original author: Nicolas Pouillard *)
let version = "ocamlbuild 0.1";;
let program_to_execute = ref false
let must_clean = ref false
let show_documentation = ref false
+let recursive = ref false
let ext_lib = ref "a"
let ext_obj = ref "o"
let ext_dll = ref "so"
let tags_internal = ref [["quiet"]]
let tag_lines_internal = ref []
let show_tags_internal = ref []
+let log_file_internal = ref "_log"
let my_include_dirs = ref [[Filename.current_dir_name]]
let my_exclude_dirs = ref [[".svn"; "CVS"]]
-let pwd = Sys.getcwd ()
-
-let internal_log_file = ref None
-let set_log_file file =
- internal_log_file := Some file;
- Log.log_file := lazy begin
- if !Log.level <= 0
- || ((!plugin || !just_plugin)
- && sys_file_exists (filename_concat pwd "myocamlbuild.ml")) then
- None
- else Some(filename_concat pwd file)
- end
-
-let () = set_log_file "_log"
-
let dummy = "*invalid-dummy-string*";; (* Dummy string for delimiting the latest argument *)
+(* The JoCaml support will be in a plugin when the plugin system will support
+ * multiple/installed plugins *)
+let use_jocaml () =
+ ocamlc := A "jocamlc";
+ ocamlopt := A "jocamlopt";
+ ocamldep := A "jocamldep";
+ ocamlyacc := A "jocamlyacc";
+ ocamllex := A "jocamllex";
+ ocamlmklib := A "jocamlmklib";
+ ocamlmktop := A "jocamlmktop";
+ ocamlrun := A "jocamlrun";
+;;
+
let add_to rxs x =
let xs = Lexers.comma_or_blank_sep_strings (Lexing.from_string x) in
rxs := xs :: !rxs
else
()
let set_cmd rcmd = String (fun s -> rcmd := Sh s)
+let set_build_dir s = make_links := false; build_dir := s
let spec =
Arg.align
[
"-quiet", Unit (fun () -> Log.level := 0), " Make as quiet as possible";
"-verbose", Int (fun i -> Log.level := i + 2), "<level> Set the verbosity level";
"-documentation", Set show_documentation, " Show rules and flags";
- "-log", String set_log_file, "<file> Set log file";
- "-no-log", Unit (fun () -> Log.log_file := lazy None), " No log file";
+ "-log", Set_string log_file_internal, "<file> Set log file";
+ "-no-log", Unit (fun () -> log_file_internal := ""), " No log file";
"-clean", Set must_clean, " Remove build directory and other files, then exit";
+ "-r", Set recursive, " Traverse directories by default (true: traverse)";
"-I", String (add_to' my_include_dirs), "<path> Add to include directories";
"-Is", String (add_to my_include_dirs), "<path,...> (same as above, but accepts a (comma or blank)-separated list)";
"-nothing-should-be-rebuilt", Set nothing_should_be_rebuilt, " Fail if something needs to be rebuilt";
"-classic-display", Set Log.classic_display, " Display executed commands the old-fashioned way";
"-use-menhir", Set use_menhir, " Use menhir instead of ocamlyacc";
+ "-use-jocaml", Unit use_jocaml, " Use jocaml compilers instead of ocaml ones";
"-j", Set_int Command.jobs, "<N> Allow N jobs at once (0 for unlimited)";
- "-build-dir", Set_string build_dir, "<path> Set build directory";
+ "-build-dir", String set_build_dir, "<path> Set build directory (implies no-links)";
"-install-lib-dir", Set_string Ocamlbuild_where.libdir, "<path> Set the install library directory";
"-install-bin-dir", Set_string Ocamlbuild_where.bindir, "<path> Set the install binary directory";
"-where", Unit (fun () -> print_endline !Ocamlbuild_where.libdir; raise Exit_OK), " Display the install library directory";
let argv' = Array.concat [Sys.argv; [|dummy|]] in
parse_argv argv' spec anon_fun usage_msg;
Shell.mkdir_p !build_dir;
- let reorder x y = x := (List.concat (List.rev !y)) in
+
+ let () =
+ let log = !log_file_internal in
+ if log = "" then Log.init None
+ else if not (Filename.is_implicit log) then
+ failwith
+ (sprintf "Bad log file name: the file name must be implicit (not %S)" log)
+ else
+ let log = filename_concat !build_dir log in
+ Shell.mkdir_p (Filename.dirname log);
+ Shell.rm_f log;
+ let log = if !Log.level > 0 then Some log else None in
+ Log.init log
+ in
+
+ let reorder x y = x := !x @ (List.concat (List.rev !y)) in
reorder targets targets_internal;
reorder ocaml_libs ocaml_libs_internal;
reorder ocaml_cflags ocaml_cflags_internal;
reorder ignore_list ignore_list_internal;
reorder show_tags show_tags_internal;
+ let check_dir dir =
+ if Filename.is_implicit dir then
+ sys_file_exists dir
+ else
+ failwith
+ (sprintf "Included or excluded directories must be implicit (not %S)" dir)
+ in
let dir_reorder my dir =
let d = !dir in
reorder dir my;
- dir := List.filter sys_file_exists (!dir @ d)
+ dir := List.filter check_dir (!dir @ d)
in
dir_reorder my_include_dirs include_dirs;
dir_reorder my_exclude_dirs exclude_dirs;
(* *)
(***********************************************************************)
-(* $Id: pathname.ml,v 1.1.4.2 2007/03/13 10:28:53 pouillar Exp $ *)
+(* $Id: pathname.ml,v 1.1.4.5 2007/12/18 08:56:50 ertai Exp $ *)
(* Original author: Nicolas Pouillard *)
open My_std
open Format
end
open Operators
-let in_source_dir p =
- if is_implicit p then pwd/p else invalid_arg (sprintf "in_source_dir: %S" p)
-
let equal x y = x = y
let to_string x = x
let readdir x = Outcome.good (sys_readdir x)
let dir_seps = ['/';'\\'] (* FIXME add more *)
+let not_normal_form_re = Glob.parse "<**/{,.,..}/**>"
+
let parent x = concat parent_dir_name x
+let split p =
+ let rec go p acc =
+ let dir = dirname p in
+ if dir = p then dir, acc
+ else go dir (basename p :: acc)
+ in go p []
+
+let join root paths =
+ let root = if root = current_dir_name then "" else root in
+ List.fold_left (/) root paths
+
+let _H1 = assert (current_dir_name = ".")
+let _H2 = assert (parent_dir_name = "..")
+
+(* Use H1, H2 *)
+let rec normalize_list = function
+ | [] -> []
+ | "." :: xs -> normalize_list xs
+ | ".." :: _ -> failwith "Pathname.normalize_list: .. is forbidden here"
+ | _ :: ".." :: xs -> normalize_list xs
+ | x :: xs -> x :: normalize_list xs
+
+let normalize x =
+ if Glob.eval not_normal_form_re x then
+ let root, paths = split x in
+ join root (normalize_list paths)
+ else x
+
(* [is_prefix x y] is [x] a pathname prefix of [y] *)
let is_prefix x y =
let lx = String.length x and ly = String.length y in
let update_extensions ext x =
add_extension ext (chop_extensions x)
-let clean_up_links entry =
- Slurp.filter begin fun path name _ ->
- let pathname = in_source_dir (path/name) in
- if link_to_dir pathname !Options.build_dir then
- let z = readlink pathname in
- (* Here is one exception where one can use Sys.file_exists directly *)
- (if not (Sys.file_exists z) then
- Shell.rm pathname; false)
- else true
- end entry
-
-let clean_up_link_to_build () =
- Options.entry := Some(clean_up_links (the !Options.entry))
-
-let source_dir_path_set_without_links_to_build =
- lazy begin
- clean_up_link_to_build ();
- Slurp.fold (fun path name _ -> StringSet.add (path/name))
- (the !Options.entry) StringSet.empty
- end
-
-let exists_in_source_dir p =
- if !*My_unix.is_degraded then sys_file_exists (in_source_dir p)
- else StringSet.mem p !*source_dir_path_set_without_links_to_build
-
-let clean_links () =
- if !*My_unix.is_degraded then
- ()
- else
- ignore (clean_up_link_to_build ())
-
let exists = sys_file_exists
let copy = Shell.cp
let print_path_list = List.print print
-let root = mk "__root__"
-
let context_table = Hashtbl.create 107
let rec include_dirs_of dir =
let dir = if dir = "" then current_dir_name else dir in
Hashtbl.replace context_table dir& List.union context& include_dirs_of dir
-let in_build_dir p =
- if is_relative p then p
- else
- root/p (* XXX: Never reached *)
-
-let exists_in_build_dir p = exists (in_build_dir p)
-
let same_contents x y = Digest.file x = Digest.file y
-let is_up_to_date b p =
- let x = in_build_dir p in
- if b then exists_in_source_dir p && exists x && same_contents x (in_source_dir p)
- else not (exists_in_source_dir p) || exists x && same_contents x (in_source_dir p)
-
-let import_in_build_dir p =
- let p_in_build_dir = in_build_dir p in
- Shell.mkdir_p (dirname p); copy (in_source_dir p) p_in_build_dir
(* *)
(***********************************************************************)
-(* $Id: pathname.mli,v 1.1 2007/02/07 08:59:14 ertai Exp $ *)
+(* $Id: pathname.mli,v 1.1.4.2 2007/12/18 08:56:50 ertai Exp $ *)
(* Original author: Nicolas Pouillard *)
include Signatures.PATHNAME
-
-val is_up_to_date : bool -> t -> bool
-val clean_up_links : bool Slurp.entry -> bool Slurp.entry
-val exists_in_source_dir : t -> bool
-val exists_in_build_dir : t -> bool
-val import_in_build_dir : t -> unit
-val in_build_dir : t -> t
-val in_source_dir : t -> t
+val link_to_dir : t -> t -> bool
+val normalize : t -> t
(* *)
(***********************************************************************)
-(* $Id: plugin.ml,v 1.1.4.1 2007/03/04 16:13:53 pouillar Exp $ *)
+(* $Id: plugin.ml,v 1.1.4.2 2007/09/17 11:56:04 ertai Exp $ *)
(* Original author: Nicolas Pouillard *)
open My_std
open Format
let ocamlbuild = ocamlbuild-.-cmo in
let dir = !Ocamlbuild_where.libdir in
if not (sys_file_exists (dir/ocamlbuildlib)) then
- failwith (sprintf "Cannot found %S in ocamlbuild -where directory" ocamlbuildlib);
+ failwith (sprintf "Cannot find %S in ocamlbuild -where directory" ocamlbuildlib);
let dir = if Pathname.is_implicit dir then Pathname.pwd/dir else dir in
let cmd =
Cmd(S[compiler; A"-I"; P dir; libs; more_options;
(* *)
(***********************************************************************)
-(* $Id: ppcache.ml,v 1.1 2007/02/07 08:59:14 ertai Exp $ *)
+(* $Id: ppcache.ml,v 1.1.4.1 2007/11/21 20:55:26 ertai Exp $ *)
(* Original author: Nicolas Pouillard *)
open My_std
open Command
let path = cache_dir/(Digest.to_hex digest);;
+let cat path = with_input_file ~bin:true path (fun ic -> copy_chan ic stdout);;
+
if sys_file_exists path then
if !output = "" then
- print_string (read_file path)
+ cat path
else
Shell.cp path !output
else
let tmp = path^".tmp" in
Command.execute (Cmd(S[cmd; Sh ">"; A tmp]));
Shell.mv tmp path;
- print_string (read_file path)
+ cat path
end else begin
Command.execute (Cmd cmd);
Shell.cp !output path
(* *)
(***********************************************************************)
-(* $Id: resource.ml,v 1.1 2007/02/07 08:59:14 ertai Exp $ *)
+(* $Id: resource.ml,v 1.1.4.7 2007/12/18 09:03:37 ertai Exp $ *)
(* Original author: Nicolas Pouillard *)
open My_std
open Format
open Log
+open Pathname.Operators
module Resources = Set.Make(Pathname)
let equal = (=)
let compare = compare
+let in_source_dir p =
+ if Pathname.is_implicit p then Pathname.pwd/p else invalid_arg (Printf.sprintf "in_source_dir: %S" p)
+
+let in_build_dir p =
+ if Pathname.is_relative p then p
+ else invalid_arg (Printf.sprintf "in_build_dir: %S" p)
+
+let clean_up_links entry =
+ if not !Options.make_links then entry else
+ Slurp.filter begin fun path name _ ->
+ let pathname = in_source_dir (path/name) in
+ if Pathname.link_to_dir pathname !Options.build_dir then
+ let z = Pathname.readlink pathname in
+ (* Here is one exception where one can use Sys.file_exists directly *)
+ (if not (Sys.file_exists z) then
+ Shell.rm pathname; false)
+ else true
+ end entry
+
+let clean_up_link_to_build () =
+ Options.entry := Some(clean_up_links (the !Options.entry))
+
+let source_dir_path_set_without_links_to_build =
+ lazy begin
+ clean_up_link_to_build ();
+ Slurp.fold (fun path name _ -> StringSet.add (path/name))
+ (the !Options.entry) StringSet.empty
+ end
+
+let clean_links () =
+ if !*My_unix.is_degraded then
+ ()
+ else
+ ignore (clean_up_link_to_build ())
+
+let exists_in_source_dir p =
+ if !*My_unix.is_degraded then sys_file_exists (in_source_dir p)
+ else StringSet.mem p !*source_dir_path_set_without_links_to_build
+
+let clean p = Shell.rm_f p
+
module Cache = struct
- open Pathname.Operators
let clean () = Shell.chdir Pathname.pwd; Shell.rm_rf !Options.build_dir
dprintf 10 "resource_changed:@ %a" print r;
(get r).changed <- Yes
+ let external_is_up_to_date absolute_path =
+ let key = "Resource: " ^ absolute_path in
+ let digest = Digest.file absolute_path in
+ let is_up_to_date =
+ try
+ let digest' = Digest_cache.get key in
+ digest = digest'
+ with Not_found ->
+ false
+ in
+ is_up_to_date || (Digest_cache.put key digest; false)
+
+ let source_is_up_to_date r_in_source_dir r_in_build_dir =
+ let key = "Resource: " ^ r_in_source_dir in
+ let digest = Digest.file r_in_source_dir in
+ let r_is_up_to_date =
+ Pathname.exists r_in_build_dir &&
+ try
+ let digest' = Digest_cache.get key in
+ digest = digest'
+ with Not_found ->
+ false
+ in
+ r_is_up_to_date || (Digest_cache.put key digest; false)
+
+ let prod_is_up_to_date p =
+ let x = in_build_dir p in
+ not (exists_in_source_dir p) || Pathname.exists x && Pathname.same_contents x (in_source_dir p)
+
let rec resource_has_changed r =
let cache_entry = get r in
match cache_entry.changed with
| Bbuilt -> false
| Bsuspension _ -> assert false
| Bcannot_be_built -> false
- | Bnot_built_yet -> not (Pathname.is_up_to_date false r) in
+ | Bnot_built_yet -> not (prod_is_up_to_date r) in
let () = cache_entry.changed <- if res then Yes else No in res
let resource_state r = (get r).built
- let resource_is_built r = (get r).built = Bbuilt
-
let resource_built r = (get r).built <- Bbuilt
- let resource_is_failed r = (get r).built = Bcannot_be_built
-
let resource_failed r = (get r).built <- Bcannot_be_built
+ let import_in_build_dir r =
+ let cache_entry = get r in
+ let r_in_build_dir = in_build_dir r in
+ let r_in_source_dir = in_source_dir r in
+ if source_is_up_to_date r_in_source_dir r_in_build_dir then begin
+ dprintf 5 "%a exists and up to date" print r;
+ end else begin
+ dprintf 5 "%a exists in source dir -> import it" print r;
+ Shell.mkdir_p (Pathname.dirname r);
+ Pathname.copy r_in_source_dir r_in_build_dir;
+ cache_entry.changed <- Yes;
+ end;
+ cache_entry.built <- Bbuilt
+
let suspend_resource r cmd kont prods =
let cache_entry = get r in
match cache_entry.built with
let print_dependencies = print_graph
- let digest_resource p =
- let f = Pathname.to_string (Pathname.in_build_dir p) in
- let buf = Buffer.create 1024 in
- Buffer.add_string buf f;
- (if sys_file_exists f then Buffer.add_string buf (Digest.file f));
- Digest.string (Buffer.contents buf)
-
- let digests = Hashtbl.create 103
-
- let get_digest_for name =
- try Some (Hashtbl.find digests name)
- with Not_found -> None
- let store_digest name d = Hashtbl.replace digests name d
-
- let _digests = lazy (Pathname.pwd / !Options.build_dir / (Pathname.mk "_digests"))
-
- let finalize () =
- with_output_file !*_digests begin fun oc ->
- Hashtbl.iter begin fun name digest ->
- Printf.fprintf oc "%S: %S\n" name digest
- end digests
- end
-
- let init () =
- Shell.chdir !Options.build_dir;
- if Pathname.exists !*_digests then
- with_input_file !*_digests begin fun ic ->
- try while true do
- let l = input_line ic in
- Scanf.sscanf l "%S: %S" store_digest
- done with End_of_file -> ()
- end;
- My_unix.at_exit_once finalize
-
end
-let clean p = Shell.rm_f p
+let digest p =
+ let f = Pathname.to_string (in_build_dir p) in
+ let buf = Buffer.create 1024 in
+ Buffer.add_string buf f;
+ (if sys_file_exists f then Buffer.add_string buf (Digest.file f));
+ Digest.string (Buffer.contents buf)
+
+let exists_in_build_dir p = Pathname.exists (in_build_dir p)
(*
type env = string
let print_env = pp_print_string
*)
-let is_up_to_date path = Pathname.is_up_to_date true path
-
-let import x = x
+(* Should normalize *)
+let import x = Pathname.normalize x
module MetaPath : sig
+ type t
type env
- val matchit : string -> string -> env option
- val subst : env -> string -> string
+ val mk : (bool * string) -> t
+ val matchit : t -> string -> env option
+ val subst : env -> t -> string
val print_env : Format.formatter -> env -> unit
end = struct
+ open Glob_ast
- type atoms = A of string | V of string
+ type atoms = A of string | V of string * Glob.globber
type t = atoms list
type env = (string * string) list
exception No_solution
- let mk s = List.map (fun (s, is_var) -> if is_var then V s else A s) (Lexers.meta_path (Lexing.from_string s))
+ let mk (pattern_allowed, s) = List.map begin function
+ | `Var(var_name, globber) -> V(var_name, globber)
+ | `Word s -> A s
+ end (Lexers.path_scheme pattern_allowed (Lexing.from_string s))
- let mk = memo mk
+ let mk = memo mk
let match_prefix s pos prefix =
match String.contains_string s pos prefix with
let matchit p s =
let sl = String.length s in
- let rec loop xs pos acc =
+ let rec loop xs pos acc delta =
match xs with
| [] -> if pos = sl then acc else raise No_solution
- | A prefix :: xs -> loop xs (match_prefix s pos prefix) acc
- | V var :: A s2 :: xs ->
- begin match String.contains_string s pos s2 with
- | Some(pos') -> loop xs (pos' + String.length s2) ((var, String.sub s pos (pos' - pos)) :: acc)
- | None -> raise No_solution
- end
- | [V var] -> (var, String.sub s pos (sl - pos)) :: acc
+ | A prefix :: xs -> loop xs (match_prefix s pos prefix) acc 0
+ | V(var, patt) :: A s2 :: xs' ->
+ begin match String.contains_string s (pos + delta) s2 with
+ | Some(pos') ->
+ let matched = String.sub s pos (pos' - pos) in
+ if Glob.eval patt matched
+ then
+ try loop xs' (pos' + String.length s2) ((var, matched) :: acc) 0
+ with No_solution -> loop xs pos acc (pos' - pos + 1)
+ else loop xs pos acc (pos' - pos + 1)
+ | None -> raise No_solution
+ end
+ | [V(var, patt)] ->
+ let matched = String.sub s pos (sl - pos) in
+ if Glob.eval patt matched then (var, matched) :: acc else raise No_solution
| V _ :: _ -> assert false
in
- try Some (loop (mk p) 0 [])
+ try Some (loop p 0 [] 0)
with No_solution -> None
let pp_opt pp_elt f =
List.map begin fun x ->
match x with
| A atom -> atom
- | V var -> List.assoc var env
- end (mk s)
+ | V(var, _) -> List.assoc var env
+ end s
end
end
type env = MetaPath.env
+type resource_pattern = (Pathname.t * MetaPath.t)
+
+let print_pattern f (x, _) = Pathname.print f x
-let matchit = MetaPath.matchit
+let import_pattern x = x, MetaPath.mk (true, x)
+let matchit (_, p) x = MetaPath.matchit p x
-let subst = MetaPath.subst
+let subst env s = MetaPath.subst env (MetaPath.mk (false, s))
+let subst_any env s = MetaPath.subst env (MetaPath.mk (true, s))
+let subst_pattern env (_, p) = MetaPath.subst env p
let print_env = MetaPath.print_env
(* *)
(***********************************************************************)
-(* $Id: resource.mli,v 1.1 2007/02/07 08:59:14 ertai Exp $ *)
+(* $Id: resource.mli,v 1.1.4.5 2007/12/18 08:58:02 ertai Exp $ *)
(* Original author: Nicolas Pouillard *)
open My_std
open Pathname
+type resource_pattern
type env
module Resources : Set.S with type elt = t
module Cache :
sig
+ type cache_entry
type suspension
type build_status =
| Bsuspension of suspension
val clean : unit -> unit
- val init : unit -> unit
val resource_state : t -> build_status
val resource_changed : t -> unit
val resource_has_changed : t -> bool
- val resource_is_built : t -> bool
val resource_built : t -> unit
- val resource_is_failed : t -> bool
val resource_failed : t -> unit
+ val import_in_build_dir : t -> unit
val suspend_resource : t -> Command.t -> (unit -> unit) -> t list -> unit
val resume_resource : t -> unit
val resume_suspension : suspension -> unit
val get_optional_resource_suspension : t -> (Command.t * (unit -> unit)) option
val clear_resource_failed : t -> unit
- val dependencies : t -> Resources.t
val add_dependency : t -> t -> unit
- val get_digest_for : string -> string option
- val store_digest : string -> string -> unit
- val digest_resource : t -> string
+ val fold_dependencies : (string -> string -> 'a -> 'a) -> 'a -> 'a
+ val external_is_up_to_date : t -> bool
+
+ (* These are not currently used by others modules. *)
+ val dependencies : t -> Resources.t
val print_cache : Format.formatter -> unit -> unit
val print_dependencies : Format.formatter -> unit -> unit
- val fold_dependencies : (string -> string -> 'a -> 'a) -> 'a -> 'a
end
+val digest : t -> string
+val exists_in_source_dir : t -> bool
+val exists_in_build_dir : t -> bool
+val in_build_dir : t -> t
+val in_source_dir : t -> t
+
+val clean_up_links : bool Slurp.entry -> bool Slurp.entry
+
val compare : t -> t -> int
val print : Format.formatter -> t -> unit
+val print_pattern : Format.formatter -> resource_pattern -> unit
val clean : t -> unit
val import : string -> t
+val import_pattern : string -> resource_pattern
-val matchit : t -> t -> env option
+val matchit : resource_pattern -> t -> env option
val subst : env -> t -> t
-val is_up_to_date : t -> bool
+val subst_any : env -> t -> t
+val subst_pattern : env -> resource_pattern -> t
+(* val is_up_to_date : t -> bool *)
val print_env : Format.formatter -> env -> unit
(* *)
(***********************************************************************)
-(* $Id: rule.ml,v 1.2.2.3 2007/04/04 18:08:13 pouillar Exp $ *)
+(* $Id: rule.ml,v 1.2.2.17 2007/12/18 08:58:02 ertai Exp $ *)
(* Original author: Nicolas Pouillard *)
open My_std
open Format
type builder = Pathname.t list list -> (Pathname.t, exn) Outcome.t list
type action = env -> builder -> Command.t
-type t =
+type digest_command = { digest : string; command : Command.t }
+
+type 'a gen_rule =
{ name : string;
tags : Tags.t;
- deps : Pathname.t list;
- prods : Pathname.t list;
- code : env -> builder -> Command.t }
+ deps : Pathname.t list; (* These pathnames must be normalized *)
+ prods : 'a list; (* Note that prods also contains stamp *)
+ stamp : 'a option;
+ code : env -> builder -> digest_command }
+
+type rule = Pathname.t gen_rule
+type rule_scheme = Resource.resource_pattern gen_rule
+
+let name_of_rule r = r.name
+let deps_of_rule r = r.deps
+let prods_of_rule r = r.prods
+let stamp_of_rule r = r.stamp
-exception Code_digest of string * (bool -> unit)
+type 'a rule_printer = (Format.formatter -> 'a -> unit) -> Format.formatter -> 'a gen_rule -> unit
let compare _ _ = assert false
let print_resource_list = List.print Resource.print
-let print_rule_contents f r =
+let print_rule_contents ppelt f r =
fprintf f "@[<v2>{@ @[<2>name =@ %S@];@ @[<2>tags =@ %a@];@ @[<2>deps =@ %a@];@ @[<2>prods = %a@];@ @[<2>code = <fun>@]@]@ }"
- r.name Tags.print r.tags print_resource_list r.deps print_resource_list r.prods
+ r.name Tags.print r.tags print_resource_list r.deps (List.print ppelt) r.prods
-let pretty_print f r =
+let pretty_print ppelt f r =
fprintf f "@[<hv2>rule@ %S@ ~deps:%a@ ~prods:%a@ <fun>@]"
- r.name print_resource_list r.deps print_resource_list r.prods
+ r.name print_resource_list r.deps (List.print ppelt) r.prods
let print = print_rule_name
let subst env rule =
let subst_resources = List.map (Resource.subst env) in
- let finder next_finder p = next_finder (Resource.subst env p) in
+ let subst_resource_patterns = List.map (Resource.subst_pattern env) in
+ let finder next_finder p = next_finder (Resource.subst_any env p) in
+ let stamp = match rule.stamp with None -> None | Some x -> Some (Resource.subst_pattern env x) in
+ let prods = subst_resource_patterns rule.prods in
{ (rule) with name = sbprintf "%s (%a)" rule.name Resource.print_env env;
- prods = subst_resources rule.prods;
- deps = subst_resources rule.deps;
+ prods = prods;
+ deps = subst_resources rule.deps; (* The substition should preserve normalization of pathnames *)
+ stamp = stamp;
code = (fun env -> rule.code (finder env)) }
-exception Can_produce of t
+exception Can_produce of rule
let can_produce target rule =
try
end rule.prods; None
with Can_produce r -> Some r
-let tags_matches tags r = if Tags.does_match tags r.tags then Some r else None
+(* let tags_matches tags r = if Tags.does_match tags r.tags then Some r else None *)
let digest_prods r =
List.fold_right begin fun p acc ->
- let f = Pathname.to_string (Pathname.in_build_dir p) in
+ let f = Pathname.to_string (Resource.in_build_dir p) in
if sys_file_exists f then (f, Digest.file f) :: acc else acc
end r.prods []
-let digest_rule r dyndeps cmd_or_digest =
+let digest_deps r dyndeps =
let buf = Buffer.create 1024 in
- (match cmd_or_digest with
- | Good cmd -> Buffer.add_string buf (Command.to_string_for_digest cmd)
- | Bad(s, _) -> Buffer.add_string buf s);
- let add_resource r = Buffer.add_string buf (Resource.Cache.digest_resource r) in
+ let add_resource r = Buffer.add_string buf (Digest.to_hex (Resource.digest r)) in
+ Buffer.add_string buf "deps:";
+ List.iter add_resource r.deps;
+ Buffer.add_string buf "dyndeps:";
+ Resources.iter add_resource dyndeps;
+ Digest.to_hex (Digest.string (Buffer.contents buf))
+
+let digest_rule r dyndeps action =
+ let buf = Buffer.create 1024 in
+ Buffer.add_string buf action.digest;
+ let add_resource r = Buffer.add_string buf (Resource.digest r) in
Buffer.add_string buf "prods:";
List.iter add_resource r.prods;
Buffer.add_string buf "deps:";
Resources.iter add_resource dyndeps;
Digest.string (Buffer.contents buf)
+let cached_digest r =
+ try Some (Digest_cache.get ("Rule: " ^ r.name))
+ with Not_found -> None
+
+let store_digest r digest = Digest_cache.put ("Rule: " ^ r.name) digest
+
let print_digest f x = pp_print_string f (Digest.to_hex x)
let exists2 find p rs =
| [] -> []
| deps -> List.map Outcome.good (builder (List.map (fun x -> [x]) deps))
-let build_deps_of_tags_on_cmd builder x =
- let rec spec x =
- match x with
- | Command.N | Command.A _ | Command.Sh _ | Command.P _ | Command.Px _ | Command.V _ | Command.Quote _ -> ()
- | Command.S l -> List.iter spec l
- | Command.T tags ->
- begin match deps_of_tags tags with
- | [] -> ()
- | deps -> List.iter ignore_good (builder (List.map (fun x -> [x]) deps))
- end in
- let rec cmd x =
- match x with
- | Command.Nop -> ()
- | Command.Cmd(s) -> spec s
- | Command.Seq(s) -> List.iter cmd s in
- cmd x
+let build_deps_of_tags_on_cmd builder =
+ Command.iter_tags begin fun tags ->
+ match deps_of_tags tags with
+ | [] -> ()
+ | deps -> List.iter ignore_good (builder (List.map (fun x -> [x]) deps))
+ end
let call builder r =
let dyndeps = ref Resources.empty in
| Bad _ -> res
end results in
let () = dprintf 5 "start rule %a" print r in
- let cmd_or_digest =
- try
- let cmd = r.code (fun x -> x) builder in
- build_deps_of_tags_on_cmd builder cmd;
- Good cmd
- with Code_digest(s, kont) -> Bad(s, kont) in
+ let action = r.code (fun x -> x) builder in
+ build_deps_of_tags_on_cmd builder action.command;
let dyndeps = !dyndeps in
let () = dprintf 10 "dyndeps: %a" Resources.print dyndeps in
let (reason, cached) =
- match exists2 List.find (fun r -> not (Pathname.exists_in_build_dir r)) r.prods with
+ match exists2 List.find (fun r -> not (Resource.exists_in_build_dir r)) r.prods with
| Some r -> (`cache_miss_missing_prod r, false)
| _ ->
begin match exists2 List.find Resource.Cache.resource_has_changed r.deps with
begin match exists2 Resources.find Resource.Cache.resource_has_changed dyndeps with
| Some r -> (`cache_miss_changed_dyn_dep r, false)
| _ ->
- begin match Resource.Cache.get_digest_for r.name with
+ begin match cached_digest r with
| None -> (`cache_miss_no_digest, false)
| Some d ->
- begin match cmd_or_digest with
- | Bad("", _) ->
- (`cache_miss_undigest, false)
- | Bad(_, _) | Good(_) ->
- let rule_digest = digest_rule r dyndeps cmd_or_digest in
- if d = rule_digest then (`cache_hit, true)
- else (`cache_miss_digest_changed(d, rule_digest), false)
- end
+ let rule_digest = digest_rule r dyndeps action in
+ if d = rule_digest then (`cache_hit, true)
+ else (`cache_miss_digest_changed(d, rule_digest), false)
end
end
end
| `cache_miss_digest_changed(old_d, new_d) ->
dprintf l "cache miss: the digest has changed for %S (the command, a dependency, or a product: %a <> %a)"
r.name print_digest old_d print_digest new_d
- | `cache_miss_undigest ->
- dprintf l "cache miss: cache not supported for the rule %S" r.name in
+ in
let prod_digests = digest_prods r in
(if not cached then List.iter Resource.clean r.prods);
(if !Options.nothing_should_be_rebuilt && not cached then
let msg = sbprintf "Need to rebuild %a through the rule `%a'" print_resource_list r.prods print r in
raise (Exit_rule_error msg)));
explain_reason 3;
- let kont = begin fun () ->
+ let thunk () =
try
- (match cmd_or_digest with
- | Good cmd -> if cached then Command.execute ~pretend:true cmd
- | Bad (_, kont) -> kont cached);
- List.iter Resource.Cache.resource_built r.prods;
+ if cached then Command.execute ~pretend:true action.command
+ else
+ begin match r.stamp with
+ | Some stamp ->
+ reset_filesys_cache ();
+ let digest_deps = digest_deps r dyndeps in
+ with_output_file stamp (fun oc -> output_string oc digest_deps)
+ | None -> ()
+ end;
+ List.iter (fun r -> Resource.Cache.resource_built r) r.prods;
(if not cached then
- let new_rule_digest = digest_rule r dyndeps cmd_or_digest in
+ let new_rule_digest = digest_rule r dyndeps action in
let new_prod_digests = digest_prods r in
- let () = Resource.Cache.store_digest r.name new_rule_digest in
+ let () = store_digest r new_rule_digest in
List.iter begin fun p ->
- let f = Pathname.to_string (Pathname.in_build_dir p) in
+ let f = Pathname.to_string (Resource.in_build_dir p) in
(try let digest = List.assoc f prod_digests in
let new_digest = List.assoc f new_prod_digests in
if digest <> new_digest then raise Not_found
end r.prods);
dprintf 5 "end rule %a" print r
with exn -> (List.iter Resource.clean r.prods; raise exn)
- end in
- match cmd_or_digest with
- | Good cmd when not cached ->
- List.iter (fun x -> Resource.Cache.suspend_resource x cmd kont r.prods) r.prods
- | Bad _ | Good _ -> kont ()
+ in
+ if cached
+ then thunk ()
+ else List.iter (fun x -> Resource.Cache.suspend_resource x action.command thunk r.prods) r.prods
let (get_rules, add_rule) =
let rules = ref [] in
end !rules []
end
-let rule name ?(tags=[]) ?(prods=[]) ?(deps=[]) ?prod ?dep ?(insert = `bottom) code =
- let res_add x acc =
- let x = Resource.import x in
- if List.mem x acc then
- failwith (sprintf "in rule %s, multiple occurences of the resource %s" name x)
- else x :: acc in
- let res_of_opt = function None -> [] | Some r -> [Resource.import r] in
- if prods = [] && prod = None then raise (Exit_rule_error "Can't make a rule that produce nothing");
+let rule name ?(tags=[]) ?(prods=[]) ?(deps=[]) ?prod ?dep ?stamp ?(insert = `bottom) code =
+ let res_add import xs xopt =
+ let init =
+ match xopt with
+ | None -> []
+ | Some r -> [import r]
+ in
+ List.fold_right begin fun x acc ->
+ let r = import x in
+ if List.mem r acc then
+ failwith (sprintf "in rule %s, multiple occurences of the resource %s" name x)
+ else r :: acc
+ end xs init
+ in
+ if prods = [] && prod = None && stamp = None then raise (Exit_rule_error "Can't make a rule that produce nothing");
+ let stamp, prods =
+ match stamp with
+ | None -> None, prods
+ | Some stamp ->
+ Some (Resource.import_pattern stamp), stamp :: prods
+ in
+ let prods = res_add Resource.import_pattern prods prod in
+ let code env build =
+ let cmd = code env build in
+ { digest = Command.digest cmd
+ ; command = cmd }
+ in
add_rule insert
{ name = name;
tags = List.fold_right Tags.add tags Tags.empty;
- deps = List.fold_right res_add deps (res_of_opt dep);
- prods = List.fold_right res_add prods (res_of_opt prod);
+ deps = res_add Resource.import (* should normalize *) deps dep;
+ stamp = stamp;
+ prods = prods;
code = code }
-let file_rule name ?tags ~prod ?deps ?dep ?insert ~cache action =
- rule name ?tags ~prod ?dep ?deps ?insert begin fun env build ->
- raise (Code_digest (cache env build, (fun cached ->
- if not cached then
- with_output_file (env prod) (action env))))
- end
-
-let custom_rule name ?tags ?prods ?prod ?deps ?dep ?insert ~cache action =
- rule name ?tags ?prods ?prod ?dep ?deps ?insert begin fun env build ->
- raise (Code_digest (cache env build, fun cached -> action env ~cached))
- end
-
module Common_commands = struct
open Command
let mv src dest = Cmd (S [A"mv"; P src; Px dest])
let ln_f pointed pointer = Cmd (S [A"ln"; A"-f"; P pointed; Px pointer])
let ln_s pointed pointer = Cmd (S[A"ln"; A"-s"; P pointed; Px pointer])
let rm_f x = Cmd (S [A"rm"; A"-f"; Px x])
- let touch file = Cmd (S[A"touch"; Px file])
let chmod opts file = Cmd (S[A"chmod"; opts; Px file])
let cmp a b = Cmd (S[A"cmp"; P a; Px b])
end
let copy_rule name ?insert src dest =
rule name ?insert ~prod:dest ~dep:src
- (fun env _ -> cp_p (env src) (env dest))
+ begin fun env _ ->
+ let src = env src and dest = env dest in
+ Shell.mkdir_p (Pathname.dirname dest);
+ cp_p src dest
+ end
(* *)
(***********************************************************************)
-(* $Id: rule.mli,v 1.2.2.2 2007/03/23 16:34:48 pouillar Exp $ *)
+(* $Id: rule.mli,v 1.2.2.8 2007/11/28 17:03:54 ertai Exp $ *)
(* Original author: Nicolas Pouillard *)
open My_std
open Resource
type builder = Pathname.t list list -> (Pathname.t, exn) Outcome.t list
type action = env -> builder -> Command.t
-type t = private
- { name : string;
- tags : Tags.t;
- deps : Pathname.t list;
- prods : Pathname.t list;
- code : env -> builder -> Command.t }
+type 'a gen_rule
+
+type rule = Pathname.t gen_rule
+type rule_scheme = resource_pattern gen_rule
+
+type 'a rule_printer = (Format.formatter -> 'a -> unit) -> Format.formatter -> 'a gen_rule -> unit
+
+val name_of_rule : 'a gen_rule -> string
+val deps_of_rule : 'a gen_rule -> Pathname.t list
+val prods_of_rule : 'a gen_rule -> 'a list
val rule : string ->
?tags:string list ->
?deps:string list ->
?prod:string ->
?dep:string ->
+ ?stamp:string ->
?insert:[`top | `before of string | `after of string | `bottom] ->
action -> unit
-val file_rule : string ->
- ?tags:string list ->
- prod:string ->
- ?deps:string list ->
- ?dep:string ->
- ?insert:[`top | `before of string | `after of string | `bottom] ->
- cache:(env -> builder -> string) ->
- (env -> out_channel -> unit) -> unit
-
-val custom_rule : string ->
- ?tags:string list ->
- ?prods:string list ->
- ?prod:string ->
- ?deps:string list ->
- ?dep:string ->
- ?insert:[`top | `before of string | `after of string | `bottom] ->
- cache:(env -> builder -> string) ->
- (env -> cached:bool -> unit) -> unit
-
(** [copy_rule name ?insert source destination] *)
val copy_rule : string ->
?insert:[`top | `before of string | `after of string | `bottom] ->
val ln_f : Pathname.t -> Pathname.t -> Command.t
val ln_s : Pathname.t -> Pathname.t -> Command.t
val rm_f : Pathname.t -> Command.t
- val touch : Pathname.t -> Command.t
val chmod : Command.spec -> Pathname.t -> Command.t
val cmp : Pathname.t -> Pathname.t -> Command.t
end
-val print : Format.formatter -> t -> unit
-val pretty_print : Format.formatter -> t -> unit
+val print : Format.formatter -> rule -> unit
+val pretty_print : 'a rule_printer
(** For system use only *)
-val subst : Resource.env -> t -> t
-val can_produce : Pathname.t -> t -> t option
-val tags_matches : Tags.t -> t -> t option
-val compare : t -> t -> int
+val subst : Resource.env -> rule_scheme -> rule
+val can_produce : Pathname.t -> rule_scheme -> rule option
+(* val tags_matches : Tags.t -> t -> t option *)
+val compare : 'a gen_rule -> 'a gen_rule -> int
-val print_rule_name : Format.formatter -> t -> unit
-val print_rule_contents : Format.formatter -> t -> unit
+val print_rule_name : Format.formatter -> 'a gen_rule -> unit
+val print_rule_contents : 'a rule_printer
-val get_rules : unit -> t list
+val get_rules : unit -> rule_scheme list
-val call : builder -> t -> unit
+val call : builder -> rule -> unit
val build_deps_of_tags : builder -> Tags.t -> Pathname.t list
(* *)
(***********************************************************************)
-(* $Id: shell.ml,v 1.1.4.1 2007/03/07 11:30:14 pouillar Exp $ *)
+(* $Id: shell.ml,v 1.1.4.2 2007/11/28 16:11:27 ertai Exp $ *)
(* Original author: Nicolas Pouillard *)
open My_std
()
end
else
- match My_unix.execute_many ~ticker:Log.update ~display:Log.display [[(cmd, ignore)]] with
+ match My_unix.execute_many ~ticker:Log.update ~display:Log.display [[(fun () -> cmd)]] with
| None -> ()
| Some(_, x) ->
failwith (Printf.sprintf "Error during command %S: %s" cmd (Printexc.to_string x))
(* *)
(***********************************************************************)
-(* $Id: signatures.mli,v 1.8.2.3 2007/04/12 13:19:02 pouillar Exp $ *)
+(* $Id: signatures.mli,v 1.8.2.19 2007/12/18 08:55:23 ertai Exp $ *)
(* Original author: Nicolas Pouillard *)
(** This module contains all module signatures that the user
could use to build an ocamlbuild plugin. *)
val rev : string -> string
+ (* Convert a character list into a character string *)
+ val implode : char list -> string
+
+ (* Convert a character string into a character list *)
+ val explode : string -> char list
+
(** The following are original functions from the [String] module. *)
include Std_signatures.STRING
end
quotation mistakes. *)
module type COMMAND = sig
type tags
+ type pathname
- (** The type [t] is basically a sequence of command specifications. This avoids having to
- flatten lists of lists. *)
- type t = Seq of t list | Cmd of spec | Nop
+ (** The type [t] provides some basic combinators and command primitives.
+ Other commands can be made of command specifications ([spec]). *)
+ type t =
+ | Seq of t list (** A sequence of commands (like the `;' in shell) *)
+ | Cmd of spec (** A command is made of command specifications ([spec]) *)
+ | Echo of string list * pathname (** Write the given strings (w/ any formatting) to the given file *)
+ | Nop (** The command that does nothing *)
(** The type for command specifications. *)
and spec =
| N (** No operation. *)
| S of spec list (** A sequence. This gets flattened in the last stages *)
| A of string (** An atom. *)
- | P of string (** A pathname. *)
- | Px of string (** A pathname, that will also be given to the call_with_target hook. *)
+ | P of pathname (** A pathname. *)
+ | Px of pathname (** A pathname, that will also be given to the call_with_target hook. *)
| Sh of string (** A bit of raw shell code, that will not be escaped. *)
| T of tags (** A set of tags, that describe properties and some semantics
information about the command, afterward these tags will be
[ `N
| `S of vspec list
| `A of string
- | `P of string (* Pathname.t *)
- | `Px of string (* Pathname.t *)
+ | `P of pathname
+ | `Px of pathname
| `Sh of string
| `Quote of vspec ]
val execute : ?quiet:bool -> ?pretend:bool -> t -> unit
(** Run the commands in the given list, if possible in parallel.
- See the module [Executor]. *)
+ See the module [Ocamlbuild_executor]. *)
val execute_many : ?quiet:bool -> ?pretend:bool -> t list -> (bool list * exn) option
(** [setup_virtual_command_solver virtual_command solver]
into command-line options. *)
val reduce : spec -> spec
- (** Print a command. *)
+ (** Print a command (the format is not suitable to running the command). *)
val print : Format.formatter -> t -> unit
- (** Convert a command to a string. *)
+ (** Convert a command to a string (same format as print). *)
val to_string : t -> string
(** Build a string representation of a command that can be passed to the
matching {i glob2}.
- [a] matches the string consisting of the single letter [a].
- [{]{i glob1},{i glob2}[}] matches strings matching {i glob1} or {i glob2}.
- - [*] matches all strings, including the empty one.
- - [?] matches strings of length 1.
+ - [?] any one-letter string, excluding the slash.
+ - [*] matches all strings not containing a slash, including the empty one.
+ - [**/] the empty string, or any string ending with a slash.
+ - [/**] any string starting with a slash, or the empty string.
+ - [/**/] any string starting and ending with a slash.
- [\[]{i c1}-{i c2}{i c3}-{i c4}...[\]] matches characters in the range {i c1} to {i c2} inclusive,
or in the range {i c3} to {i c4} inclusive. For instance [\[a-fA-F0-9\]] matches hexadecimal digits.
To match the dash, put it at the end.
<< f (g (h x)) >> becomes << f& g& h x >> *)
val ( & ) : ('a -> 'b) -> 'a -> 'b
+ (** The reversed application combinator.
+ Useful to describe some operations chaining.
+ << f x (g y (h z)) >> becomes << z |> h |> g y |> f x >> *)
+ val ( |> ) : 'a -> ('a -> 'b) -> 'b
+
(** [r @:= l] is equivalent to [r := !r @ l] *)
val ( @:= ) : 'a list ref -> 'a list -> unit
val program_to_execute : bool ref
val must_clean : bool ref
val catch_errors : bool ref
- val internal_log_file : string option ref
val use_menhir : bool ref
val show_documentation : bool ref
+ val recursive : bool ref
val targets : string list ref
val ocaml_libs : string list ref
module type PLUGIN = sig
module Pathname : PATHNAME
module Tags : TAGS
- module Command : COMMAND with type tags = Tags.t
+ module Command : COMMAND with type tags = Tags.t and type pathname = Pathname.t
module Outcome : OUTCOME
module String : STRING
module List : LIST
module Arch : ARCH
include MISC
+ (** See [COMMAND] for the description of these types. *)
+ type command = Command.t = Seq of command list | Cmd of spec | Echo of string list * Pathname.t | Nop
+ and spec = Command.spec =
+ | N | S of spec list | A of string | P of string | Px of string
+ | Sh of string | T of Tags.t | V of string | Quote of spec
+
+ (** [path1/path2] Join the given path names. *)
val ( / ) : Pathname.t -> Pathname.t -> Pathname.t
+
+ (** [path-.-extension] Add the given extension to the given pathname. *)
val ( -.- ) : Pathname.t -> string -> Pathname.t
+ (** [tags++tag] Add the given tag to the given set of tags. *)
val ( ++ ) : Tags.t -> Tags.elt -> Tags.t
+
+ (** [tags--tag] Remove the given tag to the given set of tags. *)
val ( -- ) : Tags.t -> Tags.elt -> Tags.t
+
+ (** [tags+++optional_tag] Add the given optional tag to the given set of tags
+ if the given option is Some. *)
val ( +++ ) : Tags.t -> Tags.elt option -> Tags.t
+
+ (** [tags---optional_tag] Remove the given optional tag to the given set of tags
+ if the given option is Some. *)
val ( --- ) : Tags.t -> Tags.elt option -> Tags.t
+ (** The type of the builder environments. Here an environment is just the
+ lookup function of it. Basically this function will resolve path variables
+ like % or more generally %(var_name). *)
type env = Pathname.t -> Pathname.t
+
+ (** A builder is a function that waits for conjonction of alternative targets.
+ The alternatives are here to support some choices, for instance for an
+ OCaml module an alternatives can be foo.cmo, foo.cmi, Foo.cmo, Foo.cmi.
+ Conjonctions are here to help making parallelism, indeed commands that are
+ independant will be run concurently. *)
type builder = Pathname.t list list -> (Pathname.t, exn) Outcome.t list
+
+ (** This is the type for rule actions. An action receive as argument, the
+ environment lookup function (see [env]), and a function to dynamically
+ build more targets (see [builder]). An action should return the command
+ to run in order to build the rule productions using the rule dependencies. *)
type action = env -> builder -> Command.t
+ (** This is the main function for adding a rule to the ocamlbuild engine.
+ - The first argument is the name of the rule (should be unique).
+ - It takes files that the rule produces.
+ Use ~prod for one file, ~prods for list of files.
+ - It also takes files that the rule uses.
+ Use ~dep for one file, ~deps for list of files.
+ - It finally takes the action to perform in order to produce the
+ productions files using the dependencies (see [action]).
+ There is also two more options:
+ - The ~insert argument allow to insert the rules precisely between other
+ rules.
+ - The ~stamp argument specify the name of a file that will be
+ automatically produced by ocamlbuild. This file can serve as a virtual
+ target (or phony target), since it will be filled up by a digest of
+ it dependencies.
+ - The ~tags argument in deprecated, don't use it. *)
val rule : string ->
?tags:string list ->
?prods:string list ->
?deps:string list ->
?prod:string ->
?dep:string ->
+ ?stamp:string ->
?insert:[`top | `before of string | `after of string | `bottom] ->
action -> unit
- val file_rule : string ->
- ?tags:string list ->
- prod:string ->
- ?deps:string list ->
- ?dep:string ->
- ?insert:[`top | `before of string | `after of string | `bottom] ->
- cache:(env -> builder -> string) ->
- (env -> out_channel -> unit) -> unit
-
- val custom_rule : string ->
- ?tags:string list ->
- ?prods:string list ->
- ?prod:string ->
- ?deps:string list ->
- ?dep:string ->
- ?insert:[`top | `before of string | `after of string | `bottom] ->
- cache:(env -> builder -> string) ->
- (env -> cached:bool -> unit) -> unit
-
(** [copy_rule name ?insert source destination] *)
val copy_rule : string ->
?insert:[`top | `before of string | `after of string | `bottom] ->
string -> string -> unit
- (** [dep tags deps] Will build [deps] when [tags] will be activated. *)
+ (** [dep tags deps] Will build [deps] when all [tags] will be activated. *)
val dep : Tags.elt list -> Pathname.t list -> unit
+ (** [flag tags command_spec] Will inject the given piece of command
+ ([command_spec]) when all [tags] will be activated. *)
val flag : Tags.elt list -> Command.spec -> unit
(** [non_dependency module_path module_name]
val expand_module :
Pathname.t list -> Pathname.t -> string list -> Pathname.t list
+ (** Reads the given file, parse it has list of words separated by blanks.
+ It ignore lines that begins with a '#' character. *)
val string_list_of_file : Pathname.t -> string list
+ (** Takes a pathname and returns an OCaml module name. Basically it will
+ remove directories and extensions, and then capitalize the string. *)
val module_name_of_pathname : Pathname.t -> string
+ (** The Unix mv command. *)
val mv : Pathname.t -> Pathname.t -> Command.t
+
+ (** The Unix cp command. *)
val cp : Pathname.t -> Pathname.t -> Command.t
+
+ (** The Unix ln -f command. *)
val ln_f : Pathname.t -> Pathname.t -> Command.t
+
+ (** The Unix ln -s command. *)
val ln_s : Pathname.t -> Pathname.t -> Command.t
+
+ (** The Unix rm -f command. *)
val rm_f : Pathname.t -> Command.t
- val touch : Pathname.t -> Command.t
+
+ (** The Unix chmod command (almost deprecated). *)
val chmod : Command.spec -> Pathname.t -> Command.t
+
+ (** The Unix cmp command (almost deprecated). *)
val cmp : Pathname.t -> Pathname.t -> Command.t
(** [hide_package_contents pack_name]
this package even if it contains that module. *)
val hide_package_contents : string -> unit
+ (** [tag_file filename tag_list] Tag the given filename with all given tags. *)
val tag_file : Pathname.t -> Tags.elt list -> unit
+ (** [tag_any tag_list] Tag anything with all given tags. *)
val tag_any : Tags.elt list -> unit
+ (** Returns the set of tags that applies to the given pathname. *)
val tags_of_pathname : Pathname.t -> Tags.t
+ (** Here is the list of hooks that the dispatch function have to handle.
+ Generally one respond to one or two hooks (like After_rules) and do
+ nothing in the default case. *)
type hook =
| Before_hygiene
| After_hygiene
| Before_rules
| After_rules
+ (** [dispatch hook_handler] Is the entry point for ocamlbuild plugins. Every
+ plugin must call it with a [hook_handler] where all calls to plugin
+ functions lives. *)
val dispatch : (hook -> unit) -> unit
end
(* *)
(***********************************************************************)
-(* $Id: solver.ml,v 1.1 2007/02/07 08:59:15 ertai Exp $ *)
+(* $Id: solver.ml,v 1.1.4.5 2007/12/18 08:58:02 ertai Exp $ *)
(* Original author: Nicolas Pouillard *)
open My_std
open Log
let rec pp_repeat f (n, s) =
if n > 0 then (pp_print_string f s; pp_repeat f (n - 1, s))
+(* Targets must be normalized pathnames.
+ * Recursive calls are either on input targets
+ * or dependencies of these targets (returned by Rule.deps_of_rule).
+ *)
let rec self depth on_the_go_orig target =
let rules = Rule.get_rules () in
let on_the_go = target :: on_the_go_orig in
(dprintf 5 "%a was suspended -> resuming" Resource.print target;
Resource.Cache.resume_suspension s)
| Resource.Cache.Bnot_built_yet ->
- if Resource.is_up_to_date target then
- (dprintf 5 "%a exists and up to date" Resource.print target;
- Resource.Cache.resource_built target)
- else if Pathname.exists_in_source_dir target then
- (dprintf 5 "%a exists in source dir -> import it" Resource.print target;
- Pathname.import_in_build_dir target;
- Resource.Cache.resource_built target;
- Resource.Cache.resource_changed target)
+ if not (Pathname.is_relative target) && Pathname.exists target then
+ if Resource.Cache.external_is_up_to_date target then ()
+ else (* perhaps the error can be refined *) failed target (Leaf target)
+ else
+ if Resource.exists_in_source_dir target then
+ Resource.Cache.import_in_build_dir target
else
(* FIXME tags of target
let tags = Configuration.tags_of_target target in
| [] -> assert false
| r :: rs ->
try
- List.iter (force_self (depth + 1) on_the_go) r.Rule.deps;
+ List.iter (force_self (depth + 1) on_the_go) (Rule.deps_of_rule r);
Rule.call (self_firsts (depth + 1) on_the_go) r
with Failed backtrace ->
if rs = [] then failed target (Depth (target, Choice (backtrace :: backtraces)))
with Failed backtrace -> self_first depth on_the_go (backtrace :: already_failed) rs
and self_firsts depth on_the_go rss =
let results = List.map (self_first depth on_the_go []) rss in
- let cmds, konts =
+ let cmds, thunks =
List.fold_right begin fun res ((acc1, acc2) as acc) ->
match res with
| Bad _ -> acc
| Good res ->
match Resource.Cache.get_optional_resource_suspension res with
| None -> acc
- | Some (cmd, kont) -> (cmd :: acc1, kont :: acc2)
+ | Some (cmd, thunk) -> (cmd :: acc1, thunk :: acc2)
end results ([], []) in
let count = List.length cmds in
let job_debug = if !Command.jobs = 1 then 10 else 5 in
if count > 1 then dprintf job_debug "<<< PARALLEL";
begin match opt_exn with
| Some(res, exn) ->
- List.iter2 (fun res kont -> if res then kont ()) res konts;
+ List.iter2 (fun res thunk -> if res then thunk ()) res thunks;
Log.finish ~how:`Error ();
raise exn
| None ->
- List.iter (fun kont -> kont ()) konts
+ List.iter (fun thunk -> thunk ()) thunks
end;
results
and force_self depth on_the_go x = self depth on_the_go x; Resource.Cache.resume_resource x
ocamlc -c pathname.mli
ocamlc -c discard_printf.mli
ocamlc -c command.mli
+ocamlc -c digest_cache.mli
ocamlc -c resource.mli
ocamlc -c rule.mli
ocamlc -c hygiene.mli
ocamlc -c options.mli
ocamlc -c tools.mli
+ocamlc -c exit_codes.mli
ocamlc -c main.mli
ocamlc -c ocaml_utils.mli
ocamlc -c ocaml_tools.mli
ocamlc -c ocaml_compiler.mli
ocamlc -c ocaml_dependencies.mli
ocamlc -c hooks.mli
-ocamlc -c ocamldep.mli
ocamlc -c ocaml_specific.mli
ocamlc -c configuration.mli
ocamlc -c flags.mli
ocamlc -c plugin.mli
ocamlc -c plugin.ml
ocamlc -c ocaml_dependencies.ml
+ocamlc -c exit_codes.ml
ocamlc -c main.ml
ocamlc -c ocaml_specific.ml
ocamlc -c display.ml
ocamlc -c ocaml_utils.ml
ocamlc -c ocaml_tools.ml
ocamlc -c ocaml_compiler.ml
-ocamlc -c ocamldep.ml
ocamlc -c hooks.ml
ocamllex lexers.mll
ocamlc -c lexers.ml
ocamlc -c flags.ml
ocamlc -c hygiene.ml
ocamlc -c ocaml_arch.ml
+ocamlc -c digest_cache.ml
ocamlc -c resource.ml
ocamlc -c rule.ml
ocamlc -c report.ml
ocamlc -c solver.ml
ocamlc -c ocamlbuildlight.mli
-ocamlc -pack discard_printf.cmo my_std.cmo bool.cmo glob_ast.cmo glob_lexer.cmo glob.cmo lexers.cmo my_unix.cmo tags.cmo display.cmo log.cmo shell.cmo slurp.cmo ocamlbuild_where.cmo command.cmo options.cmo pathname.cmo resource.cmo rule.cmo flags.cmo solver.cmo report.cmo ocaml_arch.cmo hygiene.cmo configuration.cmo tools.cmo fda.cmo plugin.cmo ocaml_utils.cmo ocamldep.cmo ocaml_dependencies.cmo ocaml_compiler.cmo ocaml_tools.cmo hooks.cmo ocaml_specific.cmo main.cmo -o ocamlbuild_pack.cmo
+ocamlc -pack discard_printf.cmo my_std.cmo bool.cmo glob_ast.cmo glob_lexer.cmo glob.cmo lexers.cmo my_unix.cmo tags.cmo display.cmo log.cmo shell.cmo slurp.cmo ocamlbuild_where.cmo command.cmo options.cmo pathname.cmo digest_cache.cmo resource.cmo rule.cmo flags.cmo solver.cmo report.cmo ocaml_arch.cmo hygiene.cmo configuration.cmo tools.cmo fda.cmo plugin.cmo ocaml_utils.cmo ocaml_dependencies.cmo ocaml_compiler.cmo ocaml_tools.cmo hooks.cmo ocaml_specific.cmo exit_codes.cmo main.cmo -o ocamlbuild_pack.cmo
ocamlc -c ocamlbuildlight.ml
ocamlc ocamlbuild_pack.cmo ocamlbuildlight.cmo -o ../ocamlbuild.byte.start
cd ..
(* *)
(***********************************************************************)
-(* $Id: tools.ml,v 1.2 2007/02/08 16:53:39 ertai Exp $ *)
+(* $Id: tools.ml,v 1.2.4.1 2007/11/28 16:06:06 ertai Exp $ *)
(* Original author: Nicolas Pouillard *)
(* Tools *)
let pp_l = List.print String.print
-let default_tags = ref Tags.empty;;
-
let tags_of_pathname p =
- (Tags.union (Configuration.tags_of_filename (Pathname.to_string p)) !default_tags)
+ Configuration.tags_of_filename (Pathname.to_string p)
++("file:"^p)
++("extension:"^Pathname.get_extension p)
let flags_of_pathname p = Configuration.flags_of_filename (Pathname.to_string p)
(* *)
(***********************************************************************)
-(* $Id: tools.mli,v 1.1 2007/02/07 08:59:15 ertai Exp $ *)
+(* $Id: tools.mli,v 1.1.4.1 2007/11/28 16:06:06 ertai Exp $ *)
(* Original author: Nicolas Pouillard *)
(* Tools *)
val tags_of_pathname : Pathname.t -> Tags.t
val flags_of_pathname : Pathname.t -> Command.spec
-val default_tags : Tags.t ref
val path_and_context_of_string : Pathname.t -> Pathname.t list
val pp_l : Format.formatter -> string list -> unit
#(* *)
#(***********************************************************************)
-# $Id: Makefile,v 1.64 2006/09/20 11:14:36 doligez Exp $
+# $Id: Makefile,v 1.64.6.1 2007/11/12 08:51:29 guesdon Exp $
include ../config/Makefile
if test -d $(INSTALL_BINDIR); then : ; else $(MKDIR) $(INSTALL_BINDIR); fi
if test -d $(INSTALL_LIBDIR); then : ; else $(MKDIR) $(INSTALL_LIBDIR); fi
if test -d $(INSTALL_CUSTOMDIR); then : ; else $(MKDIR) $(INSTALL_CUSTOMDIR); fi
- $(CP) $(OCAMLDOC)$(EXE) $(INSTALL_BINDIR)/$(OCAMLDOC)$(EXE)
+ $(CP) $(OCAMLDOC) $(INSTALL_BINDIR)/$(OCAMLDOC)$(EXE)
$(CP) ocamldoc.hva *.cmi $(OCAMLDOC_LIBCMA) $(INSTALL_LIBDIR)
$(CP) $(INSTALL_MLIS) $(INSTALL_CMIS) $(INSTALL_LIBDIR)
if test -d $(INSTALL_MANODIR); then : ; else $(MKDIR) $(INSTALL_MANODIR); fi
clean:: dummy
@rm -f *~ \#*\#
- @rm -f $(OCAMLDOC)$(EXE) $(OCAMLDOC_OPT) *.cma *.cmxa *.cmo *.cmi *.cmx *.a *.o
+ @rm -f $(OCAMLDOC) $(OCAMLDOC_OPT) *.cma *.cmxa *.cmo *.cmi *.cmx *.a *.o
@rm -f odoc_parser.output odoc_text_parser.output
@rm -f odoc_lexer.ml odoc_text_lexer.ml odoc_see_lexer.ml odoc_ocamlhtml.ml
@rm -f odoc_parser.ml odoc_parser.mli odoc_text_parser.ml odoc_text_parser.mli
(* *)
(***********************************************************************)
-(* $Id: odoc_html.ml,v 1.61 2007/02/26 09:57:39 guesdon Exp $ *)
+(* $Id: odoc_html.ml,v 1.61.2.2 2007/11/12 09:10:35 guesdon Exp $ *)
(** Generation of html documentation.*)
(* *)
(***********************************************************************)
-(* $Id: odoc_ocamlhtml.mll,v 1.9 2004/03/14 13:52:01 guesdon Exp $ *)
+(* $Id: odoc_ocamlhtml.mll,v 1.9.18.1 2007/11/12 09:09:54 guesdon Exp $ *)
(** Generation of html code to display OCaml code. *)
-open Lexing
+open Lexing
exception Fatal_error
exception Error of error * int * int
-let base_escape_strings = [
- ("&", "&") ;
- ("<", "<") ;
- (">", ">") ;
-]
+let base_escape_strings = [
+ ("&", "&") ;
+ ("<", "<") ;
+ (">", ">") ;
+]
let pre_escape_strings = [
(" ", " ") ;
("\n", "<br>\n") ;
("\t", " ") ;
- ]
+ ]
let pre = ref false
(** Escape the strings which would clash with html syntax,
and some other strings if we want to get a PRE style.*)
-let escape s =
+let escape s =
List.fold_left
(fun acc -> fun (s, s2) -> Str.global_replace (Str.regexp s) s2 acc)
s
(** The output functions *)
-let print ?(esc=true) s =
+let print ?(esc=true) s =
Format.pp_print_string !fmt (if esc then escape s else s)
;;
tbl
(** The function used to return html code for the given comment body. *)
-let html_of_comment = ref
+let html_of_comment = ref
(fun (s : string) -> "<b>Odoc_ocamlhtml.html_of_comment not initialized</b>")
let keyword_table =
let comment_buffer = Buffer.create 32
let reset_comment_buffer () = Buffer.reset comment_buffer
let store_comment_char = Buffer.add_char comment_buffer
+let add_comment_string = Buffer.add_string comment_buffer
let make_margin () =
let rec iter n =
let print_comment () =
let s = Buffer.contents comment_buffer in
let len = String.length s in
- let code =
+ let code =
if len < 1 then
"<span class=\""^comment_class^"\">(*"^(escape s)^"*)</span>"
else
- match s.[0] with
- '*' ->
+ match s.[0] with
+ '*' ->
(
- try
+ try
let html = !html_of_comment (String.sub s 1 (len-1)) in
"</code><table><tr><td>"^(make_margin ())^"</td><td>"^
"<span class=\""^comment_class^"\">"^
let string_buffer = Buffer.create 32
let reset_string_buffer () = Buffer.reset string_buffer
let store_string_char = Buffer.add_char string_buffer
-let get_stored_string () =
+let get_stored_string () =
let s = Buffer.contents string_buffer in
String.escaped s
let char_for_decimal_code lexbuf i =
let c = 100 * (Char.code(Lexing.lexeme_char lexbuf i) - 48) +
10 * (Char.code(Lexing.lexeme_char lexbuf (i+1)) - 48) +
- (Char.code(Lexing.lexeme_char lexbuf (i+2)) - 48) in
+ (Char.code(Lexing.lexeme_char lexbuf (i+2)) - 48) in
Char.chr(c land 0xFF)
(** To store the position of the beginning of a string and comment *)
let blank = [' ' '\010' '\013' '\009' '\012']
let lowercase = ['a'-'z' '\223'-'\246' '\248'-'\255' '_']
let uppercase = ['A'-'Z' '\192'-'\214' '\216'-'\222']
-let identchar =
+let identchar =
['A'-'Z' 'a'-'z' '_' '\192'-'\214' '\216'-'\246' '\248'-'\255' '\'' '0'-'9']
let symbolchar =
['!' '$' '%' '&' '*' '+' '-' '.' '/' ':' '<' '=' '>' '?' '@' '^' '|' '~']
rule token = parse
blank
- {
+ {
let s = Lexing.lexeme lexbuf in
(
match s with
- " " -> incr margin
+ " " -> incr margin
| "\t" -> margin := !margin + 8
| "\n" -> margin := 0
| _ -> ()
);
print s;
- token lexbuf
+ token lexbuf
}
| "_"
{ print "_" ; token lexbuf }
{ print_class string_class (Lexing.lexeme lexbuf ) ;
token lexbuf }
| "(*"
- {
+ {
reset_comment_buffer ();
- comment_start_pos := [Lexing.lexeme_start lexbuf];
+ comment_start_pos := [Lexing.lexeme_start lexbuf];
comment lexbuf ;
print_comment ();
token lexbuf }
}
| "*)"
{ lexbuf.Lexing.lex_curr_pos <- lexbuf.Lexing.lex_curr_pos - 1;
- lexbuf.Lexing.lex_curr_p <-
+ lexbuf.Lexing.lex_curr_p <-
{ lexbuf.Lexing.lex_curr_p with
pos_cnum = lexbuf.Lexing.lex_curr_p.pos_cnum - 1
} ;
print (Lexing.lexeme lexbuf) ;
- token lexbuf
+ token lexbuf
}
| "#" [' ' '\t']* ['0'-'9']+ [^ '\n' '\r'] * ('\n' | '\r' | "\r\n")
(* # linenum ... *)
- {
+ {
print (Lexing.lexeme lexbuf);
- token lexbuf
+ token lexbuf
}
| "#" { print_class kwsign_class (Lexing.lexeme lexbuf) ; token lexbuf }
| "&" { print_class kwsign_class (Lexing.lexeme lexbuf) ; token lexbuf }
{ match !comment_start_pos with
| [] -> assert false
| [x] -> comment_start_pos := []
- | _ :: l ->
+ | _ :: l ->
store_comment_char '*';
store_comment_char ')';
comment_start_pos := l;
{ reset_string_buffer();
string_start_pos := Lexing.lexeme_start lexbuf;
store_comment_char '"';
- begin try string lexbuf
- with Error (Unterminated_string, _, _) ->
+ begin
+ try string lexbuf; add_comment_string ((get_stored_string()^"\""))
+ with Error (Unterminated_string, _, _) ->
let st = List.hd !comment_start_pos in
raise (Error (Unterminated_string_in_comment, st, st + 2))
end;
comment lexbuf }
| "''"
- {
+ {
store_comment_char '\'';
store_comment_char '\'';
comment lexbuf }
| "'" [^ '\\' '\''] "'"
- {
+ {
store_comment_char '\'';
store_comment_char (Lexing.lexeme_char lexbuf 1);
store_comment_char '\'';
comment lexbuf }
| "'\\" ['\\' '\'' 'n' 't' 'b' 'r'] "'"
- {
+ {
store_comment_char '\'';
store_comment_char '\\';
store_comment_char(char_for_backslash(Lexing.lexeme_char lexbuf 1)) ;
store_comment_char '\'';
comment lexbuf }
| "'\\" ['0'-'9'] ['0'-'9'] ['0'-'9'] "'"
- {
+ {
store_comment_char '\'';
store_comment_char '\\';
store_comment_char(char_for_decimal_code lexbuf 1);
fmt := Format.formatter_of_buffer buf ;
pre := with_pre;
margin := 0;
-
+
let start = "<code class=\""^code_class^"\">" in
let ending = "</code>" in
- let html =
+ let html =
(
try
print ~esc: false start ;
Format.pp_print_flush !fmt () ;
Buffer.contents buf
with
- _ ->
- (* flush str_formatter because we already output
+ _ ->
+ (* flush str_formatter because we already output
something in it *)
Format.pp_print_flush !fmt () ;
start^code^ending
Buffer.add_string b html
-}
+}
(* *)
(***********************************************************************)
-(* $Id: tkthread.ml,v 1.1.16.1 2007/04/10 03:29:46 garrigue Exp $ *)
+(* $Id: tkthread.ml,v 1.1.16.2 2007/08/05 23:53:05 garrigue Exp $ *)
let jobs : (unit -> unit) Queue.t = Queue.create ()
let m = Mutex.create ()
Mutex.lock m; let y = f jobs in Mutex.unlock m; y
let loop_id = ref None
-let reset () = loop_id := None
-let cannot_sync () =
- match !loop_id with None -> true
- | Some id -> Thread.id (Thread.self ()) = id
-
let gui_safe () =
!loop_id = Some(Thread.id (Thread.self ()))
+let running () =
+ !loop_id <> None
let has_jobs () = not (with_jobs Queue.is_empty)
let n_jobs () = with_jobs Queue.length
let do_next_job () = with_jobs Queue.take ()
let async j x = with_jobs (Queue.add (fun () -> j x))
let sync f x =
- if cannot_sync () then f x else
+ if !loop_id = None then failwith "Tkthread.sync";
+ if gui_safe () then f x else
let m = Mutex.create () in
let res = ref None in
Mutex.lock m;
raise exn
let start () =
- Thread.create thread_main ()
+ let th = Thread.create thread_main () in
+ loop_id := Some (Thread.id th);
+ th
let top = Widget.default_toplevel
(* *)
(***********************************************************************)
-(* $Id: tkthread.mli,v 1.2.16.1 2007/04/10 03:29:46 garrigue Exp $ *)
+(* $Id: tkthread.mli,v 1.2.16.2 2007/08/05 23:53:05 garrigue Exp $ *)
(* Helper functions for using LablTk with threads.
To use, add tkthread.cmo or tkthread.cmx to your command line *)
(** Start the main loop in a new GUI thread. Do not use recursively. *)
val start : unit -> Thread.t
-(** The actual function executed in the new thread *)
+(** The actual function executed in the GUI thread *)
val thread_main : unit -> unit
(** The toplevel widget (an alias of [Widget.default_toplevel]) *)
val top : Widget.toplevel Widget.widget
With sync, beware of deadlocks!
*)
-(** Add an asynchronous job (to do in the main thread) *)
+(** Add an asynchronous job (to do in the GUI thread) *)
val async : ('a -> unit) -> 'a -> unit
-(** Add a synchronous job (to do in the main thread) *)
+(** Add a synchronous job (to do in the GUI thread).
+ Raise [Failure "Tkthread.sync"] if there is no such thread. *)
val sync : ('a -> 'b) -> 'a -> 'b
(** Whether the current thread is the GUI thread.
Note that when using X11 it is generally safe to call
most Tk functions from other threads too. *)
val gui_safe : unit -> bool
+(** Whether a GUI thread is running *)
+val running : unit -> bool
/* */
/***********************************************************************/
-/* $Id: nat_stubs.c,v 1.16 2005/09/22 14:21:50 xleroy Exp $ */
+/* $Id: nat_stubs.c,v 1.16.10.1 2007/10/25 09:23:30 xleroy Exp $ */
#include "alloc.h"
#include "config.h"
CAMLprim value is_digit_normalized(value nat, value ofs)
{
return
- Val_bool(Digit_val(nat, Long_val(ofs)) & (1L << (BNG_BITS_PER_DIGIT-1)));
+ Val_bool(Digit_val(nat, Long_val(ofs)) & ((bngdigit)1 << (BNG_BITS_PER_DIGIT-1)));
}
CAMLprim value is_digit_odd(value nat, value ofs)
#ifdef ARCH_SIXTYFOUR
len = len * 2; /* two 32-bit words per 64-bit digit */
- if (len >= (1L << 32))
+ if (len >= ((mlsize_t)1 << 32))
failwith("output_value: nat too big");
#endif
serialize_int_4((int32) len);
(* *)
(***********************************************************************)
-(* $Id: str.ml,v 1.20 2006/01/04 16:55:50 doligez Exp $ *)
+(* $Id: str.ml,v 1.20.6.1 2007/10/31 10:01:29 xleroy Exp $ *)
(** String utilities *)
let search_forward_progress expr text start =
let pos = search_forward expr text start in
- if match_end() = start && start < String.length text
- then search_forward expr text (start + 1)
- else pos
+ if match_end() > start then pos
+ else if start < String.length text then search_forward expr text (start + 1)
+ else raise Not_found
let bounded_split expr text num =
let start =
/* */
/***********************************************************************/
-/* $Id: posix.c,v 1.55 2007/01/29 12:11:17 xleroy Exp $ */
+/* $Id: posix.c,v 1.55.4.1 2007/11/01 16:42:29 xleroy Exp $ */
/* Thread interface for POSIX 1003.1c threads */
{
sigemptyset(set);
while (vset != Val_int(0)) {
- int sig = convert_signal_number(Int_val(Field(vset, 0)));
+ int sig = caml_convert_signal_number(Int_val(Field(vset, 0)));
sigaddset(set, sig);
vset = Field(vset, 1);
}
Begin_root(res)
for (i = 1; i < NSIG; i++)
- if (sigismember(set, i)) {
+ if (sigismember(set, i) > 0) {
value newcons = alloc_small(2, 0);
- Field(newcons, 0) = Val_int(i);
+ Field(newcons, 0) = Val_int(caml_rev_convert_signal_number(i));
Field(newcons, 1) = res;
res = newcons;
}
(* *)
(***********************************************************************)
-(* $Id: thread.mli,v 1.20 2005/07/31 12:32:41 xleroy Exp $ *)
+(* $Id: thread.mli,v 1.20.10.1 2007/10/25 08:35:32 xleroy Exp $ *)
(** Lightweight threads for Posix [1003.1c] and Win32. *)
result of the application [funct arg] is discarded and not
directly accessible to the parent thread. *)
-external self : unit -> t = "caml_thread_self"
+val self : unit -> t
(** Return the thread currently executing. *)
-external id : t -> int = "caml_thread_id"
+val id : t -> int
(** Return the identifier of the given thread. A thread identifier
is an integer that identifies uniquely the thread.
It can be used to build data structures indexed by threads. *)
[d] seconds. The other program threads continue to run during
this time. *)
-external join : t -> unit = "caml_thread_join"
+val join : t -> unit
(** [join th] suspends the execution of the calling thread
until the thread [th] has terminated. *)
/* */
/***********************************************************************/
-/* $Id: access.c,v 1.11 2005/03/24 17:20:53 doligez Exp $ */
+/* $Id: access.c,v 1.11.12.1 2007/10/09 14:30:29 xleroy Exp $ */
#include <mlvalues.h>
#include <alloc.h>
# else
# define R_OK 4/* test for read permission */
# define W_OK 2/* test for write permission */
-# define X_OK 1/* test for execute (search) permission */
+# define X_OK 4/* test for execute permission - not implemented in Win32 */
# define F_OK 0/* test for presence of file */
# endif
#endif
/* */
/***********************************************************************/
-/* $Id: signals.c,v 1.10 2005/03/24 17:20:53 doligez Exp $ */
+/* $Id: signals.c,v 1.10.12.1 2007/11/01 16:42:29 xleroy Exp $ */
#include <errno.h>
#include <signal.h>
#include "unixsupport.h"
#ifndef NSIG
-#define NSIG 32
+#define NSIG 64
#endif
#ifdef POSIX_SIGNALS
{
sigemptyset(set);
while (vset != Val_int(0)) {
- int sig = convert_signal_number(Int_val(Field(vset, 0)));
+ int sig = caml_convert_signal_number(Int_val(Field(vset, 0)));
sigaddset(set, sig);
vset = Field(vset, 1);
}
Begin_root(res)
for (i = 1; i < NSIG; i++)
- if (sigismember(set, i)) {
+ if (sigismember(set, i) > 0) {
value newcons = alloc_small(2, 0);
- Field(newcons, 0) = Val_int(i);
+ Field(newcons, 0) = Val_int(caml_rev_convert_signal_number(i));
Field(newcons, 1) = res;
res = newcons;
}
(* *)
(***********************************************************************)
-(* $Id: unix.mli,v 1.85 2007/01/22 07:41:00 garrigue Exp $ *)
+(* $Id: unix.mli,v 1.85.4.1 2007/11/10 12:43:13 xleroy Exp $ *)
(** Interface to the Unix system *)
val utimes : string -> float -> float -> unit
(** Set the last access time (second arg) and last modification time
(third arg) for a file. Times are expressed in seconds from
- 00:00:00 GMT, Jan. 1, 1970. *)
+ 00:00:00 GMT, Jan. 1, 1970. A time of [0.0] is interpreted as the
+ current time. *)
type interval_timer =
ITIMER_REAL
(* *)
(***********************************************************************)
-(* $Id: unixLabels.mli,v 1.15 2007/01/22 07:41:00 garrigue Exp $ *)
+(* $Id: unixLabels.mli,v 1.15.4.1 2007/11/19 21:27:56 doligez Exp $ *)
(** Interface to the Unix system.
To use as replacement to default {!Unix} module,
(** File operations on large files.
This sub-module provides 64-bit variants of the functions
{!UnixLabels.lseek} (for positioning a file descriptor),
- {!UnixLabels.truncate} and {!UnixLabels.ftruncate}
+ {!UnixLabels.truncate} and {!UnixLabels.ftruncate}
(for changing the size of a file),
and {!UnixLabels.stat}, {!UnixLabels.lstat} and {!UnixLabels.fstat}
(for obtaining information on files). These alternate functions represent
and standard error of the command. *)
val close_process_in : in_channel -> process_status
-(** Close channels opened by {!UnixLabels.open_process_in},
+(** Close channels opened by {!UnixLabels.open_process_in},
wait for the associated command to terminate,
and return its termination status. *)
val close_process_out : out_channel -> process_status
-(** Close channels opened by {!UnixLabels.open_process_out},
+(** Close channels opened by {!UnixLabels.open_process_out},
wait for the associated command to terminate,
and return its termination status. *)
val close_process : in_channel * out_channel -> process_status
-(** Close channels opened by {!UnixLabels.open_process},
+(** Close channels opened by {!UnixLabels.open_process},
wait for the associated command to terminate,
and return its termination status. *)
val close_process_full :
in_channel * out_channel * in_channel -> process_status
-(** Close channels opened by {!UnixLabels.open_process_full},
+(** Close channels opened by {!UnixLabels.open_process_full},
wait for the associated command to terminate,
and return its termination status. *)
(** [kill pid sig] sends signal number [sig] to the process
with id [pid]. *)
-type sigprocmask_command = Unix.sigprocmask_command =
+type sigprocmask_command = Unix.sigprocmask_command =
SIG_SETMASK
| SIG_BLOCK
| SIG_UNBLOCK
(** The type of socket kinds, specifying the semantics of
communications. *)
-type sockaddr = Unix.sockaddr =
+type sockaddr = Unix.sockaddr =
ADDR_UNIX of string
| ADDR_INET of inet_addr * int
(** The type of socket addresses. [ADDR_UNIX name] is a socket
val getpeername : file_descr -> sockaddr
(** Return the address of the host connected to the given socket. *)
-type msg_flag = Unix.msg_flag =
+type msg_flag = Unix.msg_flag =
MSG_OOB
| MSG_DONTROUTE
| MSG_PEEK
-(** The flags for {!UnixLabels.recv}, {!UnixLabels.recvfrom},
+(** The flags for {!UnixLabels.recv}, {!UnixLabels.recvfrom},
{!UnixLabels.send} and {!UnixLabels.sendto}. *)
val recv :
(** Return the status of the terminal referred to by the given
file descriptor. *)
-type setattr_when = Unix.setattr_when =
+type setattr_when = Unix.setattr_when =
TCSANOW
| TCSADRAIN
| TCSAFLUSH
(** Waits until all output written on the given file descriptor
has been transmitted. *)
-type flush_queue = Unix.flush_queue =
+type flush_queue = Unix.flush_queue =
TCIFLUSH
| TCOFLUSH
| TCIOFLUSH
[TCOFLUSH] flushes data written but not transmitted, and
[TCIOFLUSH] flushes both. *)
-type flow_action = Unix.flow_action =
+type flow_action = Unix.flow_action =
TCOOFF
| TCOON
| TCIOFF
/* */
/***********************************************************************/
-/* $Id: createprocess.c,v 1.13 2001/12/07 13:40:43 xleroy Exp $ */
+/* $Id: createprocess.c,v 1.13.20.1 2007/10/25 08:32:42 xleroy Exp $ */
#include <windows.h>
#include <mlvalues.h>
CloseHandle(pi.hThread);
/* Return the process handle as pseudo-PID
(this is consistent with the wait() emulation in the MSVC C library */
- return Val_int(pi.hProcess);
+ return Val_long(pi.hProcess);
}
CAMLprim value win_create_process(value * argv, int argn)
/* */
/***********************************************************************/
-/* $Id: open.c,v 1.9 2001/12/07 13:40:45 xleroy Exp $ */
+/* $Id: open.c,v 1.9.20.1 2007/10/25 07:42:48 xleroy Exp $ */
#include <mlvalues.h>
#include <alloc.h>
#include "unixsupport.h"
#include <fcntl.h>
-static int open_access_flags[8] = {
- GENERIC_READ, GENERIC_WRITE, GENERIC_READ|GENERIC_WRITE, 0, 0, 0, 0, 0,
+static int open_access_flags[12] = {
+ GENERIC_READ, GENERIC_WRITE, GENERIC_READ|GENERIC_WRITE,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0
};
-static int open_create_flags[8] = {
- 0, 0, 0, 0, 0, O_CREAT, O_TRUNC, O_EXCL
+static int open_create_flags[12] = {
+ 0, 0, 0, 0, 0, O_CREAT, O_TRUNC, O_EXCL, 0, 0, 0, 0
};
CAMLprim value unix_open(value path, value flags, value perm)
/* */
/***********************************************************************/
-/* $Id: winwait.c,v 1.18 2006/10/18 08:26:54 xleroy Exp $ */
+/* $Id: winwait.c,v 1.18.6.1 2007/10/25 08:31:58 xleroy Exp $ */
#include <windows.h>
#include <mlvalues.h>
}
if (status == STILL_ACTIVE)
return alloc_process_status((HANDLE) 0, 0);
- else
+ else {
+ CloseHandle(pid_req);
return alloc_process_status(pid_req, status);
+ }
}
(* *)
(***********************************************************************)
-(* $Id: location.ml,v 1.48 2005/03/24 17:20:54 doligez Exp $ *)
+(* $Id: location.ml,v 1.48.16.1 2007/12/06 13:36:03 doligez Exp $ *)
open Lexing
let num_loc_lines = ref 0 (* number of lines already printed after input *)
-(* Highlight the location using standout mode. *)
+(* Highlight the locations using standout mode. *)
let highlight_terminfo ppf num_lines lb loc1 loc2 =
+ Format.pp_print_flush ppf (); (* avoid mixing Format and normal output *)
(* Char 0 is at offset -lb.lex_abs_pos in lb.lex_buffer. *)
let pos0 = -lb.lex_abs_pos in
(* Do nothing if the buffer does not contain the whole phrase. *)
Format.fprintf ppf "Characters %i-%i:@."
loc.loc_start.pos_cnum loc.loc_end.pos_cnum;
(* Print the input, underlining the location *)
- print_string " ";
+ Format.pp_print_string ppf " ";
let line = ref 0 in
let pos_at_bol = ref 0 in
for pos = 0 to end_pos do
if c <> '\n' then begin
if !line = !line_start && !line = !line_end then
(* loc is on one line: print whole line *)
- print_char c
+ Format.pp_print_char ppf c
else if !line = !line_start then
(* first line of multiline loc: print ... before loc_start *)
if pos < loc.loc_start.pos_cnum
- then print_char '.'
- else print_char c
+ then Format.pp_print_char ppf '.'
+ else Format.pp_print_char ppf c
else if !line = !line_end then
(* last line of multiline loc: print ... after loc_end *)
if pos < loc.loc_end.pos_cnum
- then print_char c
- else print_char '.'
+ then Format.pp_print_char ppf c
+ else Format.pp_print_char ppf '.'
else if !line > !line_start && !line < !line_end then
(* intermediate line of multiline loc: print whole line *)
- print_char c
+ Format.pp_print_char ppf c
end else begin
if !line = !line_start && !line = !line_end then begin
(* loc is on one line: underline location *)
- print_string "\n ";
+ Format.fprintf ppf "@. ";
for i = !pos_at_bol to loc.loc_start.pos_cnum - 1 do
- print_char ' '
+ Format.pp_print_char ppf ' '
done;
for i = loc.loc_start.pos_cnum to loc.loc_end.pos_cnum - 1 do
- print_char '^'
+ Format.pp_print_char ppf '^'
done
end;
if !line >= !line_start && !line <= !line_end then begin
- print_char '\n';
- if pos < loc.loc_end.pos_cnum then print_string " "
+ Format.fprintf ppf "@.";
+ if pos < loc.loc_end.pos_cnum then Format.pp_print_string ppf " "
end;
incr line;
pos_at_bol := pos + 1;
/* */
/***********************************************************************/
-/* $Id: parser.mly,v 1.126 2006/12/15 04:50:30 garrigue Exp $ */
+/* $Id: parser.mly,v 1.126.6.1 2007/11/30 00:53:19 garrigue Exp $ */
/* The parser definition */
{ match $3 with
[{ppat_desc = Ppat_any}, exp] -> mkstr(Pstr_eval exp)
| _ -> mkstr(Pstr_value($2, List.rev $3)) }
- | EXTERNAL val_ident_colon core_type EQUAL primitive_declaration
- { mkstr(Pstr_primitive($2, {pval_type = $3; pval_prim = $5})) }
+ | EXTERNAL val_ident COLON core_type EQUAL primitive_declaration
+ { mkstr(Pstr_primitive($2, {pval_type = $4; pval_prim = $6})) }
| TYPE type_declarations
{ mkstr(Pstr_type(List.rev $2)) }
| EXCEPTION UIDENT constructor_arguments
| signature signature_item SEMISEMI { $2 :: $1 }
;
signature_item:
- VAL val_ident_colon core_type
- { mksig(Psig_value($2, {pval_type = $3; pval_prim = []})) }
- | EXTERNAL val_ident_colon core_type EQUAL primitive_declaration
- { mksig(Psig_value($2, {pval_type = $3; pval_prim = $5})) }
+ VAL val_ident COLON core_type
+ { mksig(Psig_value($2, {pval_type = $4; pval_prim = []})) }
+ | EXTERNAL val_ident COLON core_type EQUAL primitive_declaration
+ { mksig(Psig_value($2, {pval_type = $4; pval_prim = $6})) }
| TYPE type_declarations
{ mksig(Psig_type(List.rev $2)) }
| EXCEPTION UIDENT constructor_arguments
{ $3, $2, ghexp(Pexp_poly ($4, None)), symbol_rloc () }
| METHOD private_flag label COLON poly_type EQUAL seq_expr
{ $3, $2, ghexp(Pexp_poly($7,Some $5)), symbol_rloc () }
- | METHOD private_flag LABEL poly_type EQUAL seq_expr
- { $3, $2, ghexp(Pexp_poly($6,Some $4)), symbol_rloc () }
;
/* Class types */
LIDENT { $1 }
| LPAREN operator RPAREN { $2 }
;
-val_ident_colon:
- LIDENT COLON { $1 }
- | LPAREN operator RPAREN COLON { $2 }
- | LABEL { $1 }
-;
operator:
PREFIXOP { $1 }
| INFIXOP0 { $1 }
(* *)
(***********************************************************************)
-(* $Id: arg.ml,v 1.35 2004/11/25 00:04:15 doligez Exp $ *)
+(* $Id: arg.ml,v 1.35.12.2 2007/11/26 16:12:31 doligez Exp $ *)
type key = string
type doc = string
let print_spec buf (key, spec, doc) =
match spec with
- | Symbol (l, _) -> bprintf buf " %s %s %s\n" key (make_symlist "{" "|" "}" l)
+ | Symbol (l, _) -> bprintf buf " %s %s%s\n" key (make_symlist "{" "|" "}" l)
doc
| _ -> bprintf buf " %s %s\n" key doc
;;
with Not_found -> len
;;
-let max_arg_len cur (kwd, _, doc) =
- max cur (String.length kwd + second_word doc)
+let max_arg_len cur (kwd, spec, doc) =
+ match spec with
+ | Symbol _ -> max cur (String.length kwd)
+ | _ -> max cur (String.length kwd + second_word doc)
;;
let add_padding len ksd =
match ksd with
- | (_, Symbol _, _) -> ksd
+ | (kwd, (Symbol (l, _) as spec), msg) ->
+ let cutcol = second_word msg in
+ let spaces = String.make (len - cutcol + 3) ' ' in
+ (kwd, spec, "\n" ^ spaces ^ msg)
| (kwd, spec, msg) ->
let cutcol = second_word msg in
let spaces = String.make (len - String.length kwd - cutcol) ' ' in
(* *)
(***********************************************************************)
-(* $Id: arg.mli,v 1.36 2005/10/25 18:34:07 doligez Exp $ *)
+(* $Id: arg.mli,v 1.36.10.1 2007/11/20 18:24:24 doligez Exp $ *)
(** Parsing of command line arguments.
space, according to the length of the keyword. Use a
space as the first character in a doc string if you want to
align the whole string. The doc strings corresponding to
- [Symbol] arguments are not aligned. *)
+ [Symbol] arguments are aligned on the next line. *)
val current : int ref
(** Position (in {!Sys.argv}) of the argument being processed. You can
(* *)
(***********************************************************************)
-(* $Id: camlinternalMod.ml,v 1.5 2006/09/20 11:14:37 doligez Exp $ *)
+(* $Id: camlinternalMod.ml,v 1.5.6.2 2007/10/26 15:39:04 xleroy Exp $ *)
type shape =
| Function
then begin overwrite o n; Obj.truncate o (Obj.size n) (* PR #4008 *) end
else overwrite o (Obj.repr (fun x -> (Obj.obj n : _ -> _) x))
| Lazy ->
- assert (Obj.tag n = Obj.lazy_tag);
- overwrite o n
+ if Obj.tag n = Obj.lazy_tag then
+ Obj.set_field o 0 (Obj.field n 0)
+ else if Obj.tag n = Obj.forward_tag then begin (* PR#4316 *)
+ Obj.set_tag o Obj.forward_tag;
+ Obj.set_field o 0 (Obj.field n 0)
+ end else begin
+ (* forwarding pointer was shortcut by GC *)
+ Obj.set_tag o Obj.forward_tag;
+ Obj.set_field o 0 n
+ end
| Class ->
assert (Obj.tag n = 0 && Obj.size n = 4);
overwrite o n
(* *)
(***********************************************************************)
-(* $Id: camlinternalOO.ml,v 1.15 2006/04/05 02:28:13 garrigue Exp $ *)
+(* $Id: camlinternalOO.ml,v 1.15.6.1 2007/10/29 03:11:03 garrigue Exp $ *)
open Obj
try Vars.find name table.vars
with Not_found ->
let index = new_slot table in
- table.vars <- Vars.add name index table.vars;
+ if name <> "" then table.vars <- Vars.add name index table.vars;
index
let to_array arr =
(* *)
(***********************************************************************)
-(* $Id: format.ml,v 1.70 2006/11/17 08:34:05 weis Exp $ *)
+(* $Id: format.ml,v 1.70.6.1 2007/12/18 09:19:52 weis Exp $ *)
(**************************************************************
size is set when the size of the block is known
len is the declared length of the token. *)
type pp_queue_elem = {
- mutable elem_size : size; token : pp_token; length : int
+ mutable elem_size : size;
+ token : pp_token;
+ length : int;
};;
(* Scan stack:
type pp_format_elem = Format_elem of block_type * int;;
(* General purpose queues, used in the formatter. *)
-type 'a queue_elem = | Nil | Cons of 'a queue_cell
-and 'a queue_cell = {mutable head : 'a; mutable tail : 'a queue_elem};;
+type 'a queue_elem =
+ | Nil
+ | Cons of 'a queue_cell
+
+and 'a queue_cell = {
+ mutable head : 'a;
+ mutable tail : 'a queue_elem;
+};;
type 'a queue = {
- mutable insert : 'a queue_elem;
- mutable body : 'a queue_elem
+ mutable insert : 'a queue_elem;
+ mutable body : 'a queue_elem;
};;
(* The formatter specific tag handling functions. *)
type formatter_tag_functions = {
- mark_open_tag : tag -> string;
- mark_close_tag : tag -> string;
- print_open_tag : tag -> unit;
- print_close_tag : tag -> unit;
-
+ mark_open_tag : tag -> string;
+ mark_close_tag : tag -> string;
+ print_open_tag : tag -> unit;
+ print_close_tag : tag -> unit;
};;
(* A formatter with all its machinery. *)
type formatter = {
- mutable pp_scan_stack : pp_scan_elem list;
- mutable pp_format_stack : pp_format_elem list;
- mutable pp_tbox_stack : tblock list;
- mutable pp_tag_stack : tag list;
- mutable pp_mark_stack : tag list;
- (* Global variables: default initialization is
- set_margin 78
- set_min_space_left 0. *)
- (* Value of right margin. *)
- mutable pp_margin : int;
- (* Minimal space left before margin, when opening a block. *)
- mutable pp_min_space_left : int;
- (* Maximum value of indentation:
- no blocks can be opened further. *)
- mutable pp_max_indent : int;
- (* Space remaining on the current line. *)
- mutable pp_space_left : int;
- (* Current value of indentation. *)
- mutable pp_current_indent : int;
- (* True when the line has been broken by the pretty-printer. *)
- mutable pp_is_new_line : bool;
- (* Total width of tokens already printed. *)
- mutable pp_left_total : int;
- (* Total width of tokens ever put in queue. *)
- mutable pp_right_total : int;
- (* Current number of opened blocks. *)
- mutable pp_curr_depth : int;
- (* Maximum number of blocks which can be simultaneously opened. *)
- mutable pp_max_boxes : int;
- (* Ellipsis string. *)
- mutable pp_ellipsis : string;
- (* Output function. *)
- mutable pp_output_function : string -> int -> int -> unit;
- (* Flushing function. *)
- mutable pp_flush_function : unit -> unit;
- (* Output of new lines. *)
- mutable pp_output_newline : unit -> unit;
- (* Output of indentation spaces. *)
- mutable pp_output_spaces : int -> unit;
- (* Are tags printed ? *)
- mutable pp_print_tags : bool;
- (* Are tags marked ? *)
- mutable pp_mark_tags : bool;
- (* Find opening and closing markers of tags. *)
- mutable pp_mark_open_tag : tag -> string;
- mutable pp_mark_close_tag : tag -> string;
- mutable pp_print_open_tag : tag -> unit;
- mutable pp_print_close_tag : tag -> unit;
- (* The pretty-printer queue. *)
- mutable pp_queue : pp_queue_elem queue
+ mutable pp_scan_stack : pp_scan_elem list;
+ mutable pp_format_stack : pp_format_elem list;
+ mutable pp_tbox_stack : tblock list;
+ mutable pp_tag_stack : tag list;
+ mutable pp_mark_stack : tag list;
+ (* Global variables: default initialization is
+ set_margin 78
+ set_min_space_left 0. *)
+ (* Value of right margin. *)
+ mutable pp_margin : int;
+ (* Minimal space left before margin, when opening a block. *)
+ mutable pp_min_space_left : int;
+ (* Maximum value of indentation:
+ no blocks can be opened further. *)
+ mutable pp_max_indent : int;
+ (* Space remaining on the current line. *)
+ mutable pp_space_left : int;
+ (* Current value of indentation. *)
+ mutable pp_current_indent : int;
+ (* True when the line has been broken by the pretty-printer. *)
+ mutable pp_is_new_line : bool;
+ (* Total width of tokens already printed. *)
+ mutable pp_left_total : int;
+ (* Total width of tokens ever put in queue. *)
+ mutable pp_right_total : int;
+ (* Current number of opened blocks. *)
+ mutable pp_curr_depth : int;
+ (* Maximum number of blocks which can be simultaneously opened. *)
+ mutable pp_max_boxes : int;
+ (* Ellipsis string. *)
+ mutable pp_ellipsis : string;
+ (* Output function. *)
+ mutable pp_output_function : string -> int -> int -> unit;
+ (* Flushing function. *)
+ mutable pp_flush_function : unit -> unit;
+ (* Output of new lines. *)
+ mutable pp_output_newline : unit -> unit;
+ (* Output of indentation spaces. *)
+ mutable pp_output_spaces : int -> unit;
+ (* Are tags printed ? *)
+ mutable pp_print_tags : bool;
+ (* Are tags marked ? *)
+ mutable pp_mark_tags : bool;
+ (* Find opening and closing markers of tags. *)
+ mutable pp_mark_open_tag : tag -> string;
+ mutable pp_mark_close_tag : tag -> string;
+ mutable pp_print_open_tag : tag -> unit;
+ mutable pp_print_close_tag : tag -> unit;
+ (* The pretty-printer queue. *)
+ mutable pp_queue : pp_queue_elem queue;
};;
(**************************************************************
(* Queues auxilliaries. *)
-let make_queue () = {insert = Nil; body = Nil};;
+let make_queue () = { insert = Nil; body = Nil; };;
let clear_queue q = q.insert <- Nil; q.body <- Nil;;
let add_queue x q =
- let c = Cons {head = x; tail = Nil} in
- match q with
- | {insert = Cons cell} -> q.insert <- c; cell.tail <- c
- (* Invariant: when insert is Nil body should be Nil. *)
- | _ -> q.insert <- c; q.body <- c;;
+ let c = Cons { head = x; tail = Nil; } in
+ match q with
+ | { insert = Cons cell } ->
+ q.insert <- c; cell.tail <- c
+ (* Invariant: when insert is Nil body should be Nil. *)
+ | _ -> q.insert <- c; q.body <- c;;
exception Empty_queue;;
let peek_queue = function
- | {body = Cons {head = x}} -> x
- | _ -> raise Empty_queue;;
+ | { body = Cons { head = x; }; } -> x
+ | _ -> raise Empty_queue;;
let take_queue = function
- | {body = Cons {head = x; tail = tl}} as q ->
+ | { body = Cons { head = x; tail = tl; }; } as q ->
q.body <- tl;
if tl = Nil then q.insert <- Nil; (* Maintain the invariant. *)
x
- | _ -> raise Empty_queue;;
+ | _ -> raise Empty_queue;;
(* Enter a token in the pretty-printer queue. *)
let pp_enqueue state ({length = len} as token) =
- state.pp_right_total <- state.pp_right_total + len;
- add_queue token state.pp_queue;;
+ state.pp_right_total <- state.pp_right_total + len;
+ add_queue token state.pp_queue;;
let pp_clear_queue state =
- state.pp_left_total <- 1; state.pp_right_total <- 1;
- clear_queue state.pp_queue;;
+ state.pp_left_total <- 1; state.pp_right_total <- 1;
+ clear_queue state.pp_queue;;
(* Pp_infinity: large value for default tokens size.
(* Output functions for the formatter. *)
let pp_output_string state s = state.pp_output_function s 0 (String.length s)
-and pp_output_newline state = state.pp_output_newline ();;
-
-let pp_display_blanks state n = state.pp_output_spaces n;;
+and pp_output_newline state = state.pp_output_newline ()
+and pp_display_blanks state n = state.pp_output_spaces n
+;;
(* To format a break, indenting a new line. *)
let break_new_line state offset width =
- pp_output_newline state;
- state.pp_is_new_line <- true;
- let indent = state.pp_margin - width + offset in
- (* Don't indent more than pp_max_indent. *)
- let real_indent = min state.pp_max_indent indent in
- state.pp_current_indent <- real_indent;
- state.pp_space_left <- state.pp_margin - state.pp_current_indent;
- pp_display_blanks state state.pp_current_indent;;
+ pp_output_newline state;
+ state.pp_is_new_line <- true;
+ let indent = state.pp_margin - width + offset in
+ (* Don't indent more than pp_max_indent. *)
+ let real_indent = min state.pp_max_indent indent in
+ state.pp_current_indent <- real_indent;
+ state.pp_space_left <- state.pp_margin - state.pp_current_indent;
+ pp_display_blanks state state.pp_current_indent;;
(* To force a line break inside a block: no offset is added. *)
let break_line state width = break_new_line state 0 width;;
(* To format a break that fits on the current line. *)
let break_same_line state width =
- state.pp_space_left <- state.pp_space_left - width;
- pp_display_blanks state width;;
+ state.pp_space_left <- state.pp_space_left - width;
+ pp_display_blanks state width;;
(* To indent no more than pp_max_indent, if one tries to open a block
beyond pp_max_indent, then the block is rejected on the left
by simulating a break. *)
let pp_force_break_line state =
- match state.pp_format_stack with
- | Format_elem (bl_ty, width) :: _ ->
- if width > state.pp_space_left then
- (match bl_ty with
- | Pp_fits -> () | Pp_hbox -> () | _ -> break_line state width)
- | _ -> pp_output_newline state;;
+ match state.pp_format_stack with
+ | Format_elem (bl_ty, width) :: _ ->
+ if width > state.pp_space_left then
+ (match bl_ty with
+ | Pp_fits -> () | Pp_hbox -> ()
+ | _ -> break_line state width)
+ | _ -> pp_output_newline state;;
(* To skip a token, if the previous line has been broken. *)
let pp_skip_token state =
- (* When calling pp_skip_token the queue cannot be empty. *)
- match take_queue state.pp_queue with
- {elem_size = size; length = len} ->
- state.pp_left_total <- state.pp_left_total - len;
- state.pp_space_left <- state.pp_space_left + int_of_size size;;
+ (* When calling pp_skip_token the queue cannot be empty. *)
+ match take_queue state.pp_queue with
+ | { elem_size = size; length = len; } ->
+ state.pp_left_total <- state.pp_left_total - len;
+ state.pp_space_left <- state.pp_space_left + int_of_size size;;
(**************************************************************
let format_pp_token state size = function
| Pp_text s ->
- state.pp_space_left <- state.pp_space_left - size;
- pp_output_string state s;
- state.pp_is_new_line <- false
+ state.pp_space_left <- state.pp_space_left - size;
+ pp_output_string state s;
+ state.pp_is_new_line <- false
| Pp_begin (off, ty) ->
- let insertion_point = state.pp_margin - state.pp_space_left in
- if insertion_point > state.pp_max_indent then
- (* can't open a block right there. *)
- begin pp_force_break_line state end;
- let offset = state.pp_space_left - off in
- let bl_type =
- begin match ty with
- | Pp_vbox -> Pp_vbox
- | _ -> if size > state.pp_space_left then ty else Pp_fits
- end in
- state.pp_format_stack <-
- Format_elem (bl_type, offset) :: state.pp_format_stack
+ let insertion_point = state.pp_margin - state.pp_space_left in
+ if insertion_point > state.pp_max_indent then
+ (* can't open a block right there. *)
+ begin pp_force_break_line state end;
+ let offset = state.pp_space_left - off in
+ let bl_type =
+ begin match ty with
+ | Pp_vbox -> Pp_vbox
+ | _ -> if size > state.pp_space_left then ty else Pp_fits
+ end in
+ state.pp_format_stack <-
+ Format_elem (bl_type, offset) :: state.pp_format_stack
| Pp_end ->
- begin match state.pp_format_stack with
- | x :: (y :: l as ls) -> state.pp_format_stack <- ls
- | _ -> () (* No more block to close. *)
- end
+ begin match state.pp_format_stack with
+ | x :: (y :: l as ls) -> state.pp_format_stack <- ls
+ | _ -> () (* No more block to close. *)
+ end
| Pp_tbegin (Pp_tbox _ as tbox) ->
- state.pp_tbox_stack <- tbox :: state.pp_tbox_stack
+ state.pp_tbox_stack <- tbox :: state.pp_tbox_stack
| Pp_tend ->
- begin match state.pp_tbox_stack with
- | x :: ls -> state.pp_tbox_stack <- ls
- | _ -> () (* No more tabulation block to close. *)
- end
+ begin match state.pp_tbox_stack with
+ | x :: ls -> state.pp_tbox_stack <- ls
+ | _ -> () (* No more tabulation block to close. *)
+ end
| Pp_stab ->
- begin match state.pp_tbox_stack with
- | Pp_tbox tabs :: _ ->
- let rec add_tab n = function
- | [] -> [n]
- | x :: l as ls -> if n < x then n :: ls else x :: add_tab n l in
- tabs := add_tab (state.pp_margin - state.pp_space_left) !tabs
- | _ -> () (* No opened tabulation block. *)
- end
+ begin match state.pp_tbox_stack with
+ | Pp_tbox tabs :: _ ->
+ let rec add_tab n = function
+ | [] -> [n]
+ | x :: l as ls -> if n < x then n :: ls else x :: add_tab n l in
+ tabs := add_tab (state.pp_margin - state.pp_space_left) !tabs
+ | _ -> () (* No opened tabulation block. *)
+ end
| Pp_tbreak (n, off) ->
- let insertion_point = state.pp_margin - state.pp_space_left in
- begin match state.pp_tbox_stack with
- | Pp_tbox tabs :: _ ->
- let rec find n = function
- | x :: l -> if x >= n then x else find n l
- | [] -> raise Not_found in
- let tab =
- match !tabs with
- | x :: l ->
- begin try find insertion_point !tabs with Not_found -> x end
- | _ -> insertion_point in
- let offset = tab - insertion_point in
- if offset >= 0 then break_same_line state (offset + n) else
- break_new_line state (tab + off) state.pp_margin
- | _ -> () (* No opened tabulation block. *)
- end
+ let insertion_point = state.pp_margin - state.pp_space_left in
+ begin match state.pp_tbox_stack with
+ | Pp_tbox tabs :: _ ->
+ let rec find n = function
+ | x :: l -> if x >= n then x else find n l
+ | [] -> raise Not_found in
+ let tab =
+ match !tabs with
+ | x :: l ->
+ begin
+ try find insertion_point !tabs with
+ | Not_found -> x
+ end
+ | _ -> insertion_point in
+ let offset = tab - insertion_point in
+ if offset >= 0
+ then break_same_line state (offset + n)
+ else break_new_line state (tab + off) state.pp_margin
+ | _ -> () (* No opened tabulation block. *)
+ end
| Pp_newline ->
- begin match state.pp_format_stack with
- | Format_elem (_, width) :: _ -> break_line state width
- | _ -> pp_output_newline state
- end
+ begin match state.pp_format_stack with
+ | Format_elem (_, width) :: _ -> break_line state width
+ | _ -> pp_output_newline state
+ end
| Pp_if_newline ->
- if state.pp_current_indent != state.pp_margin - state.pp_space_left
- then pp_skip_token state
+ if state.pp_current_indent != state.pp_margin - state.pp_space_left
+ then pp_skip_token state
| Pp_break (n, off) ->
- begin match state.pp_format_stack with
- | Format_elem (ty, width) :: _ ->
- begin match ty with
- | Pp_hovbox ->
- if size > state.pp_space_left
- then break_new_line state off width
- else break_same_line state n
- | Pp_box ->
- (* Have the line just been broken here ? *)
- if state.pp_is_new_line then break_same_line state n else
- if size > state.pp_space_left
- then break_new_line state off width else
- (* break the line here leads to new indentation ? *)
- if state.pp_current_indent > state.pp_margin - width + off
- then break_new_line state off width
- else break_same_line state n
- | Pp_hvbox -> break_new_line state off width
- | Pp_fits -> break_same_line state n
- | Pp_vbox -> break_new_line state off width
- | Pp_hbox -> break_same_line state n
- end
- | _ -> () (* No opened block. *)
- end
+ begin match state.pp_format_stack with
+ | Format_elem (ty, width) :: _ ->
+ begin match ty with
+ | Pp_hovbox ->
+ if size > state.pp_space_left
+ then break_new_line state off width
+ else break_same_line state n
+ | Pp_box ->
+ (* Have the line just been broken here ? *)
+ if state.pp_is_new_line then break_same_line state n else
+ if size > state.pp_space_left
+ then break_new_line state off width else
+ (* break the line here leads to new indentation ? *)
+ if state.pp_current_indent > state.pp_margin - width + off
+ then break_new_line state off width
+ else break_same_line state n
+ | Pp_hvbox -> break_new_line state off width
+ | Pp_fits -> break_same_line state n
+ | Pp_vbox -> break_new_line state off width
+ | Pp_hbox -> break_same_line state n
+ end
+ | _ -> () (* No opened block. *)
+ end
| Pp_open_tag tag_name ->
- let marker = state.pp_mark_open_tag tag_name in
- pp_output_string state marker;
- state.pp_mark_stack <- tag_name :: state.pp_mark_stack
+ let marker = state.pp_mark_open_tag tag_name in
+ pp_output_string state marker;
+ state.pp_mark_stack <- tag_name :: state.pp_mark_stack
| Pp_close_tag ->
- begin match state.pp_mark_stack with
- | tag_name :: tags ->
- let marker = state.pp_mark_close_tag tag_name in
- pp_output_string state marker;
- state.pp_mark_stack <- tags
- | _ -> () (* No more tag to close. *)
- end;;
+ begin match state.pp_mark_stack with
+ | tag_name :: tags ->
+ let marker = state.pp_mark_close_tag tag_name in
+ pp_output_string state marker;
+ state.pp_mark_stack <- tags
+ | _ -> () (* No more tag to close. *)
+ end
+;;
(* Print if token size is known or printing is delayed.
Size is known when not negative.
Printing is delayed when the text waiting in the queue requires
more room to format than exists on the current line. *)
let rec advance_left state =
- try
- match peek_queue state.pp_queue with
- {elem_size = size; token = tok; length = len} ->
- let size = int_of_size size in
- if not
- (size < 0 &&
- (state.pp_right_total - state.pp_left_total < state.pp_space_left))
- then begin
- ignore(take_queue state.pp_queue);
- format_pp_token state (if size < 0 then pp_infinity else size) tok;
- state.pp_left_total <- len + state.pp_left_total;
- advance_left state
- end
- with Empty_queue -> ();;
+ try
+ match peek_queue state.pp_queue with
+ | { elem_size = size; token = tok; length = len; } ->
+ let size = int_of_size size in
+ if not
+ (size < 0 &&
+ (state.pp_right_total - state.pp_left_total <
+ state.pp_space_left)) then
+ begin
+ ignore(take_queue state.pp_queue);
+ format_pp_token state (if size < 0 then pp_infinity else size) tok;
+ state.pp_left_total <- len + state.pp_left_total;
+ advance_left state
+ end with
+ | Empty_queue -> ();;
let enqueue_advance state tok = pp_enqueue state tok; advance_left state;;
(* To enqueue a string : try to advance. *)
let make_queue_elem size tok len =
- {elem_size = size; token = tok; length = len};;
+ { elem_size = size; token = tok; length = len; };;
let enqueue_string_as state size s =
let len = int_of_size size in
Pattern matching on token in scan stack is also exhaustive,
since scan_push is used on breaks and opening of boxes. *)
let set_size state ty =
- match state.pp_scan_stack with
- | Scan_elem
- (left_tot,
- ({elem_size = size; token = tok} as queue_elem)) :: t ->
- let size = int_of_size size in
- (* test if scan stack contains any data that is not obsolete. *)
- if left_tot < state.pp_left_total then clear_scan_stack state else
- begin match tok with
- | Pp_break (_, _) | Pp_tbreak (_, _) ->
- if ty then
- begin
- queue_elem.elem_size <- size_of_int (state.pp_right_total + size);
- state.pp_scan_stack <- t
- end
- | Pp_begin (_, _) ->
- if not ty then
- begin
- queue_elem.elem_size <- size_of_int (state.pp_right_total + size);
- state.pp_scan_stack <- t
- end
- | _ -> () (* scan_push is only used for breaks and boxes. *)
+ match state.pp_scan_stack with
+ | Scan_elem
+ (left_tot,
+ ({elem_size = size; token = tok} as queue_elem)) :: t ->
+ let size = int_of_size size in
+ (* test if scan stack contains any data that is not obsolete. *)
+ if left_tot < state.pp_left_total then clear_scan_stack state else
+ begin match tok with
+ | Pp_break (_, _) | Pp_tbreak (_, _) ->
+ if ty then
+ begin
+ queue_elem.elem_size <- size_of_int (state.pp_right_total + size);
+ state.pp_scan_stack <- t
+ end
+ | Pp_begin (_, _) ->
+ if not ty then
+ begin
+ queue_elem.elem_size <- size_of_int (state.pp_right_total + size);
+ state.pp_scan_stack <- t
end
- | _ -> () (* scan_stack is never empty. *);;
+ | _ -> () (* scan_push is only used for breaks and boxes. *)
+ end
+ | _ -> () (* scan_stack is never empty. *);;
(* Push a token on scan stack. If b is true set_size is called. *)
let scan_push state b tok =
- pp_enqueue state tok;
- if b then set_size state true;
- state.pp_scan_stack <-
- Scan_elem (state.pp_right_total, tok) :: state.pp_scan_stack;;
+ pp_enqueue state tok;
+ if b then set_size state true;
+ state.pp_scan_stack <-
+ Scan_elem (state.pp_right_total, tok) :: state.pp_scan_stack;;
(* To open a new block :
the user may set the depth bound pp_max_boxes
any text nested deeper is printed as the ellipsis string. *)
let pp_open_box_gen state indent br_ty =
- state.pp_curr_depth <- state.pp_curr_depth + 1;
- if state.pp_curr_depth < state.pp_max_boxes then
- let elem =
- make_queue_elem
- (size_of_int (- state.pp_right_total))
- (Pp_begin (indent, br_ty))
- 0 in
- scan_push state false elem else
- if state.pp_curr_depth = state.pp_max_boxes
- then enqueue_string state state.pp_ellipsis;;
+ state.pp_curr_depth <- state.pp_curr_depth + 1;
+ if state.pp_curr_depth < state.pp_max_boxes then
+ let elem =
+ make_queue_elem
+ (size_of_int (- state.pp_right_total))
+ (Pp_begin (indent, br_ty))
+ 0 in
+ scan_push state false elem else
+ if state.pp_curr_depth = state.pp_max_boxes
+ then enqueue_string state state.pp_ellipsis;;
(* The box which is always opened. *)
let pp_open_sys_box state = pp_open_box_gen state 0 Pp_hovbox;;
(* Close a block, setting sizes of its subblocks. *)
let pp_close_box state () =
- if state.pp_curr_depth > 1 then
- begin
- if state.pp_curr_depth < state.pp_max_boxes then
- begin
- pp_enqueue state
- {elem_size = size_of_int 0; token = Pp_end; length = 0};
- set_size state true; set_size state false
- end;
- state.pp_curr_depth <- state.pp_curr_depth - 1;
- end;;
+ if state.pp_curr_depth > 1 then
+ begin
+ if state.pp_curr_depth < state.pp_max_boxes then
+ begin
+ pp_enqueue state
+ { elem_size = size_of_int 0; token = Pp_end; length = 0; };
+ set_size state true; set_size state false
+ end;
+ state.pp_curr_depth <- state.pp_curr_depth - 1;
+ end;;
(* Open a tag, pushing it on the tag stack. *)
let pp_open_tag state tag_name =
- if state.pp_print_tags then begin
- state.pp_tag_stack <- tag_name :: state.pp_tag_stack;
- state.pp_print_open_tag tag_name end;
- if state.pp_mark_tags then
- pp_enqueue state
- {elem_size = size_of_int 0; token = Pp_open_tag tag_name; length = 0};;
+ if state.pp_print_tags then
+ begin
+ state.pp_tag_stack <- tag_name :: state.pp_tag_stack;
+ state.pp_print_open_tag tag_name
+ end;
+ if state.pp_mark_tags then
+ pp_enqueue state {
+ elem_size = size_of_int 0;
+ token = Pp_open_tag tag_name;
+ length = 0;
+ }
+;;
(* Close a tag, popping it from the tag stack. *)
let pp_close_tag state () =
- if state.pp_mark_tags then
- pp_enqueue state
- {elem_size = size_of_int 0; token = Pp_close_tag; length = 0};
- if state.pp_print_tags then
- begin match state.pp_tag_stack with
- | tag_name :: tags ->
- state.pp_print_close_tag tag_name;
- state.pp_tag_stack <- tags
- | _ -> () (* No more tag to close. *)
- end;;
+ if state.pp_mark_tags then
+ pp_enqueue state {
+ elem_size = size_of_int 0;
+ token = Pp_close_tag;
+ length = 0;
+ };
+ if state.pp_print_tags then
+ begin
+ match state.pp_tag_stack with
+ | tag_name :: tags ->
+ state.pp_print_close_tag tag_name;
+ state.pp_tag_stack <- tags
+ | _ -> () (* No more tag to close. *)
+ end;;
let pp_set_print_tags state b = state.pp_print_tags <- b;;
let pp_set_mark_tags state b = state.pp_mark_tags <- b;;
let pp_set_tags state b = pp_set_print_tags state b; pp_set_mark_tags state b;;
let pp_get_formatter_tag_functions state () = {
- mark_open_tag = state.pp_mark_open_tag;
- mark_close_tag = state.pp_mark_close_tag;
- print_open_tag = state.pp_print_open_tag;
- print_close_tag = state.pp_print_close_tag;
+ mark_open_tag = state.pp_mark_open_tag;
+ mark_close_tag = state.pp_mark_close_tag;
+ print_open_tag = state.pp_print_open_tag;
+ print_close_tag = state.pp_print_close_tag;
};;
let pp_set_formatter_tag_functions state {
(* Initialize pretty-printer. *)
let pp_rinit state =
- pp_clear_queue state;
- clear_scan_stack state;
- state.pp_format_stack <- [];
- state.pp_tbox_stack <- [];
- state.pp_tag_stack <- [];
- state.pp_mark_stack <- [];
- state.pp_current_indent <- 0;
- state.pp_curr_depth <- 0;
- state.pp_space_left <- state.pp_margin;
- pp_open_sys_box state;;
+ pp_clear_queue state;
+ clear_scan_stack state;
+ state.pp_format_stack <- [];
+ state.pp_tbox_stack <- [];
+ state.pp_tag_stack <- [];
+ state.pp_mark_stack <- [];
+ state.pp_current_indent <- 0;
+ state.pp_curr_depth <- 0;
+ state.pp_space_left <- state.pp_margin;
+ pp_open_sys_box state;;
(* Flushing pretty-printer queue. *)
let pp_flush_queue state b =
- while state.pp_curr_depth > 1 do
- pp_close_box state ()
- done;
- state.pp_right_total <- pp_infinity;
- advance_left state;
- if b then pp_output_newline state;
- pp_rinit state;;
+ while state.pp_curr_depth > 1 do
+ pp_close_box state ()
+ done;
+ state.pp_right_total <- pp_infinity;
+ advance_left state;
+ if b then pp_output_newline state;
+ pp_rinit state;;
(**************************************************************
(* Print a new line after printing all queued text
(same for print_flush but without a newline). *)
let pp_print_newline state () =
- pp_flush_queue state true; state.pp_flush_function ()
+ pp_flush_queue state true; state.pp_flush_function ()
and pp_print_flush state () =
- pp_flush_queue state false; state.pp_flush_function ();;
+ pp_flush_queue state false; state.pp_flush_function ();;
(* To get a newline when one does not want to close the current block. *)
let pp_force_newline state () =
(* Close a tabulation block. *)
let pp_close_tbox state () =
- if state.pp_curr_depth > 1 then begin
+ if state.pp_curr_depth > 1 then
+ begin
if state.pp_curr_depth < state.pp_max_boxes then
let elem = make_queue_elem (size_of_int 0) Pp_tend 0 in
enqueue_advance state elem;
- state.pp_curr_depth <- state.pp_curr_depth - 1 end;;
+ state.pp_curr_depth <- state.pp_curr_depth - 1
+ end;;
(* Print a tabulation break. *)
let pp_print_tbreak state width offset =
let n = pp_limit n in
state.pp_margin <- n;
let new_max_indent =
- (* Try to maintain max_indent to its actual value. *)
- if state.pp_max_indent <= state.pp_margin
- then state.pp_max_indent else
- (* If possible maintain pp_min_space_left to its actual value,
- if this leads to a too small max_indent, take half of the
- new margin, if it is greater than 1. *)
- max (max (state.pp_margin - state.pp_min_space_left)
- (state.pp_margin / 2)) 1 in
- (* Rebuild invariants. *)
+ (* Try to maintain max_indent to its actual value. *)
+ if state.pp_max_indent <= state.pp_margin
+ then state.pp_max_indent else
+ (* If possible maintain pp_min_space_left to its actual value,
+ if this leads to a too small max_indent, take half of the
+ new margin, if it is greater than 1. *)
+ max (max (state.pp_margin - state.pp_min_space_left)
+ (state.pp_margin / 2)) 1 in
+ (* Rebuild invariants. *)
pp_set_max_indent state new_max_indent;;
let pp_get_margin state () = state.pp_margin;;
let default_pp_print_close_tag = default_pp_print_open_tag;;
let pp_make_formatter f g h i =
- (* The initial state of the formatter contains a dummy box. *)
- let pp_q = make_queue () in
- let sys_tok =
- make_queue_elem (size_of_int (-1)) (Pp_begin (0, Pp_hovbox)) 0 in
- add_queue sys_tok pp_q;
- let sys_scan_stack =
- (Scan_elem (1, sys_tok)) :: scan_stack_bottom in
- {pp_scan_stack = sys_scan_stack;
- pp_format_stack = [];
- pp_tbox_stack = [];
- pp_tag_stack = [];
- pp_mark_stack = [];
- pp_margin = 78;
- pp_min_space_left = 10;
- pp_max_indent = 78 - 10;
- pp_space_left = 78;
- pp_current_indent = 0;
- pp_is_new_line = true;
- pp_left_total = 1;
- pp_right_total = 1;
- pp_curr_depth = 1;
- pp_max_boxes = max_int;
- pp_ellipsis = ".";
- pp_output_function = f;
- pp_flush_function = g;
- pp_output_newline = h;
- pp_output_spaces = i;
- pp_print_tags = false;
- pp_mark_tags = false;
- pp_mark_open_tag = default_pp_mark_open_tag;
- pp_mark_close_tag = default_pp_mark_close_tag;
- pp_print_open_tag = default_pp_print_open_tag;
- pp_print_close_tag = default_pp_print_close_tag;
- pp_queue = pp_q
- };;
+ (* The initial state of the formatter contains a dummy box. *)
+ let pp_q = make_queue () in
+ let sys_tok =
+ make_queue_elem (size_of_int (-1)) (Pp_begin (0, Pp_hovbox)) 0 in
+ add_queue sys_tok pp_q;
+ let sys_scan_stack =
+ (Scan_elem (1, sys_tok)) :: scan_stack_bottom in
+ {pp_scan_stack = sys_scan_stack;
+ pp_format_stack = [];
+ pp_tbox_stack = [];
+ pp_tag_stack = [];
+ pp_mark_stack = [];
+ pp_margin = 78;
+ pp_min_space_left = 10;
+ pp_max_indent = 78 - 10;
+ pp_space_left = 78;
+ pp_current_indent = 0;
+ pp_is_new_line = true;
+ pp_left_total = 1;
+ pp_right_total = 1;
+ pp_curr_depth = 1;
+ pp_max_boxes = max_int;
+ pp_ellipsis = ".";
+ pp_output_function = f;
+ pp_flush_function = g;
+ pp_output_newline = h;
+ pp_output_spaces = i;
+ pp_print_tags = false;
+ pp_mark_tags = false;
+ pp_mark_open_tag = default_pp_mark_open_tag;
+ pp_mark_close_tag = default_pp_mark_close_tag;
+ pp_print_open_tag = default_pp_print_open_tag;
+ pp_print_close_tag = default_pp_print_close_tag;
+ pp_queue = pp_q;
+ };;
(* Default function to output spaces. *)
let blank_line = String.make 80 ' ';;
let rec display_blanks state n =
- if n > 0 then
- if n <= 80 then state.pp_output_function blank_line 0 n else
- begin
- state.pp_output_function blank_line 0 80;
- display_blanks state (n - 80)
- end;;
+ if n > 0 then
+ if n <= 80 then state.pp_output_function blank_line 0 n else
+ begin
+ state.pp_output_function blank_line 0 80;
+ display_blanks state (n - 80)
+ end;;
(* Default function to output new lines. *)
let display_newline state () = state.pp_output_function "\n" 0 1;;
let stdbuf = Buffer.create 512;;
-let str_formatter = formatter_of_buffer stdbuf;;
-let std_formatter = formatter_of_out_channel stdout;;
-let err_formatter = formatter_of_out_channel stderr;;
+let str_formatter = formatter_of_buffer stdbuf
+and std_formatter = formatter_of_out_channel stdout
+and err_formatter = formatter_of_out_channel stderr;;
let flush_str_formatter () =
pp_flush_queue str_formatter false;
and get_ellipsis_text = pp_get_ellipsis_text std_formatter
and set_formatter_out_channel =
- pp_set_formatter_out_channel std_formatter
+ pp_set_formatter_out_channel std_formatter
and set_formatter_output_functions =
- pp_set_formatter_output_functions std_formatter
+ pp_set_formatter_output_functions std_formatter
and get_formatter_output_functions =
- pp_get_formatter_output_functions std_formatter
+ pp_get_formatter_output_functions std_formatter
and set_all_formatter_output_functions =
- pp_set_all_formatter_output_functions std_formatter
+ pp_set_all_formatter_output_functions std_formatter
and get_all_formatter_output_functions =
- pp_get_all_formatter_output_functions std_formatter
+ pp_get_all_formatter_output_functions std_formatter
and set_formatter_tag_functions =
- pp_set_formatter_tag_functions std_formatter
+ pp_set_formatter_tag_functions std_formatter
and get_formatter_tag_functions =
- pp_get_formatter_tag_functions std_formatter
+ pp_get_formatter_tag_functions std_formatter
and set_print_tags =
- pp_set_print_tags std_formatter
+ pp_set_print_tags std_formatter
and get_print_tags =
- pp_get_print_tags std_formatter
+ pp_get_print_tags std_formatter
and set_mark_tags =
- pp_set_mark_tags std_formatter
+ pp_set_mark_tags std_formatter
and get_mark_tags =
- pp_get_mark_tags std_formatter
+ pp_get_mark_tags std_formatter
and set_tags =
- pp_set_tags std_formatter
+ pp_set_tags std_formatter
;;
(* Getting strings out of buffers. *)
let get_buffer_out b =
- let s = Buffer.contents b in
- Buffer.reset b;
- s;;
+ let s = Buffer.contents b in
+ Buffer.reset b;
+ s;;
(* [ppf] is supposed to be a pretty-printer that outputs in buffer [b]:
to extract contents of [ppf] as a string we flush [ppf] and get the string
out of [b]. *)
let string_out b ppf =
- pp_flush_queue ppf false;
- get_buffer_out b;;
+ pp_flush_queue ppf false;
+ get_buffer_out b;;
(* Applies [printer] to a formatter that outputs on a fresh buffer,
then returns the resulting material. *)
let exstring printer arg =
- let b = Buffer.create 512 in
- let ppf = formatter_of_buffer b in
- printer ppf arg;
- string_out b ppf;;
+ let b = Buffer.create 512 in
+ let ppf = formatter_of_buffer b in
+ printer ppf arg;
+ string_out b ppf;;
(* To turn out a character accumulator into the proper string result. *)
let implode_rev s0 = function
let mkprintf to_s get_out =
let rec kprintf k fmt =
+
let len = Sformat.length fmt in
let kpr fmt v =
let ppf = get_out fmt in
let print_as = ref None in
let pp_print_as_char c =
- match !print_as with
- | None -> pp_print_char ppf c
- | Some size ->
- pp_print_as_size ppf size (String.make 1 c);
- print_as := None
+ match !print_as with
+ | None -> pp_print_char ppf c
+ | Some size ->
+ pp_print_as_size ppf size (String.make 1 c);
+ print_as := None
and pp_print_as_string s =
- match !print_as with
- | None -> pp_print_string ppf s
- | Some size ->
- pp_print_as_size ppf size s;
- print_as := None in
+ match !print_as with
+ | None -> pp_print_string ppf s
+ | Some size ->
+ pp_print_as_size ppf size s;
+ print_as := None in
let rec doprn n i =
if i >= len then Obj.magic (k ppf) else
match Sformat.get fmt i with
| '%' ->
- Tformat.scan_format fmt v n i cont_s cont_a cont_t cont_f cont_m
+ Tformat.scan_format fmt v n i cont_s cont_a cont_t cont_f cont_m
| '@' ->
- let i = succ i in
- if i >= len then invalid_format fmt i else
- begin match Sformat.get fmt i with
- | '[' ->
- do_pp_open_box ppf n (succ i)
- | ']' ->
- pp_close_box ppf ();
- doprn n (succ i)
- | '{' ->
- do_pp_open_tag ppf n (succ i)
- | '}' ->
- pp_close_tag ppf ();
- doprn n (succ i)
- | ' ' ->
- pp_print_space ppf ();
- doprn n (succ i)
- | ',' ->
- pp_print_cut ppf ();
- doprn n (succ i)
- | '?' ->
- pp_print_flush ppf ();
- doprn n (succ i)
- | '.' ->
- pp_print_newline ppf ();
- doprn n (succ i)
- | '\n' ->
- pp_force_newline ppf ();
- doprn n (succ i)
- | ';' ->
- do_pp_break ppf n (succ i)
- | '<' ->
- let got_size size n i =
- print_as := Some size;
- doprn n (skip_gt i) in
- get_int n (succ i) got_size
- | '@' as c ->
- pp_print_as_char c;
- doprn n (succ i)
- | c -> invalid_format fmt i
- end
+ let i = succ i in
+ if i >= len then invalid_format fmt i else
+ begin match Sformat.get fmt i with
+ | '[' ->
+ do_pp_open_box ppf n (succ i)
+ | ']' ->
+ pp_close_box ppf ();
+ doprn n (succ i)
+ | '{' ->
+ do_pp_open_tag ppf n (succ i)
+ | '}' ->
+ pp_close_tag ppf ();
+ doprn n (succ i)
+ | ' ' ->
+ pp_print_space ppf ();
+ doprn n (succ i)
+ | ',' ->
+ pp_print_cut ppf ();
+ doprn n (succ i)
+ | '?' ->
+ pp_print_flush ppf ();
+ doprn n (succ i)
+ | '.' ->
+ pp_print_newline ppf ();
+ doprn n (succ i)
+ | '\n' ->
+ pp_force_newline ppf ();
+ doprn n (succ i)
+ | ';' ->
+ do_pp_break ppf n (succ i)
+ | '<' ->
+ let got_size size n i =
+ print_as := Some size;
+ doprn n (skip_gt i) in
+ get_int n (succ i) got_size
+ | '@' as c ->
+ pp_print_as_char c;
+ doprn n (succ i)
+ | c -> invalid_format fmt i
+ end
| c ->
- pp_print_as_char c;
- doprn n (succ i)
+ pp_print_as_char c;
+ doprn n (succ i)
and cont_s n s i =
pp_print_as_string s; doprn n i
kprintf (Obj.magic (fun _ -> doprn n i)) sfmt
and get_int n i c =
- if i >= len then invalid_integer fmt i else
- match Sformat.get fmt i with
- | ' ' -> get_int n (succ i) c
- | '%' ->
+ if i >= len then invalid_integer fmt i else
+ match Sformat.get fmt i with
+ | ' ' -> get_int n (succ i) c
+ | '%' ->
let cont_s n s i = c (format_int_of_string fmt i s) n i
and cont_a n printer arg i = invalid_integer fmt i
and cont_t n printer i = invalid_integer fmt i
and cont_f n i = invalid_integer fmt i
and cont_m n sfmt i = invalid_integer fmt i in
Tformat.scan_format fmt v n i cont_s cont_a cont_t cont_f cont_m
- | _ ->
+ | _ ->
let rec get j =
- if j >= len then invalid_integer fmt j else
- match Sformat.get fmt j with
- | '0' .. '9' | '-' -> get (succ j)
- | _ ->
- let size =
- if j = i then size_of_int 0 else
+ if j >= len then invalid_integer fmt j else
+ match Sformat.get fmt j with
+ | '0' .. '9' | '-' -> get (succ j)
+ | _ ->
+ let size =
+ if j = i then size_of_int 0 else
let s = Sformat.sub fmt (Sformat.index_of_int i) (j - i) in
format_int_of_string fmt j s in
- c size n j in
+ c size n j in
get i
and skip_gt i =
- if i >= len then invalid_format fmt i else
- match Sformat.get fmt i with
- | ' ' -> skip_gt (succ i)
- | '>' -> succ i
- | _ -> invalid_format fmt i
+ if i >= len then invalid_format fmt i else
+ match Sformat.get fmt i with
+ | ' ' -> skip_gt (succ i)
+ | '>' -> succ i
+ | _ -> invalid_format fmt i
and get_box_kind i =
- if i >= len then Pp_box, i else
- match Sformat.get fmt i with
- | 'h' ->
- let i = succ i in
- if i >= len then Pp_hbox, i else
- begin match Sformat.get fmt i with
- | 'o' ->
+ if i >= len then Pp_box, i else
+ match Sformat.get fmt i with
+ | 'h' ->
+ let i = succ i in
+ if i >= len then Pp_hbox, i else
+ begin match Sformat.get fmt i with
+ | 'o' ->
let i = succ i in
if i >= len then format_invalid_arg "bad box format" fmt i else
begin match Sformat.get fmt i with
| 'v' -> Pp_hovbox, succ i
| c ->
- format_invalid_arg
- ("bad box name ho" ^ String.make 1 c) fmt i end
- | 'v' -> Pp_hvbox, succ i
- | c -> Pp_hbox, i
- end
- | 'b' -> Pp_box, succ i
- | 'v' -> Pp_vbox, succ i
- | _ -> Pp_box, i
+ format_invalid_arg
+ ("bad box name ho" ^ String.make 1 c) fmt i
+ end
+ | 'v' -> Pp_hvbox, succ i
+ | c -> Pp_hbox, i
+ end
+ | 'b' -> Pp_box, succ i
+ | 'v' -> Pp_vbox, succ i
+ | _ -> Pp_box, i
and get_tag_name n i c =
- let rec get accu n i j =
- if j >= len
- then c (implode_rev (Sformat.sub fmt (Sformat.index_of_int i) (j - i)) accu) n j else
- match Sformat.get fmt j with
- | '>' -> c (implode_rev (Sformat.sub fmt (Sformat.index_of_int i) (j - i)) accu) n j
- | '%' ->
- let s0 = Sformat.sub fmt (Sformat.index_of_int i) (j - i) in
- let cont_s n s i = get (s :: s0 :: accu) n i i
- and cont_a n printer arg i =
- let s =
- if to_s
- then (Obj.magic printer : unit -> _ -> string) () arg
- else exstring printer arg in
- get (s :: s0 :: accu) n i i
- and cont_t n printer i =
- let s =
- if to_s
- then (Obj.magic printer : unit -> string) ()
- else exstring (fun ppf () -> printer ppf) () in
- get (s :: s0 :: accu) n i i
- and cont_f n i =
- format_invalid_arg "bad tag name specification" fmt i
- and cont_m n sfmt i =
- format_invalid_arg "bad tag name specification" fmt i in
- Tformat.scan_format fmt v n j cont_s cont_a cont_t cont_f cont_m
- | c -> get accu n i (succ j) in
- get [] n i i
+ let rec get accu n i j =
+ if j >= len then
+ c (implode_rev
+ (Sformat.sub fmt (Sformat.index_of_int i) (j - i))
+ accu)
+ n j else
+ match Sformat.get fmt j with
+ | '>' ->
+ c (implode_rev
+ (Sformat.sub fmt (Sformat.index_of_int i) (j - i))
+ accu)
+ n j
+ | '%' ->
+ let s0 = Sformat.sub fmt (Sformat.index_of_int i) (j - i) in
+ let cont_s n s i = get (s :: s0 :: accu) n i i
+ and cont_a n printer arg i =
+ let s =
+ if to_s
+ then (Obj.magic printer : unit -> _ -> string) () arg
+ else exstring printer arg in
+ get (s :: s0 :: accu) n i i
+ and cont_t n printer i =
+ let s =
+ if to_s
+ then (Obj.magic printer : unit -> string) ()
+ else exstring (fun ppf () -> printer ppf) () in
+ get (s :: s0 :: accu) n i i
+ and cont_f n i =
+ format_invalid_arg "bad tag name specification" fmt i
+ and cont_m n sfmt i =
+ format_invalid_arg "bad tag name specification" fmt i in
+ Tformat.scan_format fmt v n j cont_s cont_a cont_t cont_f cont_m
+ | c -> get accu n i (succ j) in
+ get [] n i i
and do_pp_break ppf n i =
- if i >= len then begin pp_print_space ppf (); doprn n i end else
- match Sformat.get fmt i with
- | '<' ->
+ if i >= len then begin pp_print_space ppf (); doprn n i end else
+ match Sformat.get fmt i with
+ | '<' ->
let rec got_nspaces nspaces n i =
get_int n i (got_offset nspaces)
and got_offset nspaces offset n i =
pp_print_break ppf (int_of_size nspaces) (int_of_size offset);
doprn n (skip_gt i) in
get_int n (succ i) got_nspaces
- | c -> pp_print_space ppf (); doprn n i
+ | c -> pp_print_space ppf (); doprn n i
and do_pp_open_box ppf n i =
- if i >= len then begin pp_open_box_gen ppf 0 Pp_box; doprn n i end else
- match Sformat.get fmt i with
- | '<' ->
+ if i >= len then begin pp_open_box_gen ppf 0 Pp_box; doprn n i end else
+ match Sformat.get fmt i with
+ | '<' ->
let kind, i = get_box_kind (succ i) in
let got_size size n i =
pp_open_box_gen ppf (int_of_size size) kind;
doprn n (skip_gt i) in
get_int n i got_size
- | c -> pp_open_box_gen ppf 0 Pp_box; doprn n i
+ | c -> pp_open_box_gen ppf 0 Pp_box; doprn n i
and do_pp_open_tag ppf n i =
- if i >= len then begin pp_open_tag ppf ""; doprn n i end else
- match Sformat.get fmt i with
- | '<' ->
+ if i >= len then begin pp_open_tag ppf ""; doprn n i end else
+ match Sformat.get fmt i with
+ | '<' ->
let got_name tag_name n i =
pp_open_tag ppf tag_name;
doprn n (skip_gt i) in
get_tag_name n (succ i) got_name
- | c -> pp_open_tag ppf ""; doprn n i in
+ | c -> pp_open_tag ppf ""; doprn n i in
doprn (Sformat.index_of_int 0) 0 in
- Tformat.kapr kpr fmt in
+ Tformat.kapr kpr fmt in
kprintf;;
(* *)
(***********************************************************************)
-(* $Id: int32.mli,v 1.18 2005/10/25 18:34:07 doligez Exp $ *)
+(* $Id: int32.mli,v 1.18.10.1 2007/10/25 08:18:08 xleroy Exp $ *)
(** 32-bit integers.
(** {6 Deprecated functions} *)
external format : string -> int32 -> string = "caml_int32_format"
-(** [Int32.format fmt n] return the string representation of the
- 32-bit integer [n] in the format specified by [fmt].
- [fmt] is a [Printf]-style format consisting of exactly
- one [%d], [%i], [%u], [%x], [%X] or [%o] conversion specification.
- This function is deprecated; use {!Printf.sprintf} with a [%lx] format
- instead. *)
+(** Do not use this deprecated function. Instead,
+ used {!Printf.sprintf} with a [%l...] format. *)
(* *)
(***********************************************************************)
-(* $Id: int64.mli,v 1.19 2005/10/25 18:34:07 doligez Exp $ *)
+(* $Id: int64.mli,v 1.19.10.1 2007/10/25 08:18:08 xleroy Exp $ *)
(** 64-bit integers.
(** {6 Deprecated functions} *)
external format : string -> int64 -> string = "caml_int64_format"
-(** [Int64.format fmt n] return the string representation of the
- 64-bit integer [n] in the format specified by [fmt].
- [fmt] is a {!Printf}-style format consisting of exactly one
- [%d], [%i], [%u], [%x], [%X] or [%o] conversion specification.
- This function is deprecated; use {!Printf.sprintf} with a [%Lx] format
- instead. *)
+(** Do not use this deprecated function. Instead,
+ used {!Printf.sprintf} with a [%L...] format. *)
(* *)
(***********************************************************************)
-(* $Id: printf.ml,v 1.53 2006/11/17 08:34:05 weis Exp $ *)
+(* $Id: printf.ml,v 1.53.6.2 2007/12/18 12:40:29 weis Exp $ *)
external format_float: string -> float -> string
= "caml_format_float"
let add_int_index i idx = index_of_int (i + int_of_index idx);;
let succ_index = add_int_index 1;;
- (* Litteral position are one-based (hence pred p instead of p). *)
- let index_of_litteral_position p = index_of_int (pred p);;
external length : ('a, 'b, 'c, 'd, 'e, 'f) format6 -> int
= "%string_length";;
'*' in the format are replaced by integers taken from the [widths] list.
extract_format returns a string. *)
let extract_format fmt start stop widths =
- let skip_positional_spec start =
- match Sformat.unsafe_get fmt start with
- | '0'..'9' ->
- let rec skip_int_litteral i =
- match Sformat.unsafe_get fmt i with
- | '0'..'9' -> skip_int_litteral (succ i)
- | '$' -> succ i
- | _ -> start in
- skip_int_litteral (succ start)
- | _ -> start in
- let start = skip_positional_spec (succ start) in
+ let start = succ start in
let b = Buffer.create (stop - start + 10) in
Buffer.add_char b '%';
let rec fill_format i widths =
match (Sformat.unsafe_get fmt i, widths) with
| ('*', h :: t) ->
Buffer.add_string b (string_of_int h);
- let i = skip_positional_spec (succ i) in
+ let i = succ i in
fill_format i t
| ('*', []) ->
assert false (* should not happen *)
if i > lim then incomplete_format fmt else
match Sformat.unsafe_get fmt i with
| '*' -> scan_flags skip (add_conv skip i 'i')
- | '$' -> scan_flags skip (succ i)
| '#' | '-' | ' ' | '+' -> scan_flags skip (succ i)
| '_' -> scan_flags true (succ i)
| '0'..'9'
else Obj.magic (fun x -> loop (succ i) (x :: args)) in
loop 0 [];;
-type positional_specification =
- | Spec_none | Spec_index of Sformat.index;;
-
-(* To scan an optional positional parameter specification,
- i.e. an integer followed by a [$].
- We do not support [*$] specifications, since this would lead to type checking
- problems: the type of the specified [*$] parameter would be the type of the
- corresponding argument to [printf], hence the type of the $n$-th argument to
- [printf] with $n$ being the {\em value} of the integer argument defining
- [*]; this means type dependency, which is out of scope of the Caml type
- algebra. *)
-let scan_positional_spec fmt got_spec n i =
- match Sformat.unsafe_get fmt i with
- | '0'..'9' as d ->
- let rec get_int_litteral accu j =
- match Sformat.unsafe_get fmt j with
- | '0'..'9' as d ->
- get_int_litteral (10 * accu + (int_of_char d - 48)) (succ j)
- | '$' ->
- if accu = 0
- then failwith "printf: bad positional specification (0)." else
- got_spec (Spec_index (Sformat.index_of_litteral_position accu)) (succ j)
- (* Not a positional specification. *)
- | _ -> got_spec Spec_none i in
- get_int_litteral (int_of_char d - 48) (succ i)
- (* No positional specification. *)
- | _ -> got_spec Spec_none i;;
-
-(* Get the position of the next argument to printf, according to the given
- positional specification. *)
-let next_index spec n =
- match spec with
- | Spec_none -> Sformat.succ_index n
- | Spec_index _ -> n;;
-
-(* Get the position of the actual argument to printf, according to its
- optional positional specification. *)
-let get_index spec n =
- match spec with
- | Spec_none -> n
- | Spec_index p -> p;;
+(* Get the index of the next argument to printf. *)
+let next_index n = Sformat.succ_index n;;
(* Decode a format string and act on it.
[fmt] is the printf format string, and [pos] points to a [%] character.
Don't do this at home, kids. *)
let scan_format fmt args n pos cont_s cont_a cont_t cont_f cont_m =
- let get_arg spec n =
- Obj.magic (args.(Sformat.int_of_index (get_index spec n))) in
-
- let rec scan_positional n widths i =
- let got_spec spec i = scan_flags spec n widths i in
- scan_positional_spec fmt got_spec n i
+ let get_arg n =
+ Obj.magic (args.(Sformat.int_of_index n)) in
- and scan_flags spec n widths i =
+ let rec scan_flags n widths i =
match Sformat.unsafe_get fmt i with
| '*' ->
- let got_spec wspec i =
- let (width : int) = get_arg wspec n in
- scan_flags spec (next_index wspec n) (width :: widths) i in
- scan_positional_spec fmt got_spec n (succ i)
+ let (width : int) = get_arg n in
+ scan_flags (next_index n) (width :: widths) (succ i)
| '0'..'9'
- | '.' | '#' | '-' | ' ' | '+' -> scan_flags spec n widths (succ i)
- | _ -> scan_conv spec n widths i
+ | '.' | '#' | '-' | ' ' | '+' -> scan_flags n widths (succ i)
+ | _ -> scan_conv n widths i
- and scan_conv spec n widths i =
+ and scan_conv n widths i =
match Sformat.unsafe_get fmt i with
| '%' ->
cont_s n "%" (succ i)
| 's' | 'S' as conv ->
- let (x : string) = get_arg spec n in
+ let (x : string) = get_arg n in
let x = if conv = 's' then x else "\"" ^ String.escaped x ^ "\"" in
let s =
(* optimize for common case %s *)
if i = succ pos then x else
format_string (extract_format fmt pos i widths) x in
- cont_s (next_index spec n) s (succ i)
+ cont_s (next_index n) s (succ i)
| 'c' | 'C' as conv ->
- let (x : char) = get_arg spec n in
+ let (x : char) = get_arg n in
let s =
if conv = 'c' then String.make 1 x else "'" ^ Char.escaped x ^ "'" in
- cont_s (next_index spec n) s (succ i)
+ cont_s (next_index n) s (succ i)
| 'd' | 'i' | 'o' | 'u' | 'x' | 'X' | 'N' as conv ->
- let (x : int) = get_arg spec n in
+ let (x : int) = get_arg n in
let s =
format_int (extract_format_int conv fmt pos i widths) x in
- cont_s (next_index spec n) s (succ i)
+ cont_s (next_index n) s (succ i)
| 'f' | 'e' | 'E' | 'g' | 'G' ->
- let (x : float) = get_arg spec n in
+ let (x : float) = get_arg n in
let s = format_float (extract_format fmt pos i widths) x in
- cont_s (next_index spec n) s (succ i)
+ cont_s (next_index n) s (succ i)
| 'F' ->
- let (x : float) = get_arg spec n in
- cont_s (next_index spec n) (string_of_float x) (succ i)
+ let (x : float) = get_arg n in
+ cont_s (next_index n) (string_of_float x) (succ i)
| 'B' | 'b' ->
- let (x : bool) = get_arg spec n in
- cont_s (next_index spec n) (string_of_bool x) (succ i)
+ let (x : bool) = get_arg n in
+ cont_s (next_index n) (string_of_bool x) (succ i)
| 'a' ->
- let printer = get_arg spec n in
- (* If the printer spec is Spec_none, go on as usual.
- If the printer spec is Spec_index p,
- printer's argument spec is Spec_index (succ_index p). *)
- let n = Sformat.succ_index (get_index spec n) in
- let arg = get_arg Spec_none n in
- cont_a (next_index spec n) printer arg (succ i)
+ let printer = get_arg n in
+ let n = Sformat.succ_index n in
+ let arg = get_arg n in
+ cont_a (next_index n) printer arg (succ i)
| 't' ->
- let printer = get_arg spec n in
- cont_t (next_index spec n) printer (succ i)
+ let printer = get_arg n in
+ cont_t (next_index n) printer (succ i)
| 'l' | 'n' | 'L' as conv ->
begin match Sformat.unsafe_get fmt (succ i) with
| 'd' | 'i' | 'o' | 'u' | 'x' | 'X' ->
let s =
match conv with
| 'l' ->
- let (x : int32) = get_arg spec n in
+ let (x : int32) = get_arg n in
format_int32 (extract_format fmt pos i widths) x
| 'n' ->
- let (x : nativeint) = get_arg spec n in
+ let (x : nativeint) = get_arg n in
format_nativeint (extract_format fmt pos i widths) x
| _ ->
- let (x : int64) = get_arg spec n in
+ let (x : int64) = get_arg n in
format_int64 (extract_format fmt pos i widths) x in
- cont_s (next_index spec n) s (succ i)
+ cont_s (next_index n) s (succ i)
| _ ->
- let (x : int) = get_arg spec n in
+ let (x : int) = get_arg n in
let s = format_int (extract_format_int 'n' fmt pos i widths) x in
- cont_s (next_index spec n) s (succ i)
+ cont_s (next_index n) s (succ i)
end
| '!' -> cont_f n (succ i)
| '{' | '(' as conv (* ')' '}' *) ->
- let (xf : ('a, 'b, 'c, 'd, 'e, 'f) format6) = get_arg spec n in
+ let (xf : ('a, 'b, 'c, 'd, 'e, 'f) format6) = get_arg n in
let i = succ i in
let j = sub_format_for_printf conv fmt i in
if conv = '{' (* '}' *) then
(* Just print the format argument as a specification. *)
cont_s
- (next_index spec n)
+ (next_index n)
(summarize_format_type xf)
j else
(* Use the format argument instead of the format specification. *)
- cont_m (next_index spec n) xf j
+ cont_m (next_index n) xf j
| (* '(' *) ')' ->
cont_s n "" (succ i)
| conv ->
bad_conversion_format fmt i conv in
- scan_positional n [] (succ pos);;
+ scan_flags n [] (succ pos);;
let mkprintf to_s get_out outc outs flush k fmt =
match Sformat.unsafe_get fmt i with
| '%' -> scan_format fmt v n i cont_s cont_a cont_t cont_f cont_m
| c -> outc out c; doprn n (succ i)
- and cont_s n s i =
- outs out s; doprn n i
- and cont_a n printer arg i =
- if to_s then
- outs out ((Obj.magic printer : unit -> _ -> string) () arg)
- else
- printer out arg;
- doprn n i
- and cont_t n printer i =
- if to_s then
- outs out ((Obj.magic printer : unit -> string) ())
- else
- printer out;
- doprn n i
- and cont_f n i =
- flush out; doprn n i
- and cont_m n xf i =
- let m = Sformat.add_int_index (count_arguments_of_format xf) n in
- pr (Obj.magic (fun _ -> doprn m i)) n xf v in
-
- doprn n 0 in
+ and cont_s n s i =
+ outs out s; doprn n i
+ and cont_a n printer arg i =
+ if to_s then
+ outs out ((Obj.magic printer : unit -> _ -> string) () arg)
+ else
+ printer out arg;
+ doprn n i
+ and cont_t n printer i =
+ if to_s then
+ outs out ((Obj.magic printer : unit -> string) ())
+ else
+ printer out;
+ doprn n i
+ and cont_f n i =
+ flush out; doprn n i
+ and cont_m n xf i =
+ let m = Sformat.add_int_index (count_arguments_of_format xf) n in
+ pr (Obj.magic (fun _ -> doprn m i)) n xf v in
+
+ doprn n 0 in
let kpr = pr k (Sformat.index_of_int 0) in
(* *)
(***********************************************************************)
-(* $Id: printf.mli,v 1.54 2006/11/17 08:34:05 weis Exp $ *)
+(* $Id: printf.mli,v 1.54.6.2 2008/01/11 10:50:06 doligez Exp $ *)
(** Formatted output functions. *)
Conversion specifications have the following form:
- [% \[positional specifier\] \[flags\] \[width\] \[.precision\] type]
+ [% \[flags\] \[width\] \[.precision\] type]
In short, a conversion specification consists in the [%] character,
followed by optional modifiers and a type which is made of one or
- [!]: take no argument and flush the output.
- [%]: take no argument and output one [%] character.
- The optional [positional specifier] consists of an integer followed
- by a [$]; the integer indicates which argument to use, the first
- argument being denoted by 1.
-
The optional [flags] are:
- [-]: left-justify the output (default is right justification).
- [0]: for numerical conversions, pad with zeroes instead of spaces.
The integer in a [width] or [precision] can also be specified as
[*], in which case an extra integer argument is taken to specify
the corresponding [width] or [precision]. This integer argument
- precedes immediately the argument to print, unless an optional
- [positional specifier] is given to indicates which argument to
- use. For instance, [%.*3$f] prints a [float] with as many fractional
- digits as the value of the third argument. *)
+ precedes immediately the argument to print.
+ For instance, [%.*f] prints a [float] with as many fractional
+ digits as the value of the argument given before the float. *)
val printf : ('a, out_channel, unit) format -> 'a
(** Same as {!Printf.fprintf}, but output on [stdout]. *)
(* *)
(***********************************************************************)
-(* $Id: depend.ml,v 1.10 2006/04/05 02:28:13 garrigue Exp $ *)
+(* $Id: depend.ml,v 1.10.6.1 2007/11/10 13:47:09 xleroy Exp $ *)
open Format
open Location
add bv l; List.iter (add_type bv) tyl
| Pcl_structure(pat, fieldl) ->
add_pattern bv pat; List.iter (add_class_field bv) fieldl
- | Pcl_fun(_, _, pat, ce) ->
- add_pattern bv pat; add_class_expr bv ce
+ | Pcl_fun(_, opte, pat, ce) ->
+ add_opt add_expr bv opte; add_pattern bv pat; add_class_expr bv ce
| Pcl_apply(ce, exprl) ->
add_class_expr bv ce; List.iter (fun (_,e) -> add_expr bv e) exprl
| Pcl_let(_, pel, ce) ->
# #
#########################################################################
-# $Id: make-package-macosx,v 1.13 2007/02/09 13:31:15 doligez Exp $
+# $Id: make-package-macosx,v 1.13.4.1 2007/12/19 14:14:06 doligez Exp $
cd package-macosx
rm -rf ocaml.pkg ocaml-rw.dmg
# stop here -> |
cat >resources/ReadMe.txt <<EOF
This package installs Objective Caml version ${VERSION}.
-You need Mac OS X 10.4.x (Tiger), with X11 and the
-XCode tools (v2.4) installed.
+You need Mac OS X 10.5.x (Jaguar), with X11 and the
+XCode tools (v3.x) installed.
Files will be installed in the following directories:
(* *)
(***********************************************************************)
-(* $Id: btype.ml,v 1.39 2006/04/05 02:28:13 garrigue Exp $ *)
+(* $Id: btype.ml,v 1.39.8.1 2007/06/08 08:03:15 garrigue Exp $ *)
(* Basic operations on core types *)
match (repr row.row_more).desc with
Tvariant row -> iter_row f row
| Tvar | Tunivar | Tsubst _ | Tconstr _ ->
- Misc.may (fun (_,l) -> List.iter f l) row.row_name;
- List.iter f row.row_bound
+ Misc.may (fun (_,l) -> List.iter f l) row.row_name
| _ -> assert false
let iter_type_expr f ty =
| Mlink rem -> iter_abbrev f !rem
let copy_row f fixed row keep more =
- let bound = ref [] in
let fields = List.map
(fun (l, fi) -> l,
match row_field_repr fi with
let e = if keep then e else ref None in
let m = if row.row_fixed then fixed else m in
let tl = List.map f tl in
- bound := List.filter
- (function {desc=Tconstr(_,[],_)} -> false | _ -> true)
- (List.map repr tl)
- @ !bound;
Reither(c, tl, m, e)
| _ -> fi)
row.row_fields in
match row.row_name with None -> None
| Some (path, tl) -> Some (path, List.map f tl) in
{ row_fields = fields; row_more = more;
- row_bound = !bound; row_fixed = row.row_fixed && fixed;
+ row_bound = (); row_fixed = row.row_fixed && fixed;
row_closed = row.row_closed; row_name = name; }
let rec copy_kind = function
(* *)
(***********************************************************************)
-(* $Id: ctype.ml,v 1.205.2.1 2007/03/05 01:24:10 garrigue Exp $ *)
+(* $Id: ctype.ml,v 1.205.2.3 2007/06/08 08:03:15 garrigue Exp $ *)
(* Operations on core types *)
let sort_row_fields = Sort.list (fun (p,_) (q,_) -> p < q)
+let rec merge_rf r1 r2 pairs fi1 fi2 =
+ match fi1, fi2 with
+ (l1,f1 as p1)::fi1', (l2,f2 as p2)::fi2' ->
+ if l1 = l2 then merge_rf r1 r2 ((l1,f1,f2)::pairs) fi1' fi2' else
+ if l1 < l2 then merge_rf (p1::r1) r2 pairs fi1' fi2 else
+ merge_rf r1 (p2::r2) pairs fi1 fi2'
+ | [], _ -> (List.rev r1, List.rev_append r2 fi2, pairs)
+ | _, [] -> (List.rev_append r1 fi1, List.rev r2, pairs)
+
let merge_row_fields fi1 fi2 =
- let rec merge r1 r2 pairs fi1 fi2 =
- match fi1, fi2 with
- (l1,f1 as p1)::fi1', (l2,f2 as p2)::fi2' ->
- if l1 = l2 then merge r1 r2 ((l1,f1,f2)::pairs) fi1' fi2' else
- if l1 < l2 then merge (p1::r1) r2 pairs fi1' fi2 else
- merge r1 (p2::r2) pairs fi1 fi2'
- | [], _ -> (List.rev r1, List.rev_append r2 fi2, pairs)
- | _, [] -> (List.rev_append r1 fi1, List.rev r2, pairs)
- in
- merge [] [] [] (sort_row_fields fi1) (sort_row_fields fi2)
+ match fi1, fi2 with
+ [], _ | _, [] -> (fi1, fi2, [])
+ | [p1], _ when not (List.mem_assoc (fst p1) fi2) -> (fi1, fi2, [])
+ | _, [p2] when not (List.mem_assoc (fst p2) fi1) -> (fi1, fi2, [])
+ | _ -> merge_rf [] [] [] (sort_row_fields fi1) (sort_row_fields fi2)
let rec filter_row_fields erase = function
[] -> []
closed_schema_rec t2
| Tvariant row ->
let row = row_repr row in
- iter_row closed_schema_rec {row with row_bound = []};
+ iter_row closed_schema_rec row;
if not (static_row row) then closed_schema_rec row.row_more
| _ ->
iter_type_expr closed_schema_rec ty
free_vars_rec true ty1; free_vars_rec false ty2
| Tvariant row ->
let row = row_repr row in
- iter_row (free_vars_rec true) {row with row_bound = []};
+ iter_row (free_vars_rec true) row;
if not (static_row row) then free_vars_rec false row.row_more
| _ ->
iter_type_expr (free_vars_rec true) ty
newgenty
(Tvariant
{row_fields = fields; row_closed = closed; row_more = newvar();
- row_bound = []; row_fixed = false; row_name = None })
+ row_bound = (); row_fixed = false; row_name = None })
(**** Unification ****)
then row2.row_name
else None
in
- let bound = row1.row_bound @ row2.row_bound in
- let row0 = {row_fields = []; row_more = more; row_bound = bound;
+ let row0 = {row_fields = []; row_more = more; row_bound = ();
row_closed = closed; row_fixed = fixed; row_name = name} in
let set_more row rest =
let rest =
let level' = pred_enlarge level in
let visited =
t :: if level' < level then [] else filter_visited visited in
- let bound = ref row.row_bound in
let fields = filter_row_fields false row.row_fields in
let fields =
List.map
orig, Unchanged
| Rpresent(Some t) ->
let (t', c) = build_subtype env visited loops posi level' t in
- if posi && level > 0 then begin
- bound := t' :: !bound;
- (l, Reither(false, [t'], false, ref None)), c
- end else
- (l, Rpresent(Some t')), c
+ let f =
+ if posi && level > 0
+ then Reither(false, [t'], false, ref None)
+ else Rpresent(Some t')
+ in (l, f), c
| _ -> assert false)
fields
in
let c = collect fields in
let row =
{ row_fields = List.map fst fields; row_more = newvar();
- row_bound = !bound; row_closed = posi; row_fixed = false;
+ row_bound = (); row_closed = posi; row_fixed = false;
row_name = if c > Unchanged then None else row.row_name }
in
(newty (Tvariant row), Changed)
row.row_fields in
let fields =
List.sort (fun (p,_) (q,_) -> compare p q)
- (List.filter (fun (_,fi) -> fi <> Rabsent) fields)
- and bound = List.fold_left
- (fun tyl ty -> if List.memq ty tyl then tyl else ty :: tyl)
- [] (List.map repr row.row_bound)
- in
+ (List.filter (fun (_,fi) -> fi <> Rabsent) fields) in
log_type ty;
- ty.desc <- Tvariant {row with row_fields = fields; row_bound = bound}
+ ty.desc <- Tvariant {row with row_fields = fields}
| Tobject (fi, nm) ->
begin match !nm with
| None -> ()
(* *)
(***********************************************************************)
-(* $Id: includemod.ml,v 1.38 2006/09/20 11:14:37 doligez Exp $ *)
+(* $Id: includemod.ml,v 1.38.6.1 2007/09/10 03:02:10 garrigue Exp $ *)
(* Inclusion checks for the module language *)
| item2 :: rem ->
let (id2, name2) = item_ident_name item2 in
let name2, report =
- match name2 with
- Field_type s when let l = String.length s in
+ match item2, name2 with
+ Tsig_type (_, {type_manifest=None}, _), Field_type s
+ when let l = String.length s in
l >= 4 && String.sub s (l-4) 4 = "#row" ->
(* Do not report in case of failure,
as the main type will generate an error *)
(* *)
(***********************************************************************)
-(* $Id: oprint.ml,v 1.24.8.1 2007/04/26 14:34:50 doligez Exp $ *)
+(* $Id: oprint.ml,v 1.24.8.2 2007/08/16 08:01:33 garrigue Exp $ *)
open Format
open Outcometree
fprintf ppf "@[<1>%a@ (%a)@]" print_ident name
(print_tree_list print_tree_1 ",") params
| Oval_variant (name, Some param) ->
- fprintf ppf "@[<2>`%s@ %a@]" name print_simple_tree param
+ fprintf ppf "@[<2>`%s@ %a@]" name print_constr_param param
| tree -> print_simple_tree ppf tree
and print_constr_param ppf = function
| Oval_int i -> parenthesize_if_neg ppf "%i" i (i < 0)
(* *)
(***********************************************************************)
-(* $Id: parmatch.ml,v 1.71 2006/09/21 14:54:54 maranget Exp $ *)
+(* $Id: parmatch.ml,v 1.71.6.1 2007/06/08 08:03:15 garrigue Exp $ *)
(* Detection of partial matches and unused match cases. *)
(* p and q compatible means, there exists V that matches both *)
-let is_absent tag row = Btype.row_field tag row = Rabsent
+let is_absent tag row = Btype.row_field tag !row = Rabsent
let is_absent_pat p = match p.pat_desc with
| Tpat_variant (tag, _, row) -> is_absent tag row
row_closed = true; row_name = nm}))
end
+let row_of_pat pat =
+ match Ctype.expand_head pat.pat_env pat.pat_type with
+ {desc = Tvariant row} -> Btype.row_repr row
+ | _ -> assert false
+
(*
Check whether the first column of env makes up a complete signature or
not.
-*)
+*)
let full_match closing env = match env with
| ({pat_desc = Tpat_construct ({cstr_tag=Cstr_exception _},_)},_)::_ ->
false
| ({pat_desc = Tpat_construct(c,_)},_) :: _ ->
List.length env = c.cstr_consts + c.cstr_nonconsts
-| ({pat_desc = Tpat_variant(_,_,row)},_) :: _ ->
+| ({pat_desc = Tpat_variant _} as p,_) :: _ ->
let fields =
List.map
(function ({pat_desc = Tpat_variant (tag, _, _)}, _) -> tag
| _ -> assert false)
env
in
- let row = Btype.row_repr row in
+ let row = row_of_pat p in
if closing && not row.row_fixed then
(* closing=true, we are considering the variant as closed *)
List.for_all
let all_tags = List.map (fun (p,_) -> get_tag p) env in
pat_of_constrs p (complete_constrs p all_tags)
end
-| ({pat_desc = Tpat_variant(_,_,row)} as p,_) :: _ ->
+| ({pat_desc = Tpat_variant (_,_,r)} as p,_) :: _ ->
let tags =
List.map
(function ({pat_desc = Tpat_variant (tag, _, _)}, _) -> tag
| _ -> assert false)
env
in
- let row = Btype.row_repr row in
+ let row = row_of_pat p in
let make_other_pat tag const =
let arg = if const then None else Some omega in
- make_pat (Tpat_variant(tag, arg, row)) p.pat_type p.pat_env in
+ make_pat (Tpat_variant(tag, arg, r)) p.pat_type p.pat_env in
begin match
List.fold_left
(fun others (tag,f) ->
else try_non_omega (filter_all q0 (mark_partial pss))
in
begin match constrs, tdefs with
- ({pat_desc=Tpat_variant(_,_,row)},_):: _, Some env ->
- let row = Btype.row_repr row in
+ ({pat_desc=Tpat_variant _} as p,_):: _, Some env ->
+ let row = row_of_pat p in
if row.row_fixed
|| pressure_variants None (filter_extra pss) then ()
else close_variant env row
(* *)
(***********************************************************************)
-(* $Id: printtyp.ml,v 1.143 2007/02/16 11:18:54 garrigue Exp $ *)
+(* $Id: printtyp.ml,v 1.143.2.1 2007/06/08 08:03:15 garrigue Exp $ *)
(* Printing functions *)
| Some(p, tyl) when namable_row row ->
List.iter (mark_loops_rec visited) tyl
| _ ->
- iter_row (mark_loops_rec visited) {row with row_bound = []}
+ iter_row (mark_loops_rec visited) row
end
| Tobject (fi, nm) ->
if List.memq px !visited_objects then add_alias px else
(* *)
(***********************************************************************)
-(* $Id: subst.ml,v 1.50 2006/04/05 02:28:13 garrigue Exp $ *)
+(* $Id: subst.ml,v 1.50.8.1 2007/06/08 08:03:16 garrigue Exp $ *)
(* Substitutions *)
(* Return a new copy *)
let row =
copy_row (typexp s) true row (not dup) more' in
- let row =
- if s.for_saving then {row with row_bound = []} else row in
match row.row_name with
Some (p, tl) ->
Tvariant {row with row_name = Some (type_path s p, tl)}
(* *)
(***********************************************************************)
-(* $Id: subst.mli,v 1.12 2002/04/18 07:27:45 garrigue Exp $ *)
+(* $Id: subst.mli,v 1.12.36.1 2007/12/26 16:00:41 xleroy Exp $ *)
(* Substitutions *)
val for_saving: t -> t
val reset_for_saving: unit -> unit
+val module_path: t -> Path.t -> Path.t
+val type_path: t -> Path.t -> Path.t
+
val type_expr: t -> type_expr -> type_expr
val class_type: t -> class_type -> class_type
val value_description: t -> value_description -> value_description
(* *)
(***********************************************************************)
-(* $Id: typeclass.ml,v 1.89 2006/12/27 14:41:23 garrigue Exp $ *)
+(* $Id: typeclass.ml,v 1.89.6.2 2007/10/29 06:56:27 garrigue Exp $ *)
open Misc
open Parsetree
Vars.fold
(fun name (mut, vr, ty) l -> if vr = Virtual then name :: l else l)
sign.cty_vars [] in
- if mets <> [] then raise(Error(loc, Virtual_class(true, mets, vals)));
+ if mets <> [] || vals <> [] then
+ raise(Error(loc, Virtual_class(true, mets, vals)));
let self_methods =
List.fold_right
(fun (lab,kind,ty) rem ->
class_expr cl_num val_env met_env sfun
| Pcl_fun (l, None, spat, scl') ->
if !Clflags.principal then Ctype.begin_def ();
- let (pat, pv, val_env, met_env) =
+ let (pat, pv, val_env', met_env) =
Typecore.type_class_arg_pattern cl_num val_env met_env l spat
in
if !Clflags.principal then begin
List.map
(function (id, id', ty) ->
(id,
- Typecore.type_exp val_env
+ Typecore.type_exp val_env'
{pexp_desc = Pexp_ident (Longident.Lident (Ident.name id));
pexp_loc = Location.none}))
pv
exp_type = Ctype.none;
exp_env = Env.empty }] in
Ctype.raise_nongen_level ();
- let cl = class_expr cl_num val_env met_env scl' in
+ let cl = class_expr cl_num val_env' met_env scl' in
Ctype.end_def ();
if Btype.is_optional l && not_function cl.cl_type then
Location.prerr_warning pat.pat_loc
(* *)
(***********************************************************************)
-(* $Id: typecore.ml,v 1.190.2.1 2007/05/02 02:10:54 garrigue Exp $ *)
+(* $Id: typecore.ml,v 1.190.2.7 2007/11/26 16:13:38 doligez Exp $ *)
(* Typechecking for the core language *)
| Constructor_arity_mismatch of Longident.t * int * int
| Label_mismatch of Longident.t * (type_expr * type_expr) list
| Pattern_type_clash of (type_expr * type_expr) list
- | Multiply_bound_variable
+ | Multiply_bound_variable of string
| Orpat_vars of Ident.t
| Expr_type_clash of (type_expr * type_expr) list
| Apply_non_function of type_expr
(* make all Reither present in open variants *)
let finalize_variant pat =
match pat.pat_desc with
- Tpat_variant(tag, opat, row) ->
- let row = row_repr row in
- let field = row_field tag row in
- begin match field with
+ Tpat_variant(tag, opat, r) ->
+ let row =
+ match expand_head pat.pat_env pat.pat_type with
+ {desc = Tvariant row} -> r := row; row_repr row
+ | _ -> assert false
+ in
+ begin match row_field tag row with
| Rabsent -> assert false
| Reither (true, [], _, e) when not row.row_closed ->
set_row_field e (Rpresent None)
set_row_field e (Reither (c, [], false, ref None))
| _ -> ()
end;
- (* Force check of well-formedness *)
- unify_pat pat.pat_env pat
+ (* Force check of well-formedness WHY? *)
+ (* unify_pat pat.pat_env pat
(newty(Tvariant{row_fields=[]; row_more=newvar(); row_closed=false;
- row_bound=[]; row_fixed=false; row_name=None}));
+ row_bound=(); row_fixed=false; row_name=None})); *)
| _ -> ()
let rec iter_pattern f p =
let enter_variable loc name ty =
if List.exists (fun (id, _) -> Ident.name id = name) !pattern_variables
- then raise(Error(loc, Multiply_bound_variable));
+ then raise(Error(loc, Multiply_bound_variable name));
let id = Ident.create name in
pattern_variables := (id, ty) :: !pattern_variables;
id
| Tpat_variant(l, p', _) ->
let ty = may_map (build_as_type env) p' in
newty (Tvariant{row_fields=[l, Rpresent ty]; row_more=newvar();
- row_bound=[]; row_name=None;
+ row_bound=(); row_name=None;
row_fixed=false; row_closed=false})
| Tpat_record lpl ->
let lbl = fst(List.hd lpl) in
let do_label lbl =
let _, ty_arg, ty_res = instance_label false lbl in
unify_pat env {p with pat_type = ty} ty_res;
- if lbl.lbl_mut = Immutable && List.mem_assoc lbl.lbl_pos ppl then begin
+ let refinable =
+ lbl.lbl_mut = Immutable && List.mem_assoc lbl.lbl_pos ppl &&
+ match (repr lbl.lbl_arg).desc with Tpoly _ -> false | _ -> true in
+ if refinable then begin
let arg = List.assoc lbl.lbl_pos ppl in
unify_pat env {arg with pat_type = build_as_type env arg} ty_arg
end else begin
end in
Array.iter do_label lbl.lbl_all;
ty
- | Tpat_or(p1, p2, path) ->
- let ty1 = build_as_type env p1 and ty2 = build_as_type env p2 in
- unify_pat env {p2 with pat_type = ty2} ty1;
- begin match path with None -> ()
- | Some path ->
- let td = try Env.find_type path env with Not_found -> assert false in
- let params = List.map (fun _ -> newvar()) td.type_params in
- match expand_head env (newty (Tconstr (path, params, ref Mnil)))
- with {desc=Tvariant row} when static_row row ->
- unify_pat env {p1 with pat_type = ty1}
- (newty (Tvariant{row with row_closed=false; row_more=newvar()}))
- | _ -> ()
- end;
- ty1
+ | Tpat_or(p1, p2, row) ->
+ begin match row with
+ None ->
+ let ty1 = build_as_type env p1 and ty2 = build_as_type env p2 in
+ unify_pat env {p2 with pat_type = ty2} ty1;
+ ty1
+ | Some row ->
+ let row = row_repr row in
+ newty (Tvariant{row with row_closed=false; row_more=newvar()})
+ end
| Tpat_any | Tpat_var _ | Tpat_constant _ | Tpat_array _ -> p.pat_type
let build_or_pat env loc lid =
raise(Typetexp.Error(loc, Typetexp.Unbound_type_constructor lid))
in
let tyl = List.map (fun _ -> newvar()) decl.type_params in
- let fields =
+ let row0 =
let ty = expand_head env (newty(Tconstr(path, tyl, ref Mnil))) in
match ty.desc with
- Tvariant row when static_row row ->
- (row_repr row).row_fields
+ Tvariant row when static_row row -> row
| _ -> raise(Error(loc, Not_a_variant_type lid))
in
- let bound = ref [] in
let pats, fields =
List.fold_left
(fun (pats,fields) (l,f) ->
(l,None) :: pats,
(l, Reither(true,[], true, ref None)) :: fields
| Rpresent (Some ty) ->
- bound := ty :: !bound;
(l, Some {pat_desc=Tpat_any; pat_loc=Location.none; pat_env=env;
pat_type=ty})
:: pats,
(l, Reither(false, [ty], true, ref None)) :: fields
| _ -> pats, fields)
- ([],[]) fields in
+ ([],[]) (row_repr row0).row_fields in
let row =
- { row_fields = List.rev fields; row_more = newvar(); row_bound = !bound;
+ { row_fields = List.rev fields; row_more = newvar(); row_bound = ();
row_closed = false; row_fixed = false; row_name = Some (path, tyl) }
in
let ty = newty (Tvariant row) in
let gloc = {loc with Location.loc_ghost=true} in
+ let row' = ref {row with row_more=newvar()} in
let pats =
- List.map (fun (l,p) -> {pat_desc=Tpat_variant(l,p,row); pat_loc=gloc;
+ List.map (fun (l,p) -> {pat_desc=Tpat_variant(l,p,row'); pat_loc=gloc;
pat_env=env; pat_type=ty})
pats
in
| pat :: pats ->
let r =
List.fold_left
- (fun pat pat0 -> {pat_desc=Tpat_or(pat0,pat,Some path);
+ (fun pat pat0 -> {pat_desc=Tpat_or(pat0,pat,Some row0);
pat_loc=gloc; pat_env=env; pat_type=ty})
pat pats in
rp { r with pat_loc = loc }
let arg_type = match arg with None -> [] | Some arg -> [arg.pat_type] in
let row = { row_fields =
[l, Reither(arg = None, arg_type, true, ref None)];
- row_bound = arg_type;
+ row_bound = ();
row_closed = false;
row_more = newvar ();
row_fixed = false;
row_name = None } in
rp {
- pat_desc = Tpat_variant(l, arg, row);
+ pat_desc = Tpat_variant(l, arg, ref {row with row_more = newvar()});
pat_loc = sp.ppat_loc;
pat_type = newty (Tvariant row);
pat_env = env }
let reset_delayed_checks () = delayed_checks := []
let add_delayed_check f = delayed_checks := f :: !delayed_checks
let force_delayed_checks () =
+ (* checks may change type levels *)
+ let snap = Btype.snapshot () in
List.iter (fun f -> f ()) (List.rev !delayed_checks);
- reset_delayed_checks ()
+ reset_delayed_checks ();
+ Btype.backtrack snap
(* Generalization criterion for expressions *)
| Texp_array [] -> true
| Texp_ifthenelse(cond, ifso, ifnot) ->
is_nonexpansive ifso && is_nonexpansive_opt ifnot
+ | Texp_sequence (e1, e2) -> is_nonexpansive e2 (* PR#4354 *)
| Texp_new (_, cl_decl) when Ctype.class_type_arity cl_decl.cty_type > 0 ->
true
(* Note: nonexpansive only means no _observable_ side effects *)
exp_loc = sexp.pexp_loc;
exp_type= newty (Tvariant{row_fields = [l, Rpresent arg_type];
row_more = newvar ();
- row_bound = [];
+ row_bound = ();
row_closed = false;
row_fixed = false;
row_name = None});
fprintf ppf "This pattern matches values of type")
(function ppf ->
fprintf ppf "but is here used to match values of type")
- | Multiply_bound_variable ->
- fprintf ppf "This variable is bound several times in this matching"
+ | Multiply_bound_variable name ->
+ fprintf ppf "Variable %s is bound several times in this matching" name
| Orpat_vars id ->
fprintf ppf "Variable %s must occur on both sides of this | pattern"
(Ident.name id)
(* *)
(***********************************************************************)
-(* $Id: typecore.mli,v 1.39 2007/02/27 03:46:19 garrigue Exp $ *)
+(* $Id: typecore.mli,v 1.39.2.1 2007/11/19 21:27:17 doligez Exp $ *)
(* Type inference for the core language *)
| Constructor_arity_mismatch of Longident.t * int * int
| Label_mismatch of Longident.t * (type_expr * type_expr) list
| Pattern_type_clash of (type_expr * type_expr) list
- | Multiply_bound_variable
+ | Multiply_bound_variable of string
| Orpat_vars of Ident.t
| Expr_type_clash of (type_expr * type_expr) list
| Apply_non_function of type_expr
(* *)
(***********************************************************************)
-(* $Id: typedtree.ml,v 1.37 2006/04/05 02:28:13 garrigue Exp $ *)
+(* $Id: typedtree.ml,v 1.37.8.2 2007/07/10 07:34:35 garrigue Exp $ *)
(* Abstract syntax tree after typing *)
| Tpat_constant of constant
| Tpat_tuple of pattern list
| Tpat_construct of constructor_description * pattern list
- | Tpat_variant of label * pattern option * row_desc
+ | Tpat_variant of label * pattern option * row_desc ref
| Tpat_record of (label_description * pattern) list
| Tpat_array of pattern list
- | Tpat_or of pattern * pattern * Path.t option
+ | Tpat_or of pattern * pattern * row_desc option
type partial = Partial | Total
type optional = Required | Optional
(* *)
(***********************************************************************)
-(* $Id: typedtree.mli,v 1.35 2006/04/05 02:28:13 garrigue Exp $ *)
+(* $Id: typedtree.mli,v 1.35.8.2 2007/07/10 07:34:35 garrigue Exp $ *)
(* Abstract syntax tree after typing *)
| Tpat_constant of constant
| Tpat_tuple of pattern list
| Tpat_construct of constructor_description * pattern list
- | Tpat_variant of label * pattern option * row_desc
+ | Tpat_variant of label * pattern option * row_desc ref
| Tpat_record of (label_description * pattern) list
| Tpat_array of pattern list
- | Tpat_or of pattern * pattern * Path.t option
+ | Tpat_or of pattern * pattern * row_desc option
type partial = Partial | Total
type optional = Required | Optional
(* *)
(***********************************************************************)
-(* $Id: typemod.ml,v 1.78.2.1 2007/04/26 09:43:13 xleroy Exp $ *)
+(* $Id: typemod.ml,v 1.78.2.4 2007/12/26 16:00:41 xleroy Exp $ *)
(* Type-checking of the module language *)
(fun (name, smty) ->
(Ident.create name, approx_modtype transl_modtype env smty))
sdecls in
- let first = transition (make_env init) init in
- let final_env = make_env first in
- let final_decl = transition final_env init in
- check_recmod_typedecls final_env sdecls final_decl;
- (final_decl, final_env)
+ let env0 = make_env init in
+ let dcl1 = transition env0 init in
+ let env1 = make_env dcl1 in
+ let dcl2 = transition env1 dcl1 in
+ let env2 = make_env dcl2 in
+ check_recmod_typedecls env2 sdecls dcl2;
+(*
+ List.iter
+ (fun (id, mty) ->
+ Format.printf "%a: %a@." Printtyp.ident id Printtyp.modtype mty)
+ dcl2;
+*)
+ (dcl2, env2)
(* Try to convert a module expression to a module path. *)
None -> mty
| Some p -> Mtype.enrich_modtype env (Pdot(p, name, nopos)) mty
+let check_recmodule_inclusion env bindings =
+ (* PR#4450, PR#4470: consider
+ module rec X : DECL = MOD where MOD has inferred type ACTUAL
+ The "natural" typing condition
+ E, X: ACTUAL |- ACTUAL <: DECL
+ leads to circularities through manifest types.
+ Instead, we "unroll away" the potential circularities a finite number
+ of times. The (weaker) condition we implement is:
+ E, X: DECL,
+ X1: ACTUAL,
+ X2: ACTUAL{X <- X1}/X1
+ ...
+ Xn: ACTUAL{X <- X(n-1)}/X(n-1)
+ |- ACTUAL{X <- Xn}/Xn <: DECL{X <- Xn}
+ so that manifest types rooted at X(n+1) are expanded in terms of X(n),
+ avoiding circularities. The strengthenings ensure that
+ Xn.t = X(n-1).t = ... = X2.t = X1.t.
+ N can be chosen arbitrarily; larger values of N result in more
+ recursive definitions being accepted. A good choice appears to be
+ the number of mutually recursive declarations. *)
+
+ let subst_and_strengthen env s id mty =
+ Mtype.strengthen env (Subst.modtype s mty)
+ (Subst.module_path s (Pident id)) in
+
+ let rec check_incl first_time n env s =
+ if n > 0 then begin
+ (* Generate fresh names Y_i for the rec. bound module idents X_i *)
+ let bindings1 =
+ List.map
+ (fun (id, mty_decl, modl, mty_actual) ->
+ (id, Ident.rename id, mty_actual))
+ bindings in
+ (* Enter the Y_i in the environment with their actual types substituted
+ by the input substitution s *)
+ let env' =
+ List.fold_left
+ (fun env (id, id', mty_actual) ->
+ let mty_actual' =
+ if first_time
+ then mty_actual
+ else subst_and_strengthen env s id mty_actual in
+ Env.add_module id' mty_actual' env)
+ env bindings1 in
+ (* Build the output substitution Y_i <- X_i *)
+ let s' =
+ List.fold_left
+ (fun s (id, id', mty_actual) ->
+ Subst.add_module id (Pident id') s)
+ Subst.identity bindings1 in
+ (* Recurse with env' and s' *)
+ check_incl false (n-1) env' s'
+ end else begin
+ (* Base case: check inclusion of s(mty_actual) in s(mty_decl)
+ and insert coercion if needed *)
+ let check_inclusion (id, mty_decl, modl, mty_actual) =
+ let mty_decl' = Subst.modtype s mty_decl
+ and mty_actual' = subst_and_strengthen env s id mty_actual in
+ let coercion =
+ try
+ Includemod.modtypes env mty_actual' mty_decl'
+ with Includemod.Error msg ->
+ raise(Error(modl.mod_loc, Not_included msg)) in
+ let modl' =
+ { mod_desc = Tmod_constraint(modl, mty_decl, coercion);
+ mod_type = mty_decl;
+ mod_env = env;
+ mod_loc = modl.mod_loc } in
+ (id, modl') in
+ List.map check_inclusion bindings
+ end
+ in check_incl true (List.length bindings) env Subst.identity
+
(* Type a module value expression *)
let rec type_module anchor env smod =
let (decls, newenv) =
transl_recmodule_modtypes loc env
(List.map (fun (name, smty, smodl) -> (name, smty)) sbind) in
- let type_recmodule_binding (id, mty) (name, smty, smodl) =
- let modl =
- type_module (anchor_recmodule id anchor) newenv smodl in
- let coercion =
- try
- Includemod.modtypes newenv
- (Mtype.strengthen env modl.mod_type (Pident id))
- mty
- with Includemod.Error msg ->
- raise(Error(smodl.pmod_loc, Not_included msg)) in
- let modl' =
- { mod_desc = Tmod_constraint(modl, mty, coercion);
- mod_type = mty;
- mod_env = newenv;
- mod_loc = smodl.pmod_loc } in
- (id, modl') in
- let bind = List.map2 type_recmodule_binding decls sbind in
+ let bindings1 =
+ List.map2
+ (fun (id, mty) (name, smty, smodl) ->
+ let modl =
+ type_module (anchor_recmodule id anchor) newenv smodl in
+ let mty' =
+ enrich_module_type anchor (Ident.name id) modl.mod_type newenv in
+ (id, mty, modl, mty'))
+ decls sbind in
+ let bindings2 =
+ check_recmodule_inclusion newenv bindings1 in
let (str_rem, sig_rem, final_env) = type_struct newenv srem in
- (Tstr_recmodule bind :: str_rem,
+ (Tstr_recmodule bindings2 :: str_rem,
map_rec (fun rs (id, modl) -> Tsig_module(id, modl.mod_type, rs))
- bind sig_rem,
+ bindings2 sig_rem,
final_env)
| {pstr_desc = Pstr_modtype(name, smty); pstr_loc = loc} :: srem ->
check "module type" loc modtype_names name;
(* *)
(***********************************************************************)
-(* $Id: types.ml,v 1.26 2006/04/05 02:28:13 garrigue Exp $ *)
+(* $Id: types.ml,v 1.26.8.1 2007/06/08 08:03:16 garrigue Exp $ *)
(* Representation of types and declarations *)
and row_desc =
{ row_fields: (label * row_field) list;
row_more: type_expr;
- row_bound: type_expr list;
+ row_bound: unit;
row_closed: bool;
row_fixed: bool;
row_name: (Path.t * type_expr list) option }
(* *)
(***********************************************************************)
-(* $Id: types.mli,v 1.26 2006/04/05 02:28:13 garrigue Exp $ *)
+(* $Id: types.mli,v 1.26.8.1 2007/06/08 08:03:16 garrigue Exp $ *)
(* Representation of types and declarations *)
and row_desc =
{ row_fields: (label * row_field) list;
row_more: type_expr;
- row_bound: type_expr list;
+ row_bound: unit; (* kept for compatibility *)
row_closed: bool;
row_fixed: bool;
row_name: (Path.t * type_expr list) option }
(fun l -> if not (List.mem_assoc l row.row_fields) then
raise(Error(styp.ptyp_loc, Present_has_no_type l)))
present;
- let bound = ref row.row_bound in
let fields =
List.map
(fun (l,f) -> l,
if List.mem l present then f else
match Btype.row_field_repr f with
| Rpresent (Some ty) ->
- bound := ty :: !bound;
Reither(false, [ty], false, ref None)
| Rpresent None ->
Reither (true, [], false, ref None)
row.row_fields
in
let row = { row_closed = true; row_fields = fields;
- row_bound = !bound; row_name = Some (path, args);
+ row_bound = (); row_name = Some (path, args);
row_fixed = false; row_more = newvar () } in
let static = Btype.static_row row in
let row =
instance t
end
| Ptyp_variant(fields, closed, present) ->
- let bound = ref [] and name = ref None in
+ let name = ref None in
let mkfield l f =
newty (Tvariant {row_fields=[l,f]; row_more=newvar();
- row_bound=[]; row_closed=true;
+ row_bound=(); row_closed=true;
row_fixed=false; row_name=None}) in
- let add_typed_field loc l f fields =
+ let hfields = Hashtbl.create 17 in
+ let add_typed_field loc l f =
+ let h = Btype.hash_variant l in
try
- let f' = List.assoc l fields in
+ let (l',f') = Hashtbl.find hfields h in
+ (* Check for tag conflicts *)
+ if l <> l' then raise(Error(styp.ptyp_loc, Variant_tags(l, l')));
let ty = mkfield l f and ty' = mkfield l f' in
- if equal env false [ty] [ty'] then fields else
- try unify env ty ty'; fields
+ if equal env false [ty] [ty'] then () else
+ try unify env ty ty'
with Unify trace -> raise(Error(loc, Constructor_mismatch (ty,ty')))
with Not_found ->
- (l, f) :: fields
+ Hashtbl.add hfields h (l,f)
in
- let rec add_field fields = function
+ let rec add_field = function
Rtag (l, c, stl) ->
name := None;
let f = match present with
Some present when not (List.mem l present) ->
let tl = List.map (transl_type env policy) stl in
- bound := tl @ !bound;
Reither(c, tl, false, ref None)
| _ ->
if List.length stl > 1 || c && stl <> [] then
match stl with [] -> Rpresent None
| st :: _ -> Rpresent (Some(transl_type env policy st))
in
- add_typed_field styp.ptyp_loc l f fields
+ add_typed_field styp.ptyp_loc l f
| Rinherit sty ->
let ty = transl_type env policy sty in
let nm =
{desc=Tconstr(p, tl, _)} -> Some(p, tl)
| _ -> None
in
- name := if fields = [] then nm else None;
+ begin try
+ (* Set name if there are no fields yet *)
+ Hashtbl.iter (fun _ _ -> raise Exit) hfields;
+ name := nm
+ with Exit ->
+ (* Unset it otherwise *)
+ name := None
+ end;
let fl = match expand_head env ty, nm with
{desc=Tvariant row}, _ when Btype.static_row row ->
let row = Btype.row_repr row in
| _ ->
raise(Error(sty.ptyp_loc, Not_a_variant ty))
in
- List.fold_left
- (fun fields (l, f) ->
+ List.iter
+ (fun (l, f) ->
let f = match present with
Some present when not (List.mem l present) ->
begin match f with
Rpresent(Some ty) ->
- bound := ty :: !bound;
Reither(false, [ty], false, ref None)
| Rpresent None ->
Reither(true, [], false, ref None)
end
| _ -> f
in
- add_typed_field sty.ptyp_loc l f fields)
- fields fl
+ add_typed_field sty.ptyp_loc l f)
+ fl
in
- let fields = List.fold_left add_field [] fields in
+ List.iter add_field fields;
+ let fields = Hashtbl.fold (fun _ p l -> p :: l) hfields [] in
begin match present with None -> ()
| Some present ->
List.iter
raise(Error(styp.ptyp_loc, Present_has_no_type l)))
present
end;
- (* Check for tag conflicts *)
- let ht = Hashtbl.create (List.length fields + 1) in
- List.iter
- (fun (l,_) ->
- let h = Btype.hash_variant l in
- try
- let l' = Hashtbl.find ht h in
- if l <> l' then raise(Error(styp.ptyp_loc, Variant_tags(l, l')))
- with Not_found ->
- Hashtbl.add ht h l)
- fields;
let row =
{ row_fields = List.rev fields; row_more = newvar ();
- row_bound = !bound; row_closed = closed;
+ row_bound = (); row_closed = closed;
row_fixed = false; row_name = !name } in
let static = Btype.static_row row in
let row =
- if static || policy <> Univars then row
- else { row with row_more = new_pre_univar () }
+ if static then row else
+ match policy with
+ Fixed ->
+ raise (Error (styp.ptyp_loc, Unbound_type_variable ".."))
+ | Extensible -> row
+ | Univars -> { row with row_more = new_pre_univar () }
in
newty (Tvariant row)
| Ptyp_poly(vars, st) ->
(* *)
(***********************************************************************)
-(* $Id: ccomp.ml,v 1.21 2007/02/25 14:58:21 xleroy Exp $ *)
+(* $Id: ccomp.ml,v 1.21.2.1 2007/11/10 12:23:37 xleroy Exp $ *)
(* Compiling C files and building C libraries *)
then build_diversion lst
else s
+let quote_optfile = function
+ | None -> ""
+ | Some f -> Filename.quote f
+
let compile_file name =
command
(Printf.sprintf
(* *)
(***********************************************************************)
-(* $Id: ccomp.mli,v 1.11 2006/09/23 08:51:31 xleroy Exp $ *)
+(* $Id: ccomp.mli,v 1.11.6.1 2007/11/10 12:23:37 xleroy Exp $ *)
(* Compiling C files and building C libraries *)
val create_archive: string -> string list -> int
val expand_libname: string -> string
val quote_files: string list -> string
+val quote_optfile: string option -> string
val make_link_options: string list -> string
val merge_manifest: string -> int