summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Changes15
-rw-r--r--Makefile15
-rw-r--r--Makefile.nt12
-rw-r--r--VERSION2
-rw-r--r--_tags22
-rw-r--r--asmcomp/i386/emit.mlp2
-rw-r--r--asmcomp/power/emit.mlp35
-rwxr-xr-xboot/myocamlbuild.bootbin1647177 -> 1667336 bytes
-rwxr-xr-xboot/ocamlcbin1021065 -> 1021647 bytes
-rwxr-xr-xboot/ocamldepbin284189 -> 286557 bytes
-rwxr-xr-xboot/ocamllexbin162155 -> 162155 bytes
-rwxr-xr-xbuild/boot-c-parts-windows.sh12
-rwxr-xr-xbuild/boot-c-parts.sh19
-rwxr-xr-xbuild/boot.sh21
-rwxr-xr-xbuild/buildbot109
-rwxr-xr-xbuild/camlp4-bootstrap.sh6
-rwxr-xr-xbuild/camlp4-byte-only.sh6
-rwxr-xr-xbuild/camlp4-native-only.sh6
-rw-r--r--build/camlp4-targets.sh7
-rwxr-xr-xbuild/distclean.sh21
-rwxr-xr-xbuild/fastworld.sh3
-rwxr-xr-xbuild/install.sh373
-rwxr-xr-xbuild/mkconfig.sh9
-rwxr-xr-xbuild/mkmyocamlbuild_config.sh1
-rwxr-xr-xbuild/mkruntimedef.sh9
-rwxr-xr-xbuild/myocamlbuild.sh16
-rwxr-xr-xbuild/ocamlbuild-byte-only.sh6
-rwxr-xr-xbuild/ocamlbuild-native-only.sh6
-rw-r--r--build/otherlibs-targets.sh1
-rwxr-xr-xbuild/partial-boot.sh4
-rwxr-xr-xbuild/partial-install.sh43
-rw-r--r--build/targets.sh15
-rwxr-xr-xbuild/world.all.sh1
-rwxr-xr-xbuild/world.byte.sh1
-rwxr-xr-xbuild/world.native.sh1
-rwxr-xr-xbuild/world.sh1
-rw-r--r--byterun/config.h2
-rw-r--r--byterun/globroots.c10
-rw-r--r--byterun/globroots.h4
-rw-r--r--camlp4/Camlp4/Camlp4Ast.partial.ml21
-rw-r--r--camlp4/Camlp4/ErrorHandler.ml4
-rw-r--r--camlp4/Camlp4/OCamlInitSyntax.ml86
-rw-r--r--camlp4/Camlp4/PreCast.ml3
-rw-r--r--camlp4/Camlp4/PreCast.mli13
-rw-r--r--camlp4/Camlp4/Printers/DumpCamlp4Ast.ml2
-rw-r--r--camlp4/Camlp4/Printers/DumpCamlp4Ast.mli3
-rw-r--r--camlp4/Camlp4/Printers/DumpOCamlAst.ml2
-rw-r--r--camlp4/Camlp4/Printers/DumpOCamlAst.mli3
-rw-r--r--camlp4/Camlp4/Printers/Null.mli2
-rw-r--r--camlp4/Camlp4/Printers/OCaml.ml95
-rw-r--r--camlp4/Camlp4/Printers/OCaml.mli13
-rw-r--r--camlp4/Camlp4/Printers/OCamlr.ml51
-rw-r--r--camlp4/Camlp4/Printers/OCamlr.mli10
-rw-r--r--camlp4/Camlp4/Register.ml27
-rw-r--r--camlp4/Camlp4/Register.mli17
-rw-r--r--camlp4/Camlp4/Sig.ml291
-rw-r--r--camlp4/Camlp4/Struct.mlpack2
-rw-r--r--camlp4/Camlp4/Struct/Camlp4Ast.mlast276
-rw-r--r--camlp4/Camlp4/Struct/Camlp4Ast2OCamlAst.ml62
-rw-r--r--camlp4/Camlp4/Struct/CleanAst.ml11
-rw-r--r--camlp4/Camlp4/Struct/CommentFilter.mli2
-rw-r--r--camlp4/Camlp4/Struct/DynAst.ml91
-rw-r--r--camlp4/Camlp4/Struct/EmptyPrinter.ml2
-rw-r--r--camlp4/Camlp4/Struct/EmptyPrinter.mli2
-rw-r--r--camlp4/Camlp4/Struct/FreeVars.ml5
-rw-r--r--camlp4/Camlp4/Struct/Grammar/Context.ml6
-rw-r--r--camlp4/Camlp4/Struct/Grammar/Parser.mli70
-rw-r--r--camlp4/Camlp4/Struct/Grammar/Print.ml4
-rw-r--r--camlp4/Camlp4/Struct/Lexer.mll89
-rw-r--r--camlp4/Camlp4/Struct/Quotation.ml72
-rw-r--r--camlp4/Camlp4/Struct/Token.ml2
-rw-r--r--camlp4/Camlp4/Struct/Warning.ml26
-rw-r--r--camlp4/Camlp4Bin.ml29
-rw-r--r--camlp4/Camlp4Filters/Camlp4FoldGenerator.ml39
-rw-r--r--camlp4/Camlp4Filters/Camlp4LocationStripper.ml2
-rw-r--r--camlp4/Camlp4Filters/Camlp4MapGenerator.ml44
-rw-r--r--camlp4/Camlp4Filters/Camlp4Tracer.ml2
-rw-r--r--camlp4/Camlp4Filters/Camlp4TrashRemover.ml2
-rw-r--r--camlp4/Camlp4Parsers/Camlp4GrammarParser.ml7
-rw-r--r--camlp4/Camlp4Parsers/Camlp4MacroParser.ml186
-rw-r--r--camlp4/Camlp4Parsers/Camlp4OCamlOriginalQuotationExpander.ml2
-rw-r--r--camlp4/Camlp4Parsers/Camlp4OCamlParser.ml335
-rw-r--r--camlp4/Camlp4Parsers/Camlp4OCamlReloadedParser.ml94
-rw-r--r--camlp4/Camlp4Parsers/Camlp4OCamlRevisedParser.ml520
-rw-r--r--camlp4/Camlp4Parsers/Camlp4OCamlRevisedParserParser.ml7
-rw-r--r--camlp4/Camlp4Parsers/Camlp4OCamlRevisedQuotationExpander.ml2
-rw-r--r--camlp4/Camlp4Parsers/Camlp4QuotationCommon.ml32
-rw-r--r--camlp4/Camlp4Top/Rprint.ml2
-rw-r--r--camlp4/Camlp4Top/Top.ml4
-rw-r--r--camlp4/Camlp4_config.ml1
-rw-r--r--camlp4/Camlp4_config.mli1
-rw-r--r--camlp4/boot/Camlp4.ml5768
-rw-r--r--camlp4/boot/Camlp4.ml42
-rw-r--r--camlp4/boot/Camlp4Ast.ml827
-rw-r--r--camlp4/boot/camlp4boot.ml2867
-rw-r--r--camlp4/boot/camlp4boot.ml41
-rw-r--r--camlp4/camlp4fulllib.mllib42
-rw-r--r--camlp4/examples/_tags8
-rw-r--r--camlp4/examples/apply_operator.ml6
-rw-r--r--camlp4/examples/apply_operator_test.ml1
-rw-r--r--camlp4/examples/lambda_quot.ml38
-rw-r--r--camlp4/examples/lambda_test.ml13
-rw-r--r--camlp4/examples/macros.ml67
-rw-r--r--camlp4/examples/parse_files.ml31
-rw-r--r--camlp4/examples/test_macros.ml15
-rw-r--r--camlp4/examples/test_type_quotation.ml3
-rw-r--r--camlp4/examples/type_quotation.ml18
-rw-r--r--camlp4/test/fixtures/macrotest.ml15
-rw-r--r--config/Makefile.msvc18
-rwxr-xr-xconfigure16
-rw-r--r--man/ocaml.m2
-rw-r--r--myocamlbuild.ml164
-rw-r--r--ocamlbuild/ChangeLog145
-rw-r--r--ocamlbuild/Makefile5
-rw-r--r--ocamlbuild/TODO1
-rw-r--r--ocamlbuild/command.ml8
-rw-r--r--ocamlbuild/command.mli2
-rw-r--r--ocamlbuild/examples/example_with_C/_tags1
-rw-r--r--ocamlbuild/examples/example_with_C/fib.ml5
-rw-r--r--ocamlbuild/examples/example_with_C/fibwrap.c7
-rw-r--r--ocamlbuild/examples/example_with_C/main.c10
-rw-r--r--ocamlbuild/examples/example_with_C/myocamlbuild.ml35
-rw-r--r--ocamlbuild/examples/example_with_C/x.ml1
-rw-r--r--ocamlbuild/executor.ml16
-rw-r--r--ocamlbuild/main.ml2
-rw-r--r--ocamlbuild/manual/manual.tex15
-rw-r--r--ocamlbuild/my_std.ml25
-rw-r--r--ocamlbuild/my_unix.ml2
-rw-r--r--ocamlbuild/my_unix_with_unix.ml4
-rw-r--r--ocamlbuild/ocaml_compiler.ml31
-rw-r--r--ocamlbuild/ocaml_specific.ml35
-rw-r--r--ocamlbuild/ocaml_tools.ml13
-rw-r--r--ocamlbuild/ocaml_utils.ml22
-rw-r--r--ocamlbuild/ocamlbuild-presentation.rslide1
-rw-r--r--ocamlbuild/ocamlbuild_where.mli5
-rw-r--r--ocamlbuild/ocamldep.ml18
-rw-r--r--ocamlbuild/ocamldep.mli6
-rw-r--r--ocamlbuild/options.ml54
-rw-r--r--ocamlbuild/pathname.ml24
-rw-r--r--ocamlbuild/plugin.ml2
-rw-r--r--ocamlbuild/rule.ml18
-rw-r--r--ocamlbuild/rule.mli5
-rw-r--r--ocamlbuild/shell.ml26
-rw-r--r--ocamlbuild/signatures.mli7
-rwxr-xr-xocamlbuild/start.sh2
-rw-r--r--ocamlbuild/test/good-output193
-rwxr-xr-xocamlbuild/test/test7/test.sh5
-rw-r--r--ocamlbuild/test/test8/myocamlbuild.ml2
-rw-r--r--ocamldoc/odoc_args.ml1
-rw-r--r--ocamldoc/odoc_config.ml6
-rw-r--r--ocamldoc/odoc_config.mli3
-rw-r--r--ocamldoc/odoc_info.ml1
-rw-r--r--ocamldoc/odoc_info.mli3
-rw-r--r--ocamldoc/odoc_messages.ml3
-rw-r--r--otherlibs/labltk/support/Makefile6
-rw-r--r--otherlibs/labltk/support/tkthread.ml4
-rw-r--r--otherlibs/labltk/support/tkthread.mli12
-rw-r--r--otherlibs/num/.depend2
-rw-r--r--otherlibs/systhreads/Makefile4
-rw-r--r--parsing/printast.ml15
-rw-r--r--stdlib/scanf.mli46
-rw-r--r--typing/ctype.ml14
-rw-r--r--typing/oprint.ml8
-rw-r--r--typing/typecore.ml14
-rw-r--r--typing/typedecl.ml5
-rw-r--r--typing/typemod.ml50
-rw-r--r--typing/typetexp.ml20
-rw-r--r--win32caml/inria.h8
168 files changed, 8987 insertions, 5405 deletions
diff --git a/Changes b/Changes
index 546650ba9..154b9c677 100644
--- a/Changes
+++ b/Changes
@@ -8,21 +8,23 @@ Standard library:
Objective Caml 3.10.0:
----------------------
+(Changes that can break existing programs are marked with a "*" )
+
Language features:
- Added virtual instance variables in classes "val virtual v : t"
-- Changed the behaviour of instance variable overriding; the new
+* Changed the behaviour of instance variable overriding; the new
definition replaces the old one, rather than creating a new
variable.
New tools:
- ocamlbuild: compilation manager for OCaml applications and libraries.
- See description in reference manual.
-- Camlp4: heavily revised implementation, new API.
+ See draft documentation at http://gallium.inria.fr/~pouillar/
+* Camlp4: heavily revised implementation, new API.
New ports:
-- MacOSX PowerPC 64 bits.
-- MS Windows 32 bits using the Visual Studio 2005 toolchain.
+- MacOS X PowerPC 64 bits.
- MS Windows 64 bits (x64) using the Microsoft PSDK toolchain.
+- MS Windows 32 bits using the Visual Studio 2005 toolchain.
Compilers:
- Faster type-checking of functor applications.
@@ -72,8 +74,9 @@ Other libraries:
better handling of channels opened on sockets (PR#4098);
fixed GC bug in Unix.system (PR#4112).
-OCamldoc:
+Documentation generator (OCamldoc):
- correctly handle '?' in value names (PR#4215)
+- new option -hide-warnings not to print ocamldoc warnings
Lexer generator (ocamllex): improved error reporting.
diff --git a/Makefile b/Makefile
index f33abeb04..2f1c047b0 100644
--- a/Makefile
+++ b/Makefile
@@ -145,7 +145,7 @@ coreboot:
$(MAKE) promote-cross
# Rebuild ocamlc and ocamllex (run on byterun/ocamlrun)
$(MAKE) partialclean
- $(MAKE) ocamlc ocamllex
+ $(MAKE) ocamlc ocamllex ocamltools
# Rebuild the library (using byterun/ocamlrun ./ocamlc)
$(MAKE) library-cross
# Promote the new compiler and the new runtime
@@ -189,7 +189,7 @@ backup:
mkdir boot/Saved
mv boot/Saved.prev boot/Saved/Saved.prev
cp boot/ocamlrun$(EXE) boot/Saved
- mv boot/ocamlc boot/ocamllex boot/ocamlyacc$(EXE) boot/Saved
+ mv boot/ocamlc boot/ocamllex boot/ocamlyacc$(EXE) boot/ocamldep boot/Saved
cd boot; cp $(LIBFILES) Saved
# Promote the newly compiled system to the rank of cross compiler
@@ -198,6 +198,7 @@ promote-cross:
cp ocamlc boot/ocamlc
cp lex/ocamllex boot/ocamllex
cp yacc/ocamlyacc$(EXE) boot/ocamlyacc$(EXE)
+ cp tools/ocamldep boot/ocamldep
cd stdlib; cp $(LIBFILES) ../boot
# Promote the newly compiled system to the rank of bootstrap compiler
@@ -213,7 +214,7 @@ restore:
# Check if fixpoint reached
compare:
- @if cmp boot/ocamlc ocamlc && cmp boot/ocamllex lex/ocamllex; \
+ @if cmp boot/ocamlc ocamlc && cmp boot/ocamllex lex/ocamllex && cmp boot/ocamldep tools/ocamldep; \
then echo "Fixpoint reached, bootstrap succeeded."; \
else echo "Fixpoint not reached, try one more bootstrapping cycle."; \
fi
@@ -261,7 +262,7 @@ install: FORCE
if test -f debugger/ocamldebug; then (cd debugger; $(MAKE) install); \
else :; fi
cp config/Makefile $(LIBDIR)/Makefile.config
- ./build/partial-install.sh
+ BINDIR=$(BINDIR) LIBDIR=$(LIBDIR) PREFIX=$(PREFIX) ./build/partial-install.sh
# Installation of the native-code compiler
installopt:
@@ -609,8 +610,6 @@ camlp4out: ocamlc otherlibraries ocamlbuild-partial-boot ocamlbuild.byte
./build/camlp4-byte-only.sh
camlp4opt: ocamlopt otherlibrariesopt ocamlbuild-partial-boot ocamlbuild.native
./build/camlp4-native-only.sh
-partialclean::
- rm -rf _build/camlp4
# Ocamlbuild
@@ -618,12 +617,12 @@ ocamlbuild.byte: ocamlc otherlibraries ocamlbuild-partial-boot
./build/ocamlbuild-byte-only.sh
ocamlbuild.native: ocamlopt otherlibrariesopt ocamlbuild-partial-boot
./build/ocamlbuild-native-only.sh
-partialclean::
- rm -rf _build/ocamlbuild
.PHONY: ocamlbuild-partial-boot
ocamlbuild-partial-boot:
./build/partial-boot.sh
+partialclean::
+ rm -rf _build
# Check that the stack limit is reasonable.
diff --git a/Makefile.nt b/Makefile.nt
index 60d8db6f4..ec8b91b1b 100644
--- a/Makefile.nt
+++ b/Makefile.nt
@@ -131,7 +131,7 @@ bootstrap:
$(MAKEREC) promote-cross
# Rebuild ocamlc and ocamllex (run on byterun/ocamlrun)
$(MAKEREC) partialclean
- $(MAKEREC) ocamlc ocamllex
+ $(MAKEREC) ocamlc ocamllex ocamltools
# Rebuild the library (using byterun/ocamlrun ./ocamlc)
$(MAKEREC) library-cross
# Promote the new compiler and the new runtime
@@ -166,7 +166,7 @@ backup:
mkdir boot/Saved
mv boot/Saved.prev boot/Saved/Saved.prev
cp boot/ocamlrun.exe boot/Saved/ocamlrun.exe
- cd boot ; mv ocamlc ocamllex ocamlyacc.exe Saved
+ cd boot ; mv ocamlc ocamllex ocamldep ocamlyacc.exe Saved
cd boot ; cp $(LIBFILES) Saved
# Promote the newly compiled system to the rank of cross compiler
@@ -175,6 +175,7 @@ promote-cross:
cp ocamlc boot/ocamlc
cp lex/ocamllex boot/ocamllex
cp yacc/ocamlyacc.exe boot/ocamlyacc.exe
+ cp tools/ocamldep boot/ocamldep
cd stdlib ; cp $(LIBFILES) ../boot
# Promote the newly compiled system to the rank of bootstrap compiler
@@ -192,6 +193,7 @@ restore:
compare:
- cmp -i 4096 boot/ocamlc ocamlc
- cmp -i 4096 boot/ocamllex lex/ocamllex
+ - cmp -i 4096 boot/ocamldep tools/ocamldep
# Remove old bootstrap compilers
cleanboot:
@@ -568,8 +570,6 @@ camlp4out: ocamlc otherlibraries ocamlbuild-partial-boot ocamlbuild.byte
./build/camlp4-byte-only.sh
camlp4opt: ocamlopt otherlibrariesopt ocamlbuild-partial-boot ocamlbuild.native
./build/camlp4-native-only.sh
-partialclean::
- rm -rf _build/camlp4
# Ocamlbuild
@@ -577,12 +577,12 @@ ocamlbuild.byte: ocamlc otherlibraries ocamlbuild-partial-boot
./build/ocamlbuild-byte-only.sh
ocamlbuild.native: ocamlopt otherlibrariesopt ocamlbuild-partial-boot
./build/ocamlbuild-native-only.sh
-partialclean::
- rm -rf _build/ocamlbuild
.PHONY: ocamlbuild-partial-boot
ocamlbuild-partial-boot:
./build/partial-boot.sh
+partialclean::
+ rm -rf _build
# The Win32 toplevel GUI
diff --git a/VERSION b/VERSION
index ae4108de2..2fa41a2dd 100644
--- a/VERSION
+++ b/VERSION
@@ -1,4 +1,4 @@
-3.11+dev3 (2007-10-04)
+3.11+dev4 (2007-10-08)
# The version string is the first line of this file.
# It must be in the format described in stdlib/sys.mli
diff --git a/_tags b/_tags
index 6856ef9a1..6dd67f0e1 100644
--- a/_tags
+++ b/_tags
@@ -3,31 +3,41 @@
true: -traverse
# Traverse only these directories
-<{bytecomp,driver,stdlib,tools,asmcomp,camlp4,ocamlbuild,toplevel,ocamldoc,typing,otherlibs,utils,debugger,lex,parsing,byterun}/**>: traverse
+<{bytecomp,driver,stdlib,tools,asmcomp,camlp4,ocamlbuild,toplevel,ocamldoc,typing,otherlibs,utils,debugger,lex,parsing,byterun,asmrun}/**>: traverse
-"boot" or "byterun": not_hygienic
+"boot" or "byterun" or "asmrun": not_hygienic
# These should not be required but it fails on *BSD and Windows...
-"yacc" or "asmrun" or "win32caml": not_hygienic
+"yacc" or "win32caml": not_hygienic
+
+# We want -g everywhere it's possible
+true: debug
+
+# By default everything we link needs the stdlib
+true: use_stdlib
+
+# The stdlib don't require the stdlib
+<stdlib/**>: -use_stdlib
<**/*.ml*>: warn_Alez
"toplevel/topstart.byte": linkall
+<ocamldoc/**>: -debug
<ocamldoc/*.ml>: ocamldoc_sources
<ocamldoc/*.ml*>: include_unix, include_str, include_dynlink
"ocamldoc/odoc.byte": use_unix, use_str, use_dynlink
"ocamldoc/odoc_opt.native": use_unix, use_str
-<camlp4/**>: debug
<camlp4/**/*.ml*>: camlp4boot, -warn_Alez, warn_Ale
<camlp4/Camlp4_config.ml*>: -camlp4boot
-<camlp4/build/*> or <camlp4/boot/*> or "camlp4/Camlp4/Struct/Lexer.ml": -camlp4boot, -warn_Ale, warn_a, -debug
+<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
<camlp4/Camlp4Printers/**.ml>: include_unix
"camlp4/Camlp4/Struct/DynLoader.ml": include_dynlink
<camlp4/Camlp4Top/**>: include_toplevel
+<camlp4/camlp4{,boot,o,r,of,rf,oof,orf}.byte>: -debug
<ocamlbuild/*>: -warn_Alez, include_unix
@@ -52,8 +62,6 @@ true: -traverse
# See the remark about static linking of threads.cmxa in myocamlbuild.ml
<otherlibs/systhreads/threads.cma>: ocamlmklib
-<**/*.ml{,i}>: include_stdlib
-"otherlibs/threads/unix.ml" or "otherlibs/threads/marshal.ml": -include_stdlib, include_threads_stdlib
"otherlibs/threads/pervasives.ml": include_unix
<otherlibs/**>: otherlibs
diff --git a/asmcomp/i386/emit.mlp b/asmcomp/i386/emit.mlp
index b8191771a..b50ecff27 100644
--- a/asmcomp/i386/emit.mlp
+++ b/asmcomp/i386/emit.mlp
@@ -979,7 +979,7 @@ let end_assembly() =
efa_word = (fun n -> ` .long {emit_int n}\n`);
efa_align = emit_align;
efa_label_rel = (fun lbl ofs ->
- ` .long ({emit_label lbl} - .) + {emit_int32 ofs}\n`);
+ ` .long {emit_label lbl} - . + {emit_int32 ofs}\n`);
efa_def_label = (fun l -> `{emit_label l}:\n`);
efa_string = (fun s ->
let s = s ^ "\000" in
diff --git a/asmcomp/power/emit.mlp b/asmcomp/power/emit.mlp
index 46702e37e..81a1894e5 100644
--- a/asmcomp/power/emit.mlp
+++ b/asmcomp/power/emit.mlp
@@ -312,12 +312,6 @@ let tailrec_entry_point = ref 0
let defined_functions = ref StringSet.empty
(* Label of glue code for calling the GC *)
let call_gc_label = ref 0
-(* Label of jump table *)
-let lbl_jumptbl = ref 0
-(* List of all labels in jumptable (reverse order) *)
-let jumptbl_entries = ref []
-(* Number of jumptable entries *)
-let num_jumptbl_entries = ref 0
(* Fixup conditional branches that exceed hardware allowed range *)
@@ -746,19 +740,20 @@ let rec emit_instr i dslot =
| Some lbl -> ` bgt {emit_label lbl}\n`
end
| Lswitch jumptbl ->
- if !lbl_jumptbl = 0 then lbl_jumptbl := new_label();
- ` addis {emit_gpr 11}, 0, {emit_upper emit_label !lbl_jumptbl}\n`;
- ` addi {emit_gpr 11}, {emit_gpr 11}, {emit_lower emit_label !lbl_jumptbl}\n`;
- ` addi {emit_gpr 0}, {emit_reg i.arg.(0)}, {emit_int !num_jumptbl_entries}\n`;
- ` {emit_string slgi} {emit_gpr 0}, {emit_gpr 0}, 2\n`;
+ let lbl = new_label() in
+ ` addis {emit_gpr 11}, 0, {emit_upper emit_label lbl}\n`;
+ ` addi {emit_gpr 11}, {emit_gpr 11}, {emit_lower emit_label lbl}\n`;
+ ` {emit_string slgi} {emit_gpr 0}, {emit_reg i.arg.(0)}, 2\n`;
` {emit_string lwa}x {emit_gpr 0}, {emit_gpr 11}, {emit_gpr 0}\n`;
` add {emit_gpr 0}, {emit_gpr 11}, {emit_gpr 0}\n`;
` mtctr {emit_gpr 0}\n`;
` bctr\n`;
+ emit_string rodata_space;
+ `{emit_label lbl}:`;
for i = 0 to Array.length jumptbl - 1 do
- jumptbl_entries := jumptbl.(i) :: !jumptbl_entries;
- incr num_jumptbl_entries
- done
+ ` .long {emit_label jumptbl.(i)} - {emit_label lbl}\n`
+ done;
+ emit_string code_space
| Lsetuptrap lbl ->
` bl {emit_label lbl}\n`
| Lpushtrap ->
@@ -926,9 +921,6 @@ let data l =
let begin_assembly() =
defined_functions := StringSet.empty;
external_functions := StringSet.empty;
- num_jumptbl_entries := 0;
- jumptbl_entries := [];
- lbl_jumptbl := 0;
(* Emit the beginning of the segments *)
let lbl_begin = Compilenv.make_symbol (Some "data_begin") in
emit_string data_space;
@@ -940,15 +932,6 @@ let begin_assembly() =
`{emit_symbol lbl_begin}:\n`
let end_assembly() =
- (* Emit the jump table *)
- if !num_jumptbl_entries > 0 then begin
- emit_string code_space;
- `{emit_label !lbl_jumptbl}:\n`;
- List.iter
- (fun lbl -> ` .long {emit_label lbl} - {emit_label !lbl_jumptbl}\n`)
- (List.rev !jumptbl_entries);
- jumptbl_entries := []
- end;
if pic_externals then
(* Emit the pointers to external functions *)
StringSet.iter emit_external !external_functions;
diff --git a/boot/myocamlbuild.boot b/boot/myocamlbuild.boot
index e868dfe98..3187433c9 100755
--- a/boot/myocamlbuild.boot
+++ b/boot/myocamlbuild.boot
Binary files differ
diff --git a/boot/ocamlc b/boot/ocamlc
index 71250fa9f..7c34fd622 100755
--- a/boot/ocamlc
+++ b/boot/ocamlc
Binary files differ
diff --git a/boot/ocamldep b/boot/ocamldep
index ef85504aa..734b04ce8 100755
--- a/boot/ocamldep
+++ b/boot/ocamldep
Binary files differ
diff --git a/boot/ocamllex b/boot/ocamllex
index 1f74727b8..6c31d1dd9 100755
--- a/boot/ocamllex
+++ b/boot/ocamllex
Binary files differ
diff --git a/build/boot-c-parts-windows.sh b/build/boot-c-parts-windows.sh
index f028c9522..45193d338 100755
--- a/build/boot-c-parts-windows.sh
+++ b/build/boot-c-parts-windows.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+# $Id$
cd `dirname $0`/..
set -ex
@@ -10,7 +11,9 @@ set -ex
(cd win32caml && make)
mkdir -p _build/boot
-cp -f byterun/{ocamlrun.exe,libcamlrun.$A,ocamlrun.dll} \
+cp -f byterun/ocamlrun.exe \
+ byterun/libcamlrun.$A \
+ byterun/ocamlrun.dll \
asmrun/libasmrun.$A \
yacc/ocamlyacc.exe \
boot/ocamlc \
@@ -20,10 +23,3 @@ cp -f byterun/{ocamlrun.exe,libcamlrun.$A,ocamlrun.dll} \
mkdir -p _build/byterun
cp -f byterun/ocamlrun.exe byterun/ocamlrun.dll boot
cp -f byterun/ocamlrun.$A _build/byterun
-mkdir -p _build/stdlib
-cp -f byterun/libcamlrun.$A \
- asmrun/libasmrun.$A \
- _build/stdlib
-mkdir -p _build/asmrun
-cp -f asmrun/{meta,dynlink}.$O \
- _build/asmrun
diff --git a/build/boot-c-parts.sh b/build/boot-c-parts.sh
index 5146a4fdb..a38c16410 100755
--- a/build/boot-c-parts.sh
+++ b/build/boot-c-parts.sh
@@ -1,24 +1,21 @@
#!/bin/sh
+# $Id$
cd `dirname $0`/..
set -ex
-# Create a bunch of symlinks to _build/{boot,stdlib,asmrun}
+# Create a bunch of symlinks to _build/boot
mkdir -p _build/boot
-ln -sf ../../byterun/{ocamlrun,libcamlrun.a} \
- ../../asmrun/libasmrun{,p}.a \
+ln -sf ../../byterun/ocamlrun \
+ ../../byterun/libcamlrun.a \
+ ../../asmrun/libasmrun.a \
+ ../../asmrun/libasmrunp.a \
../../yacc/ocamlyacc \
../../boot/ocamlc \
../../boot/ocamllex \
../../boot/ocamldep \
_build/boot
-ln -sf ../byterun/ocamlrun boot
-mkdir -p _build/stdlib
-ln -sf ../../byterun/libcamlrun.a \
- ../../asmrun/libasmrun{,p}.a \
- _build/stdlib
-mkdir -p _build/asmrun
-ln -sf ../../asmrun/{meta,dynlink}.o \
- _build/asmrun
+
+[ -f boot/ocamlrun ] || ln -sf ../byterun/ocamlrun boot
(cd byterun && make)
(cd asmrun && make all meta.o dynlink.o)
diff --git a/build/boot.sh b/build/boot.sh
index 91eb42038..7329d20b7 100755
--- a/build/boot.sh
+++ b/build/boot.sh
@@ -1,12 +1,23 @@
#!/bin/sh
+# $Id$
cd `dirname $0`/..
set -ex
-./boot/ocamlrun boot/myocamlbuild.boot boot/stdlib.cma boot/std_exit.cmo
-boot/ocamlrun boot/myocamlbuild.boot -log _boot_log1 \
+TAGLINE='true: -use_stdlib'
+./boot/ocamlrun boot/myocamlbuild.boot \
+ -tag-line "$TAG_LINE" \
+ boot/stdlib.cma boot/std_exit.cmo
+
+boot/ocamlrun boot/myocamlbuild.boot \
+ -tag-line "$TAG_LINE" -log _boot_log1 \
ocamlbuild/ocamlbuildlightlib.cma ocamlbuild/ocamlbuildlight.byte
+
rm -f _build/myocamlbuild
+
boot/ocamlrun boot/myocamlbuild.boot \
- -just-plugin -install-dir _build/ocamlbuild -byte-plugin
+ -just-plugin -install-lib-dir _build/ocamlbuild -byte-plugin
+
cp _build/myocamlbuild boot/myocamlbuild
-./boot/ocamlrun boot/myocamlbuild $@ -log _boot_log2 \
- boot/camlheader ocamlc
+
+./boot/ocamlrun boot/myocamlbuild \
+ -tag-line "$TAG_LINE" \
+ $@ -log _boot_log2 boot/camlheader ocamlc
diff --git a/build/buildbot b/build/buildbot
new file mode 100755
index 000000000..c755852fe
--- /dev/null
+++ b/build/buildbot
@@ -0,0 +1,109 @@
+#!/bin/sh
+
+usage() {
+ echo "Usage: $0 (make|ocb|ocamlbuild) (win (mingw|msvc|msvc64) | <configure-arg>*)"
+ exit 1
+}
+
+logfile="buildbot.log"
+
+finish() {
+ curl -s -0 -F "log=@$logfile" \
+ -F "host=`hostname`" \
+ -F "mode=$mode-$opt_win-$opt_win2" \
+ http://weblog.feydakins.org/dropbox || :
+}
+
+rm -f buildbot.failed
+rm -f $logfile
+
+bad() {
+ touch buildbot.failed
+}
+
+finish_if_bad() {
+ if [ -f buildbot.failed ]; then
+ finish
+ exit 2
+ fi
+}
+
+if figlet "test" > /dev/null 2> /dev/null; then
+ draw="figlet"
+else
+ draw="echo ----------- "
+fi
+
+if echo | tee -a tee.log > /dev/null 2> /dev/null; then
+ tee="tee -a $logfile"
+else
+ tee=:
+fi
+
+rm -f tee.log
+
+log() {
+ $draw $@
+ $tee
+}
+
+mode=$1
+shift 1
+
+case "$mode" in
+ make|ocb|ocamlbuild) : ;;
+ *) usage;;
+esac
+
+case "$1" in
+ win)
+ opt_win=win
+ opt_win2=$2
+ shift 2
+ Makefile=Makefile.nt;;
+ *) Makefile=Makefile;;
+esac
+
+( [ -f config/Makefile ] && make -f $Makefile clean || : ) 2>&1 | log clean
+
+( ./build/distclean.sh || : ) 2>&1 | log distclean
+
+(cvs -q up -dP -r release310 || bad) 2>&1 | log cvs up
+finish_if_bad
+
+case "$opt_win" in
+win)
+
+ # FIXME
+ sed -e 's/\(OTHERLIBRARIES=.*\) labltk/\1/' \
+ < "config/Makefile.$opt_win2" > config/Makefile || bad
+ finish_if_bad
+
+ cp config/m-nt.h config/m.h || bad
+ finish_if_bad
+ cp config/s-nt.h config/s.h || bad
+ finish_if_bad
+ ;;
+
+*)
+ (./configure --prefix `pwd`/_install $@ || bad) 2>&1 | log configure
+ finish_if_bad
+ ;;
+esac
+
+case "$mode" in
+ make)
+ (make -f $Makefile world opt opt.opt install || bad) 2>&1 | log build install
+ finish_if_bad
+ ;;
+ ocb|ocamlbuild)
+ (./build/fastworld.sh || bad) 2>&1 | log build
+ finish_if_bad
+ (./build/install.sh || bad) 2>&1 | log install
+ finish_if_bad
+ ;;
+esac
+
+(cat _build/not_installed || bad) 2>&1 | log not_installed
+
+finish
diff --git a/build/camlp4-bootstrap.sh b/build/camlp4-bootstrap.sh
index e1458475e..d5b448b16 100755
--- a/build/camlp4-bootstrap.sh
+++ b/build/camlp4-bootstrap.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+# $Id$
set -e
cd `dirname $0`/..
@@ -25,4 +26,9 @@ $OCAMLBUILD $TMPTARGETS $TARGETS
for t in $TARGETS; do
echo promote $t
cp _build/$t camlp4/boot/`basename $t`
+ if cmp _build/$t camlp4/boot/`basename $t`.old; then
+ echo fixpoint for $t
+ else
+ echo $t is different, you should rebootstrap it by cleaning, building and call this script
+ fi
done
diff --git a/build/camlp4-byte-only.sh b/build/camlp4-byte-only.sh
index 4085b9b2b..1b2e35996 100755
--- a/build/camlp4-byte-only.sh
+++ b/build/camlp4-byte-only.sh
@@ -1,7 +1,9 @@
#!/bin/sh
+# $Id$
set -e
-export OCAMLBUILD_PARTIAL="true"
+OCAMLBUILD_PARTIAL="true"
+export OCAMLBUILD_PARTIAL
cd `dirname $0`/..
. build/targets.sh
set -x
-$OCAMLBUILD $@ $OCAMLC_BYTE $OCAMLLEX_BYTE $CAMLP4_BYTE
+$OCAMLBUILD $@ byte_stdlib_partial_mode $OCAMLC_BYTE $OCAMLLEX_BYTE $CAMLP4_BYTE
diff --git a/build/camlp4-native-only.sh b/build/camlp4-native-only.sh
index 59cbec374..638aba981 100755
--- a/build/camlp4-native-only.sh
+++ b/build/camlp4-native-only.sh
@@ -1,7 +1,9 @@
#!/bin/sh
+# $Id$
set -e
-export OCAMLBUILD_PARTIAL="true"
+OCAMLBUILD_PARTIAL="true"
+export OCAMLBUILD_PARTIAL
cd `dirname $0`/..
. build/targets.sh
set -x
-$OCAMLBUILD $@ $OCAMLOPT_BYTE $OCAMLLEX_BYTE $CAMLP4_NATIVE
+$OCAMLBUILD $@ native_stdlib_partial_mode $OCAMLOPT_BYTE $OCAMLLEX_BYTE $CAMLP4_NATIVE
diff --git a/build/camlp4-targets.sh b/build/camlp4-targets.sh
index 32b55db64..7c68906a4 100644
--- a/build/camlp4-targets.sh
+++ b/build/camlp4-targets.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+# $Id$
CAMLP4_COMMON="\
camlp4/Camlp4/Camlp4Ast.partial.ml \
camlp4/boot/camlp4boot.byte"
@@ -7,13 +8,15 @@ CAMLP4_BYTE="$CAMLP4_COMMON \
camlp4/Camlp4Top.cmo \
camlp4/camlp4prof.byte$EXE \
camlp4/mkcamlp4.byte$EXE \
- camlp4/camlp4.byte$EXE"
+ camlp4/camlp4.byte$EXE \
+ camlp4/camlp4fulllib.cma"
CAMLP4_NATIVE="$CAMLP4_COMMON \
camlp4/Camlp4.cmx \
camlp4/Camlp4Top.cmx \
camlp4/camlp4prof.native$EXE \
camlp4/mkcamlp4.native$EXE \
- camlp4/camlp4.native$EXE"
+ camlp4/camlp4.native$EXE \
+ camlp4/camlp4fulllib.cmxa"
for i in camlp4boot camlp4r camlp4rf camlp4o camlp4of camlp4oof camlp4orf; do
CAMLP4_BYTE="$CAMLP4_BYTE camlp4/$i.byte$EXE camlp4/$i.cma"
diff --git a/build/distclean.sh b/build/distclean.sh
index 606ebb5e7..e9db93934 100755
--- a/build/distclean.sh
+++ b/build/distclean.sh
@@ -1,9 +1,10 @@
#!/bin/sh
+# $Id$
cd `dirname $0`/..
set -ex
-(cd byterun && make clean)
-(cd asmrun && make clean)
-(cd yacc && make clean)
+(cd byterun && make clean) || :
+(cd asmrun && make clean) || :
+(cd yacc && make clean) || :
rm -rf _build
rm -f boot/ocamlrun boot/ocamlrun.exe boot/camlheader \
boot/myocamlbuild boot/myocamlbuild.native boot/myocamlbuild.native.exe \
@@ -12,13 +13,17 @@ rm -f boot/ocamlrun boot/ocamlrun.exe boot/camlheader \
# from partial boot
rm -f driver/main.byte driver/optmain.byte lex/main.byte \
- tools/ocamlmklib.byte camlp4/build/location.ml{,i} \
- tools/myocamlbuild_config.ml camlp4/build/linenum.ml{i,l} \
- camlp4/build/terminfo.ml{i,}
+ tools/ocamlmklib.byte camlp4/build/location.ml \
+ camlp4/build/location.mli \
+ tools/myocamlbuild_config.ml camlp4/build/linenum.mli \
+ camlp4/build/linenum.mll \
+ camlp4/build/terminfo.mli camlp4/build/terminfo.ml
# from ocamlbuild bootstrap
-rm -f ocamlbuild/{_log,ocamlbuild.byte.start,boot/ocamlbuild}
-rm -rf ocamlbuild/{_build,_start}
+rm -f ocamlbuild/_log ocamlbuild/,ocamlbuild.byte.start \
+ ocamlbuild/boot/ocamlbuild ocamlbuild/myocamlbuild_config.ml \
+ ocamlbuild/myocamlbuild_config.mli
+rm -rf ocamlbuild/_build ocamlbuild/_start
# from the old build system
rm -f camlp4/build/camlp4_config.ml camlp4/**/*.cm*
diff --git a/build/fastworld.sh b/build/fastworld.sh
index 16b4b9b32..59e093a19 100755
--- a/build/fastworld.sh
+++ b/build/fastworld.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+# $Id$
cd `dirname $0`
set -e
./mkconfig.sh
@@ -21,7 +22,7 @@ $OCAMLBUILD $@ -log _boot_fast_log \
rm -f _build/myocamlbuild
boot/ocamlrun boot/myocamlbuild \
- -just-plugin -install-dir _build/ocamlbuild \
+ -just-plugin -install-lib-dir _build/ocamlbuild \
-ocamlopt "../_build/ocamlopt.opt -nostdlib -I boot -I stdlib -I $UNIXDIR"
cp _build/myocamlbuild boot/myocamlbuild.native
diff --git a/build/install.sh b/build/install.sh
index 5a640ebf6..12f326074 100755
--- a/build/install.sh
+++ b/build/install.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+# $Id$
set -e
cd `dirname $0`/..
@@ -8,9 +9,11 @@ cd `dirname $0`/..
not_installed=$PWD/_build/not_installed
rm -f "$not_installed"
+touch "$not_installed"
wontinstall() {
echo "$1" >> "$not_installed"
+ echo " don't install $1"
}
installbin() {
@@ -44,7 +47,9 @@ installlib() {
dest="$2/`basename $1`"
echo " install library $dest"
cp -f "$1" "$2"
- ranlib "$dest"
+ if [ "$RANLIB" != "" ]; then
+ "$RANLIB" "$dest"
+ fi
else
wontinstall "$1"
fi
@@ -88,15 +93,14 @@ mkdir -p $LIBDIR/threads
mkdir -p $LIBDIR/labltk
mkdir -p $LIBDIR/ocamlbuild
mkdir -p $LIBDIR/ocamldoc
+mkdir -p $LIBDIR/ocamldoc/custom
mkdir -p $STUBLIBDIR
mkdir -p $MANDIR/man1
mkdir -p $MANDIR/man3
mkdir -p $MANDIR/man$MANEXT
echo "Installing core libraries..."
-installlibdir byterun/libcamlrun.{$A,p.$A} \
- asmrun/libasmrun.{$A,p.$A} \
- asmrun/libasmrunp.{$A,p.$A} \
+installlibdir byterun/libcamlrun.$A asmrun/libasmrun.$A asmrun/libasmrunp.$A \
$LIBDIR
PUBLIC_INCLUDES="\
@@ -110,13 +114,20 @@ for i in $PUBLIC_INCLUDES; do
done
cd ..
-installdir otherlibs/{win32,}unix/unixsupport.h $LIBDIR/caml
+WIN32=""
+if [ "x$EXE" = "x.exe" ]; then
+ installbin win32caml/ocamlwin.exe $PREFIX/OCamlWin.exe
+ installdir byterun/ocamlrun.dll $BINDIR
+ WIN32=win32
+fi
-installdir byterun/ocamlrun.dll yacc/ocamlyacc byterun/ocamlrun $BINDIR
+installdir otherlibs/"$WIN32"unix/unixsupport.h \
+ otherlibs/bigarray/bigarray.h \
+ $LIBDIR/caml
-installdir byterun/ld.conf $LIBDIR
+installdir yacc/ocamlyacc byterun/ocamlrun $BINDIR
-installbin win32caml/ocamlwin.exe $PREFIX/OCamlWin.exe
+installdir byterun/ld.conf $LIBDIR
cd _build
@@ -132,101 +143,101 @@ set=set # coloration workaround
echo "Installing the standard library..."
installdir \
stdlib/stdlib.cma \
- stdlib/stdlib{,.p}.cmxa \
+ stdlib/stdlib.cmxa stdlib/stdlib.p.cmxa \
stdlib/camlheader \
stdlib/camlheader_ur \
stdlib/std_exit.cm[io] \
- stdlib/arg.{cmi,mli} \
- stdlib/array.{cmi,mli} \
- stdlib/arrayLabels.{cmi,mli} \
- stdlib/buffer.{cmi,mli} \
- stdlib/callback.{cmi,mli} \
- stdlib/camlinternalMod.{cmi,mli} \
- stdlib/camlinternalOO.{cmi,mli} \
- stdlib/char.{cmi,mli} \
- stdlib/complex.{cmi,mli} \
- stdlib/digest.{cmi,mli} \
- stdlib/filename.{cmi,mli} \
- stdlib/format.{cmi,mli} \
- stdlib/gc.{cmi,mli} \
- stdlib/genlex.{cmi,mli} \
- stdlib/hashtbl.{cmi,mli} \
- stdlib/int32.{cmi,mli} \
- stdlib/int64.{cmi,mli} \
- stdlib/lazy.{cmi,mli} \
- stdlib/lexing.{cmi,mli} \
- stdlib/list.{cmi,mli} \
- stdlib/listLabels.{cmi,mli} \
- stdlib/map.{cmi,mli} \
- stdlib/marshal.{cmi,mli} \
- stdlib/moreLabels.{cmi,mli} \
- stdlib/nativeint.{cmi,mli} \
- stdlib/obj.{cmi,mli} \
- stdlib/oo.{cmi,mli} \
- stdlib/parsing.{cmi,mli} \
- stdlib/pervasives.{cmi,mli} \
- stdlib/printexc.{cmi,mli} \
- stdlib/printf.{cmi,mli} \
- stdlib/queue.{cmi,mli} \
- stdlib/random.{cmi,mli} \
- stdlib/scanf.{cmi,mli} \
- stdlib/sort.{cmi,mli} \
- stdlib/stack.{cmi,mli} \
- stdlib/stdLabels.{cmi,mli} \
- stdlib/stream.{cmi,mli} \
- stdlib/string.{cmi,mli} \
- stdlib/stringLabels.{cmi,mli} \
- stdlib/sys.{cmi,mli} \
- stdlib/weak.{cmi,mli} \
- stdlib/$set.{cmi,mli} \
- stdlib/arg{,.p}.{cmx,$O} \
- stdlib/array{,.p}.{cmx,$O} \
- stdlib/arrayLabels{,.p}.{cmx,$O} \
- stdlib/buffer{,.p}.{cmx,$O} \
- stdlib/callback{,.p}.{cmx,$O} \
- stdlib/camlinternalMod{,.p}.{cmx,$O} \
- stdlib/camlinternalOO{,.p}.{cmx,$O} \
- stdlib/char{,.p}.{cmx,$O} \
- stdlib/complex{,.p}.{cmx,$O} \
- stdlib/digest{,.p}.{cmx,$O} \
- stdlib/filename{,.p}.{cmx,$O} \
- stdlib/format{,.p}.{cmx,$O} \
- stdlib/gc{,.p}.{cmx,$O} \
- stdlib/genlex{,.p}.{cmx,$O} \
- stdlib/hashtbl{,.p}.{cmx,$O} \
- stdlib/int32{,.p}.{cmx,$O} \
- stdlib/int64{,.p}.{cmx,$O} \
- stdlib/lazy{,.p}.{cmx,$O} \
- stdlib/lexing{,.p}.{cmx,$O} \
- stdlib/list{,.p}.{cmx,$O} \
- stdlib/listLabels{,.p}.{cmx,$O} \
- stdlib/map{,.p}.{cmx,$O} \
- stdlib/marshal{,.p}.{cmx,$O} \
- stdlib/moreLabels{,.p}.{cmx,$O} \
- stdlib/nativeint{,.p}.{cmx,$O} \
- stdlib/obj{,.p}.{cmx,$O} \
- stdlib/oo{,.p}.{cmx,$O} \
- stdlib/parsing{,.p}.{cmx,$O} \
- stdlib/pervasives{,.p}.{cmx,$O} \
- stdlib/printexc{,.p}.{cmx,$O} \
- stdlib/printf{,.p}.{cmx,$O} \
- stdlib/queue{,.p}.{cmx,$O} \
- stdlib/random{,.p}.{cmx,$O} \
- stdlib/scanf{,.p}.{cmx,$O} \
- stdlib/sort{,.p}.{cmx,$O} \
- stdlib/stack{,.p}.{cmx,$O} \
- stdlib/stdLabels{,.p}.{cmx,$O} \
- stdlib/std_exit{,.p}.{cmx,$O} \
- stdlib/stream{,.p}.{cmx,$O} \
- stdlib/string{,.p}.{cmx,$O} \
- stdlib/stringLabels{,.p}.{cmx,$O} \
- stdlib/sys{,.p}.{cmx,$O} \
- stdlib/weak{,.p}.{cmx,$O} \
- stdlib/$set{,.p}.{cmx,$O} \
+ stdlib/arg.cmi stdlib/arg.mli \
+ stdlib/array.cmi stdlib/array.mli \
+ stdlib/arrayLabels.cmi stdlib/arrayLabels.mli \
+ stdlib/buffer.cmi stdlib/buffer.mli \
+ stdlib/callback.cmi stdlib/callback.mli \
+ stdlib/camlinternalMod.cmi stdlib/camlinternalMod.mli \
+ stdlib/camlinternalOO.cmi stdlib/camlinternalOO.mli \
+ stdlib/char.cmi stdlib/char.mli \
+ stdlib/complex.cmi stdlib/complex.mli \
+ stdlib/digest.cmi stdlib/digest.mli \
+ stdlib/filename.cmi stdlib/filename.mli \
+ stdlib/format.cmi stdlib/format.mli \
+ stdlib/gc.cmi stdlib/gc.mli \
+ stdlib/genlex.cmi stdlib/genlex.mli \
+ stdlib/hashtbl.cmi stdlib/hashtbl.mli \
+ stdlib/int32.cmi stdlib/int32.mli \
+ stdlib/int64.cmi stdlib/int64.mli \
+ stdlib/lazy.cmi stdlib/lazy.mli \
+ stdlib/lexing.cmi stdlib/lexing.mli \
+ stdlib/list.cmi stdlib/list.mli \
+ stdlib/listLabels.cmi stdlib/listLabels.mli \
+ stdlib/map.cmi stdlib/map.mli \
+ stdlib/marshal.cmi stdlib/marshal.mli \
+ stdlib/moreLabels.cmi stdlib/moreLabels.mli \
+ stdlib/nativeint.cmi stdlib/nativeint.mli \
+ stdlib/obj.cmi stdlib/obj.mli \
+ stdlib/oo.cmi stdlib/oo.mli \
+ stdlib/parsing.cmi stdlib/parsing.mli \
+ stdlib/pervasives.cmi stdlib/pervasives.mli \
+ stdlib/printexc.cmi stdlib/printexc.mli \
+ stdlib/printf.cmi stdlib/printf.mli \
+ stdlib/queue.cmi stdlib/queue.mli \
+ stdlib/random.cmi stdlib/random.mli \
+ stdlib/scanf.cmi stdlib/scanf.mli \
+ stdlib/sort.cmi stdlib/sort.mli \
+ stdlib/stack.cmi stdlib/stack.mli \
+ stdlib/stdLabels.cmi stdlib/stdLabels.mli \
+ stdlib/stream.cmi stdlib/stream.mli \
+ stdlib/string.cmi stdlib/string.mli \
+ stdlib/stringLabels.cmi stdlib/stringLabels.mli \
+ stdlib/sys.cmi stdlib/sys.mli \
+ stdlib/weak.cmi stdlib/weak.mli \
+ stdlib/$set.cmi stdlib/$set.mli \
+ stdlib/arg.cmx stdlib/arg.p.cmx stdlib/arg.$O stdlib/arg.p.$O \
+ stdlib/array.cmx stdlib/array.p.cmx stdlib/array.$O stdlib/array.p.$O \
+ stdlib/arrayLabels.cmx stdlib/arrayLabels.p.cmx stdlib/arrayLabels.$O stdlib/arrayLabels.p.$O \
+ stdlib/buffer.cmx stdlib/buffer.p.cmx stdlib/buffer.$O stdlib/buffer.p.$O \
+ stdlib/callback.cmx stdlib/callback.p.cmx stdlib/callback.$O stdlib/callback.p.$O \
+ stdlib/camlinternalMod.cmx stdlib/camlinternalMod.p.cmx stdlib/camlinternalMod.$O stdlib/camlinternalMod.p.$O \
+ stdlib/camlinternalOO.cmx stdlib/camlinternalOO.p.cmx stdlib/camlinternalOO.$O stdlib/camlinternalOO.p.$O \
+ stdlib/char.cmx stdlib/char.p.cmx stdlib/char.$O stdlib/char.p.$O \
+ stdlib/complex.cmx stdlib/complex.p.cmx stdlib/complex.$O stdlib/complex.p.$O \
+ stdlib/digest.cmx stdlib/digest.p.cmx stdlib/digest.$O stdlib/digest.p.$O \
+ stdlib/filename.cmx stdlib/filename.p.cmx stdlib/filename.$O stdlib/filename.p.$O \
+ stdlib/format.cmx stdlib/format.p.cmx stdlib/format.$O stdlib/format.p.$O \
+ stdlib/gc.cmx stdlib/gc.p.cmx stdlib/gc.$O stdlib/gc.p.$O \
+ stdlib/genlex.cmx stdlib/genlex.p.cmx stdlib/genlex.$O stdlib/genlex.p.$O \
+ stdlib/hashtbl.cmx stdlib/hashtbl.p.cmx stdlib/hashtbl.$O stdlib/hashtbl.p.$O \
+ stdlib/int32.cmx stdlib/int32.p.cmx stdlib/int32.$O stdlib/int32.p.$O \
+ stdlib/int64.cmx stdlib/int64.p.cmx stdlib/int64.$O stdlib/int64.p.$O \
+ stdlib/lazy.cmx stdlib/lazy.p.cmx stdlib/lazy.$O stdlib/lazy.p.$O \
+ stdlib/lexing.cmx stdlib/lexing.p.cmx stdlib/lexing.$O stdlib/lexing.p.$O \
+ stdlib/list.cmx stdlib/list.p.cmx stdlib/list.$O stdlib/list.p.$O \
+ stdlib/listLabels.cmx stdlib/listLabels.p.cmx stdlib/listLabels.$O stdlib/listLabels.p.$O \
+ stdlib/map.cmx stdlib/map.p.cmx stdlib/map.$O stdlib/map.p.$O \
+ stdlib/marshal.cmx stdlib/marshal.p.cmx stdlib/marshal.$O stdlib/marshal.p.$O \
+ stdlib/moreLabels.cmx stdlib/moreLabels.p.cmx stdlib/moreLabels.$O stdlib/moreLabels.p.$O \
+ stdlib/nativeint.cmx stdlib/nativeint.p.cmx stdlib/nativeint.$O stdlib/nativeint.p.$O \
+ stdlib/obj.cmx stdlib/obj.p.cmx stdlib/obj.$O stdlib/obj.p.$O \
+ stdlib/oo.cmx stdlib/oo.p.cmx stdlib/oo.$O stdlib/oo.p.$O \
+ stdlib/parsing.cmx stdlib/parsing.p.cmx stdlib/parsing.$O stdlib/parsing.p.$O \
+ stdlib/pervasives.cmx stdlib/pervasives.p.cmx stdlib/pervasives.$O stdlib/pervasives.p.$O \
+ stdlib/printexc.cmx stdlib/printexc.p.cmx stdlib/printexc.$O stdlib/printexc.p.$O \
+ stdlib/printf.cmx stdlib/printf.p.cmx stdlib/printf.$O stdlib/printf.p.$O \
+ stdlib/queue.cmx stdlib/queue.p.cmx stdlib/queue.$O stdlib/queue.p.$O \
+ stdlib/random.cmx stdlib/random.p.cmx stdlib/random.$O stdlib/random.p.$O \
+ stdlib/scanf.cmx stdlib/scanf.p.cmx stdlib/scanf.$O stdlib/scanf.p.$O \
+ stdlib/sort.cmx stdlib/sort.p.cmx stdlib/sort.$O stdlib/sort.p.$O \
+ stdlib/stack.cmx stdlib/stack.p.cmx stdlib/stack.$O stdlib/stack.p.$O \
+ stdlib/stdLabels.cmx stdlib/stdLabels.p.cmx stdlib/stdLabels.$O stdlib/stdLabels.p.$O \
+ stdlib/std_exit.cmx stdlib/std_exit.p.cmx stdlib/std_exit.$O stdlib/std_exit.p.$O \
+ stdlib/stream.cmx stdlib/stream.p.cmx stdlib/stream.$O stdlib/stream.p.$O \
+ stdlib/string.cmx stdlib/string.p.cmx stdlib/string.$O stdlib/string.p.$O \
+ stdlib/stringLabels.cmx stdlib/stringLabels.p.cmx stdlib/stringLabels.$O stdlib/stringLabels.p.$O \
+ stdlib/sys.cmx stdlib/sys.p.cmx stdlib/sys.$O stdlib/sys.p.$O \
+ stdlib/weak.cmx stdlib/weak.p.cmx stdlib/weak.$O stdlib/weak.p.$O \
+ stdlib/$set.cmx stdlib/$set.p.cmx stdlib/$set.$O stdlib/$set.p.$O \
$LIBDIR
installlibdir \
- stdlib/stdlib.{$A,p.$A} \
+ stdlib/stdlib.$A stdlib/stdlib.p.$A \
$LIBDIR
echo "Installing ocamllex, ocamldebug..."
@@ -256,16 +267,16 @@ installdir \
otherlibs/bigarray/bigarray.cma \
otherlibs/dbm/dbm.cma \
otherlibs/dynlink/dynlink.cma \
- otherlibs/{,win32}graph/graphics.cma \
+ otherlibs/"$WIN32"graph/graphics.cma \
otherlibs/num/nums.cma \
otherlibs/str/str.cma \
- otherlibs/{,win32}unix/unix.cma \
- otherlibs/bigarray/bigarray{,.p}.cmxa \
- otherlibs/dbm/dbm{,.p}.cmxa \
- otherlibs/{,win32}graph/graphics{,.p}.cmxa \
- otherlibs/num/nums{,.p}.cmxa \
- otherlibs/str/str{,.p}.cmxa \
- otherlibs/{,win32}unix/unix{,.p}.cmxa \
+ otherlibs/"$WIN32"unix/unix.cma \
+ otherlibs/bigarray/bigarray.cmxa \
+ otherlibs/dbm/dbm.cmxa \
+ otherlibs/"$WIN32"graph/graphics.cmxa \
+ otherlibs/num/nums.cmxa \
+ otherlibs/str/str.cmxa \
+ otherlibs/"$WIN32"unix/unix.cmxa \
toplevel/toplevellib.cma \
otherlibs/systhreads/thread.mli \
otherlibs/systhreads/mutex.mli \
@@ -275,13 +286,27 @@ installdir \
$LIBDIR
installdir \
- otherlibs/labltk/support/fileevent.{mli,cmi,cmx} \
- otherlibs/labltk/support/protocol.{mli,cmi,cmx} \
- otherlibs/labltk/support/textvariable.{mli,cmi,cmx} \
- otherlibs/labltk/support/timer.{mli,cmi,cmx} \
- otherlibs/labltk/support/rawwidget.{mli,cmi,cmx} \
- otherlibs/labltk/support/widget.{mli,cmi,cmx} \
- otherlibs/labltk/support/tkthread.{mli,cmi,cmo} \
+ otherlibs/labltk/support/fileevent.mli \
+ otherlibs/labltk/support/fileevent.cmi \
+ otherlibs/labltk/support/fileevent.cmx \
+ otherlibs/labltk/support/protocol.mli \
+ otherlibs/labltk/support/protocol.cmi \
+ otherlibs/labltk/support/protocol.cmx \
+ otherlibs/labltk/support/textvariable.mli \
+ otherlibs/labltk/support/textvariable.cmi \
+ otherlibs/labltk/support/textvariable.cmx \
+ otherlibs/labltk/support/timer.mli \
+ otherlibs/labltk/support/timer.cmi \
+ otherlibs/labltk/support/timer.cmx \
+ otherlibs/labltk/support/rawwidget.mli \
+ otherlibs/labltk/support/rawwidget.cmi \
+ otherlibs/labltk/support/rawwidget.cmx \
+ otherlibs/labltk/support/widget.mli \
+ otherlibs/labltk/support/widget.cmi \
+ otherlibs/labltk/support/widget.cmx \
+ otherlibs/labltk/support/tkthread.mli \
+ otherlibs/labltk/support/tkthread.cmi \
+ otherlibs/labltk/support/tkthread.cmo \
otherlibs/labltk/support/tkthread.$O \
otherlibs/labltk/labltk/*.mli \
otherlibs/labltk/labltk/*.cmi \
@@ -309,7 +334,7 @@ installdir \
installdir \
otherlibs/systhreads/threads.cma \
- otherlibs/systhreads/threads{,.p}.cmxa \
+ otherlibs/systhreads/threads.cmxa \
otherlibs/systhreads/thread.cmi \
otherlibs/systhreads/mutex.cmi \
otherlibs/systhreads/condition.cmi \
@@ -320,11 +345,11 @@ installdir \
installdir \
otherlibs/bigarray/dllbigarray$EXT_DLL \
otherlibs/dbm/dllmldbm$EXT_DLL \
- otherlibs/{,win32}graph/dllgraphics$EXT_DLL \
+ otherlibs/"$WIN32"graph/dllgraphics$EXT_DLL \
otherlibs/num/dllnums$EXT_DLL \
otherlibs/str/dllstr$EXT_DLL \
otherlibs/systhreads/dllthreads$EXT_DLL \
- otherlibs/{,win32}unix/dllunix$EXT_DLL \
+ otherlibs/"$WIN32"unix/dllunix$EXT_DLL \
otherlibs/threads/dllvmthreads$EXT_DLL \
otherlibs/labltk/support/dlllabltk$EXT_DLL \
otherlibs/labltk/tkanim/dlltkanim$EXT_DLL \
@@ -335,11 +360,16 @@ installlibdir \
$LIBDIR/vmthreads
installdir \
- otherlibs/threads/thread.{cmi,mli} \
- otherlibs/threads/mutex.{cmi,mli} \
- otherlibs/threads/condition.{cmi,mli} \
- otherlibs/threads/event.{cmi,mli} \
- otherlibs/threads/threadUnix.{cmi,mli} \
+ otherlibs/threads/thread.cmi \
+ otherlibs/threads/thread.mli \
+ otherlibs/threads/mutex.cmi \
+ otherlibs/threads/mutex.mli \
+ otherlibs/threads/condition.cmi \
+ otherlibs/threads/condition.mli \
+ otherlibs/threads/event.cmi \
+ otherlibs/threads/event.mli \
+ otherlibs/threads/threadUnix.cmi \
+ otherlibs/threads/threadUnix.mli \
otherlibs/threads/threads.cma \
otherlibs/threads/stdlib.cma \
otherlibs/threads/unix.cma \
@@ -355,25 +385,25 @@ installlibdir \
$LIBDIR/labltk
installlibdir \
- otherlibs/bigarray/libbigarray.{$A,p.$A} \
- otherlibs/dbm/libmldbm.{$A,p.$A} \
- otherlibs/{,win32}graph/libgraphics.{$A,p.$A} \
- otherlibs/num/libnums.{$A,p.$A} \
- otherlibs/str/libstr.{$A,p.$A} \
- otherlibs/systhreads/libthreads.{$A,p.$A} \
- otherlibs/systhreads/libthreadsnat.{$A,p.$A} \
- otherlibs/{,win32}unix/libunix.{$A,p.$A} \
+ otherlibs/bigarray/libbigarray.$A \
+ otherlibs/dbm/libmldbm.$A \
+ otherlibs/"$WIN32"graph/libgraphics.$A \
+ otherlibs/num/libnums.$A \
+ otherlibs/str/libstr.$A \
+ otherlibs/systhreads/libthreads.$A \
+ otherlibs/systhreads/libthreadsnat.$A \
+ otherlibs/"$WIN32"unix/libunix.$A \
$LIBDIR
echo "Installing object files and interfaces..."
installdir \
- tools/profiling.cm{o,i} \
+ tools/profiling.cm[oi] \
toplevel/topstart.cmo \
toplevel/toploop.cmi \
toplevel/topdirs.cmi \
toplevel/topmain.cmi \
typing/outcometree.cmi \
- otherlibs/{,win32}graph/graphicsX11.cmi \
+ otherlibs/graph/graphicsX11.cmi \
otherlibs/dynlink/dynlink.cmi \
otherlibs/num/arith_status.cmi \
otherlibs/num/big_int.cmi \
@@ -382,37 +412,50 @@ installdir \
otherlibs/num/ratio.cmi \
otherlibs/bigarray/bigarray.cmi \
otherlibs/dbm/dbm.cmi \
- otherlibs/{,win32}graph/graphics.cmi \
+ otherlibs/"$WIN32"graph/graphics.cmi \
otherlibs/str/str.cmi \
- otherlibs/{,win32}unix/unix.cmi \
- otherlibs/{,win32}unix/unixLabels.cmi \
- otherlibs/num/arith_flags{,.p}.{cmx,$O} \
- otherlibs/num/int_misc{,.p}.{cmx,$O} \
- otherlibs/num/arith_status{,.p}.{cmx,$O} \
- otherlibs/num/big_int{,.p}.{cmx,$O} \
- otherlibs/num/nat{,.p}.{cmx,$O} \
- otherlibs/num/num{,.p}.{cmx,$O} \
- otherlibs/num/ratio{,.p}.{cmx,$O} \
- otherlibs/bigarray/bigarray{,.p}.{cmx,$O} \
- otherlibs/dbm/dbm{,.p}.{cmx,$O} \
- otherlibs/{,win32}graph/graphics{,.p}.{cmx,$O} \
- otherlibs/str/str{,.p}.{cmx,$O} \
- otherlibs/{,win32}unix/unix{,.p}.{cmx,$O} \
- otherlibs/{,win32}unix/unixLabels{,.p}.{cmx,$O} \
+ otherlibs/"$WIN32"unix/unix.cmi \
+ otherlibs/"$WIN32"unix/unixLabels.cmi \
+ otherlibs/num/arith_flags.cmx \
+ otherlibs/num/arith_flags.$O \
+ otherlibs/num/int_misc.cmx \
+ otherlibs/num/int_misc.$O \
+ otherlibs/num/arith_status.cmx \
+ otherlibs/num/arith_status.$O \
+ otherlibs/num/big_int.cmx \
+ otherlibs/num/big_int.$O \
+ otherlibs/num/nat.cmx \
+ otherlibs/num/nat.$O \
+ otherlibs/num/num.cmx \
+ otherlibs/num/num.$O \
+ otherlibs/num/ratio.cmx \
+ otherlibs/num/ratio.$O \
+ otherlibs/bigarray/bigarray.cmx \
+ otherlibs/bigarray/bigarray.$O \
+ otherlibs/dbm/dbm.cmx \
+ otherlibs/dbm/dbm.$O \
+ otherlibs/"$WIN32"graph/graphics.cmx \
+ otherlibs/"$WIN32"graph/graphics.$O \
+ otherlibs/str/str.cmx \
+ otherlibs/str/str.$O \
+ otherlibs/"$WIN32"unix/unix.cmx \
+ otherlibs/"$WIN32"unix/unix.$O \
+ otherlibs/"$WIN32"unix/unixLabels.cmx \
+ otherlibs/"$WIN32"unix/unixLabels.$O \
$LIBDIR
installlibdir \
- otherlibs/bigarray/bigarray.{$A,p.$A} \
- otherlibs/dbm/dbm.{$A,p.$A} \
- otherlibs/{,win32}graph/graphics.{$A,p.$A} \
- otherlibs/num/nums.{$A,p.$A} \
- otherlibs/str/str.{$A,p.$A} \
- otherlibs/{,win32}unix/unix.{$A,p.$A} \
- stdlib/stdlib.{$A,p.$A} \
+ otherlibs/bigarray/bigarray.$A \
+ otherlibs/dbm/dbm.$A \
+ otherlibs/"$WIN32"graph/graphics.$A \
+ otherlibs/num/nums.$A \
+ otherlibs/str/str.$A \
+ otherlibs/"$WIN32"unix/unix.$A \
+ stdlib/stdlib.$A \
$LIBDIR
installlibdir \
- otherlibs/systhreads/threads.{$A,p.$A} \
+ otherlibs/systhreads/threads.$A \
$LIBDIR/threads
echo "Installing manuals..."
@@ -425,7 +468,8 @@ installbin ocamldoc/ocamldoc.opt$EXE $BINDIR/ocamldoc.opt$EXE
installdir \
../ocamldoc/ocamldoc.hva \
ocamldoc/*.cmi \
- ocamldoc/odoc_info.{mli,cm[ia],cmxa,$A} \
+ ocamldoc/odoc_info.mli ocamldoc/odoc_info.cm[ia] ocamldoc/odoc_info.cmxa \
+ ocamldoc/odoc_info.$A \
$LIBDIR/ocamldoc
installdir \
@@ -458,15 +502,17 @@ for dir in Camlp4Parsers Camlp4Printers Camlp4Filters Camlp4Top; do
installdir \
$dir/*.cm* \
$dir/*.$O \
- $dir/*.p.$O \
$CAMLP4DIR/$dir
done
installdir \
- camlp4lib.{cma,cmxa} Camlp4.cmi \
- {camlp4o,camlp4of,camlp4oof,camlp4orf,camlp4r,camlp4rf}.cma \
- Camlp4Bin.{cm[iox],$O,p.$O} Camlp4Top.cm[io] \
+ camlp4lib.cma camlp4lib.cmxa Camlp4.cmi \
+ camlp4fulllib.cma camlp4fulllib.cmxa \
+ 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 \
$CAMLP4DIR
-installlibdir camlp4lib.{$A,p.$A} $CAMLP4DIR
+installlibdir camlp4lib.$A camlp4fulllib.$A $CAMLP4DIR
cd ..
echo "Installing ocamlbuild..."
@@ -476,16 +522,17 @@ installbin ocamlbuild/ocamlbuild.native$EXE $BINDIR/ocamlbuild.native$EXE
installbestbin ocamlbuild/ocamlbuild.native$EXE ocamlbuild/ocamlbuild.byte$EXE $BINDIR/ocamlbuild$EXE
installlibdir \
- ocamlbuild/ocamlbuildlib.{$A,p.$A} \
+ ocamlbuild/ocamlbuildlib.$A \
$LIBDIR/ocamlbuild
installdir \
- ocamlbuild/ocamlbuildlib{,.p}.cmxa \
+ ocamlbuild/ocamlbuildlib.cmxa \
ocamlbuild/ocamlbuildlib.cma \
ocamlbuild/ocamlbuild_plugin.cmi \
ocamlbuild/ocamlbuild_pack.cmi \
ocamlbuild/ocamlbuild.cmo \
- ocamlbuild/ocamlbuild{,.p}.{cmx,$O} \
+ ocamlbuild/ocamlbuild.cmx \
+ ocamlbuild/ocamlbuild.$O \
$LIBDIR/ocamlbuild
installdir \
diff --git a/build/mkconfig.sh b/build/mkconfig.sh
index 7d786d8a4..591bebc65 100755
--- a/build/mkconfig.sh
+++ b/build/mkconfig.sh
@@ -1,8 +1,11 @@
#!/bin/sh
+# $Id$
cd `dirname $0`/..
-sed -e 's/\$(\([^)]*\))/${\1}/g' \
- -e 's/^\([^=]*\)=\([^"]*\)$/\1="\2"/' \
- -e 's/^\(.*\$([0-9]).*\)$/# \1/' \
+sed -e 's/^\(.*\$([0-9]).*\)$/# \1/' \
+ -e 's/\$(\([^)]*\))/${\1}/g' \
+ -e 's/^\([^#=]*\)=\([^"]*\)$/if [ "x$\1" = "x" ]; then \1="\2"; fi/' \
config/Makefile > config/config.sh
+
+
diff --git a/build/mkmyocamlbuild_config.sh b/build/mkmyocamlbuild_config.sh
index 0b8137f23..158e13d5e 100755
--- a/build/mkmyocamlbuild_config.sh
+++ b/build/mkmyocamlbuild_config.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+# $Id$
cd `dirname $0`/..
diff --git a/build/mkruntimedef.sh b/build/mkruntimedef.sh
new file mode 100755
index 000000000..54f7cc5c7
--- /dev/null
+++ b/build/mkruntimedef.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+# $Id$
+echo 'let builtin_exceptions = [|'; \
+sed -n -e 's|.*/\* \("[A-Za-z_]*"\) \*/$| \1;|p' byterun/fail.h | \
+sed -e '$s/;$//'; \
+echo '|]'; \
+echo 'let builtin_primitives = [|'; \
+sed -e 's/.*/ "&";/' -e '$s/;$//' byterun/primitives; \
+echo '|]'
diff --git a/build/myocamlbuild.sh b/build/myocamlbuild.sh
index f75718018..dc129a849 100755
--- a/build/myocamlbuild.sh
+++ b/build/myocamlbuild.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+# $Id$
cd `dirname $0`/..
set -xe
if [ ! -x _build/ocamlbuild/ocamlbuildlight.byte ]; then
@@ -6,16 +7,13 @@ if [ ! -x _build/ocamlbuild/ocamlbuildlight.byte ]; then
(cd ocamlbuild && make)
fi
mkdir -p _build/ocamlbuild
- cp ocamlbuild/_build/ocamlbuild{light{.cmo,.byte,lib.cma},_plugin.cmi,_pack.cmi} _build/ocamlbuild
+ for i in "light.cmo" "light.byte" "lightlib.cma" "_plugin.cmi" "_pack.cmi"
+ do
+ cp ocamlbuild/_build/ocamlbuild$i _build/ocamlbuild
+ done
fi
+rm -f ocamlbuild/myocamlbuild_config.ml ocamlbuild/myocamlbuild_config.mli
rm -rf _build/myocamlbuild boot/myocamlbuild boot/myocamlbuild.native
./boot/ocamlrun _build/ocamlbuild/ocamlbuildlight.byte -no-hygiene \
- -tag debug -install-dir _build/ocamlbuild -byte-plugin -just-plugin
+ -tag debug -install-lib-dir _build/ocamlbuild -byte-plugin -just-plugin
cp _build/myocamlbuild boot/myocamlbuild.boot
-# cp boot/myocamlbuild boot/myocamlbuild.boot
-# rm -f boot/myocamlbuild.boot
-# boot/myocamlbuild.native
-# ocamlbuildlight -build-dir _build_myocamlbuild_boot -byte-plugin -no-hygiene
-# cp _build_myocamlbuild_boot/myocamlbuild boot/myocamlbuild.boot
-# ocamlbuild -build-dir _build_myocamlbuild_native -no-hygiene
-# cp _build_myocamlbuild_native/myocamlbuild boot/myocamlbuild.native
diff --git a/build/ocamlbuild-byte-only.sh b/build/ocamlbuild-byte-only.sh
index 0e5046f5b..87e7ba3a0 100755
--- a/build/ocamlbuild-byte-only.sh
+++ b/build/ocamlbuild-byte-only.sh
@@ -1,7 +1,9 @@
#!/bin/sh
+# $Id$
set -e
-export OCAMLBUILD_PARTIAL="true"
+OCAMLBUILD_PARTIAL="true"
+export OCAMLBUILD_PARTIAL
cd `dirname $0`/..
. build/targets.sh
set -x
-$OCAMLBUILD $@ $OCAMLC_BYTE $OCAMLLEX_BYTE $OCAMLBUILD_BYTE
+$OCAMLBUILD $@ byte_stdlib_partial_mode $OCAMLC_BYTE $OCAMLLEX_BYTE $OCAMLBUILD_BYTE
diff --git a/build/ocamlbuild-native-only.sh b/build/ocamlbuild-native-only.sh
index ac4cc8ad6..03d93edc1 100755
--- a/build/ocamlbuild-native-only.sh
+++ b/build/ocamlbuild-native-only.sh
@@ -1,7 +1,9 @@
#!/bin/sh
+# $Id$
set -e
-export OCAMLBUILD_PARTIAL="true"
+OCAMLBUILD_PARTIAL="true"
+export OCAMLBUILD_PARTIAL
cd `dirname $0`/..
. build/targets.sh
set -x
-$OCAMLBUILD $@ $OCAMLOPT_BYTE $OCAMLLEX_BYTE $OCAMLBUILD_NATIVE
+$OCAMLBUILD $@ native_stdlib_partial_mode $OCAMLOPT_BYTE $OCAMLLEX_BYTE $OCAMLBUILD_NATIVE
diff --git a/build/otherlibs-targets.sh b/build/otherlibs-targets.sh
index b71eb4b0f..77542fad2 100644
--- a/build/otherlibs-targets.sh
+++ b/build/otherlibs-targets.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+# $Id$
OTHERLIBS_BYTE=""
OTHERLIBS_NATIVE=""
OTHERLIBS_UNIX_NATIVE=""
diff --git a/build/partial-boot.sh b/build/partial-boot.sh
index e4e96a0b0..e2b8097b7 100755
--- a/build/partial-boot.sh
+++ b/build/partial-boot.sh
@@ -1,7 +1,9 @@
#!/bin/sh
+# $Id$
set -ex
cd `dirname $0`/..
-export OCAMLBUILD_PARTIAL="true"
+OCAMLBUILD_PARTIAL="true"
+export OCAMLBUILD_PARTIAL
mkdir -p _build
cp -rf boot _build/
cp parsing/location.ml parsing/location.mli camlp4/build
diff --git a/build/partial-install.sh b/build/partial-install.sh
index 67ee23f01..e5a6c3936 100755
--- a/build/partial-install.sh
+++ b/build/partial-install.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+# $Id$
######################################
######### Copied from build/install.sh
@@ -13,9 +14,11 @@ cd `dirname $0`/..
not_installed=$PWD/_build/not_installed
rm -f "$not_installed"
+touch "$not_installed"
wontinstall() {
echo "$1" >> "$not_installed"
+ echo " don't install $1"
}
installbin() {
@@ -49,7 +52,9 @@ installlib() {
dest="$2/`basename $1`"
echo " install library $dest"
cp -f "$1" "$2"
- ranlib "$dest"
+ if [ "$RANLIB" != "" ]; then
+ "$RANLIB" "$dest"
+ fi
else
wontinstall "$1"
fi
@@ -121,35 +126,39 @@ for dir in Camlp4Parsers Camlp4Printers Camlp4Filters Camlp4Top; do
installdir \
$dir/*.cm* \
$dir/*.$O \
- $dir/*.p.$O \
$CAMLP4DIR/$dir
done
installdir \
- camlp4lib.{cma,cmxa} Camlp4.cmi \
- {camlp4o,camlp4of,camlp4oof,camlp4orf,camlp4r,camlp4rf}.cma \
- Camlp4Bin.{cm[iox],$O,p.$O} Camlp4Top.cm[io] \
+ camlp4lib.cma camlp4lib.cmxa Camlp4.cmi \
+ camlp4fulllib.cma camlp4fulllib.cmxa \
+ 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 \
$CAMLP4DIR
-installlibdir camlp4lib.{$A,p.$A} $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,p.$A} \
+ ocamlbuildlib.$A \
$LIBDIR/ocamlbuild
installdir \
- ocamlbuild/ocamlbuildlib{,.p}.cmxa \
- ocamlbuild/ocamlbuildlib.cma \
- ocamlbuild/ocamlbuild_plugin.cmi \
- ocamlbuild/ocamlbuild_pack.cmi \
- ocamlbuild/ocamlbuild.cmo \
- ocamlbuild/ocamlbuild{,.p}.{cmx,$O} \
+ ocamlbuildlib.cmxa \
+ ocamlbuildlib.cma \
+ ocamlbuild_plugin.cmi \
+ ocamlbuild_pack.cmi \
+ ocamlbuild.cmo \
+ ocamlbuild.cmx \
+ ocamlbuild.$O \
$LIBDIR/ocamlbuild
+cd ..
installdir \
../ocamlbuild/man/ocamlbuild.1 \
diff --git a/build/targets.sh b/build/targets.sh
index ee5b0f9c8..90041aaaa 100644
--- a/build/targets.sh
+++ b/build/targets.sh
@@ -1,8 +1,13 @@
+# $Id$
. config/config.sh
. build/otherlibs-targets.sh
. build/camlp4-targets.sh
-STDLIB_BYTE="stdlib/stdlib.cma stdlib/std_exit.cmo \
- stdlib/camlheader stdlib/camlheader_ur"
+
+INSTALL_BIN="$BINDIR"
+export INSTALL_BIN
+
+STDLIB_BYTE="stdlib/libcamlrun.$A stdlib/stdlib.cma \
+ stdlib/std_exit.cmo stdlib/camlheader stdlib/camlheader_ur"
OCAMLLEX_BYTE=lex/ocamllex$EXE
OCAMLC_BYTE=ocamlc$EXE
OCAMLOPT_BYTE=ocamlopt$EXE
@@ -20,9 +25,11 @@ if [ ! -z "$DEBUGGER" ]; then
DEBUGGER=debugger/ocamldebug$EXE
fi
OCAMLDOC_BYTE="ocamldoc/ocamldoc$EXE ocamldoc/odoc_info.cma"
-STDLIB_NATIVE="stdlib/stdlib.cmxa stdlib/std_exit.cmx"
+STDLIB_NATIVE="stdlib/stdlib.cmxa stdlib/std_exit.cmx asmrun/libasmrun.$A"
case $PROFILING in
-prof) STDLIB_NATIVE="$STDLIB_NATIVE stdlib/stdlib.p.cmxa stdlib/std_exit.p.cmx";;
+prof)
+ STDLIB_NATIVE="$STDLIB_NATIVE asmrun/libasmrunp.$A \
+ stdlib/stdlib.p.cmxa stdlib/std_exit.p.cmx";;
noprof) ;;
*) echo "unexpected PROFILING value $PROFILING"; exit 1;;
esac
diff --git a/build/world.all.sh b/build/world.all.sh
index b84bf8a16..d8a18abb9 100755
--- a/build/world.all.sh
+++ b/build/world.all.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+# $Id$
set -e
cd `dirname $0`/..
. build/targets.sh
diff --git a/build/world.byte.sh b/build/world.byte.sh
index 56b3de5f0..d3e96dc4b 100755
--- a/build/world.byte.sh
+++ b/build/world.byte.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+# $Id$
set -e
cd `dirname $0`/..
. build/targets.sh
diff --git a/build/world.native.sh b/build/world.native.sh
index 88f740338..ac4a18323 100755
--- a/build/world.native.sh
+++ b/build/world.native.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+# $Id$
set -e
cd `dirname $0`/..
. build/targets.sh
diff --git a/build/world.sh b/build/world.sh
index bb0c813c9..1acf2b594 100755
--- a/build/world.sh
+++ b/build/world.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+# $Id$
cd `dirname $0`
set -ex
./mkconfig.sh
diff --git a/byterun/config.h b/byterun/config.h
index 9a52c5524..25681e7f5 100644
--- a/byterun/config.h
+++ b/byterun/config.h
@@ -85,7 +85,7 @@ typedef struct { uint32 l, h; } uint64, int64;
float is at byte offset [a], the next lsb at [b], ..., and the
most significant byte at [h]. */
-#if defined(__arm__)
+#if defined(__arm__) && !defined(__ARM_EABI__)
#define ARCH_FLOAT_ENDIANNESS 0x45670123
#elif defined(ARCH_BIG_ENDIAN)
#define ARCH_FLOAT_ENDIANNESS 0x76543210
diff --git a/byterun/globroots.c b/byterun/globroots.c
index 792da34d8..b59b8ed96 100644
--- a/byterun/globroots.c
+++ b/byterun/globroots.c
@@ -28,7 +28,7 @@
1 with probability 3/16, 2 with probability 3/64, etc.
We use a simple linear congruential PRNG (see Knuth vol 2) instead
of random(), because we need exactly 32 bits of pseudo-random data
- (i.e. 2 * (MAX_LEVEL + 1)). Moreover, the congruential PRNG
+ (i.e. 2 * (NUM_LEVELS - 1)). Moreover, the congruential PRNG
is faster and guaranteed to be deterministic (to reproduce bugs). */
static uint32 random_seed = 0;
@@ -45,7 +45,7 @@ static int random_level(void)
"less random" than the most significant bits with a modulus of 2^m,
so consume most significant bits first */
while ((r & 0xC0000000U) == 0xC0000000U) { level++; r = r << 2; }
- Assert(level <= MAX_LEVEL);
+ Assert(level < NUM_LEVELS);
return level;
}
@@ -57,10 +57,10 @@ struct global_root_list caml_global_roots = { NULL, { NULL, }, 0 };
CAMLexport void caml_register_global_root(value *r)
{
- struct global_root * update[MAX_LEVEL];
+ struct global_root * update[NUM_LEVELS];
struct global_root * e, * f;
int i, new_level;
-
+
Assert (((intnat) r & 3) == 0); /* compact.c demands this (for now) */
/* Init "cursor" to list head */
@@ -97,7 +97,7 @@ CAMLexport void caml_register_global_root(value *r)
CAMLexport void caml_remove_global_root(value *r)
{
- struct global_root * update[MAX_LEVEL];
+ struct global_root * update[NUM_LEVELS];
struct global_root * e, * f;
int i;
diff --git a/byterun/globroots.h b/byterun/globroots.h
index 51fa8e65d..684860abc 100644
--- a/byterun/globroots.h
+++ b/byterun/globroots.h
@@ -27,11 +27,11 @@ struct global_root {
struct global_root * forward[1]; /* variable-length array */
};
-#define MAX_LEVEL 15
+#define NUM_LEVELS 17
struct global_root_list {
value * root; /* dummy value for layout compatibility */
- struct global_root * forward[MAX_LEVEL]; /* forward chaining */
+ struct global_root * forward[NUM_LEVELS]; /* forward chaining */
int level; /* max used level */
};
diff --git a/camlp4/Camlp4/Camlp4Ast.partial.ml b/camlp4/Camlp4/Camlp4Ast.partial.ml
index d9356c8e3..7a9023761 100644
--- a/camlp4/Camlp4/Camlp4Ast.partial.ml
+++ b/camlp4/Camlp4/Camlp4Ast.partial.ml
@@ -84,7 +84,7 @@
| 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 patt and patt (* p = 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) *)
@@ -128,9 +128,9 @@
(* ?s or ?s:e *)
| ExOlb of Loc.t and string and expr
(* {< b >} *)
- | ExOvr of Loc.t and binding
+ | ExOvr of Loc.t and rec_binding
(* { b } or { (e) with b } *)
- | ExRec of Loc.t and binding and expr
+ | ExRec of Loc.t and rec_binding and expr
(* do { e } *)
| ExSeq of Loc.t and expr
(* e#s *)
@@ -152,8 +152,9 @@
(* while e do { e } *)
| ExWhi of Loc.t and expr and expr ]
and module_type =
+ [ MtNil of Loc.t
(* i *) (* A.B.C *)
- [ MtId of Loc.t and ident
+ | MtId of Loc.t and ident
(* functor (s : mt) -> mt *)
| MtFun of Loc.t and string and module_type and module_type
(* 's *)
@@ -205,11 +206,16 @@
[ BiNil of Loc.t
(* b and b *) (* let a = 42 and c = 43 *)
| BiAnd of Loc.t and binding and binding
- (* b ; b *)
- | BiSem of Loc.t and binding and binding
(* p = e *) (* let patt = expr *)
| BiEq of Loc.t and patt and expr
| BiAnt of Loc.t and string (* $s$ *) ]
+ and rec_binding =
+ [ RbNil of Loc.t
+ (* b ; b *)
+ | RbSem of Loc.t and rec_binding and rec_binding
+ (* i = e *)
+ | RbEq of Loc.t and ident and expr
+ | RbAnt of Loc.t and string (* $s$ *) ]
and module_binding =
[ MbNil of Loc.t
(* mb and mb *) (* module rec (s : mt) = me and (s : mt) = me *)
@@ -227,8 +233,9 @@
| McArr of Loc.t and patt and expr and expr
| McAnt of Loc.t and string (* $s$ *) ]
and module_expr =
+ [ MeNil of Loc.t
(* i *)
- [ MeId of Loc.t and ident
+ | MeId of Loc.t and ident
(* me me *)
| MeApp of Loc.t and module_expr and module_expr
(* functor (s : mt) -> me *)
diff --git a/camlp4/Camlp4/ErrorHandler.ml b/camlp4/Camlp4/ErrorHandler.ml
index 7c68bd4fc..231efed90 100644
--- a/camlp4/Camlp4/ErrorHandler.ml
+++ b/camlp4/Camlp4/ErrorHandler.ml
@@ -113,10 +113,10 @@ value default_handler ppf x = do {
(Obj.obj (Obj.field (Obj.field x 0) 0) : string);
if Obj.size x > 1 then do {
pp_print_string ppf " (";
- for i = 1 to Obj.size x - 1 do {
+ for i = 1 to Obj.size x - 1 do
if i > 1 then pp_print_string ppf ", " else ();
ObjTools.print ppf (Obj.field x i);
- };
+ done;
pp_print_char ppf ')'
}
else ();
diff --git a/camlp4/Camlp4/OCamlInitSyntax.ml b/camlp4/Camlp4/OCamlInitSyntax.ml
index b28c40e05..218623599 100644
--- a/camlp4/Camlp4/OCamlInitSyntax.ml
+++ b/camlp4/Camlp4/OCamlInitSyntax.ml
@@ -16,26 +16,30 @@
* - Nicolas Pouillard: initial version
*)
-module Make (Warning : Sig.Warning)
- (Ast : Sig.Camlp4Ast with module Loc = Warning.Loc)
- (Gram : Sig.Grammar.Static with module Loc = Warning.Loc
+module Make (Ast : Sig.Camlp4Ast)
+ (Gram : Sig.Grammar.Static with module Loc = Ast.Loc
with type Token.t = Sig.camlp4_token)
(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
+: 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 Warning = Warning;
module Loc = Ast.Loc;
module Ast = Ast;
module Gram = Gram;
module Token = Gram.Token;
open Sig;
+ (* Warnings *)
+ type warning = Loc.t -> string -> unit;
+ value default_warning loc txt = Format.eprintf "<W> %a: %s@." Loc.print loc txt;
+ value current_warning = ref default_warning;
+ value print_warning loc txt = current_warning.val loc txt;
+
value a_CHAR = Gram.Entry.mk "a_CHAR";
value a_FLOAT = Gram.Entry.mk "a_FLOAT";
value a_INT = Gram.Entry.mk "a_INT";
@@ -43,7 +47,6 @@ module Make (Warning : Sig.Warning)
value a_INT64 = Gram.Entry.mk "a_INT64";
value a_LABEL = Gram.Entry.mk "a_LABEL";
value a_LIDENT = Gram.Entry.mk "a_LIDENT";
- value a_LIDENT_or_operator = Gram.Entry.mk "a_LIDENT_or_operator";
value a_NATIVEINT = Gram.Entry.mk "a_NATIVEINT";
value a_OPTLABEL = Gram.Entry.mk "a_OPTLABEL";
value a_STRING = Gram.Entry.mk "a_STRING";
@@ -90,7 +93,6 @@ module Make (Warning : Sig.Warning)
value eq_expr = Gram.Entry.mk "eq_expr";
value expr = Gram.Entry.mk "expr";
value expr_eoi = Gram.Entry.mk "expr_eoi";
- value field = Gram.Entry.mk "field";
value field_expr = Gram.Entry.mk "field_expr";
value fun_binding = Gram.Entry.mk "fun_binding";
value fun_def = Gram.Entry.mk "fun_def";
@@ -141,16 +143,15 @@ module Make (Warning : Sig.Warning)
value patt_eoi = Gram.Entry.mk "patt_eoi";
value patt_tcon = Gram.Entry.mk "patt_tcon";
value phrase = Gram.Entry.mk "phrase";
- value pipe_ctyp = Gram.Entry.mk "pipe_ctyp";
value poly_type = Gram.Entry.mk "poly_type";
value row_field = Gram.Entry.mk "row_field";
- value sem_ctyp = Gram.Entry.mk "sem_ctyp";
value sem_expr = Gram.Entry.mk "sem_expr";
value sem_expr_for_list = Gram.Entry.mk "sem_expr_for_list";
value sem_patt = Gram.Entry.mk "sem_patt";
value sem_patt_for_list = Gram.Entry.mk "sem_patt_for_list";
value semi = Gram.Entry.mk "semi";
value sequence = Gram.Entry.mk "sequence";
+ value do_sequence = Gram.Entry.mk "do_sequence";
value sig_item = Gram.Entry.mk "sig_item";
value sig_items = Gram.Entry.mk "sig_items";
value star_ctyp = Gram.Entry.mk "star_ctyp";
@@ -184,10 +185,16 @@ module Make (Warning : Sig.Warning)
value class_expr_quot = Gram.Entry.mk "quotation of class expression";
value with_constr_quot = Gram.Entry.mk "quotation of with constraint";
value binding_quot = Gram.Entry.mk "quotation of binding";
+ value rec_binding_quot = Gram.Entry.mk "quotation of record binding";
value match_case_quot = Gram.Entry.mk "quotation of match_case (try/match/function case)";
value module_binding_quot = Gram.Entry.mk "quotation of module rec binding";
value ident_quot = Gram.Entry.mk "quotation of identifier";
-
+ value prefixop = Gram.Entry.mk "prefix operator (start with '!', '?', '~')";
+ value infixop0 = Gram.Entry.mk "infix operator (level 0) (comparison operators, and some others)";
+ value infixop1 = Gram.Entry.mk "infix operator (level 1) (start with '^', '@')";
+ value infixop2 = Gram.Entry.mk "infix operator (level 2) (start with '+', '-')";
+ value infixop3 = Gram.Entry.mk "infix operator (level 3) (start with '*', '/', '%')";
+ value infixop4 = Gram.Entry.mk "infix operator (level 4) (start with \"**\") (right assoc)";
EXTEND Gram
top_phrase:
@@ -215,31 +222,30 @@ module Make (Warning : Sig.Warning)
module Quotation = Quotation;
- module Parser = struct
- module Ast = Ast;
- value wrap directive_handler pa init_loc cs =
- let rec loop loc =
- let (pl, stopped_at_directive) = pa loc cs in
- match stopped_at_directive with
- [ Some new_loc ->
- let pl =
- match List.rev pl with
- [ [] -> assert False
- | [x :: xs] ->
- match directive_handler x with
- [ None -> xs
- | Some x -> [x :: xs] ] ]
- in (List.rev pl) @ (loop new_loc)
- | None -> pl ]
- in loop init_loc;
- value parse_implem ?(directive_handler = fun _ -> None) _loc cs =
- let l = wrap directive_handler (Gram.parse implem) _loc cs in
- <:str_item< $list:l$ >>;
- value parse_interf ?(directive_handler = fun _ -> None) _loc cs =
- let l = wrap directive_handler (Gram.parse interf) _loc cs in
- <:sig_item< $list:l$ >>;
- end;
+ value wrap directive_handler pa init_loc cs =
+ let rec loop loc =
+ let (pl, stopped_at_directive) = pa loc cs in
+ match stopped_at_directive with
+ [ Some new_loc ->
+ let pl =
+ match List.rev pl with
+ [ [] -> assert False
+ | [x :: xs] ->
+ match directive_handler x with
+ [ None -> xs
+ | Some x -> [x :: xs] ] ]
+ in (List.rev pl) @ (loop new_loc)
+ | None -> pl ]
+ in loop init_loc;
+
+ value parse_implem ?(directive_handler = fun _ -> None) _loc cs =
+ let l = wrap directive_handler (Gram.parse implem) _loc cs in
+ <:str_item< $list:l$ >>;
- module Printer = Struct.EmptyPrinter.Make Ast;
+ value parse_interf ?(directive_handler = fun _ -> None) _loc cs =
+ let l = wrap directive_handler (Gram.parse interf) _loc cs in
+ <:sig_item< $list:l$ >>;
+ value print_interf ?input_file:(_) ?output_file:(_) _ = failwith "No interface printer";
+ value print_implem ?input_file:(_) ?output_file:(_) _ = failwith "No implementation printer";
end;
diff --git a/camlp4/Camlp4/PreCast.ml b/camlp4/Camlp4/PreCast.ml
index 8c29bb1de..06adf42ba 100644
--- a/camlp4/Camlp4/PreCast.ml
+++ b/camlp4/Camlp4/PreCast.ml
@@ -46,14 +46,13 @@ type camlp4_token = Sig.camlp4_token ==
| EOI ];
module Loc = Struct.Loc;
-module Warning = Struct.Warning.Make 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 Warning Ast Gram Quotation;
+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;
diff --git a/camlp4/Camlp4/PreCast.mli b/camlp4/Camlp4/PreCast.mli
index fd64e6d19..1c6eb2e98 100644
--- a/camlp4/Camlp4/PreCast.mli
+++ b/camlp4/Camlp4/PreCast.mli
@@ -42,7 +42,6 @@ type camlp4_token = Sig.camlp4_token ==
module Id : Sig.Id;
module Loc : Sig.Loc;
-module Warning : Sig.Warning with module Loc = Loc;
module Ast : Sig.Camlp4Ast with module Loc = Loc;
module Token : Sig.Token
with module Loc = Loc
@@ -58,19 +57,17 @@ module DynLoader : Sig.DynLoader;
module AstFilters : Sig.AstFilters with module Ast = Ast;
module Syntax : Sig.Camlp4Syntax
with module Loc = Loc
- and module Warning = Warning
and module Token = Token
and module Ast = Ast
and module Gram = Gram
and module Quotation = Quotation;
module Printers : sig
- module OCaml : Sig.Printer with module Ast = Sig.Camlp4AstToAst Ast;
- module OCamlr : Sig.Printer with module Ast = Sig.Camlp4AstToAst Ast;
- (* module OCamlrr : Sig.Printer with module Ast = Sig.Camlp4AstToAst Ast; *)
- module DumpOCamlAst : Sig.Printer with module Ast = Sig.Camlp4AstToAst Ast;
- module DumpCamlp4Ast : Sig.Printer with module Ast = Sig.Camlp4AstToAst Ast;
- module Null : Sig.Printer with module Ast = Sig.Camlp4AstToAst Ast;
+ 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)
diff --git a/camlp4/Camlp4/Printers/DumpCamlp4Ast.ml b/camlp4/Camlp4/Printers/DumpCamlp4Ast.ml
index 40b597921..11bfcc7f1 100644
--- a/camlp4/Camlp4/Printers/DumpCamlp4Ast.ml
+++ b/camlp4/Camlp4/Printers/DumpCamlp4Ast.ml
@@ -23,7 +23,7 @@ module Id = struct
end;
module Make (Syntax : Sig.Syntax)
-: Sig.Printer with module Ast = Syntax.Ast
+: (Sig.Printer Syntax.Ast).S
= struct
include Syntax;
diff --git a/camlp4/Camlp4/Printers/DumpCamlp4Ast.mli b/camlp4/Camlp4/Printers/DumpCamlp4Ast.mli
index 0af1fa1a7..d35642ab4 100644
--- a/camlp4/Camlp4/Printers/DumpCamlp4Ast.mli
+++ b/camlp4/Camlp4/Printers/DumpCamlp4Ast.mli
@@ -18,5 +18,4 @@
module Id : Sig.Id;
-module Make (Syntax : Sig.Syntax) : Sig.Printer
- with module Ast = Syntax.Ast;
+module Make (Syntax : Sig.Syntax) : (Sig.Printer Syntax.Ast).S;
diff --git a/camlp4/Camlp4/Printers/DumpOCamlAst.ml b/camlp4/Camlp4/Printers/DumpOCamlAst.ml
index ee35d5142..952fce9f8 100644
--- a/camlp4/Camlp4/Printers/DumpOCamlAst.ml
+++ b/camlp4/Camlp4/Printers/DumpOCamlAst.ml
@@ -23,7 +23,7 @@ module Id : Sig.Id = struct
end;
module Make (Syntax : Sig.Camlp4Syntax)
-: Sig.Printer with module Ast = Syntax.Ast
+: (Sig.Printer Syntax.Ast).S
= struct
include Syntax;
module Ast2pt = Struct.Camlp4Ast2OCamlAst.Make Ast;
diff --git a/camlp4/Camlp4/Printers/DumpOCamlAst.mli b/camlp4/Camlp4/Printers/DumpOCamlAst.mli
index b97898b19..3233557d0 100644
--- a/camlp4/Camlp4/Printers/DumpOCamlAst.mli
+++ b/camlp4/Camlp4/Printers/DumpOCamlAst.mli
@@ -18,5 +18,4 @@
module Id : Sig.Id;
-module Make (Syntax : Sig.Camlp4Syntax) : Sig.Printer
- with module Ast = Syntax.Ast;
+module Make (Syntax : Sig.Camlp4Syntax) : (Sig.Printer Syntax.Ast).S;
diff --git a/camlp4/Camlp4/Printers/Null.mli b/camlp4/Camlp4/Printers/Null.mli
index 562c2c02f..d77151177 100644
--- a/camlp4/Camlp4/Printers/Null.mli
+++ b/camlp4/Camlp4/Printers/Null.mli
@@ -19,4 +19,4 @@
module Id : Sig.Id;
-module Make (Syntax : Sig.Syntax) : Sig.Printer with module Ast = Syntax.Ast;
+module Make (Syntax : Sig.Syntax) : (Sig.Printer Syntax.Ast).S;
diff --git a/camlp4/Camlp4/Printers/OCaml.ml b/camlp4/Camlp4/Printers/OCaml.ml
index b9cd23a91..a203ae7aa 100644
--- a/camlp4/Camlp4/Printers/OCaml.ml
+++ b/camlp4/Camlp4/Printers/OCaml.ml
@@ -66,13 +66,12 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
module StringSet = Set.Make String;
value is_infix =
- let infixes =
+ let first_chars = ['='; '<'; '>'; '|'; '&'; '$'; '@'; '^'; '+'; '-'; '*'; '/'; '%'; '\\']
+ and infixes =
List.fold_right StringSet.add
-(* "**."; "=."; "<>."; "<."; ">."; "<=."; ">=."; "~-"; "~-." *)
- ["=="; "!="; "+"; "-"; "+."; "-."; "*"; "*."; "/"; "/."; "**";
- "="; "<>"; "<"; ">"; "<="; ">="; "^"; "^^"; "@"; "&&"; "||";
- "asr"; "land"; "lor"; "lsl"; "lsr"; "lxor"; "mod"; "or" ] StringSet.empty
- in fun s -> StringSet.mem s infixes;
+ ["asr"; "land"; "lor"; "lsl"; "lsr"; "lxor"; "mod"; "or"] StringSet.empty
+ in fun s -> (StringSet.mem s infixes
+ || (s <> "" && List.mem s.[0] first_chars));
value is_keyword =
let keywords =
@@ -251,7 +250,7 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
method match_case f =
fun
[ <:match_case@_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 f =
@@ -283,20 +282,18 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
(list o#simple_patt "@ ") [p::pl] o#ctyp t o#expr e
| _ -> pp f "%a @[<0>%a=@]@ %a" o#simple_patt
p (list' o#simple_patt "" "@ ") pl o#expr e ]
- | <:binding< $_$ ; $_$ >> -> assert False
| <:binding< $anti:s$ >> -> o#anti f s ];
method record_binding f bi =
- let () = o#node f bi Ast.loc_of_binding in
+ let () = o#node f bi Ast.loc_of_rec_binding in
match bi with
- [ <:binding<>> -> ()
- | <:binding< $p$ = $e$ >> ->
- pp f "@ @[<2>%a =@ %a@];" o#simple_patt p o#expr e
- | <:binding< $b1$ ; $b2$ >> ->
+ [ <:rec_binding<>> -> ()
+ | <:rec_binding< $i$ = $e$ >> ->
+ pp f "@ @[<2>%a =@ %a@];" o#var_ident i o#expr e
+ | <:rec_binding< $b1$ ; $b2$ >> ->
do { o#under_semi#record_binding f b1;
o#under_semi#record_binding f b2 }
- | <:binding< $_$ and $_$ >> -> assert False
- | <:binding< $anti:s$ >> -> o#anti f s ];
+ | <: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;
@@ -421,18 +418,18 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
pp f "@[<2>-.@,%a@]" o#expr x
| <: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#dot_expr x n o#dot_expr y
+ pp f "@[<2>%a@ %s@ %a@]" o#apply_expr x n o#apply_expr y
| <:expr< $x$ $y$ >> ->
let (a, al) = get_expr_args x [y] in
if (not curry_constr) && Ast.is_expr_constructor a then
match al with
[ [ <:expr< ($tup:_$) >> ] ->
- pp f "@[<2>%a@ (%a)@]" o#dot_expr x o#expr y
- | [_] -> pp f "@[<2>%a@ %a@]" o#dot_expr x o#dot_expr y
+ pp f "@[<2>%a@ (%a)@]" o#apply_expr x o#expr y
+ | [_] -> pp f "@[<2>%a@ %a@]" o#apply_expr x o#apply_expr y
| al ->
- pp f "@[<2>%a@ (%a)@]" o#dot_expr a
+ pp f "@[<2>%a@ (%a)@]" o#apply_expr a
(list o#under_pipe#expr ",@ ") al ]
- else pp f "@[<2>%a@]" (list o#dot_expr "@ ") [a::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
| <:expr< $e1$ := $e2$ >> ->
@@ -462,9 +459,15 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
pp f "@[<0>@[<hv2>try@ %a@]@ @[<0>with%a@]@]"
o#expr e o#match_case a
| <:expr< assert False >> -> pp f "@[<2>assert@ false@]"
- | <:expr< assert $e$ >> -> pp f "@[<2>assert@ %a@]" o#expr e
+ | <: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
+ | e -> o#apply_expr f e ];
+
+ method apply_expr f e =
+ let () = o#node f e Ast.loc_of_expr in
+ match e with
+ [ <:expr< new $i$ >> -> pp f "@[<2>new@ %a@]" o#ident i
| e -> o#dot_expr f e ];
method dot_expr f e =
@@ -508,9 +511,9 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
| <:expr< $chr:s$ >> -> pp f "'%s'" (ocaml_char s)
| <:expr< $id:i$ >> -> o#var_ident f i
| <:expr< { $b$ } >> ->
- pp f "@[<hv0>@[<hv2>{@ %a@]@ }@]" o#record_binding b
+ pp f "@[<hv0>@[<hv2>{%a@]@ }@]" o#record_binding b
| <:expr< { ($e$) with $b$ } >> ->
- pp f "@[<hv0>@[<hv2>{@ (%a)@ with@ %a@]@ }@]"
+ pp f "@[<hv0>@[<hv2>{@ (%a)@ with%a@]@ }@]"
o#expr e o#record_binding b
| <:expr< $str:s$ >> -> pp f "\"%s\"" s
| <:expr< while $e1$ do { $e2$ } >> ->
@@ -521,7 +524,7 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
| <:expr< ? $s$ : $e$ >> -> pp f "@[<2>?%s:@ %a@]" s o#dot_expr e
| <:expr< ` $lid:s$ >> -> pp f "`%a" o#var s
| <:expr< {< $b$ >} >> ->
- pp f "@[<hv0>@[<hv2>{<@ %a@]@ >}@]" o#record_binding b
+ pp f "@[<hv0>@[<hv2>{<%a@]@ >}@]" o#record_binding b
| <:expr< object $cst$ end >> ->
pp f "@[<hv0>@[<hv2>object@ %a@]@ end@]" o#class_str_item cst
| <:expr< object ($p$ : $t$) $cst$ end >> ->
@@ -530,7 +533,6 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
| <:expr< object ($p$) $cst$ end >> ->
pp f "@[<hv0>@[<hv2>object @[<2>(%a)@]@ %a@]@ end@]"
o#patt p o#class_str_item cst
- | <:expr< new $i$ >> -> pp f "@[<2>new@ %a@]" o#ident i
| <:expr< $e1$, $e2$ >> ->
pp f "%a,@ %a" o#simple_expr e1 o#simple_expr e2
| <:expr< $e1$; $e2$ >> ->
@@ -543,9 +545,8 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
<:expr< if $_$ then $_$ else $_$ >> |
<:expr< let $rec:_$ $_$ in $_$ >> |
<:expr< let module $_$ = $_$ in $_$ >> |
- (* Note: `new' is treated differently in pa_o and in pa_r,
- and should not occur at this level *)
- <:expr< assert $_$ >> | <:expr< assert False >> | <:expr< lazy $_$ >> ->
+ <:expr< assert $_$ >> | <:expr< assert False >> |
+ <:expr< lazy $_$ >> | <:expr< new $_$ >> ->
pp f "(%a)" o#reset#expr e ];
method direction_flag f b =
@@ -557,7 +558,7 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
method patt f p =
let () = o#node f p Ast.loc_of_patt in match p with
[ <:patt< ( $p1$ as $p2$ ) >> -> pp f "@[<1>(%a@ as@ %a)@]" o#patt p1 o#patt p2
- | <:patt< $p1$ = $p2$ >> -> pp f "@[<2>%a =@ %a@]" o#patt p1 o#patt p2
+ | <:patt< $i$ = $p$ >> -> pp f "@[<2>%a =@ %a@]" o#var_ident i o#patt p
| <:patt< $p1$; $p2$ >> -> pp f "%a;@ %a" o#patt p1 o#patt p2
| p -> o#patt1 f p ];
@@ -643,7 +644,7 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
| <:ctyp< ? $s$ : $t$ >> -> pp f "@[<2>?%s:@ %a@]" s o#simple_ctyp t
| <:ctyp< < > >> -> pp f "< >"
| <:ctyp< < .. > >> -> pp f "< .. >"
- | <:ctyp< < $t$ .. > >> -> pp f "@[<0>@[<2><@ %a@ ..@]@ >@]" o#ctyp t
+ | <:ctyp< < $t$ .. > >> -> pp f "@[<0>@[<2><@ %a;@ ..@]@ >@]" o#ctyp t
| <:ctyp< < $t$ > >> -> pp f "@[<0>@[<2><@ %a@]@ >@]" o#ctyp t
| <:ctyp< '$s$ >> -> pp f "'%a" o#var s
| <:ctyp< { $t$ } >> -> pp f "@[<2>{@ %a@]@ }" o#ctyp t
@@ -684,9 +685,7 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
| Ast.TyDcl _ tn tp te cl -> do {
pp f "@[<2>%a%a@]" o#type_params tp o#var tn;
match te with
- [ <:ctyp< '$s$ >>
- when not (List.exists (fun [ <:ctyp< '$s'$ >> -> s = s'
- | _ -> False ]) tp) -> ()
+ [ <:ctyp<>> -> ()
| _ -> pp f " =@ %a" o#ctyp te ];
if cl <> [] then pp f "@ %a" (list o#constrain "@ ") cl else ();
}
@@ -738,6 +737,8 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
| <:sig_item< module $s$ : $mt$ >> ->
pp f "@[<2>module %a :@ %a%s@]"
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
| <:sig_item< module type $s$ = $mt$ >> ->
pp f "@[<2>module type %a =@ %a%s@]"
o#var s o#module_type mt semisep
@@ -817,7 +818,8 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
method module_type f mt =
let () = o#node f mt Ast.loc_of_module_type in
match mt with
- [ <:module_type< $id:i$ >> -> o#ident f i
+ [ <:module_type<>> -> assert False
+ | <:module_type< $id:i$ >> -> o#ident f i
| <:module_type< $anti:s$ >> -> o#anti f s
| <:module_type< functor ( $s$ : $mt1$ ) -> $mt2$ >> ->
pp f "@[<2>functor@ @[<1>(%a :@ %a)@]@ ->@ %a@]"
@@ -843,7 +845,8 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
method module_expr f me =
let () = o#node f me Ast.loc_of_module_expr in
match me with
- [ <:module_expr< $id:i$ >> -> o#ident f i
+ [ <:module_expr<>> -> assert False
+ | <:module_expr< $id:i$ >> -> o#ident f i
| <:module_expr< $anti:s$ >> -> o#anti f s
| <:module_expr< $me1$ $me2$ >> ->
pp f "@[<2>%a@,(%a)@]" o#module_expr me1 o#module_expr me2
@@ -866,12 +869,10 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
pp f "@[<2>%a@]" o#ident i
| <:class_expr< $id:i$ [ $t$ ] >> ->
pp f "@[<2>@[<1>[%a]@]@ %a@]" o#class_params t o#ident i
- (* | <:class_expr< virtual $id:i$ >> -> *)
- | Ast.CeCon _ Ast.BTrue i <:ctyp<>> ->
- pp f "@[<2>virtual@ %a@]" o#ident i
- | Ast.CeCon _ Ast.BTrue i t ->
- (* | <:class_expr< virtual $id:i$ [ $t$ ] >> -> *)
- pp f "@[<2>virtual@ @[<1>[%a]@]@ %a@]" o#class_params t o#ident i
+ | <:class_expr< virtual $lid:i$ >> ->
+ pp f "@[<2>virtual@ %a@]" o#var i
+ | <:class_expr< virtual $lid:i$ [ $t$ ] >> ->
+ pp f "@[<2>virtual@ @[<1>[%a]@]@ %a@]" o#class_params t o#var i
| <:class_expr< fun $p$ -> $ce$ >> ->
pp f "@[<2>fun@ %a@ ->@ %a@]" o#patt p o#class_expr ce
| <:class_expr< let $rec:r$ $bi$ in $ce$ >> ->
@@ -901,12 +902,10 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
pp f "@[<2>%a@]" o#ident i
| <:class_type< $id:i$ [ $t$ ] >> ->
pp f "@[<2>[@,%a@]@,]@ %a" o#class_params t o#ident i
- (* | <:class_type< virtual $id:i$ >> -> *)
- | Ast.CtCon _ Ast.BTrue i <:ctyp<>> ->
- pp f "@[<2>virtual@ %a@]" o#ident i
- (* | <:class_type< virtual $id:i$ [ $t$ ] >> -> *)
- | Ast.CtCon _ Ast.BTrue i t ->
- pp f "@[<2>virtual@ [@,%a@]@,]@ %a" o#class_params t o#ident i
+ | <:class_type< virtual $lid:i$ >> ->
+ pp f "@[<2>virtual@ %a@]" o#var i
+ | <:class_type< virtual $lid:i$ [ $t$ ] >> ->
+ pp f "@[<2>virtual@ [@,%a@]@,]@ %a" o#class_params t o#var i
| <:class_type< [ $t$ ] -> $ct$ >> ->
pp f "@[<2>%a@ ->@ %a@]" o#simple_ctyp t o#class_type ct
| <:class_type< object $csg$ end >> ->
@@ -1017,7 +1016,7 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
end;
module MakeMore (Syntax : Sig.Camlp4Syntax)
-: Sig.Printer with module Ast = Syntax.Ast
+: (Sig.Printer Syntax.Ast).S
= struct
include Make Syntax;
diff --git a/camlp4/Camlp4/Printers/OCaml.mli b/camlp4/Camlp4/Printers/OCaml.mli
index ba930cf9a..a856529d8 100644
--- a/camlp4/Camlp4/Printers/OCaml.mli
+++ b/camlp4/Camlp4/Printers/OCaml.mli
@@ -22,7 +22,6 @@ module Make (Syntax : Sig.Camlp4Syntax) : sig
open Format;
include Sig.Camlp4Syntax
with module Loc = Syntax.Loc
- and module Warning = Syntax.Warning
and module Token = Syntax.Token
and module Ast = Syntax.Ast
and module Gram = Syntax.Gram;
@@ -83,6 +82,7 @@ module Make (Syntax : Sig.Camlp4Syntax) : sig
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 -> list Ast.expr -> unit;
method expr_list_cons : bool -> formatter -> Ast.expr -> unit;
@@ -94,7 +94,7 @@ module Make (Syntax : Sig.Camlp4Syntax) : sig
method ident : formatter -> Ast.ident -> unit;
method intlike : formatter -> string -> unit;
method binding : formatter -> Ast.binding -> unit;
- method record_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 -> (list Ast.expr * option Ast.expr);
@@ -156,13 +156,6 @@ module Make (Syntax : Sig.Camlp4Syntax) : sig
value print :
option string -> (printer -> formatter -> 'a -> unit) -> 'a -> unit;
-
- value print_interf :
- ?input_file: string -> ?output_file: string -> Ast.sig_item -> unit;
-
- value print_implem :
- ?input_file: string -> ?output_file: string -> Ast.str_item -> unit;
end;
-module MakeMore (Syntax : Sig.Camlp4Syntax)
-: Sig.Printer with module Ast = Syntax.Ast;
+module MakeMore (Syntax : Sig.Camlp4Syntax) : (Sig.Printer Syntax.Ast).S;
diff --git a/camlp4/Camlp4/Printers/OCamlr.ml b/camlp4/Camlp4/Printers/OCamlr.ml
index 66a089c17..6c2232c63 100644
--- a/camlp4/Camlp4/Printers/OCamlr.ml
+++ b/camlp4/Camlp4/Printers/OCamlr.ml
@@ -33,6 +33,12 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
value pp = fprintf;
+ value is_keyword =
+ let keywords = ["where"]
+ and not_keywords = ["false"; "function"; "true"; "val"]
+ in 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;
@@ -83,9 +89,9 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
| v ->
match lex_string v with
[ (LIDENT s | UIDENT s | ESCAPED_IDENT s) when is_keyword s ->
- pp f "\\%s" s
+ pp f "%s__" s
| SYMBOL s ->
- pp f "\\%s" s
+ pp f "( %s )" s
| LIDENT s | UIDENT s | ESCAPED_IDENT s ->
pp_print_string f s
| tok -> failwith (sprintf
@@ -165,30 +171,13 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
[ <:expr< $e$.val >> -> pp f "@[<2>%a.@,val@]" o#simple_expr e
| e -> super#dot_expr f e ];
- method simple_expr f e =
- let () = o#node f e Ast.loc_of_expr in
- match e with
- [ <:expr< for $s$ = $e1$ to $e2$ do { $e3$ } >> ->
- pp f "@[<hv0>@[<hv2>@[<2>for %a@ =@ %a@ to@ %a@ do {@]@ %a@]@ }@]"
- o#var s o#expr e1 o#expr e2 o#seq e3
- | <:expr< for $s$ = $e1$ downto $e2$ do { $e3$ } >> ->
- pp f "@[<hv0>@[<hv2>@[<2>for %a@ =@ %a@ downto@ %a@ do {@]@ %a@]@ }@]"
- o#var s o#expr e1 o#expr e2 o#seq e3
- | <:expr< while $e1$ do { $e2$ } >> ->
- pp f "@[<2>while@ %a@ do {@ %a@ }@]" o#expr e1 o#seq e2
- | <:expr< do { $e$ } >> ->
- pp f "@[<hv0>@[<hv2>do {@ %a@]@ }@]" o#seq e
- | e -> super#simple_expr f e ];
-
method ctyp f t =
let () = o#node f t Ast.loc_of_ctyp in
match t with
[ Ast.TyDcl _ tn tp te cl -> do {
pp f "@[<2>%a%a@]" o#var tn o#type_params tp;
match te with
- [ <:ctyp< '$s$ >>
- when not (List.exists (fun [ <:ctyp< '$s'$ >> -> s = s'
- | _ -> False ]) tp) -> ()
+ [ <:ctyp<>> -> ()
| _ -> pp f " =@ %a" o#ctyp te ];
if cl <> [] then pp f "@ %a" (list o#constrain "@ ") cl else ();
}
@@ -249,12 +238,10 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
pp f "@[<2>%a@]" o#ident i
| <:class_type< $id:i$ [ $t$ ] >> ->
pp f "@[<2>%a [@,%a@]@,]" o#ident i o#class_params t
- (* | <:class_type< virtual $id:i$ >> -> *)
- | Ast.CtCon _ Ast.BTrue i <:ctyp<>> ->
- pp f "@[<2>virtual@ %a@]" o#ident i
- (* | <:class_type< virtual $id:i$ [ $t$ ] >> -> *)
- | Ast.CtCon _ Ast.BTrue i t ->
- pp f "@[<2>virtual@ %a@ [@,%a@]@,]" o#ident i o#class_params t
+ | <:class_type< virtual $lid:i$ >> ->
+ pp f "@[<2>virtual@ %a@]" o#var i
+ | <:class_type< virtual $lid:i$ [ $t$ ] >> ->
+ pp f "@[<2>virtual@ %a@ [@,%a@]@,]" o#var i o#class_params t
| ct -> super#class_type f ct ];
method class_expr f ce =
@@ -264,12 +251,10 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
pp f "@[<2>%a@]" o#ident i
| <:class_expr< $id:i$ [ $t$ ] >> ->
pp f "@[<2>%a@ @[<1>[%a]@]@]" o#ident i o#class_params t
- (* | <:class_expr< virtual $id:i$ >> -> *)
- | Ast.CeCon _ Ast.BTrue i <:ctyp<>> ->
- pp f "@[<2>virtual@ %a@]" o#ident i
- | Ast.CeCon _ Ast.BTrue i t ->
- (* | <:class_expr< virtual $id:i$ [ $t$ ] >> -> *)
- pp f "@[<2>virtual@ %a@ @[<1>[%a]@]@]" o#ident i o#ctyp t
+ | <:class_expr< virtual $lid:i$ >> ->
+ pp f "@[<2>virtual@ %a@]" o#var i
+ | <:class_expr< virtual $lid:i$ [ $t$ ] >> ->
+ pp f "@[<2>virtual@ %a@ @[<1>[%a]@]@]" o#var i o#ctyp t
| ce -> super#class_expr f ce ];
end;
@@ -281,7 +266,7 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
end;
module MakeMore (Syntax : Sig.Camlp4Syntax)
-: Sig.Printer with module Ast = Syntax.Ast
+: (Sig.Printer Syntax.Ast).S
= struct
include Make Syntax;
diff --git a/camlp4/Camlp4/Printers/OCamlr.mli b/camlp4/Camlp4/Printers/OCamlr.mli
index c09bf6eb5..f1db176a5 100644
--- a/camlp4/Camlp4/Printers/OCamlr.mli
+++ b/camlp4/Camlp4/Printers/OCamlr.mli
@@ -22,7 +22,6 @@ module Make (Syntax : Sig.Camlp4Syntax) : sig
open Format;
include Sig.Camlp4Syntax
with module Loc = Syntax.Loc
- and module Warning = Syntax.Warning
and module Token = Syntax.Token
and module Ast = Syntax.Ast
and module Gram = Syntax.Gram;
@@ -43,13 +42,6 @@ module Make (Syntax : Sig.Camlp4Syntax) : sig
value print :
option string -> (printer -> formatter -> 'a -> unit) -> 'a -> unit;
-
- value print_interf :
- ?input_file: string -> ?output_file: string -> Ast.sig_item -> unit;
-
- value print_implem :
- ?input_file: string -> ?output_file: string -> Ast.str_item -> unit;
end;
-module MakeMore (Syntax : Sig.Camlp4Syntax)
-: Sig.Printer with module Ast = Syntax.Ast;
+module MakeMore (Syntax : Sig.Camlp4Syntax) : (Sig.Printer Syntax.Ast).S;
diff --git a/camlp4/Camlp4/Register.ml b/camlp4/Camlp4/Register.ml
index e491f4c17..6044b0d97 100644
--- a/camlp4/Camlp4/Register.ml
+++ b/camlp4/Camlp4/Register.ml
@@ -34,13 +34,18 @@ value str_item_printer = ref (fun ?input_file:(_) ?output_file:(_) _ -> failwith
value callbacks = Queue.create ();
+value loaded_modules = ref [];
+
value iter_and_take_callbacks f =
let rec loop () = loop (f (Queue.take callbacks)) in
try loop () with [ Queue.Empty -> () ];
value declare_dyn_module m f =
- (* let () = Format.eprintf "declare_dyn_module: %s@." m in *)
- Queue.add (m, f) callbacks;
+ begin
+ (* let () = Format.eprintf "declare_dyn_module: %s@." m in *)
+ loaded_modules.val := [ m :: loaded_modules.val ];
+ Queue.add (m, f) callbacks;
+ end;
value register_str_item_parser f = str_item_parser.val := f;
value register_sig_item_parser f = sig_item_parser.val := f;
@@ -72,7 +77,7 @@ end;
module Printer
(Id : Sig.Id) (Maker : functor (Syn : Sig.Syntax)
- -> Sig.Printer with module Ast = Syn.Ast) =
+ -> (Sig.Printer Syn.Ast).S) =
struct
declare_dyn_module Id.name (fun _ ->
let module M = Maker Syntax in
@@ -81,7 +86,7 @@ end;
module OCamlPrinter
(Id : Sig.Id) (Maker : functor (Syn : Sig.Camlp4Syntax)
- -> Sig.Printer with module Ast = Syn.Ast) =
+ -> (Sig.Printer Syn.Ast).S) =
struct
declare_dyn_module Id.name (fun _ ->
let module M = Maker Syntax in
@@ -89,7 +94,7 @@ struct
end;
module OCamlPreCastPrinter
- (Id : Sig.Id) (P : Sig.Printer with module Ast = PreCast.Ast) =
+ (Id : Sig.Id) (P : (Sig.Printer PreCast.Ast).S) =
struct
declare_dyn_module Id.name (fun _ ->
register_printer P.print_implem P.print_interf);
@@ -97,7 +102,7 @@ end;
module Parser
(Id : Sig.Id) (Maker : functor (Ast : Sig.Ast)
- -> Sig.Parser with module Ast = Ast) =
+ -> (Sig.Parser Ast).S) =
struct
declare_dyn_module Id.name (fun _ ->
let module M = Maker PreCast.Ast in
@@ -106,7 +111,7 @@ end;
module OCamlParser
(Id : Sig.Id) (Maker : functor (Ast : Sig.Camlp4Ast)
- -> Sig.Parser with module Ast = Ast) =
+ -> (Sig.Parser Ast).S) =
struct
declare_dyn_module Id.name (fun _ ->
let module M = Maker PreCast.Ast in
@@ -114,7 +119,7 @@ struct
end;
module OCamlPreCastParser
- (Id : Sig.Id) (P : Sig.Parser with module Ast = PreCast.Ast) =
+ (Id : Sig.Id) (P : (Sig.Parser PreCast.Ast).S) =
struct
declare_dyn_module Id.name (fun _ ->
register_parser P.parse_implem P.parse_interf);
@@ -126,10 +131,8 @@ struct
declare_dyn_module Id.name (fun _ -> let module M = Maker AstFilters in ());
end;
-let module M = Syntax.Parser in do {
- sig_item_parser.val := M.parse_interf;
- str_item_parser.val := M.parse_implem;
-};
+sig_item_parser.val := Syntax.parse_interf;
+str_item_parser.val := Syntax.parse_implem;
module CurrentParser = struct
module Ast = Ast;
diff --git a/camlp4/Camlp4/Register.mli b/camlp4/Camlp4/Register.mli
index 337ca55d2..df1180ffd 100644
--- a/camlp4/Camlp4/Register.mli
+++ b/camlp4/Camlp4/Register.mli
@@ -42,13 +42,13 @@ value register_sig_item_parser : parser_fun PreCast.Ast.sig_item -> unit;
value register_parser : parser_fun PreCast.Ast.str_item -> parser_fun PreCast.Ast.sig_item -> unit;
module Parser
- (Id : Sig.Id) (Maker : functor (Ast : Sig.Ast) -> Sig.Parser with module Ast = Ast) : sig end;
+ (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 with module Ast = Ast) : sig end;
+ (Id : Sig.Id) (Maker : functor (Ast : Sig.Camlp4Ast) -> (Sig.Parser Ast).S) : sig end;
module OCamlPreCastParser
- (Id : Sig.Id) (Parser : Sig.Parser with module Ast = PreCast.Ast) : sig end;
+ (Id : Sig.Id) (Parser : (Sig.Parser PreCast.Ast).S) : sig end;
(** {6 Registering Printers} *)
@@ -61,16 +61,16 @@ value register_printer : printer_fun PreCast.Ast.str_item -> printer_fun PreCast
module Printer
(Id : Sig.Id)
- (Maker : functor (Syn : Sig.Syntax) -> Sig.Printer with module Ast = Syn.Ast) :
+ (Maker : functor (Syn : Sig.Syntax) -> (Sig.Printer Syn.Ast).S) :
sig end;
module OCamlPrinter
(Id : Sig.Id)
- (Maker : functor (Syn : Sig.Camlp4Syntax) -> Sig.Printer with module Ast = Syn.Ast) :
+ (Maker : functor (Syn : Sig.Camlp4Syntax) -> (Sig.Printer Syn.Ast).S) :
sig end;
module OCamlPreCastPrinter
- (Id : Sig.Id) (Printer : Sig.Printer with module Ast = PreCast.Ast) :
+ (Id : Sig.Id) (Printer : (Sig.Printer PreCast.Ast).S) :
sig end;
(** {6 Registering Filters} *)
@@ -80,9 +80,10 @@ module AstFilter
value declare_dyn_module : string -> (unit -> unit) -> unit;
value iter_and_take_callbacks : ((string * (unit -> unit)) -> unit) -> unit;
+value loaded_modules : ref (list string);
-module CurrentParser : Sig.Parser with module Ast = PreCast.Ast;
-module CurrentPrinter : Sig.Printer with module Ast = PreCast.Ast;
+module CurrentParser : (Sig.Parser PreCast.Ast).S;
+module CurrentPrinter : (Sig.Printer PreCast.Ast).S;
value enable_ocaml_printer : unit -> unit;
value enable_ocamlr_printer : unit -> unit;
diff --git a/camlp4/Camlp4/Sig.ml b/camlp4/Camlp4/Sig.ml
index a9ee50e1b..afa425ed2 100644
--- a/camlp4/Camlp4/Sig.ml
+++ b/camlp4/Camlp4/Sig.ml
@@ -19,13 +19,13 @@
*)
module type Type = sig
- type t = 'abstract;
+ 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 = 'abstract;
+ type t;
exception E of t;
value to_string : t -> string;
value print : Format.formatter -> t -> unit;
@@ -44,7 +44,7 @@ end;
module type Loc = sig
- type t = 'a;
+ type t;
(** Return a start location for the given file name.
This location starts at the begining of the file. *)
@@ -174,12 +174,13 @@ module type Loc = sig
end;
-module type Warning = sig
- module Loc : Loc;
- type t = Loc.t -> string -> unit;
- value default : t;
- value current : ref t;
- value print : t;
+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. *)
@@ -214,25 +215,26 @@ module type Ast = sig
module Loc : Loc;
- type meta_bool = 'abstract;
- type meta_option 'a = 'abstract;
- type meta_list 'a = 'abstract;
- type ctyp = 'abstract;
- type patt = 'abstract;
- type expr = 'abstract;
- type module_type = 'abstract;
- type sig_item = 'abstract;
- type with_constr = 'abstract;
- type module_expr = 'abstract;
- type str_item = 'abstract;
- type class_type = 'abstract;
- type class_sig_item = 'abstract;
- type class_expr = 'abstract;
- type class_str_item = 'abstract;
- type match_case = 'abstract;
- type ident = 'abstract;
- type binding = 'abstract;
- type module_binding = 'abstract;
+ type meta_bool;
+ type meta_option 'a;
+ type meta_list 'a;
+ 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;
value loc_of_ctyp : ctyp -> Loc.t;
value loc_of_patt : patt -> Loc.t;
@@ -247,6 +249,7 @@ module type Ast = sig
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;
@@ -287,6 +290,7 @@ module type Ast = sig
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;
@@ -318,6 +322,7 @@ module type Ast = sig
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;
@@ -345,7 +350,31 @@ end;
It provides:
- Types for all kinds of structure.
- Map: A base class for map traversals.
- - Map classes and functions for common kinds. *)
+ - 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 *)
+ *)
module type Camlp4Ast = sig
module Loc : Loc;
@@ -365,6 +394,7 @@ module type Camlp4Ast = sig
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;
@@ -401,6 +431,7 @@ module type Camlp4Ast = sig
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;
@@ -425,6 +456,7 @@ module type Camlp4Ast = sig
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;
@@ -465,6 +497,7 @@ module type Camlp4Ast = sig
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;
@@ -497,38 +530,33 @@ module type Camlp4Ast = sig
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;
end;
- (** See {!Ast.remove_antiquots}. *)
- (* class remove_antiquots : object inherit map; end; *)
-
- class c_expr : [expr -> expr] -> object inherit map; end;
- class c_patt : [patt -> patt] -> object inherit map; end;
- class c_ctyp : [ctyp -> ctyp] -> object inherit map; end;
- class c_str_item : [str_item -> str_item] -> object inherit map; end;
- class c_sig_item : [sig_item -> sig_item] -> object inherit map; end;
- class c_loc : [Loc.t -> Loc.t] -> object inherit map; end;
-
- value map_expr : (expr -> expr) -> expr -> expr;
- value map_patt : (patt -> patt) -> patt -> patt;
- value map_ctyp : (ctyp -> ctyp) -> ctyp -> ctyp;
- value map_str_item : (str_item -> str_item) -> str_item -> str_item;
- value map_sig_item : (sig_item -> sig_item) -> sig_item -> sig_item;
- value map_loc : (Loc.t -> Loc.t) -> Loc.t -> Loc.t;
+ value map_expr : (expr -> expr) -> map;
+ value map_patt : (patt -> patt) -> 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 ident_of_expr : expr -> ident;
+ value ident_of_patt : patt -> ident;
value ident_of_ctyp : ctyp -> ident;
value biAnd_of_list : list binding -> binding;
- value biSem_of_list : list binding -> binding;
+ value rbSem_of_list : list rec_binding -> rec_binding;
value paSem_of_list : list patt -> patt;
value paCom_of_list : list patt -> patt;
value tyOr_of_list : list ctyp -> ctyp;
value tyAnd_of_list : list ctyp -> ctyp;
+ value tyAmp_of_list : list ctyp -> ctyp;
value tySem_of_list : list ctyp -> ctyp;
+ value tyCom_of_list : list ctyp -> ctyp;
+ value tySta_of_list : list ctyp -> ctyp;
value stSem_of_list : list str_item -> str_item;
value sgSem_of_list : list sig_item -> sig_item;
value crSem_of_list : list class_str_item -> class_str_item;
@@ -546,6 +574,7 @@ module type Camlp4Ast = sig
value list_of_ctyp : ctyp -> list ctyp -> list ctyp;
value list_of_binding : binding -> list binding -> list binding;
+ value list_of_rec_binding : rec_binding -> list rec_binding -> list rec_binding;
value list_of_with_constr : with_constr -> list with_constr -> list with_constr;
value list_of_patt : patt -> list patt -> list patt;
value list_of_expr : expr -> list expr -> list expr;
@@ -602,6 +631,7 @@ module Camlp4AstToAst (M : Camlp4Ast) : Ast
and type class_expr = M.class_expr
and type class_str_item = M.class_str_item
and type binding = M.binding
+ 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
@@ -635,6 +665,41 @@ module type AstFilters = sig
end;
+(** Ast as one single type *)
+
+module type DynAst = sig
+ module Ast : Ast;
+ type tag 'a;
+
+ value ctyp_tag : tag Ast.ctyp;
+ value patt_tag : tag Ast.patt;
+ value expr_tag : tag Ast.expr;
+ value module_type_tag : tag Ast.module_type;
+ value sig_item_tag : tag Ast.sig_item;
+ value with_constr_tag : tag Ast.with_constr;
+ value module_expr_tag : tag Ast.module_expr;
+ value str_item_tag : tag Ast.str_item;
+ value class_type_tag : tag Ast.class_type;
+ value class_sig_item_tag : tag Ast.class_sig_item;
+ value class_expr_tag : tag Ast.class_expr;
+ value class_str_item_tag : tag Ast.class_str_item;
+ value match_case_tag : tag Ast.match_case;
+ value ident_tag : tag Ast.ident;
+ value binding_tag : tag Ast.binding;
+ value rec_binding_tag : tag Ast.rec_binding;
+ value module_binding_tag : tag Ast.module_binding;
+
+ value string_of_tag : tag 'a -> string;
+
+ module Pack (X : sig type t 'a; end) : sig
+ type pack;
+ value pack : tag 'a -> X.t 'a -> pack;
+ value unpack : tag 'a -> pack -> X.t 'a;
+ value print_tag : Format.formatter -> pack -> unit;
+ end;
+end;
+
+
(** Quotation operations. *)
type quotation =
@@ -645,45 +710,32 @@ type quotation =
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
for the location variable. The string is the quotation contents. *)
type expand_fun 'a = Loc.t -> option string -> string -> 'a;
- (** The type for quotation expanders kind:
- - [ExStr exp] for an expander [exp] returning a string which
- can be parsed to create a syntax tree. Its boolean parameter
- tells whether the quotation is in position of an expression
- (True) or in position of a pattern (False). Quotations expanders
- created with this way may work for some particular language syntax,
- and not for another one (e.g. may work when used with Revised
- syntax and not when used with Ocaml syntax, and conversely).
- - [ExAst (expr_exp, patt_exp)] for expanders returning directly
- syntax trees, therefore not necessiting to be parsed afterwards.
- The function [expr_exp] is called when the quotation is in
- position of an expression, and [patt_exp] when the quotation is
- in position of a pattern. Quotation expanders created with this
- way are independant from the language syntax. *)
- type expander =
- [ ExStr of bool -> expand_fun string
- | ExAst of (expand_fun Ast.expr) and (expand_fun Ast.patt) ];
-
(** [add name exp] adds the quotation [name] associated with the
expander [exp]. *)
- value add : string -> expander -> unit;
+ value add : string -> DynAst.tag 'a -> expand_fun 'a -> unit;
(** [find name] returns the expander of the given quotation name. *)
- value find : string -> expander;
+ value find : string -> DynAst.tag 'a -> expand_fun 'a;
(** [default] holds the default quotation name. *)
value default : ref string;
+ (** [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;
+
(** function translating quotation names; default = identity *)
value translate : ref (string -> string);
- value expand_expr : (Loc.t -> string -> Ast.expr) -> Loc.t -> quotation -> Ast.expr;
- value expand_patt : (Loc.t -> string -> Ast.patt) -> Loc.t -> quotation -> Ast.patt;
+ value expand : Loc.t -> quotation -> DynAst.tag 'a -> 'a;
(** [dump_file] optionally tells Camlp4 to dump the
result of an expander if this result is syntactically incorrect.
@@ -701,7 +753,7 @@ module type Token = sig
module Loc : Loc;
- type t = 'abstract;
+ type t;
value to_string : t -> string;
@@ -718,7 +770,7 @@ module type Token = sig
(** The type for this filter chain.
A basic implementation just store the [is_keyword] function given
by [mk] and use it in the [filter] function. *)
- type t = 'abstract;
+ type t;
(** The given predicate function returns true if the given string
is a keyword. This function can be used in filters to translate
@@ -802,7 +854,7 @@ type camlp4_token =
module type Camlp4Token = Token with type t = camlp4_token;
module type DynLoader = sig
- type t = 'abstract;
+ type t;
exception Error of string and string;
(** [mk ?ocaml_stdlib ?camlp4_stdlib]
@@ -831,7 +883,7 @@ module Grammar = struct
(** Internal signature for sematantic actions of grammars,
not for the casual user. These functions are unsafe. *)
module type Action = sig
- type t = 'abstract;
+ type t ;
value mk : 'a -> t;
value get : t -> 'a;
@@ -857,9 +909,9 @@ module Grammar = struct
module Action : Action;
module Token : Token with module Loc = Loc;
- type gram = 'abstract;
- type internal_entry = 'abstract;
- type tree = 'abstract;
+ type gram;
+ type internal_entry;
+ type tree;
type token_pattern = ((Token.t -> bool) * string);
@@ -907,7 +959,7 @@ module Grammar = struct
module Entry : sig
(** The abstract type of grammar entries. The type parameter is the type
of the semantic actions that are associated with this entry. *)
- type t 'a = 'abstract;
+ type t 'a;
(** Make a new entry from the given name. *)
value mk : gram -> string -> t 'a;
@@ -937,7 +989,7 @@ module Grammar = struct
(** [get_filter g] Get the {!Token.Filter} associated to the [g]. *)
value get_filter : gram -> Token.Filter.t;
- type not_filtered 'a = 'abstract;
+ type not_filtered 'a;
(** This function is called by the EXTEND ... END syntax. *)
value extend : Entry.t 'a -> extend_statment -> unit;
@@ -988,7 +1040,7 @@ module Grammar = struct
module Entry : sig
(** The abstract type of grammar entries. The type parameter is the type
of the semantic actions that are associated with this entry. *)
- type t 'a = 'abstract;
+ type t 'a;
(** Make a new entry from the given name. *)
value mk : string -> t 'a;
@@ -1018,7 +1070,7 @@ module Grammar = struct
(** Get the {!Token.Filter} associated to the grammar module. *)
value get_filter : unit -> Token.Filter.t;
- type not_filtered 'a = 'abstract;
+ type not_filtered 'a;
(** This function is called by the EXTEND ... END syntax. *)
value extend : Entry.t 'a -> extend_statment -> unit;
@@ -1075,37 +1127,35 @@ end;
(** {6 Parser} *)
-module type Parser = sig
-
- module Ast : Ast;
- open Ast;
-
- (** Called when parsing an implementation (ml file) to build the syntax
- tree; the returned list contains the phrases (structure items) as a
- single "declare" node (a list of structure items); if the parser
- encounter a directive it stops (since the directive may change the
- syntax), the given [directive_handler] function evaluates it and
- the parsing starts again. *)
- value parse_implem : ?directive_handler:(str_item -> option str_item) ->
- Loc.t -> Stream.t char -> Ast.str_item;
-
- (** Same as {!parse_implem} but for interface (mli file). *)
- value parse_interf : ?directive_handler:(sig_item -> option sig_item) ->
- Loc.t -> Stream.t char -> Ast.sig_item;
-
+module Parser (Ast : Ast) = struct
+ module type S = sig
+
+ (** Called when parsing an implementation (ml file) to build the syntax
+ tree; the returned list contains the phrases (structure items) as a
+ single "declare" node (a list of structure items); if the parser
+ encounter a directive it stops (since the directive may change the
+ 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;
+
+ (** 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;
+ end;
end;
(** {6 Printer} *)
-module type Printer = sig
-
- module Ast : Ast;
+module Printer (Ast : Ast) = struct
+ module type S = sig
- value print_interf : ?input_file:string -> ?output_file:string ->
- Ast.sig_item -> unit;
- value print_implem : ?input_file:string -> ?output_file:string ->
- Ast.str_item -> unit;
+ value print_interf : ?input_file:string -> ?output_file:string ->
+ Ast.sig_item -> unit;
+ value print_implem : ?input_file:string -> ?output_file:string ->
+ Ast.str_item -> unit;
+ end;
end;
(** A syntax module is a sort of constistent bunch of modules and values.
@@ -1114,15 +1164,16 @@ end;
There is also the main grammar entries. *)
module type Syntax = sig
module Loc : Loc;
- module Warning : Warning with module Loc = Loc;
module Ast : Ast with module Loc = Loc;
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 Parser : Parser with module Ast = Ast;
- module Printer : Printer with module Ast = Ast;
+
+ include (Warning Loc).S;
+ include (Parser Ast).S;
+ include (Printer Ast).S;
end;
(** A syntax module is a sort of constistent bunch of modules and values.
@@ -1131,7 +1182,6 @@ end;
There is also the main grammar entries. *)
module type Camlp4Syntax = sig
module Loc : Loc;
- module Warning : Warning with module Loc = Loc;
module Ast : Camlp4Ast with module Loc = Loc;
module Token : Camlp4Token with module Loc = Loc;
@@ -1140,8 +1190,10 @@ module type Camlp4Syntax = sig
module AntiquotSyntax : AntiquotSyntax with module Ast = Camlp4AstToAst Ast;
(* Gram is not constrained here for flexibility *)
module Quotation : Quotation with module Ast = Camlp4AstToAst Ast;
- module Parser : Parser with module Ast = Camlp4AstToAst Ast;
- module Printer : Printer with module Ast = Camlp4AstToAst Ast;
+
+ include (Warning Loc).S;
+ include (Parser Ast).S;
+ include (Printer Ast).S;
value interf : Gram.Entry.t (list Ast.sig_item * option Loc.t);
value implem : Gram.Entry.t (list Ast.str_item * option Loc.t);
@@ -1154,7 +1206,6 @@ module type Camlp4Syntax = sig
value a_INT64 : Gram.Entry.t string;
value a_LABEL : Gram.Entry.t string;
value a_LIDENT : Gram.Entry.t string;
- value a_LIDENT_or_operator : Gram.Entry.t string;
value a_NATIVEINT : Gram.Entry.t string;
value a_OPTLABEL : Gram.Entry.t string;
value a_STRING : Gram.Entry.t string;
@@ -1167,6 +1218,7 @@ module type Camlp4Syntax = sig
value match_case_quot : Gram.Entry.t Ast.match_case;
value binding : Gram.Entry.t Ast.binding;
value binding_quot : Gram.Entry.t Ast.binding;
+ value rec_binding_quot : Gram.Entry.t Ast.rec_binding;
value class_declaration : Gram.Entry.t Ast.class_expr;
value class_description : Gram.Entry.t Ast.class_type;
value class_expr : Gram.Entry.t Ast.class_expr;
@@ -1208,8 +1260,7 @@ module type Camlp4Syntax = sig
value expr : Gram.Entry.t Ast.expr;
value expr_eoi : Gram.Entry.t Ast.expr;
value expr_quot : Gram.Entry.t Ast.expr;
- value field : Gram.Entry.t Ast.ctyp;
- value field_expr : Gram.Entry.t Ast.binding;
+ value field_expr : Gram.Entry.t Ast.rec_binding;
value fun_binding : Gram.Entry.t Ast.expr;
value fun_def : Gram.Entry.t Ast.expr;
value ident : Gram.Entry.t Ast.ident;
@@ -1218,7 +1269,7 @@ module type Camlp4Syntax = sig
value ipatt_tcon : Gram.Entry.t Ast.patt;
value label : Gram.Entry.t string;
value label_declaration : Gram.Entry.t Ast.ctyp;
- value label_expr : Gram.Entry.t Ast.binding;
+ value label_expr : Gram.Entry.t Ast.rec_binding;
value label_ipatt : Gram.Entry.t Ast.patt;
value label_longident : Gram.Entry.t Ast.ident;
value label_patt : Gram.Entry.t Ast.patt;
@@ -1243,7 +1294,7 @@ module type Camlp4Syntax = sig
value opt_class_self_type : Gram.Entry.t Ast.ctyp;
value opt_comma_ctyp : Gram.Entry.t Ast.ctyp;
value opt_dot_dot : Gram.Entry.t Ast.meta_bool;
- value opt_eq_ctyp : Gram.Entry.t (list Ast.ctyp -> Ast.ctyp);
+ value opt_eq_ctyp : Gram.Entry.t Ast.ctyp;
value opt_expr : Gram.Entry.t Ast.expr;
value opt_meth_list : Gram.Entry.t Ast.ctyp;
value opt_mutable : Gram.Entry.t Ast.meta_bool;
@@ -1258,16 +1309,15 @@ module type Camlp4Syntax = sig
value patt_quot : Gram.Entry.t Ast.patt;
value patt_tcon : Gram.Entry.t Ast.patt;
value phrase : Gram.Entry.t Ast.str_item;
- value pipe_ctyp : Gram.Entry.t Ast.ctyp;
value poly_type : Gram.Entry.t Ast.ctyp;
value row_field : Gram.Entry.t Ast.ctyp;
- value sem_ctyp : Gram.Entry.t Ast.ctyp;
value sem_expr : Gram.Entry.t Ast.expr;
value sem_expr_for_list : Gram.Entry.t (Ast.expr -> Ast.expr);
value sem_patt : Gram.Entry.t Ast.patt;
value sem_patt_for_list : Gram.Entry.t (Ast.patt -> Ast.patt);
value semi : Gram.Entry.t unit;
value sequence : Gram.Entry.t Ast.expr;
+ value do_sequence : Gram.Entry.t Ast.expr;
value sig_item : Gram.Entry.t Ast.sig_item;
value sig_item_quot : Gram.Entry.t Ast.sig_item;
value sig_items : Gram.Entry.t Ast.sig_item;
@@ -1289,11 +1339,16 @@ module type Camlp4Syntax = sig
value value_val : Gram.Entry.t unit;
value with_constr : Gram.Entry.t Ast.with_constr;
value with_constr_quot : Gram.Entry.t Ast.with_constr;
+ value prefixop : Gram.Entry.t Ast.expr;
+ value infixop0 : Gram.Entry.t Ast.expr;
+ value infixop1 : Gram.Entry.t Ast.expr;
+ value infixop2 : Gram.Entry.t Ast.expr;
+ value infixop3 : Gram.Entry.t Ast.expr;
+ value infixop4 : Gram.Entry.t Ast.expr;
end;
module type SyntaxExtension = functor (Syn : Syntax)
-> (Syntax with module Loc = Syn.Loc
- and module Warning = Syn.Warning
and module Ast = Syn.Ast
and module Token = Syn.Token
and module Gram = Syn.Gram
diff --git a/camlp4/Camlp4/Struct.mlpack b/camlp4/Camlp4/Struct.mlpack
index bd8c40a1e..a939fe77b 100644
--- a/camlp4/Camlp4/Struct.mlpack
+++ b/camlp4/Camlp4/Struct.mlpack
@@ -11,5 +11,5 @@ Lexer
Loc
Quotation
Token
-Warning
Grammar
+DynAst
diff --git a/camlp4/Camlp4/Struct/Camlp4Ast.mlast b/camlp4/Camlp4/Struct/Camlp4Ast.mlast
index 95bccdb5c..b7a8b4ff6 100644
--- a/camlp4/Camlp4/Struct/Camlp4Ast.mlast
+++ b/camlp4/Camlp4/Struct/Camlp4Ast.mlast
@@ -45,93 +45,11 @@ module Make (Loc : Sig.Loc)
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";
- module Meta = 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 = struct
- value meta_loc_patt _loc location =
- let (a, b, c, d, e, f, g, h) = Loc.to_tuple location in
- <:patt< Loc.of_tuple
- ($`str:a$, $`int:b$, $`int:c$, $`int:d$,
- $`int:e$, $`int:f$, $`int:g$,
- $if h then <:patt< True >> else <:patt< False >> $) >>;
- value meta_loc_expr _loc location =
- let (a, b, c, d, e, f, g, h) = Loc.to_tuple location in
- <:expr< Loc.of_tuple
- ($`str:a$, $`int:b$, $`int:c$, $`int:d$,
- $`int:e$, $`int:f$, $`int:g$,
- $if h then <:expr< True >> else <:expr< False >> $) >>;
- end;
-
- module MetaGhostLoc = struct
- value meta_loc_patt _loc _ = <:patt< Loc.ghost >>;
- value meta_loc_expr _loc _ = <:expr< Loc.ghost >>;
- end;
-
- module MetaLocVar = struct
- value meta_loc_patt _loc _ = <:patt< $lid:Loc.name.val$ >>;
- value meta_loc_expr _loc _ = <:expr< $lid:Loc.name.val$ >>;
- end;
-
- module Make (MetaLoc : META_LOC) = struct
- open MetaLoc;
-
- value meta_acc_Loc_t = meta_loc_expr;
- module Expr = Camlp4Filters.MetaGeneratorExpr Ast;
- value meta_acc_Loc_t = meta_loc_patt;
- module Patt = Camlp4Filters.MetaGeneratorPatt Ast;
- end;
-
- end;
-
- class map = Camlp4Filters.GenerateMap.generated;
-
- class fold = Camlp4Filters.GenerateFold.generated;
-
- class c_expr f = object
- inherit map as super;
- method expr x = f (super#expr x);
- end;
- class c_patt f = object
- inherit map as super;
- method patt x = f (super#patt x);
- end;
- class c_ctyp f = object
- inherit map as super;
- method ctyp x = f (super#ctyp x);
- end;
- class c_str_item f = object
- inherit map as super;
- method str_item x = f (super#str_item x);
- end;
- class c_sig_item f = object
- inherit map as super;
- method sig_item x = f (super#sig_item x);
- end;
- class c_loc f = object
- inherit map as super;
- method _Loc_t x = f (super#_Loc_t x);
- end;
- value map_patt f ast = (new c_patt f)#patt ast;
- value map_loc f ast = (new c_loc f)#_Loc_t ast;
- value map_sig_item f ast = (new c_sig_item f)#sig_item ast;
- value map_str_item f ast = (new c_str_item f)#str_item ast;
- value map_ctyp f ast = (new c_ctyp f)#ctyp ast;
- value map_expr f ast = (new c_expr f)#expr ast;
value ghost = Loc.ghost;
value rec is_module_longident =
@@ -142,6 +60,47 @@ module Make (Loc : Sig.Loc)
| <:ident< $uid:_$ >> -> True
| _ -> False ];
+ value ident_of_expr =
+ let error () =
+ invalid_arg "ident_of_expr: this expression is not an identifier" in
+ let rec self =
+ fun
+ [ <:expr@_loc< $e1$ $e2$ >> -> <:ident< $self e1$ $self e2$ >>
+ | <:expr@_loc< $e1$.$e2$ >> -> <:ident< $self e1$.$self e2$ >>
+ | <:expr< $lid:_$ >> -> error ()
+ | <:expr< $id:i$ >> -> if is_module_longident i then i else error ()
+ | _ -> error () ] in
+ fun
+ [ <:expr< $id:i$ >> -> i
+ | <:expr< $_$ $_$ >> -> error ()
+ | t -> self t ];
+
+ value ident_of_ctyp =
+ let error () =
+ invalid_arg "ident_of_ctyp: this type is not an identifier" in
+ let rec self =
+ fun
+ [ <:ctyp@_loc< $t1$ $t2$ >> -> <:ident< $self t1$ $self t2$ >>
+ | <:ctyp< $lid:_$ >> -> error ()
+ | <:ctyp< $id:i$ >> -> if is_module_longident i then i else error ()
+ | _ -> error () ] in
+ fun
+ [ <:ctyp< $id:i$ >> -> i
+ | t -> self t ];
+
+ value ident_of_patt =
+ let error () =
+ invalid_arg "ident_of_patt: this pattern is not an identifier" in
+ let rec self =
+ fun
+ [ <:patt@_loc< $p1$ $p2$ >> -> <:ident< $self p1$ $self p2$ >>
+ | <:patt< $lid:_$ >> -> error ()
+ | <:patt< $id:i$ >> -> if is_module_longident i then i else error ()
+ | _ -> error () ] in
+ fun
+ [ <:patt< $id:i$ >> -> i
+ | p -> self p ];
+
value rec is_irrefut_patt =
fun
[ <:patt< $lid:_$ >> -> True
@@ -181,34 +140,6 @@ module Make (Loc : Sig.Loc)
| <:expr< `$_$ >> -> True
| _ -> False ];
- value ident_of_expr =
- let error () =
- invalid_arg "ident_of_expr: this expression is not an identifier" in
- let rec self =
- fun
- [ <:expr@_loc< $e1$ $e2$ >> -> <:ident< $self e1$ $self e2$ >>
- | <:expr@_loc< $e1$.$e2$ >> -> <:ident< $self e1$.$self e2$ >>
- | <:expr< $lid:_$ >> -> error ()
- | <:expr< $id:i$ >> -> if is_module_longident i then i else error ()
- | <:expr< $_$ >> -> error () ] in
- fun
- [ <:expr< $id:i$ >> -> i
- | <:expr< $_$ $_$ >> -> error ()
- | t -> self t ];
-
- value ident_of_ctyp =
- let error () =
- invalid_arg "ident_of_ctyp: this type is not an identifier" in
- let rec self =
- fun
- [ <:ctyp@_loc< $t1$ $t2$ >> -> <:ident< $self t1$ $self t2$ >>
- | <:ctyp< $lid:_$ >> -> error ()
- | <:ctyp< $id:i$ >> -> if is_module_longident i then i else error ()
- | <:ctyp< $_$ >> -> error () ] in
- fun
- [ <:ctyp< $id:i$ >> -> i
- | t -> self t ];
-
value rec tyOr_of_list =
fun
[ [] -> <:ctyp@ghost<>>
@@ -230,6 +161,27 @@ module Make (Loc : Sig.Loc)
| [t::ts] ->
let _loc = loc_of_ctyp t in <:ctyp< $t$ ; $tySem_of_list ts$ >> ];
+ value rec tyCom_of_list =
+ fun
+ [ [] -> <:ctyp@ghost<>>
+ | [t] -> t
+ | [t::ts] ->
+ let _loc = loc_of_ctyp t in <:ctyp< $t$, $tyCom_of_list ts$ >> ];
+
+ value rec tyAmp_of_list =
+ fun
+ [ [] -> <:ctyp@ghost<>>
+ | [t] -> t
+ | [t::ts] ->
+ let _loc = loc_of_ctyp t in <:ctyp< $t$ & $tyAmp_of_list ts$ >> ];
+
+ value rec tySta_of_list =
+ fun
+ [ [] -> <:ctyp@ghost<>>
+ | [t] -> t
+ | [t::ts] ->
+ let _loc = loc_of_ctyp t in <:ctyp< $t$ * $tySta_of_list ts$ >> ];
+
value rec stSem_of_list =
fun
[ [] -> <:str_item@ghost<>>
@@ -251,6 +203,14 @@ module Make (Loc : Sig.Loc)
| [b::bs] ->
let _loc = loc_of_binding b in <:binding< $b$ and $biAnd_of_list bs$ >> ];
+ value rec rbSem_of_list =
+ fun
+ [ [] -> <:rec_binding@ghost<>>
+ | [b] -> b
+ | [b::bs] ->
+ let _loc = loc_of_rec_binding b in
+ <:rec_binding< $b$; $rbSem_of_list bs$ >> ];
+
value rec wcAnd_of_list =
fun
[ [] -> <:with_constr@ghost<>>
@@ -347,14 +307,6 @@ module Make (Loc : Sig.Loc)
let _loc = loc_of_patt x in
<:patt< $x$, $paCom_of_list xs$ >> ];
- value rec biSem_of_list =
- fun
- [ [] -> <:binding@ghost<>>
- | [x] -> x
- | [x::xs] ->
- let _loc = loc_of_binding x in
- <:binding< $x$; $biSem_of_list xs$ >> ];
-
value rec exSem_of_list =
fun
[ [] -> <:expr@ghost<>>
@@ -390,15 +342,20 @@ module Make (Loc : Sig.Loc)
fun
[ <:binding< $b1$ and $b2$ >> -> pel_of_binding b1 @ pel_of_binding b2
| <:binding< $p$ = $e$ >> -> [(p, e)]
- | <:binding< $b1$ ; $b2$ >> -> pel_of_binding b1 @ pel_of_binding b2
| _ -> assert False ];
value rec list_of_binding x acc =
match x with
- [ <:binding< $b1$ and $b2$ >> | <:binding< $b1$; $b2$ >> ->
+ [ <:binding< $b1$ and $b2$ >> ->
list_of_binding b1 (list_of_binding b2 acc)
| t -> [t :: acc] ];
+ value rec list_of_rec_binding x acc =
+ match x with
+ [ <:rec_binding< $b1$; $b2$ >> ->
+ list_of_rec_binding b1 (list_of_rec_binding b2 acc)
+ | t -> [t :: acc] ];
+
value rec list_of_with_constr x acc =
match x with
[ <:with_constr< $w1$ and $w2$ >> ->
@@ -493,6 +450,83 @@ module Make (Loc : Sig.Loc)
list_of_module_binding x (list_of_module_binding y acc)
| x -> [x :: acc] ];
+ module Meta = 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 = struct
+ value meta_loc_patt _loc location =
+ let (a, b, c, d, e, f, g, h) = Loc.to_tuple location in
+ <:patt< Loc.of_tuple
+ ($`str:a$, $`int:b$, $`int:c$, $`int:d$,
+ $`int:e$, $`int:f$, $`int:g$,
+ $if h then <:patt< True >> else <:patt< False >> $) >>;
+ value meta_loc_expr _loc location =
+ let (a, b, c, d, e, f, g, h) = Loc.to_tuple location in
+ <:expr< Loc.of_tuple
+ ($`str:a$, $`int:b$, $`int:c$, $`int:d$,
+ $`int:e$, $`int:f$, $`int:g$,
+ $if h then <:expr< True >> else <:expr< False >> $) >>;
+ end;
+
+ module MetaGhostLoc = struct
+ value meta_loc_patt _loc _ = <:patt< Loc.ghost >>;
+ value meta_loc_expr _loc _ = <:expr< Loc.ghost >>;
+ end;
+
+ module MetaLocVar = struct
+ value meta_loc_patt _loc _ = <:patt< $lid:Loc.name.val$ >>;
+ value meta_loc_expr _loc _ = <:expr< $lid:Loc.name.val$ >>;
+ end;
+
+ module Make (MetaLoc : META_LOC) = struct
+ open MetaLoc;
+
+ value meta_acc_Loc_t = meta_loc_expr;
+ module Expr = Camlp4Filters.MetaGeneratorExpr Ast;
+ value meta_acc_Loc_t = meta_loc_patt;
+ module Patt = Camlp4Filters.MetaGeneratorPatt Ast;
+ end;
+
+ end;
+
+ class map = Camlp4Filters.GenerateMap.generated;
+
+ class fold = Camlp4Filters.GenerateFold.generated;
+
+ value map_expr f = object
+ inherit map as super;
+ method expr x = f (super#expr x);
+ end;
+ value map_patt f = object
+ inherit map as super;
+ method patt x = f (super#patt x);
+ end;
+ value map_ctyp f = object
+ inherit map as super;
+ method ctyp x = f (super#ctyp x);
+ end;
+ value map_str_item f = object
+ inherit map as super;
+ method str_item x = f (super#str_item x);
+ end;
+ value map_sig_item f = object
+ inherit map as super;
+ method sig_item x = f (super#sig_item x);
+ end;
+ value map_loc f = object
+ inherit map as super;
+ method _Loc_t x = f (super#_Loc_t x);
+ end;
end;
module Camlp4Trash = struct
diff --git a/camlp4/Camlp4/Struct/Camlp4Ast2OCamlAst.ml b/camlp4/Camlp4/Struct/Camlp4Ast2OCamlAst.ml
index f4881a39b..98237ffd9 100644
--- a/camlp4/Camlp4/Struct/Camlp4Ast2OCamlAst.ml
+++ b/camlp4/Camlp4/Struct/Camlp4Ast2OCamlAst.ml
@@ -42,6 +42,18 @@ module Make (Ast : Sig.Camlp4Ast) = struct
with [ Failure _ as exn -> Loc.raise loc exn ]
;
+ value remove_underscores s =
+ let l = String.length s in
+ let rec remove src dst =
+ if src >= l then
+ if dst >= l then s else String.sub s 0 dst
+ else
+ match s.[src] with
+ [ '_' -> remove (src + 1) dst
+ | c -> do { s.[dst] := c; remove (src + 1) (dst + 1) } ]
+ in remove 0 0
+ ;
+
value mkloc = Loc.to_ocaml_location;
value mkghloc loc = Loc.to_ocaml_location (Loc.ghostify loc);
@@ -288,14 +300,14 @@ module Make (Ast : Sig.Camlp4Ast) = struct
| _ -> assert False (*FIXME*) ];
value rec type_decl tl cl loc m pflag =
fun
- [ TyMan _ t1 t2 ->
+ [ <:ctyp< $t1$ == $t2$ >> ->
type_decl tl cl loc (Some (ctyp t1)) pflag t2
- | TyPrv _ t ->
+ | <:ctyp< private $t$ >> ->
type_decl tl cl loc m True t
- | TyRec _ t ->
+ | <:ctyp< { $t$ } >> ->
mktype loc tl cl
(Ptype_record (List.map mktrecord (list_of_ctyp t [])) (mkprivate' pflag)) m
- | TySum _ t ->
+ | <:ctyp< [ $t$ ] >> ->
mktype loc tl cl
(Ptype_variant (List.map mkvariant (list_of_ctyp t [])) (mkprivate' pflag)) m
| t ->
@@ -303,7 +315,7 @@ module Make (Ast : Sig.Camlp4Ast) = struct
error loc "only one manifest type allowed by definition" else
let m =
match t with
- [ TyQuo _ s -> if List.mem_assoc s tl then Some (ctyp t) else None
+ [ <:ctyp<>> -> None
| _ -> Some (ctyp t) ]
in
let k = if pflag then Ptype_private else Ptype_abstract in
@@ -465,7 +477,7 @@ module Make (Ast : Sig.Camlp4Ast) = struct
let nati = try Nativeint.of_string s with [
Failure _ -> error loc "Integer literal exceeds the range of representable integers of type nativeint"
] in mkpat loc (Ppat_constant (Const_nativeint nati))
- | PaFlo loc s -> mkpat loc (Ppat_constant (Const_float s))
+ | PaFlo loc s -> mkpat loc (Ppat_constant (Const_float (remove_underscores s)))
| PaLab loc _ _ -> error loc "labeled pattern not allowed here"
| PaOlb loc _ _ | PaOlbi loc _ _ _ -> error loc "labeled pattern not allowed here"
| PaOrp loc p1 p2 -> mkpat loc (Ppat_or (patt p1) (patt p2))
@@ -491,7 +503,7 @@ module Make (Ast : Sig.Camlp4Ast) = struct
error (loc_of_patt p) "invalid pattern" ]
and mklabpat =
fun
- [ <:patt< $id:i$ = $p$ >> -> (ident ~conv_lid:conv_lab i, patt p)
+ [ <:patt< $i$ = $p$ >> -> (ident ~conv_lid:conv_lab i, patt p)
| p -> error (loc_of_patt p) "invalid pattern" ];
value rec expr_fa al =
@@ -622,7 +634,7 @@ module Make (Ast : Sig.Camlp4Ast) = struct
[ <:ctyp<>> -> None
| t -> Some (ctyp t) ] in
mkexp loc (Pexp_constraint (expr e) t1 (Some (ctyp t2)))
- | ExFlo loc s -> mkexp loc (Pexp_constant (Const_float s))
+ | ExFlo loc s -> mkexp loc (Pexp_constant (Const_float (remove_underscores s)))
| ExFor loc i e1 e2 df el ->
let e3 = ExSeq loc el in
let df = if mb2b df then Upto else Downto in
@@ -677,7 +689,7 @@ module Make (Ast : Sig.Camlp4Ast) = struct
| ExOvr loc iel -> mkexp loc (Pexp_override (mkideexp iel []))
| ExRec loc lel eo ->
match lel with
- [ <:binding<>> -> error loc "empty record"
+ [ <:rec_binding<>> -> error loc "empty record"
| _ ->
let eo =
match eo with
@@ -736,7 +748,7 @@ module Make (Ast : Sig.Camlp4Ast) = struct
| e -> ("", expr e) ]
and binding x acc =
match x with
- [ <:binding< $x$ and $y$ >> | <:binding< $x$; $y$ >> ->
+ [ <:binding< $x$ and $y$ >> ->
binding x (binding y acc)
| <:binding< $p$ = $e$ >> -> [(patt p, expr e) :: acc]
| <:binding<>> -> acc
@@ -754,15 +766,15 @@ module Make (Ast : Sig.Camlp4Ast) = struct
| w -> mkexp (loc_of_expr w) (Pexp_when (expr w) (expr e)) ]
and mklabexp x acc =
match x with
- [ <:binding< $x$ and $y$ >> | <:binding< $x$; $y$ >> ->
+ [ <:rec_binding< $x$; $y$ >> ->
mklabexp x (mklabexp y acc)
- | <:binding< $id:i$ = $e$ >> -> [(ident ~conv_lid:conv_lab i, expr e) :: acc]
+ | <:rec_binding< $i$ = $e$ >> -> [(ident ~conv_lid:conv_lab i, expr e) :: acc]
| _ -> assert False ]
and mkideexp x acc =
match x with
- [ <:binding< $x$ and $y$ >> | <:binding< $x$; $y$ >> ->
+ [ <:rec_binding< $x$; $y$ >> ->
mkideexp x (mkideexp y acc)
- | <:binding< $lid:s$ = $e$ >> -> [(s, expr e) :: acc]
+ | <:rec_binding< $lid:s$ = $e$ >> -> [(s, expr e) :: acc]
| _ -> assert False ]
and mktype_decl x acc =
match x with
@@ -780,13 +792,14 @@ module Make (Ast : Sig.Camlp4Ast) = struct
| _ -> assert False ]
and module_type =
fun
- [ MtId loc i -> mkmty loc (Pmty_ident (long_uident i))
- | MtFun loc n nt mt ->
+ [ <:module_type@loc<>> -> error loc "abstract/nil module type not allowed here"
+ | <:module_type@loc< $id:i$ >> -> mkmty loc (Pmty_ident (long_uident i))
+ | <:module_type@loc< functor ($n$ : $nt$) -> $mt$ >> ->
mkmty loc (Pmty_functor n (module_type nt) (module_type mt))
- | MtQuo loc _ -> error loc "abstract module type not allowed here"
- | MtSig loc sl ->
+ | <:module_type@loc< '$_$ >> -> error loc "module type variable not allowed here"
+ | <:module_type@loc< sig $sl$ end >> ->
mkmty loc (Pmty_signature (sig_item sl []))
- | MtWit loc mt wc ->
+ | <:module_type@loc< $mt$ with $wc$ >> ->
mkmty loc (Pmty_with (module_type mt) (mkwithc wc []))
| <:module_type< $anti:_$ >> -> assert False ]
and sig_item s l =
@@ -839,14 +852,15 @@ module Make (Ast : Sig.Camlp4Ast) = struct
| _ -> assert False ]
and module_expr =
fun
- [ MeId loc i -> mkmod loc (Pmod_ident (long_uident i))
- | MeApp loc me1 me2 ->
+ [ <:module_expr@loc<>> -> error loc "nil module expression"
+ | <:module_expr@loc< $id:i$ >> -> mkmod loc (Pmod_ident (long_uident i))
+ | <:module_expr@loc< $me1$ $me2$ >> ->
mkmod loc (Pmod_apply (module_expr me1) (module_expr me2))
- | MeFun loc n mt me ->
+ | <:module_expr@loc< functor ($n$ : $mt$) -> $me$ >> ->
mkmod loc (Pmod_functor n (module_type mt) (module_expr me))
- | MeStr loc sl ->
+ | <:module_expr@loc< struct $sl$ end >> ->
mkmod loc (Pmod_structure (str_item sl []))
- | MeTyc loc me mt ->
+ | <:module_expr@loc< ($me$ : $mt$) >> ->
mkmod loc (Pmod_constraint (module_expr me) (module_type mt))
| <:module_expr@loc< $anti:_$ >> -> error loc "antiquotation in module_expr" ]
and str_item s l =
diff --git a/camlp4/Camlp4/Struct/CleanAst.ml b/camlp4/Camlp4/Struct/CleanAst.ml
index 0374ae282..bd1cac2fa 100644
--- a/camlp4/Camlp4/Struct/CleanAst.ml
+++ b/camlp4/Camlp4/Struct/CleanAst.ml
@@ -30,7 +30,7 @@ module Make (Ast : Sig.Camlp4Ast) = struct
method expr = fun
[ <:expr< let $rec:_$ $ <:binding<>> $ in $e$ >> |
- <:expr< { ($e$) with $ <:binding<>> $ } >> |
+ <:expr< { ($e$) with $ <:rec_binding<>> $ } >> |
<:expr< $ <:expr<>> $, $e$ >> |
<:expr< $e$, $ <:expr<>> $ >> |
<:expr< $ <:expr<>> $; $e$ >> |
@@ -54,11 +54,14 @@ module Make (Ast : Sig.Camlp4Ast) = struct
method binding = fun
[ <:binding< $ <:binding<>> $ and $bi$ >> |
- <:binding< $bi$ and $ <:binding<>> $ >> |
- <:binding< $ <:binding<>> $ ; $bi$ >> |
- <:binding< $bi$ ; $ <:binding<>> $ >> -> self#binding 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<>> $ >> ->
diff --git a/camlp4/Camlp4/Struct/CommentFilter.mli b/camlp4/Camlp4/Struct/CommentFilter.mli
index c1789c6c3..79ece6a4c 100644
--- a/camlp4/Camlp4/Struct/CommentFilter.mli
+++ b/camlp4/Camlp4/Struct/CommentFilter.mli
@@ -19,7 +19,7 @@
module Make (Token : Sig.Camlp4Token) : sig
open Token;
- type t = 'abstract;
+ type t;
value mk : unit -> t;
diff --git a/camlp4/Camlp4/Struct/DynAst.ml b/camlp4/Camlp4/Struct/DynAst.ml
new file mode 100644
index 000000000..2161e1c91
--- /dev/null
+++ b/camlp4/Camlp4/Struct/DynAst.ml
@@ -0,0 +1,91 @@
+(* camlp4r *)
+(****************************************************************************)
+(* *)
+(* Objective Caml *)
+(* *)
+(* 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 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
+ *)
+
+module Make (Ast : Sig.Ast) : Sig.DynAst with module Ast = Ast = struct
+ module Ast = Ast;
+ type tag 'a =
+ [ 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 ];
+
+ value string_of_tag =
+ fun
+ [ Tag_ctyp -> "ctyp"
+ | Tag_patt -> "patt"
+ | Tag_expr -> "expr"
+ | Tag_module_type -> "module_type"
+ | Tag_sig_item -> "sig_item"
+ | Tag_with_constr -> "with_constr"
+ | Tag_module_expr -> "module_expr"
+ | Tag_str_item -> "str_item"
+ | Tag_class_type -> "class_type"
+ | Tag_class_sig_item -> "class_sig_item"
+ | Tag_class_expr -> "class_expr"
+ | Tag_class_str_item -> "class_str_item"
+ | Tag_match_case -> "match_case"
+ | Tag_ident -> "ident"
+ | Tag_binding -> "binding"
+ | Tag_rec_binding -> "rec_binding"
+ | Tag_module_binding -> "module_binding" ];
+
+ value ctyp_tag = Tag_ctyp;
+ value patt_tag = Tag_patt;
+ value expr_tag = Tag_expr;
+ value module_type_tag = Tag_module_type;
+ value sig_item_tag = Tag_sig_item;
+ value with_constr_tag = Tag_with_constr;
+ value module_expr_tag = Tag_module_expr;
+ value str_item_tag = Tag_str_item;
+ value class_type_tag = Tag_class_type;
+ value class_sig_item_tag = Tag_class_sig_item;
+ value class_expr_tag = Tag_class_expr;
+ value class_str_item_tag = Tag_class_str_item;
+ value match_case_tag = Tag_match_case;
+ value ident_tag = Tag_ident;
+ value binding_tag = Tag_binding;
+ value rec_binding_tag = Tag_rec_binding;
+ value module_binding_tag = Tag_module_binding;
+
+ type dyn;
+ external dyn_tag : tag 'a -> tag dyn = "%identity";
+
+ module Pack(X : sig type t 'a; end) = struct
+ (* These Obj.* hacks should be avoided with GADTs *)
+ type pack = (tag dyn * Obj.t);
+ exception Pack_error;
+ value pack tag v = (dyn_tag tag, Obj.repr v);
+ value unpack (tag : tag 'a) (tag', obj) =
+ if dyn_tag tag = tag' then (Obj.obj obj : X.t 'a) else raise Pack_error;
+ value print_tag f (tag, _) = Format.pp_print_string f (string_of_tag tag);
+ end;
+end;
diff --git a/camlp4/Camlp4/Struct/EmptyPrinter.ml b/camlp4/Camlp4/Struct/EmptyPrinter.ml
index 2cde4dde7..5886809b6 100644
--- a/camlp4/Camlp4/Struct/EmptyPrinter.ml
+++ b/camlp4/Camlp4/Struct/EmptyPrinter.ml
@@ -17,8 +17,6 @@
*)
module Make (Ast : Sig.Ast) = struct
- module Ast = Ast;
-
value print_interf ?input_file:(_) ?output_file:(_) _ = failwith "No interface printer";
value print_implem ?input_file:(_) ?output_file:(_) _ = failwith "No implementation printer";
end;
diff --git a/camlp4/Camlp4/Struct/EmptyPrinter.mli b/camlp4/Camlp4/Struct/EmptyPrinter.mli
index 186d93015..f8bf907ae 100644
--- a/camlp4/Camlp4/Struct/EmptyPrinter.mli
+++ b/camlp4/Camlp4/Struct/EmptyPrinter.mli
@@ -16,4 +16,4 @@
* - Nicolas Pouillard: initial version
*)
-module Make (Ast : Sig.Ast) : Sig.Printer with module Ast = Ast;
+module Make (Ast : Sig.Ast) : (Sig.Printer Ast).S;
diff --git a/camlp4/Camlp4/Struct/FreeVars.ml b/camlp4/Camlp4/Struct/FreeVars.ml
index ffeae02fa..78c33ef40 100644
--- a/camlp4/Camlp4/Struct/FreeVars.ml
+++ b/camlp4/Camlp4/Struct/FreeVars.ml
@@ -23,13 +23,13 @@ module Make (Ast : Sig.Camlp4Ast) = struct
value rec fold_binding_vars f bi acc =
match bi with
- [ <:binding< $bi1$ and $bi2$ >> | <:binding< $bi1$; $bi2$ >> ->
+ [ <:binding< $bi1$ and $bi2$ >> ->
fold_binding_vars f bi1 (fold_binding_vars f bi2 acc)
| <:binding< $lid:i$ = $_$ >> -> f i acc
| _ -> assert False ];
class c_fold_pattern_vars ['accu] f init =
- object (o)
+ object
inherit Ast.fold as super;
value acc = init;
method acc : 'accu = acc;
@@ -37,7 +37,6 @@ module Make (Ast : Sig.Camlp4Ast) = struct
fun
[ <:patt< $lid:s$ >> | <:patt< ~ $s$ >> | <:patt< ? $s$ >> ->
{< acc = f s acc >}
- | <:patt< $lid:_$ = $p$ >> -> o#patt p
| p -> super#patt p ];
end;
diff --git a/camlp4/Camlp4/Struct/Grammar/Context.ml b/camlp4/Camlp4/Struct/Grammar/Context.ml
index fbd24134d..75d731c66 100644
--- a/camlp4/Camlp4/Struct/Grammar/Context.ml
+++ b/camlp4/Camlp4/Struct/Grammar/Context.ml
@@ -20,7 +20,7 @@
module type S = sig
module Token : Sig.Token;
open Token;
- type t = 'abstract;
+ type t;
value call_with_ctx : Stream.t (Token.t * Loc.t) -> (t -> 'a) -> 'a;
value loc_bp : t -> Loc.t;
value loc_ep : t -> Loc.t;
@@ -68,8 +68,8 @@ module Make (Token : Sig.Token) : S with module Token = Token = struct
loop list n;
value njunk c n =
- do { for i = 1 to n do { Stream.junk c.strm };
- set_loc c };
+ (for i = 1 to n do Stream.junk c.strm done;
+ set_loc c);
value streams = ref [];
value mk strm =
diff --git a/camlp4/Camlp4/Struct/Grammar/Parser.mli b/camlp4/Camlp4/Struct/Grammar/Parser.mli
new file mode 100644
index 000000000..a782445e1
--- /dev/null
+++ b/camlp4/Camlp4/Struct/Grammar/Parser.mli
@@ -0,0 +1,70 @@
+(* camlp4r *)
+(****************************************************************************)
+(* *)
+(* Objective Caml *)
+(* *)
+(* 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 GNU Library General Public License, with the special *)
+(* exception on linking described in LICENSE at the top of the Objective *)
+(* Caml source tree. *)
+(* *)
+(****************************************************************************)
+
+(* $Id$ *)
+
+(* Authors:
+ * - Daniel de Rauglaudre: initial version
+ * - Nicolas Pouillard: refactoring
+ *)
+
+module Make (Structure : Structure.S) : sig
+ open Structure;
+ open Context;
+ value add_loc :
+ Context.t -> Loc.t -> (Context.t -> 'a -> 'b) -> 'a -> ('b * Loc.t);
+ value level_number : internal_entry -> string -> int;
+ value strict_parsing : ref bool;
+ value strict_parsing_warning : ref bool;
+ value top_symb :
+ internal_entry -> symbol -> symbol;
+ value top_tree :
+ internal_entry -> tree -> tree;
+ value entry_of_symb :
+ internal_entry -> symbol -> internal_entry;
+ value continue :
+ internal_entry -> Loc.t -> Action.t -> symbol -> Context.t -> tree ->
+ (Stream.t (Token.t * Loc.t) -> Action.t) -> Stream.t (Token.t * Loc.t) -> Action.t;
+ value skip_if_empty :
+ Context.t -> Loc.t -> ('a -> 'b) -> 'a -> Action.t;
+ value do_recover :
+ (internal_entry -> 'a -> 'b -> tree -> Context.t -> Stream.t (Token.t * Loc.t) -> Action.t) -> internal_entry ->
+ 'a -> 'b -> Loc.t -> Action.t -> symbol -> Context.t -> tree -> Stream.t (Token.t * Loc.t) -> Action.t;
+ value recover :
+ (internal_entry -> 'a -> 'b -> tree -> Context.t -> Stream.t (Token.t * Loc.t) -> Action.t) -> internal_entry ->
+ 'a -> 'b -> Loc.t -> Action.t -> symbol -> Context.t -> tree -> Stream.t (Token.t * Loc.t) -> Action.t;
+ value parser_of_tree :
+ internal_entry -> int -> int -> tree -> Context.t -> Stream.t (Token.t * Loc.t) -> Action.t;
+ value parser_cont :
+ (Context.t -> Stream.t (Token.t * Loc.t) -> Action.t) -> internal_entry -> int -> int -> symbol -> tree ->
+ Context.t -> Loc.t -> Action.t -> Stream.t (Token.t * Loc.t) -> Action.t;
+ value parser_of_token_list :
+ (Context.t -> Loc.t -> Action.t -> Stream.t (Token.t * Loc.t) -> Action.t) -> list symbol -> Context.t -> Stream.t (Token.t * Loc.t) -> Action.t;
+ value parser_of_symbol :
+ internal_entry -> int -> symbol -> Context.t -> Stream.t (Token.t * Loc.t) -> Action.t;
+ value parse_top_symb' :
+ internal_entry -> symbol -> Context.t -> Stream.t (Token.t * Loc.t) -> Action.t;
+ value parse_top_symb :
+ internal_entry -> symbol -> Stream.t (Token.t * Loc.t) -> Action.t;
+ value start_parser_of_levels :
+ internal_entry -> int -> list level -> int -> Context.t -> Stream.t (Token.t * Loc.t) -> Action.t;
+ value start_parser_of_entry :
+ internal_entry -> int -> Context.t -> Stream.t (Token.t * Loc.t) -> Action.t;
+ value continue_parser_of_levels :
+ internal_entry -> int -> list level -> Context.t -> int -> Loc.t -> 'a -> Stream.t (Token.t * Loc.t) -> Action.t;
+ value continue_parser_of_entry :
+ internal_entry -> int -> Loc.t -> Action.t -> Context.t -> Stream.t (Token.t * Loc.t) -> Action.t;
+end;
+
diff --git a/camlp4/Camlp4/Struct/Grammar/Print.ml b/camlp4/Camlp4/Struct/Grammar/Print.ml
index dadf4aed2..f5a972302 100644
--- a/camlp4/Camlp4/Struct/Grammar/Print.ml
+++ b/camlp4/Camlp4/Struct/Grammar/Print.ml
@@ -27,7 +27,7 @@ module Make (Structure : Structure.S) = struct
[ DeadEnd -> []
| LocAct _ _ -> [[]]
| Node {node = n; brother = b; son = s} ->
- List.map (fun l -> [n :: l]) (flatten_tree s) @ flatten_tree b ];
+ [ [n :: l] | l <- flatten_tree s ] @ flatten_tree b ];
value rec print_symbol ppf =
fun
@@ -101,7 +101,7 @@ module Make (Structure : Structure.S) = struct
List.fold_left
(fun sep lev ->
let rules =
- List.map (fun t -> [Sself :: t]) (flatten_tree lev.lsuffix) @
+ [ [Sself :: t] | t <- flatten_tree lev.lsuffix ] @
flatten_tree lev.lprefix
in
do {
diff --git a/camlp4/Camlp4/Struct/Lexer.mll b/camlp4/Camlp4/Struct/Lexer.mll
index 87cb362ae..658ea88da 100644
--- a/camlp4/Camlp4/Struct/Lexer.mll
+++ b/camlp4/Camlp4/Struct/Lexer.mll
@@ -110,15 +110,16 @@ module Make (Token : Sig.Camlp4Token)
(* To store some context information:
* loc : position of the beginning of a string, quotation and comment
* in_comment: are we in a comment?
- * quotations: shall we lex quotation? (antiquotations are lexed if
- * quotations are).
+ * quotations: shall we lex quotation?
* If quotations is false it's a SYMBOL token.
+ * antiquots : shall we lex antiquotations.
*)
type context =
{ loc : Loc.t ;
in_comment : bool ;
quotations : bool ;
+ antiquots : bool ;
lexbuf : lexbuf ;
buffer : Buffer.t }
@@ -126,6 +127,7 @@ module Make (Token : Sig.Camlp4Token)
{ loc = Loc.ghost ;
in_comment = false ;
quotations = true ;
+ antiquots = false ;
lexbuf = lb ;
buffer = Buffer.create 256 }
@@ -139,6 +141,7 @@ module Make (Token : Sig.Camlp4Token)
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
@@ -146,7 +149,8 @@ module Make (Token : Sig.Camlp4Token)
let p = c.lexbuf.lex_start_p in
c.lexbuf.lex_start_p <- { (p) with pos_cnum = p.pos_cnum + shift }
- let with_curr_loc f c = f { (c) with loc = Loc.of_lexbuf c.lexbuf } c.lexbuf
+ 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;
@@ -155,7 +159,7 @@ module Make (Token : Sig.Camlp4Token)
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 c in
+ let s = parse_nested quotation (update_loc c) in
let contents = String.sub s 0 (String.length s - 2) in
QUOTATION { q_name = name ;
q_loc = loc ;
@@ -193,8 +197,10 @@ module Make (Token : Sig.Camlp4Token)
let identchar =
['A'-'Z' 'a'-'z' '_' '\192'-'\214' '\216'-'\246' '\248'-'\255' '\'' '0'-'9']
let ident = (lowercase|uppercase) identchar*
- let symbolchar =
- ['$' '!' '%' '&' '*' '+' '-' '.' '/' ':' '<' '=' '>' '?' '@' '^' '|' '~']
+ let locname = ident
+ let not_star_symbolchar =
+ ['$' '!' '%' '&' '+' '-' '.' '/' ':' '<' '=' '>' '?' '@' '^' '|' '~' '\\']
+ let symbolchar = '*' | not_star_symbolchar
let hexa_char = ['0'-'9' 'A'-'F' 'a'-'f']
let decimal_literal =
['0'-'9'] ['0'-'9' '_']*
@@ -211,6 +217,43 @@ module Make (Token : Sig.Camlp4Token)
('.' ['0'-'9' '_']* )?
(['e' 'E'] ['+' '-']? ['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 = ['%' '&' '.' '/' '@' '^']
+
+ (* These symbols are unsafe since "[<", "[|", etc. exsist. *)
+ 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)*
+
+ (* A '(' or a new super '(' without "(<" *)
+ | '(' (['|' ':'] delimchars*)?
+ (* Old brackets, no new brackets starting with "[|" or "[:" *)
+ | '[' ['|' ':']?
+ (* Old "[<","{<" and new ones *)
+ | ['[' '{'] delimchars* '<'
+ (* Old brace and new ones *)
+ | '{' (['|' ':'] delimchars*)?
+
+ let right_delimitor =
+ (* At least a safe_delimchars *)
+ (delimchars|right_delims)* safe_delimchars (delimchars|right_delims)* right_delims
+ (* A ')' or a new super ')' without ">)" *)
+ | (delimchars* ['|' ':'])? ')'
+ (* Old brackets, no new brackets ending with "|]" or ":]" *)
+ | ['|' ':']? ']'
+ (* Old ">]",">}" and new ones *)
+ | '>' delimchars* [']' '}']
+ (* Old brace and new ones *)
+ | (delimchars* ['|' ':'])? '}'
+
+
rule token c = parse
| newline { update_loc c None 1 false 0; NEWLINE }
| blank + as x { BLANKS x }
@@ -272,16 +315,24 @@ module Make (Token : Sig.Camlp4Token)
[^ '\010' '\013'] * newline
{ let inum = int_of_string num
in update_loc c name inum true 0; LINE_DIRECTIVE(inum, name) }
- | ( "#" | "`" | "'" | "(" | ")" | "," | "." | ".." | ":" | "::"
- | ":=" | ":>" | ":]" | ";" | ";;" | "[" | "[|" | "[<" | "[:"
- | "]" | "{" | "{<" | "|]" | ">]" | "}" | ">}" | "_" ) as x { SYMBOL x }
-
- | '$' { if quotations c
+ | '(' (not_star_symbolchar as op) ')'
+ { ESCAPED_IDENT (String.make 1 op) }
+ | '(' (not_star_symbolchar symbolchar* not_star_symbolchar as op) ')'
+ { ESCAPED_IDENT op }
+ | '(' (not_star_symbolchar symbolchar* as op) blank+ ')'
+ { ESCAPED_IDENT op }
+ | '(' blank+ (symbolchar* not_star_symbolchar as op) ')'
+ { ESCAPED_IDENT op }
+ | '(' blank+ (symbolchar+ as op) blank+ ')'
+ { ESCAPED_IDENT op }
+ | ( "#" | "`" | "'" | "," | "." | ".." | ":" | "::"
+ | ":=" | ":>" | ";" | ";;" | "_"
+ | left_delimitor | right_delimitor ) as x { SYMBOL x }
+ | '$' { if antiquots c
then with_curr_loc dollar (shift 1 c)
else parse (symbolchar_star "$") c }
- | ['~' '?' '!' '=' '<' '>' '|' '&' '@' '^' '+' '-' '*' '/' '%'] symbolchar *
+ | ['~' '?' '!' '=' '<' '>' '|' '&' '@' '^' '+' '-' '*' '/' '%' '\\'] symbolchar *
as x { SYMBOL x }
- | '\\' ((symbolchar | identchar)+ as x) { ESCAPED_IDENT x }
| eof
{ let pos = lexbuf.lex_curr_p in
lexbuf.lex_curr_p <- { pos with pos_bol = pos.pos_bol + 1 ;
@@ -292,7 +343,7 @@ module Make (Token : Sig.Camlp4Token)
"(*"
{ store c; with_curr_loc comment c; parse comment c }
| "*)" { store c }
- | '<' (':' ident)? ('@' ident)? '<'
+ | '<' (':' ident)? ('@' locname)? '<'
{ store c;
if quotations c then with_curr_loc quotation c; parse comment c }
| ident { store_parse comment c }
@@ -350,13 +401,13 @@ module Make (Token : Sig.Camlp4Token)
and maybe_quotation_colon c = parse
| (ident as name) '<'
{ mk_quotation quotation c name "" (3 + String.length name) }
- | (ident as name) '@' (ident as loc) '<'
+ | (ident as name) '@' (locname as loc) '<'
{ mk_quotation quotation c name loc
(4 + String.length loc + String.length name) }
| symbolchar* as tok { SYMBOL("<:" ^ tok) }
and quotation c = parse
- | '<' (':' ident)? ('@' ident)? '<' { store c ;
+ | '<' (':' ident)? ('@' locname)? '<' { store c ;
with_curr_loc quotation c ;
parse quotation c }
| ">>" { store c }
@@ -367,19 +418,16 @@ module Make (Token : Sig.Camlp4Token)
and dollar c = parse
| '$' { set_start_p c; ANTIQUOT("", "") }
- (* Removed because it breaks escapings like: <:expr< $str: "\n"$ >>
- * | '\\' _ { istore_char c 1; parse (antiquot "") c } *)
| ('`'? (identchar*|'.'+) as name) ':'
{ with_curr_loc (antiquot name) (shift (1 + String.length name) c) }
| _ { store_parse (antiquot "") c }
and antiquot name c = parse
| '$' { set_start_p c; ANTIQUOT(name, buff_contents c) }
- (* Idem: | '\\' _ { istore_char c 1; parse (antiquot name) c } *)
| eof { err Unterminated_antiquot (loc c) }
| newline
{ update_loc c None 1 false 0; store_parse (antiquot name) c }
- | '<' (':' ident)? ('@' ident)? '<'
+ | '<' (':' ident)? ('@' locname)? '<'
{ store c; with_curr_loc quotation c; parse (antiquot name) c }
| _ { store_parse (antiquot name) c }
@@ -408,6 +456,7 @@ module Make (Token : Sig.Camlp4Token)
let from_lexbuf ?(quotations = true) lb =
let c = { (default_context lb) with
loc = Loc.of_lexbuf lb;
+ antiquots = !Camlp4_config.antiquotations;
quotations = quotations }
in from_context c
diff --git a/camlp4/Camlp4/Struct/Quotation.ml b/camlp4/Camlp4/Struct/Quotation.ml
index b27f53c30..3ba791517 100644
--- a/camlp4/Camlp4/Struct/Quotation.ml
+++ b/camlp4/Camlp4/Struct/Quotation.ml
@@ -18,24 +18,29 @@
* - Nicolas Pouillard: refactoring
*)
-
(* $Id$ *)
module Make (Ast : Sig.Ast)
: Sig.Quotation with module Ast = Ast
= struct
module Ast = Ast;
+ module DynAst = DynAst.Make Ast;
module Loc = Ast.Loc;
open Format;
open Sig;
type expand_fun 'a = Loc.t -> option string -> string -> 'a;
- type expander =
- [ ExStr of bool -> expand_fun string
- | ExAst of (expand_fun Ast.expr) and (expand_fun Ast.patt) ];
+ module Exp_key = DynAst.Pack(struct
+ type t 'a = unit;
+ end);
+
+ module Exp_fun = DynAst.Pack(struct
+ type t 'a = expand_fun 'a;
+ end);
- value expanders_table = ref [];
+ value expanders_table =
+ (ref [] : ref (list ((string * Exp_key.pack) * Exp_fun.pack)));
value default = ref "";
value translate = ref (fun x -> x);
@@ -45,9 +50,13 @@ module Make (Ast : Sig.Ast)
[ "" -> default.val
| name -> name ];
- value find name = List.assoc (expander_name name) expanders_table.val;
+ value find name tag =
+ let key = (expander_name name, Exp_key.pack tag ()) in
+ Exp_fun.unpack tag (List.assoc key expanders_table.val);
- value add name f = expanders_table.val := [(name, f) :: expanders_table.val];
+ value add name tag f =
+ let elt = ((name, Exp_key.pack tag ()), Exp_fun.pack tag f) in
+ expanders_table.val := [elt :: expanders_table.val];
value dump_file = ref None;
@@ -57,18 +66,21 @@ module Make (Ast : Sig.Ast)
| Expanding
| ParsingResult of Loc.t and string
| Locating ];
- type t = (string * error * exn);
+ type t = (string * string * error * exn);
exception E of t;
- value print ppf (name, ctx, exn) =
+ value print ppf (name, position, ctx, exn) =
let name = if name = "" then default.val else name in
- let pp x = fprintf ppf "@?@[<2>While %s %S:" x name in
+ let pp x = fprintf ppf "@?@[<2>While %s %S in a position of %S:" x name position in
let () =
match ctx with
[ Finding -> do {
pp "finding quotation";
- fprintf ppf " available quotations are:\n@[<2>";
- List.iter (fun (s,_) -> fprintf ppf "%s@ " s) expanders_table.val;
+ 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 "@]"
}
| Expanding -> pp "expanding quotation"
@@ -105,56 +117,46 @@ module Make (Ast : Sig.Ast)
let module M = ErrorHandler.Register Error in ();
open Error;
- value expand_quotation loc expander quot =
+ value expand_quotation loc expander pos_tag quot =
debug quot "expand_quotation: name: %s, str: %S@." quot.q_name quot.q_contents in
let loc_name_opt = if quot.q_loc = "" then None else Some quot.q_loc in
try expander loc loc_name_opt quot.q_contents with
[ Loc.Exc_located _ (Error.E _) as exc ->
raise exc
| Loc.Exc_located iloc exc ->
- let exc1 = Error.E (quot.q_name, Expanding, exc) in
+ let exc1 = Error.E (quot.q_name, pos_tag, Expanding, exc) in
raise (Loc.Exc_located iloc exc1)
| exc ->
- let exc1 = Error.E (quot.q_name, Expanding, exc) in
+ let exc1 = Error.E (quot.q_name, pos_tag, Expanding, exc) in
raise (Loc.Exc_located loc exc1) ];
- value parse_quotation_result parse loc quot str =
+ value parse_quotation_result parse loc quot pos_tag str =
try parse loc str with
- [ Loc.Exc_located iloc (Error.E (n, Expanding, exc)) ->
+ [ Loc.Exc_located iloc (Error.E (n, pos_tag, Expanding, exc)) ->
let ctx = ParsingResult iloc quot.q_contents in
- let exc1 = Error.E (n, ctx, exc) in
+ let exc1 = Error.E (n, pos_tag, ctx, exc) in
raise (Loc.Exc_located iloc exc1)
| Loc.Exc_located iloc (Error.E _ as exc) ->
raise (Loc.Exc_located iloc exc)
| Loc.Exc_located iloc exc ->
let ctx = ParsingResult iloc quot.q_contents in
- let exc1 = Error.E (quot.q_name, ctx, exc) in
+ let exc1 = Error.E (quot.q_name, pos_tag, ctx, exc) in
raise (Loc.Exc_located iloc exc1) ];
- value handle_quotation loc proj in_expr parse quotation =
+ value expand loc quotation tag =
+ let pos_tag = DynAst.string_of_tag tag in
let name = quotation.q_name in
debug quot "handle_quotation: name: %s, str: %S@." name quotation.q_contents in
let expander =
- try find name
+ try find name tag
with
[ Loc.Exc_located _ (Error.E _) as exc -> raise exc
| Loc.Exc_located qloc exc ->
- raise (Loc.Exc_located qloc (Error.E (name, Finding, exc)))
+ raise (Loc.Exc_located qloc (Error.E (name, pos_tag, Finding, exc)))
| exc ->
- raise (Loc.Exc_located loc (Error.E (name, Finding, exc))) ]
+ raise (Loc.Exc_located loc (Error.E (name, pos_tag, Finding, exc))) ]
in
let loc = Loc.join (Loc.move `start quotation.q_shift loc) in
- match expander with
- [ ExStr f ->
- let new_str = expand_quotation loc (f in_expr) quotation in
- parse_quotation_result parse loc quotation new_str
- | ExAst fe fp ->
- expand_quotation loc (proj (fe, fp)) quotation ];
-
- value expand_expr parse loc x =
- handle_quotation loc fst True parse x;
-
- value expand_patt parse loc x =
- handle_quotation loc snd False parse x;
+ expand_quotation loc expander pos_tag quotation;
end;
diff --git a/camlp4/Camlp4/Struct/Token.ml b/camlp4/Camlp4/Struct/Token.ml
index 7037888a1..4dbdacacb 100644
--- a/camlp4/Camlp4/Struct/Token.ml
+++ b/camlp4/Camlp4/Struct/Token.ml
@@ -66,7 +66,7 @@ module Make (Loc : Sig.Loc)
INT64 _ s | NATIVEINT _ s | FLOAT _ s | CHAR _ s | STRING _ s |
LABEL s | OPTLABEL s | COMMENT s | BLANKS s | ESCAPED_IDENT s -> s
| tok ->
- invalid_arg ("Cannot extract a string from a this token: "^
+ invalid_arg ("Cannot extract a string from this token: "^
to_string tok) ];
module Error = struct
diff --git a/camlp4/Camlp4/Struct/Warning.ml b/camlp4/Camlp4/Struct/Warning.ml
deleted file mode 100644
index dbb04008e..000000000
--- a/camlp4/Camlp4/Struct/Warning.ml
+++ /dev/null
@@ -1,26 +0,0 @@
-(****************************************************************************)
-(* *)
-(* 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:
- * - Daniel de Rauglaudre: initial version
- * - Nicolas Pouillard: refactoring
- *)
-module Make (Loc : Sig.Loc) : Sig.Warning with module Loc = Loc = struct
- module Loc = Loc;
- open Format;
- type t = Loc.t -> string -> unit;
- value default loc txt = eprintf "<W> %a: %s@." Loc.print loc txt;
- value current = ref default;
- value print loc txt = current.val loc txt;
-end;
diff --git a/camlp4/Camlp4Bin.ml b/camlp4/Camlp4Bin.ml
index ac893b409..9464e65c4 100644
--- a/camlp4/Camlp4Bin.ml
+++ b/camlp4/Camlp4Bin.ml
@@ -28,7 +28,7 @@ module CleanAst = Camlp4.Struct.CleanAst.Make Ast;
module SSet = Set.Make String;
value pa_r = "Camlp4OCamlRevisedParser";
-(* value pa_rr = "Camlp4OCamlrrParser"; *)
+value pa_rr = "Camlp4OCamlReloadedParser";
value pa_o = "Camlp4OCamlParser";
value pa_rp = "Camlp4OCamlRevisedParserParser";
value pa_op = "Camlp4OCamlParserParser";
@@ -40,6 +40,8 @@ value pa_rq = "Camlp4OCamlRevisedQuotationExpander";
value pa_oq = "Camlp4OCamlOriginalQuotationExpander";
value pa_l = "Camlp4ListComprehension";
+open Register;
+
value dyn_loader = ref (fun []);
value rcall_callback = ref (fun () -> ());
value loaded_modules = ref SSet.empty;
@@ -53,23 +55,24 @@ value rewrite_and_load n x =
add_to_loaded_modules name;
DynLoader.load dyn_loader name
} in
- let load = List.iter (fun n ->
- if SSet.mem n loaded_modules.val then ()
- else do {
+ let load = List.iter begin fun n ->
+ if SSet.mem n loaded_modules.val || List.mem n Register.loaded_modules.val then ()
+ else begin
add_to_loaded_modules n;
DynLoader.load dyn_loader (n ^ ".cmo");
- }) in
+ end
+ end in
do {
match (n, String.lowercase x) with
[ ("Parsers"|"", "pa_r.cmo" | "r" | "ocamlr" | "ocamlrevised" | "camlp4ocamlrevisedparser.cmo") -> load [pa_r]
- (* | ("Parsers"|"", "rr" | "OCamlrr") -> load [pa_r; pa_rr] *)
+ | ("Parsers"|"", "rr" | "reloaded" | "ocamlreloaded" | "camlp4ocamlreloadedparser.cmo") -> load [pa_rr]
| ("Parsers"|"", "pa_o.cmo" | "o" | "ocaml" | "camlp4ocamlparser.cmo") -> load [pa_r; pa_o]
| ("Parsers"|"", "pa_rp.cmo" | "rp" | "rparser" | "camlp4ocamlrevisedparserparser.cmo") -> load [pa_r; pa_o; pa_rp]
| ("Parsers"|"", "pa_op.cmo" | "op" | "parser" | "camlp4ocamlparserparser.cmo") -> load [pa_r; pa_o; pa_rp; pa_op]
- | ("Parsers"|"", "pa_extend.cmo" | "pa_extend_m.cmo" | "g" | "grammar" | "camlp4grammarparser.cmo") -> load [pa_r; pa_g]
- | ("Parsers"|"", "pa_macro.cmo" | "m" | "macro" | "camlp4macroparser.cmo") -> load [pa_r; pa_m]
- | ("Parsers"|"", "q" | "camlp4quotationexpander.cmo") -> load [pa_r; pa_qb; pa_q]
- | ("Parsers"|"", "q_MLast.cmo" | "rq" | "camlp4ocamlrevisedquotationexpander.cmo") -> load [pa_r; pa_qb; pa_rq]
+ | ("Parsers"|"", "pa_extend.cmo" | "pa_extend_m.cmo" | "g" | "grammar" | "camlp4grammarparser.cmo") -> load [pa_g]
+ | ("Parsers"|"", "pa_macro.cmo" | "m" | "macro" | "camlp4macroparser.cmo") -> load [pa_m]
+ | ("Parsers"|"", "q" | "camlp4quotationexpander.cmo") -> load [pa_qb; pa_q]
+ | ("Parsers"|"", "q_mlast.cmo" | "rq" | "camlp4ocamlrevisedquotationexpander.cmo") -> load [pa_qb; pa_rq]
| ("Parsers"|"", "oq" | "camlp4ocamloriginalquotationexpander.cmo") -> load [pa_r; pa_o; pa_qb; pa_oq]
| ("Parsers"|"", "rf") -> load [pa_r; pa_rp; pa_qb; pa_q; pa_g; pa_l; pa_m]
| ("Parsers"|"", "of") -> load [pa_r; pa_o; pa_rp; pa_op; pa_qb; pa_rq; pa_g; pa_l; pa_m]
@@ -85,8 +88,6 @@ value rewrite_and_load n x =
| ("Filters"|"", "tracer" | "camlp4tracer.cmo") -> load ["Camlp4Tracer"]
| ("Printers"|"", "pr_r.cmo" | "r" | "ocamlr" | "camlp4ocamlrevisedprinter.cmo") ->
Register.enable_ocamlr_printer ()
- (* | ("Printers"|"", "rr" | "OCamlrr" | "Camlp4Printers/OCamlrr.cmo") -> *)
- (* Register.enable_ocamlrr_printer () *)
| ("Printers"|"", "pr_o.cmo" | "o" | "ocaml" | "camlp4ocamlprinter.cmo") ->
Register.enable_ocaml_printer ()
| ("Printers"|"", "pr_dump.cmo" | "p" | "dumpocaml" | "camlp4ocamlastdumper.cmo") ->
@@ -116,7 +117,7 @@ value rec parse_file dyn_loader name pa getdir =
| None -> None ]) in
let loc = Loc.mk name
in do {
- Warning.current.val := print_warning;
+ 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
@@ -146,8 +147,6 @@ value gimd =
[ <:str_item@loc< # $n$ $str:s$ >> -> Some (loc, n, s)
| _ -> None ];
-open Register;
-
value process_intf dyn_loader name =
process dyn_loader name CurrentParser.parse_interf CurrentPrinter.print_interf
(new CleanAst.clean_ast)#sig_item
diff --git a/camlp4/Camlp4Filters/Camlp4FoldGenerator.ml b/camlp4/Camlp4Filters/Camlp4FoldGenerator.ml
index ad6ed45af..aa6340438 100644
--- a/camlp4/Camlp4Filters/Camlp4FoldGenerator.ml
+++ b/camlp4/Camlp4Filters/Camlp4FoldGenerator.ml
@@ -191,6 +191,16 @@ module Make (AstFilters : Camlp4.Sig.AstFilters) = struct
<: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$ : $_$ >> ->
@@ -202,19 +212,30 @@ module Make (AstFilters : Camlp4.Sig.AstFilters) = struct
and record_binding_of_type =
fun
[ <:ctyp< $lid:s$ : mutable $t$ >> | <:ctyp< $lid:s$ : $t$ >> ->
- <:binding< $lid:s$ = $expr_of_ty (Some <:expr< $lid:xs s$ >>) t$ >>
+ <:rec_binding< $lid:s$ = $expr_of_ty (Some <:expr< $lid:xs s$ >>) t$ >>
| <:ctyp< $t1$ ; $t2$ >> ->
- <:binding< $record_binding_of_type t1$; $record_binding_of_type t2$ >>
+ <:rec_binding< $record_binding_of_type t1$; $record_binding_of_type t2$ >>
| _ -> assert False ]
- and fun_of_ctyp =
+ 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
- | _ -> <:expr< fun _ -> o >> ]
+ | <: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
@@ -227,7 +248,7 @@ module Make (AstFilters : Camlp4.Sig.AstFilters) = struct
[ [] -> 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 ctyp) 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$ >>
@@ -289,20 +310,20 @@ module Make (AstFilters : Camlp4.Sig.AstFilters) = struct
StringMap.fold class_sig_item_of_type_decl tyMap <:class_sig_item<>>
and inject_structure_drop_trash generated =
- Ast.map_str_item
+ (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 ])
+ | s -> s ]))#str_item
and inject_signature generated =
- Ast.map_sig_item
+ (Ast.map_sig_item
(fun
[ <:sig_item@_loc< class $lid:c$ : Camlp4Filters.GenerateFold.generated >> ->
<:sig_item< class $lid:c$ : object $generated$ end >>
- | s -> s ])
+ | s -> s ]))#sig_item
and process_str_item str_item =
let tyMap = collect_types_in_str_item str_item in
diff --git a/camlp4/Camlp4Filters/Camlp4LocationStripper.ml b/camlp4/Camlp4Filters/Camlp4LocationStripper.ml
index c57e68673..594b0fc1b 100644
--- a/camlp4/Camlp4Filters/Camlp4LocationStripper.ml
+++ b/camlp4/Camlp4Filters/Camlp4LocationStripper.ml
@@ -29,7 +29,7 @@ module Make (AstFilters : Camlp4.Sig.AstFilters) = struct
open AstFilters;
open Ast;
- register_str_item_filter (new Ast.c_loc (fun _ -> Loc.ghost))#str_item;
+ register_str_item_filter (Ast.map_loc (fun _ -> Loc.ghost))#str_item;
end;
diff --git a/camlp4/Camlp4Filters/Camlp4MapGenerator.ml b/camlp4/Camlp4Filters/Camlp4MapGenerator.ml
index 2270f52b5..ec45872d7 100644
--- a/camlp4/Camlp4Filters/Camlp4MapGenerator.ml
+++ b/camlp4/Camlp4Filters/Camlp4MapGenerator.ml
@@ -196,6 +196,16 @@ module Make (AstFilters : Camlp4.Sig.AstFilters) = struct
<: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$ : $_$ >> ->
@@ -207,19 +217,30 @@ module Make (AstFilters : Camlp4.Sig.AstFilters) = struct
and record_binding_of_type =
fun
[ <:ctyp< $lid:s$ : mutable $t$ >> | <:ctyp< $lid:s$ : $t$ >> ->
- <:binding< $lid:s$ = $expr_of_ty (Some <:expr< $lid:xs s$ >>) t$ >>
+ <:rec_binding< $lid:s$ = $expr_of_ty (Some <:expr< $lid:xs s$ >>) t$ >>
| <:ctyp< $t1$ ; $t2$ >> ->
- <:binding< $record_binding_of_type t1$; $record_binding_of_type t2$ >>
+ <:rec_binding< $record_binding_of_type t1$; $record_binding_of_type t2$ >>
| _ -> assert False ]
- and fun_of_ctyp =
+ 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
- | _ -> <:expr< fun x -> x >> ]
+ | <: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
@@ -232,7 +253,7 @@ module Make (AstFilters : Camlp4.Sig.AstFilters) = struct
[ [] -> 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 ctyp) 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$ >>
@@ -294,20 +315,25 @@ module Make (AstFilters : Camlp4.Sig.AstFilters) = struct
StringMap.fold class_sig_item_of_type_decl tyMap <:class_sig_item<>>
and inject_structure_drop_trash generated =
- Ast.map_str_item
+ (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 ])
+ | s -> s ]))#str_item
and inject_signature generated =
- Ast.map_sig_item
+ (Ast.map_sig_item
(fun
[ <:sig_item@_loc< class $lid:c$ : Camlp4Filters.GenerateMap.generated >> ->
<:sig_item< class $lid:c$ : object $generated$ end >>
- | s -> s ])
+ | <: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
diff --git a/camlp4/Camlp4Filters/Camlp4Tracer.ml b/camlp4/Camlp4Filters/Camlp4Tracer.ml
index a7cf5ca53..61c8c9027 100644
--- a/camlp4/Camlp4Filters/Camlp4Tracer.ml
+++ b/camlp4/Camlp4Filters/Camlp4Tracer.ml
@@ -51,7 +51,7 @@ module Make (AstFilters : Camlp4.Sig.AstFilters) = struct
[ <:expr@_loc< fun [ $m$ ] >> -> <:expr< fun [ $map_match_case m$ ] >>
| x -> x ];
- register_str_item_filter (new Ast.c_expr map_expr)#str_item;
+ register_str_item_filter (Ast.map_expr map_expr)#str_item;
end;
diff --git a/camlp4/Camlp4Filters/Camlp4TrashRemover.ml b/camlp4/Camlp4Filters/Camlp4TrashRemover.ml
index b5b1a8622..baeec6c92 100644
--- a/camlp4/Camlp4Filters/Camlp4TrashRemover.ml
+++ b/camlp4/Camlp4Filters/Camlp4TrashRemover.ml
@@ -30,7 +30,7 @@ module Make (AstFilters : Camlp4.Sig.AstFilters) = struct
open Ast;
register_str_item_filter
- (new Ast.c_str_item
+ (Ast.map_str_item
(fun
[ <:str_item@_loc< module Camlp4Trash = $_$ >> ->
<:str_item<>>
diff --git a/camlp4/Camlp4Parsers/Camlp4GrammarParser.ml b/camlp4/Camlp4Parsers/Camlp4GrammarParser.ml
index 8bae3c382..e00b72da2 100644
--- a/camlp4/Camlp4Parsers/Camlp4GrammarParser.ml
+++ b/camlp4/Camlp4Parsers/Camlp4GrammarParser.ml
@@ -147,7 +147,7 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
Hashtbl.iter
(fun s (r, e) ->
if r.val = Unused then
- Warning.print e.name.loc ("Unused local entry \"" ^ s ^ "\"")
+ print_warning e.name.loc ("Unused local entry \"" ^ s ^ "\"")
else ())
ht;
}
@@ -309,7 +309,7 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
value srules loc t rl tvar =
List.map
(fun r ->
- let sl = List.map (fun s -> s.text) r.prod in
+ let sl = [ s.text | s <- r.prod ] in
let ac = text_of_action loc r.prod t r.action tvar in
(sl, ac))
rl
@@ -600,7 +600,6 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
fun
[ <:patt@_loc< $lid:_$ >> -> <:patt< _ >>
| <:patt< ($p$ as $_$) >> -> self#patt p
- | <:patt@_loc< $p1$ = $p2$ >> -> <:patt@_loc< $p1$ = $self#patt p2$ >>
| p -> super#patt p ];
end;
@@ -625,6 +624,8 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
"LIST0 STRING becomes LIST0 [ x = STRING -> x ]"))
| _ -> () ];
+ Camlp4_config.antiquotations.val := True;
+
EXTEND Gram
GLOBAL: expr symbol;
expr: AFTER "top"
diff --git a/camlp4/Camlp4Parsers/Camlp4MacroParser.ml b/camlp4/Camlp4Parsers/Camlp4MacroParser.ml
index 3015da99c..33594fefb 100644
--- a/camlp4/Camlp4Parsers/Camlp4MacroParser.ml
+++ b/camlp4/Camlp4Parsers/Camlp4MacroParser.ml
@@ -16,6 +16,8 @@ open Camlp4; (* -*- camlp4r -*- *)
(* Authors:
* - Daniel de Rauglaudre: initial version
* - Nicolas Pouillard: refactoring
+ * - Aleksey Nogin: extra features and bug fixes.
+ * - Christopher Conway: extra feature (-D<uident>=)
*)
module Id = struct
@@ -31,16 +33,22 @@ Added statements:
DEFINE <uident>
DEFINE <uident> = <expression>
DEFINE <uident> (<parameters>) = <expression>
- IFDEF <uident> THEN <structure_items> (END | ENDIF)
- IFDEF <uident> THEN <structure_items> ELSE <structure_items> (END | ENDIF)
- IFNDEF <uident> THEN <structure_items> (END | ENDIF)
- IFNDEF <uident> THEN <structure_items> ELSE <structure_items> (END | ENDIF)
+ IFDEF <uident> THEN <structure_items> [ ELSE <structure_items> ] (END | ENDIF)
+ IFNDEF <uident> THEN <structure_items> [ ELSE <structure_items> ] (END | ENDIF)
+ INCLUDE <string>
+
+ At toplevel (signature item):
+
+ DEFINE <uident>
+ IFDEF <uident> THEN <signature_items> [ ELSE <signature_items> ] (END | ENDIF)
+ IFNDEF <uident> THEN <signature_items> [ ELSE <signature_items> ] (END | ENDIF)
INCLUDE <string>
In expressions:
- IFDEF <uident> THEN <expression> ELSE <expression> (END | ENDIF)
- IFNDEF <uident> THEN <expression> ELSE <expression> (END | ENDIF)
+ IFDEF <uident> THEN <expression> [ ELSE <expression> ] (END | ENDIF)
+ IFNDEF <uident> THEN <expression> [ ELSE <expression> ] (END | ENDIF)
+ DEFINE <lident> = <expression> IN <expression>
__FILE__
__LOCATION__
@@ -51,7 +59,7 @@ Added statements:
As Camlp4 options:
- -D<uident> define <uident>
+ -D<uident> or -D<uident>=expr define <uident> with optional value <expr>
-U<uident> undefine it
-I<dir> add <dir> to the search path for INCLUDE'd files
@@ -60,7 +68,13 @@ Added statements:
the macro cannot be used as a pattern, there is an error message if
it is used in a pattern.
+ You can also define a local macro in an expression usigng the DEFINE ... IN form.
+ Note that local macros have lowercase names and can not take parameters.
+ If a macro is defined to = NOTHING, and then used as an argument to a function,
+ this will be equivalent to function taking one less argument. Similarly,
+ passing NOTHING as an argument to a macro is equivalent to "erasing" the
+ corresponding parameter from the macro body.
The toplevel statement INCLUDE <string> can be used to include a
file containing macro definitions and also any other toplevel items.
@@ -82,8 +96,8 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
[ SdStr of 'a
| SdDef of string and option (list string * Ast.expr)
| SdUnd of string
- | SdITE of string and 'a and 'a
- | SdInc of string ];
+ | SdITE of string and list (item_or_def 'a) and list (item_or_def 'a)
+ | SdLazy of Lazy.t 'a ];
value rec list_remove x =
fun
@@ -95,29 +109,16 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
value is_defined i = List.mem_assoc i defined.val;
- class reloc _loc = object
- inherit Ast.map as super;
- method _Loc_t _ = _loc;
- end;
-
- class subst _loc env = object
- inherit reloc _loc as super;
- method expr =
- fun
- [ <:expr< $lid:x$ >> | <:expr< $uid:x$ >> as e ->
- try List.assoc x env with
- [ Not_found -> e ]
- | e -> super#expr e ];
- end;
-
- value bad_patt _loc =
+ value bad_patt _loc =
Loc.raise _loc
(Failure
"this macro cannot be used in a pattern (see its definition)");
+
value substp _loc env =
loop where rec loop =
fun
[ <:expr< $e1$ $e2$ >> -> <:patt< $loop e1$ $loop e2$ >>
+ | <:expr< >> -> <:patt< >>
| <:expr< $lid:x$ >> ->
try List.assoc x env with
[ Not_found -> <:patt< $lid:x$ >> ]
@@ -130,12 +131,34 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
| <:expr< $x1$, $x2$ >> -> <:patt< $loop x1$, $loop x2$ >>
| <:expr< { $bi$ } >> ->
let rec substbi = fun
- [ <:binding< $b1$; $b2$ >> -> <:patt< $substbi b1$; $substbi b2$ >>
- | <:binding< $p$ = $e$ >> -> <:patt< $p$ = $loop e$ >>
+ [ <:rec_binding< $b1$; $b2$ >> -> <:patt< $substbi b1$; $substbi b2$ >>
+ | <:rec_binding< $i$ = $e$ >> -> <:patt< $i$ = $loop e$ >>
| _ -> bad_patt _loc ]
in <:patt< { $substbi bi$ } >>
| _ -> bad_patt _loc ];
+ class reloc _loc = object
+ inherit Ast.map as super;
+ method _Loc_t _ = _loc;
+ end;
+
+ class subst _loc env = object
+ inherit reloc _loc as super;
+ method expr =
+ fun
+ [ <:expr< $lid:x$ >> | <:expr< $uid:x$ >> as e ->
+ try List.assoc x env with
+ [ Not_found -> super#expr e ]
+ | e -> super#expr e ];
+
+ method patt =
+ fun
+ [ <:patt< $lid:x$ >> | <:patt< $uid:x$ >> as p ->
+ try substp _loc [] (List.assoc x env) with
+ [ Not_found -> super#patt p ]
+ | p -> super#patt p ];
+ end;
+
value incorrect_number loc l1 l2 =
Loc.raise loc
(Failure
@@ -211,6 +234,12 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
with
[ Not_found -> () ];
+ value parse_def s =
+ match Gram.parse_string expr (Loc.mk "<command line>") s with
+ [ <:expr< $uid:n$ >> -> define None n
+ | <:expr< $uid:n$ = $e$ >> -> define (Some ([],e)) n
+ | _ -> invalid_arg s ];
+
(* This is a list of directories to search for INCLUDE statements. *)
value include_dirs = ref [];
@@ -234,27 +263,69 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
let st = Stream.of_channel ch in
Gram.parse rule (Loc.mk file) st;
+ value rec execute_macro nil cons =
+ fun
+ [ SdStr i -> i
+ | SdDef x eo -> do { define eo x; nil }
+ | SdUnd x -> do { undef x; nil }
+ | SdITE i l1 l2 -> execute_macro_list nil cons (if is_defined i then l1 else l2)
+ | SdLazy l -> Lazy.force l ]
+
+ and execute_macro_list nil cons = fun
+ [ [] -> nil
+ | [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 ]
+ ;
+
EXTEND Gram
GLOBAL: expr patt str_item sig_item;
str_item: FIRST
- [ [ "DEFINE"; i = uident; def = opt_macro_value ->
- do { define def i; <:str_item<>> }
- | "UNDEF"; i = uident ->
- do { undef i; <:str_item<>> }
- | "IFDEF"; i = uident; "THEN"; st = str_items; _ = endif ->
- if is_defined i then st else <:str_item<>>
- | "IFDEF"; i = uident; "THEN"; st1 = str_items; "ELSE"; st2 = str_items; _ = endif ->
- if is_defined i then st1 else st2
- | "IFNDEF"; i = uident; "THEN"; st = str_items; _ = endif ->
- if is_defined i then <:str_item<>> else st
- | "IFNDEF"; i = uident; "THEN"; st1 = str_items; "ELSE"; st2 = str_items; _ = endif ->
- if is_defined i then st2 else st1
- | "INCLUDE"; fname = STRING ->
- parse_include_file str_items fname ] ]
+ [ [ x = macro_def ->
+ execute_macro <:str_item<>> (fun a b -> <:str_item< $a$; $b$ >>) x ] ]
;
sig_item: FIRST
- [ [ "INCLUDE"; fname = STRING ->
- parse_include_file sig_items fname ] ]
+ [ [ x = macro_def_sig ->
+ execute_macro <:sig_item<>> (fun a b -> <:sig_item< $a$; $b$ >>) x ] ]
+ ;
+ macro_def:
+ [ [ "DEFINE"; i = uident; def = opt_macro_value -> SdDef i def
+ | "UNDEF"; i = uident -> SdUnd i
+ | "IFDEF"; i = uident; "THEN"; st1 = smlist; st2 = else_macro_def ->
+ SdITE i st1 st2
+ | "IFNDEF"; i = uident; "THEN"; st2 = smlist; st1 = else_macro_def ->
+ SdITE i st1 st2
+ | "INCLUDE"; fname = STRING ->
+ SdLazy (lazy (parse_include_file str_items fname)) ] ]
+ ;
+ macro_def_sig:
+ [ [ "DEFINE"; i = uident -> SdDef i None
+ | "UNDEF"; i = uident -> SdUnd i
+ | "IFDEF"; i = uident; "THEN"; sg1 = sglist; sg2 = else_macro_def_sig ->
+ SdITE i sg1 sg2
+ | "IFNDEF"; i = uident; "THEN"; sg2 = sglist; sg1 = else_macro_def_sig ->
+ SdITE i sg1 sg2
+ | "INCLUDE"; fname = STRING ->
+ SdLazy (lazy (parse_include_file sig_items fname)) ] ]
+ ;
+ else_macro_def:
+ [ [ "ELSE"; st = smlist; endif -> st
+ | endif -> [] ] ]
+ ;
+ else_macro_def_sig:
+ [ [ "ELSE"; st = sglist; endif -> st
+ | endif -> [] ] ]
+ ;
+ else_expr:
+ [ [ "ELSE"; e = expr; endif -> e
+ | endif -> <:expr< () >> ] ]
+ ;
+ smlist:
+ [ [ sml = LIST1 [ d = macro_def; semi -> d | si = str_item; semi -> SdStr si ] -> sml ] ]
+ ;
+ sglist:
+ [ [ sgl = LIST1 [ d = macro_def_sig; semi -> d | si = sig_item; semi -> SdStr si ] -> sgl ] ]
;
endif:
[ [ "END" -> ()
@@ -266,10 +337,12 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
| -> None ] ]
;
expr: LEVEL "top"
- [ [ "IFDEF"; i = uident; "THEN"; e1 = expr; "ELSE"; e2 = expr; _ = endif ->
+ [ [ "IFDEF"; i = uident; "THEN"; e1 = expr; e2 = else_expr ->
if is_defined i then e1 else e2
- | "IFNDEF"; i = uident; "THEN"; e1 = expr; "ELSE"; e2 = expr; _ = endif ->
- if is_defined i then e2 else e1 ] ]
+ | "IFNDEF"; i = uident; "THEN"; e1 = expr; e2 = else_expr ->
+ if is_defined i then e2 else e1
+ | "DEFINE"; i = LIDENT; "="; def = expr; "IN"; body = expr ->
+ (new subst _loc [(i, def)])#expr body ] ]
;
expr: LEVEL "simple"
[ [ LIDENT "__FILE__" -> <:expr< $`str:Loc.file_name _loc$ >>
@@ -281,9 +354,9 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
$if h then <:expr< True >> else <:expr< False >> $) >> ] ]
;
patt:
- [ [ "IFDEF"; i = uident; "THEN"; p1 = patt; "ELSE"; p2 = patt; _ = endif ->
+ [ [ "IFDEF"; i = uident; "THEN"; p1 = patt; "ELSE"; p2 = patt; endif ->
if is_defined i then p1 else p2
- | "IFNDEF"; i = uident; "THEN"; p1 = patt; "ELSE"; p2 = patt; _ = endif ->
+ | "IFNDEF"; i = uident; "THEN"; p1 = patt; "ELSE"; p2 = patt; endif ->
if is_defined i then p2 else p1 ] ]
;
uident:
@@ -291,7 +364,7 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
;
END;
- Options.add "-D" (Arg.String (define None))
+ Options.add "-D" (Arg.String parse_def)
"<string> Define for IFDEF instruction.";
Options.add "-U" (Arg.String undef)
"<string> Undefine for IFDEF instruction.";
@@ -301,3 +374,18 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
end;
let module M = Register.OCamlSyntaxExtension Id Make in ();
+
+module MakeNothing (AstFilters : Camlp4.Sig.AstFilters) = struct
+ open AstFilters;
+ open Ast;
+
+ value remove_nothings =
+ fun
+ [ <:expr< $e$ NOTHING >> | <:expr< fun $ <:patt< NOTHING >> $ -> $e$ >> -> e
+ | e -> e];
+
+ register_str_item_filter (Ast.map_expr remove_nothings)#str_item;
+
+end;
+
+let module M = Camlp4.Register.AstFilter Id MakeNothing in ();
diff --git a/camlp4/Camlp4Parsers/Camlp4OCamlOriginalQuotationExpander.ml b/camlp4/Camlp4Parsers/Camlp4OCamlOriginalQuotationExpander.ml
index b5b120ba0..c033a22cb 100644
--- a/camlp4/Camlp4Parsers/Camlp4OCamlOriginalQuotationExpander.ml
+++ b/camlp4/Camlp4Parsers/Camlp4OCamlOriginalQuotationExpander.ml
@@ -19,7 +19,7 @@ open Camlp4; (* -*- camlp4r -*- *)
open PreCast;
let module Gram = MakeGram Lexer in
-let module M1 = OCamlInitSyntax.Make Warning Ast Gram Quotation in
+let module M1 = OCamlInitSyntax.Make Ast Gram Quotation in
let module M2 = Camlp4OCamlRevisedParser.Make M1 in
let module M3 = Camlp4OCamlParser.Make M2 in
let module M3 = Camlp4QuotationCommon.Make M3 Syntax.AntiquotSyntax in ();
diff --git a/camlp4/Camlp4Parsers/Camlp4OCamlParser.ml b/camlp4/Camlp4Parsers/Camlp4OCamlParser.ml
index fdc6d7ebb..9dba583f8 100644
--- a/camlp4/Camlp4Parsers/Camlp4OCamlParser.ml
+++ b/camlp4/Camlp4Parsers/Camlp4OCamlParser.ml
@@ -31,21 +31,6 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
Camlp4_config.constructors_arity.val := False;
(*FIXME remove this and use OCaml ones *)
- value bigarray_get _loc arr arg =
- let coords =
- match arg with
- [ <:expr< ($e1$, $e2$) >> | <:expr< $e1$, $e2$ >> ->
- Ast.list_of_expr e1 (Ast.list_of_expr e2 [])
- | _ -> [arg] ]
- in
- match coords with
- [ [c1] -> <:expr< Bigarray.Array1.get $arr$ $c1$ >>
- | [c1; c2] -> <:expr< Bigarray.Array2.get $arr$ $c1$ $c2$ >>
- | [c1; c2; c3] -> <:expr< Bigarray.Array3.get $arr$ $c1$ $c2$ $c3$ >>
- (* | coords -> <:expr< Bigarray.Genarray.get $arr$ [| $`list:coords$ |] >> ] *)
- | coords ->
- <:expr< Bigarray.Genarray.get $arr$ [| $Ast.exSem_of_list coords$ |] >> ];
-
value bigarray_set _loc var newval =
match var with
[ <:expr< Bigarray.Array1.get $arr$ $c1$ >> ->
@@ -57,22 +42,6 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
| <:expr< Bigarray.Genarray.get $arr$ [| $coords$ |] >> ->
Some <:expr< Bigarray.Genarray.set $arr$ [| $coords$ |] $newval$ >>
| _ -> None ];
- value mkumin _loc f arg =
- match (f, arg) with
- [ ("-", <:expr< $int:n$ >>) when int_of_string n > 0 ->
- <:expr< $int:"-" ^ n$ >>
- | ("-", <:expr< $int32:n$ >>) when (Int32.of_string n) > 0l ->
- <:expr< $int32:"-" ^ n$ >>
- | ("-", <:expr< $int64:n$ >>) when (Int64.of_string n) > 0L ->
- <:expr< $int64:"-" ^ n$ >>
- | ("-", <:expr< $nativeint:n$ >>) when (Nativeint.of_string n) > 0n ->
- <:expr< $nativeint:"-" ^ n$ >>
- | (_, <:expr< $flo:n$ >>) when float_of_string n > 0.0 ->
- <:expr< $flo:"-" ^ n$ >>
- | _ ->
- let f = "~" ^ f in
- <:expr< $lid:f$ $arg$ >> ]
- ;
value mk_anti ?(c = "") n s = "\\$"^n^c^":"^s;
(*FIXME*)
@@ -90,11 +59,6 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
(Ast.loc_of_expr e2) in
<:expr< do { $e1$; $e2$ } >> ];
- value get_seq =
- fun
- [ <:expr< do { $e$ } >> -> e
- | e -> e ];
-
value is_operator =
let ht = Hashtbl.create 73 in
let ct = Hashtbl.create 73 in
@@ -110,97 +74,6 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
}
;
- value operator_rparen =
- Gram.Entry.of_parser "operator_rparen"
- (fun strm ->
- match Stream.npeek 2 strm with
- [ [(KEYWORD s | SYMBOL s, _); (KEYWORD ")", _)] when is_operator s ->
- do { Stream.junk strm; Stream.junk strm; s }
- | _ -> raise Stream.Failure ])
- ;
-
- value symbolchar =
- let list =
- ['!'; '$'; '%'; '&'; '*'; '+'; '-'; '.'; '/'; ':'; '<'; '='; '>'; '?';
- '@'; '^'; '|'; '~']
- 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
- ;
-
- value prefixop =
- let list = ['!'; '?'; '~'] in
- let excl = ["!="; "??"] in
- Gram.Entry.of_parser "prefixop"
- (parser
- [: `(KEYWORD x | SYMBOL x, _loc)
- when
- not (List.mem x excl) && String.length x >= 2 &&
- List.mem x.[0] list && symbolchar x 1 :] ->
- <:expr< $lid:x$ >>)
- ;
-
- value infixop0 =
- let list_ok = ["<"; ">"; "<="; ">="; "="; "<>"; "=="; "!="; "$"] in
- let list_first_char_ok = ['='; '<'; '>'; '|'; '&'; '$'; '!'] in
- let excl = ["<-"; "||"; "&&"] in
- Gram.Entry.of_parser "infixop0"
- (parser
- [: `(KEYWORD x | SYMBOL x, _loc)
- when
- (List.mem x list_ok) ||
- (not (List.mem x excl) && String.length x >= 2 &&
- List.mem x.[0] list_first_char_ok && symbolchar x 1) :] ->
- <:expr< $lid:x$ >>)
- ;
-
- value infixop1 =
- let list = ['@'; '^'] in
- Gram.Entry.of_parser "infixop1"
- (parser
- [: `(KEYWORD x | SYMBOL x, _loc)
- when
- String.length x >= 1 && List.mem x.[0] list &&
- symbolchar x 1 :] ->
- <:expr< $lid:x$ >>)
- ;
-
- value infixop2 =
- let list = ['+'; '-'] in
- Gram.Entry.of_parser "infixop2"
- (parser
- [: `(KEYWORD x | SYMBOL x, _loc)
- when
- x <> "->" && String.length x >= 1 && List.mem x.[0] list &&
- symbolchar x 1 :] ->
- <:expr< $lid:x$ >>)
- ;
-
- value infixop3 =
- let list = ['*'; '/'; '%'] in
- Gram.Entry.of_parser "infixop3"
- (parser
- [: `(KEYWORD x | SYMBOL x, _loc)
- when
- String.length x >= 1 && List.mem x.[0] list &&
- symbolchar x 1 :] ->
- <:expr< $lid:x$ >>)
- ;
-
- value infixop4 =
- Gram.Entry.of_parser "infixop4"
- (parser
- [: `(KEYWORD x | SYMBOL x, _loc)
- when
- String.length x >= 3 && x.[0] == '*' && x.[1] == '*' &&
- symbolchar x 2 :] ->
- <:expr< $lid:x$ >>)
- ;
-
value test_constr_decl =
Gram.Entry.of_parser "test_constr_decl"
(fun strm ->
@@ -325,30 +198,44 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
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 END;
DELETE_RULE Gram label_expr: label_longident; fun_binding END;
+ DELETE_RULE Gram expr: "let"; opt_rec; binding; "in"; SELF END;
+ DELETE_RULE Gram expr: "let"; "module"; a_UIDENT; module_binding0; "in"; SELF END;
+ DELETE_RULE Gram expr: "fun"; "["; LIST0 match_case0 SEP "|"; "]" END;
+ DELETE_RULE Gram expr: "if"; SELF; "then"; SELF; "else"; SELF END;
+ DELETE_RULE Gram expr: "do"; do_sequence END;
+ DELETE_RULE Gram expr: SELF; SELF END;
+ DELETE_RULE Gram expr: "new"; class_longident END;
+ DELETE_RULE Gram expr: "["; sem_expr_for_list; "::"; expr; "]" END;
+ DELETE_RULE Gram expr: "{"; label_expr; "}" END;
+ DELETE_RULE Gram expr: "{"; "("; SELF; ")"; "with"; label_expr; "}" END;
+ DELETE_RULE Gram expr: "("; SELF; ","; comma_expr; ")" END;
+ DELETE_RULE Gram expr: SELF; ":="; SELF; dummy END;
+ DELETE_RULE Gram expr: "~"; a_LIDENT; ":"; SELF END;
+ DELETE_RULE Gram expr: "?"; a_LIDENT; ":"; SELF END;
+ (* Some other DELETE_RULE are after the grammar *)
value clear = Gram.Entry.clear;
clear ctyp;
- clear expr;
clear patt;
- clear a_LIDENT_or_operator;
clear a_UIDENT;
clear type_longident_and_parameters;
clear type_parameters;
clear ipatt;
clear labeled_ipatt;
clear semi;
+ clear do_sequence;
clear let_binding;
clear type_kind;
clear constructor_arg_list;
clear poly_type;
clear class_name_and_param;
- clear class_fun_def;
clear class_longident_and_param;
clear class_type_longident_and_param;
clear class_type_plus;
clear type_constraint;
- clear comma_expr;
clear comma_patt;
clear sequence;
clear sem_expr_for_list;
@@ -361,7 +248,7 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
EXTEND Gram
GLOBAL:
a_CHAR a_FLOAT a_INT a_INT32 a_INT64 a_LABEL a_LIDENT
- a_LIDENT_or_operator a_NATIVEINT a_OPTLABEL a_STRING a_UIDENT a_ident
+ a_NATIVEINT a_OPTLABEL a_STRING a_UIDENT a_ident
amp_ctyp and_ctyp match_case match_case0 match_case_quot binding binding_quot
class_declaration class_description class_expr class_expr_quot
class_fun_binding class_fun_def class_info_for_class_expr
@@ -373,7 +260,7 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
comma_ctyp comma_expr comma_ipatt comma_patt comma_type_parameter
constrain constructor_arg_list constructor_declaration
constructor_declarations ctyp ctyp_quot cvalue_binding direction_flag
- dummy eq_expr expr expr_eoi expr_quot field field_expr fun_binding
+ dummy eq_expr expr expr_eoi expr_quot field_expr fun_binding
fun_def ident ident_quot implem interf ipatt ipatt_tcon label
label_declaration label_expr label_ipatt label_longident label_patt
labeled_ipatt let_binding meth_list module_binding module_binding0
@@ -384,15 +271,14 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
opt_comma_ctyp opt_dot_dot opt_eq_ctyp opt_expr
opt_meth_list opt_mutable opt_polyt opt_private opt_rec
opt_virtual opt_when_expr patt patt_as_patt_opt patt_eoi
- patt_quot patt_tcon phrase pipe_ctyp poly_type row_field sem_ctyp
+ patt_quot patt_tcon phrase poly_type row_field
sem_expr sem_expr_for_list sem_patt sem_patt_for_list semi sequence
sig_item sig_item_quot sig_items star_ctyp str_item str_item_quot
str_items top_phrase type_constraint type_declaration
type_ident_and_parameters type_kind type_longident
type_longident_and_parameters type_parameter type_parameters typevars
use_file val_longident value_let value_val with_constr with_constr_quot
-
- infixop0 infixop1 infixop2 infixop3 infixop4
+ infixop0 infixop1 infixop2 infixop3 infixop4 do_sequence
;
sem_expr:
[ [ e1 = expr LEVEL "top"; ";"; e2 = SELF -> <:expr< $e1$; $e2$ >>
@@ -402,6 +288,10 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
sequence:
[ [ e = sem_expr -> e ] ]
;
+ do_sequence:
+ [ [ seq = sequence; "done" -> seq
+ ] ]
+ ;
sem_expr_for_list:
[ [ e = expr LEVEL "top"; ";"; el = SELF -> fun acc -> <:expr< [ $e$ :: $el acc$ ] >>
| e = expr LEVEL "top"; ";" -> fun acc -> <:expr< [ $e$ :: $acc$ ] >>
@@ -420,39 +310,29 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
<:str_item< let module $m$ = $mb$ in $e$ >>
] ]
;
- expr:
+ expr: BEFORE "top"
[ ";" RIGHTA
[ e1 = SELF; ";"; e2 = SELF ->
conc_seq e1 e2
- | e1 = SELF; ";" -> e1 ]
- | "top"
- [ "let"; r = opt_rec; bi = binding; "in";
+ | e1 = SELF; ";" -> e1 ] ];
+ expr: LEVEL "top"
+ [ [ "let"; r = opt_rec; bi = binding; "in";
x = expr LEVEL ";" ->
<:expr< let $rec:r$ $bi$ in $x$ >>
| "let"; "module"; m = a_UIDENT; mb = module_binding0; "in";
e = expr LEVEL ";" ->
<:expr< let module $m$ = $mb$ in $e$ >>
- | "function"; OPT "|"; a = match_case ->
+ | "function"; a = match_case ->
<:expr< fun [ $a$ ] >>
- | "fun"; p = labeled_ipatt; e = fun_def ->
- <:expr< fun $p$ -> $e$ >>
- | "match"; e = SELF; "with"; OPT "|"; a = match_case ->
- <:expr< match $e$ with [ $a$ ] >>
- | "try"; e = SELF; "with"; OPT "|"; a = match_case ->
- <:expr< try $e$ with [ $a$ ] >>
| "if"; e1 = SELF; "then"; e2 = expr LEVEL "top";
"else"; e3 = expr LEVEL "top" ->
<:expr< if $e1$ then $e2$ else $e3$ >>
| "if"; e1 = SELF; "then"; e2 = expr LEVEL "top" ->
<:expr< if $e1$ then $e2$ else () >>
- | "for"; i = a_LIDENT; "="; e1 = SELF; df = direction_flag; e2 = SELF;
- "do"; el = SELF; "done" ->
- <:expr< for $i$ = $e1$ $to:df$ $e2$ do { $get_seq el$ } >>
- | "while"; e1 = SELF; "do"; e2 = SELF; "done" ->
- <:expr< while $e1$ do { $get_seq e2$ } >>
- | "object"; csp = opt_class_self_patt; cst = class_structure; "end" ->
- <:expr< object ($csp$) $cst$ end >> ]
- | [ e = SELF; ","; el = (*FIXME comma_expr*)LIST1 NEXT SEP "," ->
+ ] ];
+ expr: BEFORE "||"
+ [ ","
+ [ e = SELF; ","; el = (*FIXME comma_expr*)LIST1 NEXT SEP "," ->
<:expr< ( $e$, $Ast.exCom_of_list el$ ) >> ]
| ":=" NONA
[ e1 = SELF; ":="; e2 = expr LEVEL "top" ->
@@ -460,105 +340,28 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
| e1 = SELF; "<-"; e2 = expr LEVEL "top" ->
match bigarray_set _loc e1 e2 with
[ Some e -> e
- | None -> <:expr< $e1$ := $e2$ >> ] ]
- | "||" RIGHTA
- [ e1 = SELF; op = infixop6; e2 = SELF -> <:expr< $op$ $e1$ $e2$ >> ]
- | "&&" RIGHTA
- [ e1 = SELF; op = infixop5; e2 = SELF -> <:expr< $op$ $e1$ $e2$ >> ]
- | "<" LEFTA
- [ e1 = SELF; op = infixop0; e2 = SELF -> <:expr< $op$ $e1$ $e2$ >> ]
- | "^" RIGHTA
- [ e1 = SELF; op = infixop1; e2 = SELF -> <:expr< $op$ $e1$ $e2$ >> ]
- | RIGHTA
+ | None -> <:expr< $e1$ := $e2$ >> ]
+ ] ];
+ expr: AFTER "^"
+ [ "::" RIGHTA
[ e1 = SELF; "::"; e2 = SELF -> <:expr< [$e1$ :: $e2$] >> ]
- | "+" LEFTA
- [ e1 = SELF; op = infixop2; e2 = SELF -> <:expr< $op$ $e1$ $e2$ >> ]
- | "*" LEFTA
- [ e1 = SELF; "*"; e2 = SELF -> <:expr< $e1$ * $e2$ >>
- | e1 = SELF; "/"; e2 = SELF -> <:expr< $e1$ / $e2$ >>
- | e1 = SELF; "%"; e2 = SELF -> <:expr< $lid:"%"$ $e1$ $e2$ >>
- | e1 = SELF; "land"; e2 = SELF -> <:expr< $e1$ land $e2$ >>
- | e1 = SELF; "lor"; e2 = SELF -> <:expr< $e1$ lor $e2$ >>
- | e1 = SELF; "lxor"; e2 = SELF -> <:expr< $e1$ lxor $e2$ >>
- | e1 = SELF; "mod"; e2 = SELF -> <:expr< $e1$ mod $e2$ >>
- | e1 = SELF; op = infixop3; e2 = SELF -> <:expr< $op$ $e1$ $e2$ >> ]
- | "**" RIGHTA
- [ e1 = SELF; "**"; e2 = SELF -> <:expr< $e1$ ** $e2$ >>
- | e1 = SELF; "asr"; e2 = SELF -> <:expr< $e1$ asr $e2$ >>
- | e1 = SELF; "lsl"; e2 = SELF -> <:expr< $e1$ lsl $e2$ >>
- | e1 = SELF; "lsr"; e2 = SELF -> <:expr< $e1$ lsr $e2$ >>
- | e1 = SELF; op = infixop4; e2 = SELF -> <:expr< $op$ $e1$ $e2$ >> ]
- | "unary minus" NONA
- [ "-"; e = SELF -> <:expr< $mkumin _loc "-" e$ >>
- | "-."; e = SELF -> <:expr< $mkumin _loc "-." e$ >> ]
- | "apply" LEFTA
- [ e1 = SELF; e2 = SELF ->
+ ];
+ expr: LEVEL "apply" (* LEFTA *)
+ [ [ e1 = SELF; e2 = SELF ->
match (is_expr_constr_call e1, e2) with
[ (True, <:expr< ( $tup:e$ ) >>) ->
List.fold_left (fun e1 e2 -> <:expr< $e1$ $e2$ >>) e1
(Ast.list_of_expr e [])
| _ -> <:expr< $e1$ $e2$ >> ]
- | "assert"; e = SELF ->
- match e with
- [ <:expr< False >> -> <:expr< assert False >>
- | _ -> <:expr< assert $e$ >> ]
- | "lazy"; e = SELF ->
- <:expr< lazy $e$ >> ]
- | "label"
- [ i = LABEL; e = SELF -> <:expr< ~ $i$ : $e$ >> (* Here it's LABEL and not
- tilde_label since ~a:b
- is different than ~a : b *)
- | "~"; i = a_LIDENT -> <:expr< ~ $i$ >>
- | i = OPTLABEL; e = SELF -> <:expr< ? $i$ : $e$ >> (* Same remark for ?a:b *)
- | "?"; i = a_LIDENT -> <:expr< ? $i$ >> ]
- | "." LEFTA
- [ e1 = SELF; "."; "("; e2 = SELF; ")" -> <:expr< $e1$ .( $e2$ ) >>
- | e1 = SELF; "."; "["; e2 = SELF; "]" -> <:expr< $e1$ .[ $e2$ ] >>
- | e1 = SELF; "."; "{"; e2 = SELF; "}" -> bigarray_get _loc e1 e2
- | e1 = SELF; "."; e2 = SELF -> <:expr< $e1$ . $e2$ >>
- | e = SELF; "#"; lab = label -> <:expr< $e$ # $lab$ >> ]
- | "~-" NONA
- [ "!"; e = SELF -> <:expr< $e$ . val>>
- | "~-"; e = SELF -> <:expr< ~- $e$ >>
- | "~-."; e = SELF -> <:expr< ~-. $e$ >>
- | f = prefixop; e = SELF -> <:expr< $f$ $e$ >> ]
- | "simple" LEFTA
- [ `QUOTATION x -> Quotation.expand_expr (Gram.parse_string expr) _loc x
- | `ANTIQUOT ("exp"|""|"anti" as n) s ->
- <:expr< $anti:mk_anti ~c:"expr" n s$ >>
- | `ANTIQUOT ("tup" as n) s ->
- <:expr< ($tup: <:expr< $anti:mk_anti ~c:"expr" n s$ >>$) >>
- | s = a_INT -> <:expr< $int:s$ >>
- | s = a_INT32 -> <:expr< $int32:s$ >>
- | s = a_INT64 -> <:expr< $int64:s$ >>
- | s = a_NATIVEINT -> <:expr< $nativeint:s$ >>
- | s = a_FLOAT -> <:expr< $flo:s$ >>
- | s = a_STRING -> <:expr< $str:s$ >>
- | c = a_CHAR -> <:expr< $chr:c$ >>
- | i = val_longident -> <:expr< $id:i$ >>
- | "false" -> <:expr< False >>
+ ] ];
+ expr: LEVEL "simple" (* LEFTA *)
+ [ [ "false" -> <:expr< False >>
| "true" -> <:expr< True >>
- | "["; "]" -> <:expr< [] >>
- | "["; mk = sem_expr_for_list; "]" -> mk <:expr< [] >>
- | "[|"; "|]" -> <:expr< [| |] >>
- | "[|"; el = sem_expr; "|]" -> <:expr< [| $el$ |] >>
| "{"; test_label_eq; lel = label_expr; "}" ->
<:expr< { $lel$ } >>
| "{"; e = expr LEVEL "."; "with"; lel = label_expr; "}" ->
<:expr< { ($e$) with $lel$ } >>
- | "{<"; ">}" -> <:expr< {< >} >>
- | "{<"; fel = field_expr; ">}" -> <:expr< {< $fel$ >} >>
- | "("; ")" -> <:expr< () >>
- | "("; op = operator_rparen -> <:expr< $lid:op$ >>
- | "("; e = SELF; ":"; t = ctyp; ")" -> <:expr< ($e$ : $t$) >>
- | "("; e = SELF; ":"; t = ctyp; ":>"; t2 = ctyp; ")" ->
- <:expr< ($e$ : $t$ :> $t2$) >>
- | "("; e = SELF; ":>"; t = ctyp; ")" -> <:expr< ($e$ :> $t$) >>
- | "("; e = SELF; ")" -> <:expr< $e$ >>
- | "begin"; e = SELF; "end" -> <:expr< $e$ >>
- | "begin"; "end" -> <:expr< () >>
| "new"; i = class_longident -> <:expr< new $i$ >>
- | "`"; s = a_ident -> <:expr< ` $s$ >>
] ]
;
val_longident:
@@ -568,12 +371,10 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
| i = a_LIDENT -> <:ident< $lid:i$ >>
| `ANTIQUOT (""|"id"|"anti"|"list" as n) s; "."; i = SELF ->
<:ident< $anti:mk_anti ~c:"ident" n s$.$i$ >>
- | i = a_UIDENT; "."; "("; j = operator_rparen ->
- <:ident< $uid:i$.$lid:j$ >>
| i = a_UIDENT; "."; j = SELF -> <:ident< $uid:i$.$j$ >> ] ]
;
match_case:
- [ [ l = LIST1 match_case0 SEP "|" -> Ast.mcOr_of_list l ] ]
+ [ [ OPT "|"; l = LIST1 match_case0 SEP "|" -> Ast.mcOr_of_list l ] ]
;
patt_constr:
[ [ i = module_longident -> <:patt< $id:i$ >>
@@ -597,11 +398,14 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
List.fold_left (fun p1 p2 -> <:patt< $p1$ $p2$ >>) p1
(Ast.list_of_patt p [])
| _ -> <:patt< $p1$ $p2$ >> ]
+ | `ANTIQUOT (""|"pat"|"anti" as n) s ->
+ <:patt< $anti:mk_anti ~c:"patt" n s$ >>
| p = patt_constr -> p ]
| "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$ >>$) >>
+ | `QUOTATION x -> Quotation.expand _loc x Quotation.DynAst.patt_tag
| i = ident -> <:patt< $id:i$ >>
| s = a_INT -> <:patt< $int:s$ >>
| s = a_INT32 -> <:patt< $int32:s$ >>
@@ -627,27 +431,18 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
| "[|"; pl = sem_patt; "|]" -> <:patt< [| $pl$ |] >>
| "{"; pl = label_patt; "}" -> <:patt< { $pl$ } >>
| "("; ")" -> <:patt< () >>
- | "("; op = operator_rparen -> <:patt< $lid:op$ >>
| "("; p = patt; ":"; t = ctyp; ")" -> <:patt< ($p$ : $t$) >>
| "("; p = patt; ")" -> <:patt< $p$ >>
| "_" -> <:patt< _ >>
| "`"; s = a_ident -> <:patt< ` $s$ >>
- | "#"; i = type_longident -> <:patt< # $i$ >>
- | `QUOTATION x ->
- Quotation.expand_patt (Gram.parse_string patt) _loc x ] ]
- ;
- infixop5:
- [ [ x = [ "&" | "&&" ] -> <:expr< $lid:x$ >> ] ]
- ;
- infixop6:
- [ [ x = [ "or" | "||" ] -> <:expr< $lid:x$ >> ] ]
+ | "#"; i = type_longident -> <:patt< # $i$ >> ] ]
;
(* comma_expr:
[ [ e1 = SELF; ","; e2 = SELF -> <:expr< $e1$, $e2$ >>
| e = expr LEVEL ":=" -> e ] ]
; *)
let_binding:
- [ [ test_just_a_lident_or_patt; s = a_LIDENT_or_operator; e = fun_binding ->
+ [ [ test_just_a_lident_or_patt; s = a_LIDENT; e = fun_binding ->
<:binding< $lid:s$ = $e$ >>
| p = patt; "="; e = expr ->
<:binding< $p$ = $e$ >> ] ]
@@ -664,6 +459,7 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
[ wc1 = SELF; "and"; wc2 = SELF -> <:with_constr< $wc1$ and $wc2$ >>
| `ANTIQUOT (""|"with_constr"|"anti"|"list" as n) s ->
<:with_constr< $anti:mk_anti ~c:"with_constr" n s$ >>
+ | `QUOTATION x -> Quotation.expand _loc x Quotation.DynAst.with_constr_tag
| "type"; `ANTIQUOT (""|"typ"|"anti" as n) s; "="; t = opt_private_ctyp ->
<:with_constr< type $anti:mk_anti ~c:"ctyp" n s$ = $t$ >>
| "type"; t1 = type_longident_and_parameters; "="; t2 = opt_private_ctyp ->
@@ -736,6 +532,7 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
<:ctyp< ($tup:<:ctyp< $anti:mk_anti ~c:"ctyp" n s$ >>$) >>
| `ANTIQUOT ("id" as n) s ->
<:ctyp< $id:<:ident< $anti:mk_anti ~c:"ident" n s$ >>$ >>
+ | `QUOTATION x -> Quotation.expand _loc x Quotation.DynAst.ctyp_tag
| "("; t = SELF; ","; mk = comma_ctyp_app; ")";
i = ctyp LEVEL "ctyp2" ->
mk <:ctyp< $i$ $t$ >>
@@ -760,7 +557,12 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
] ]
;
star_ctyp:
- [ [ t1 = ctyp LEVEL "ctyp1"; "*"; t2 = SELF -> <:ctyp< $t1$ * $t2$ >>
+ [ [ `ANTIQUOT (""|"typ" as n) s ->
+ <:ctyp< $anti:mk_anti ~c:"ctyp" n s$ >>
+ | `ANTIQUOT ("list" as n) s ->
+ <:ctyp< $anti:mk_anti ~c:"ctyp*" n s$ >>
+ | t1 = ctyp LEVEL "ctyp1"; "*"; t2 = SELF ->
+ <:ctyp< $t1$ * $t2$ >>
| t = ctyp LEVEL "ctyp1" -> t
] ]
;
@@ -805,6 +607,12 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
| "{"; t = label_declaration; "}" ->
<:ctyp< { $t$ } >> ] ]
;
+ module_longident_with_app: LEVEL "apply"
+ [ [ i = SELF; "("; j = SELF; ")" -> <:ident< $i$ $j$ >> ] ]
+ ;
+ type_longident: LEVEL "apply"
+ [ [ i = SELF; "("; j = SELF; ")" -> <:ident< $i$ $j$ >> ] ]
+ ;
constructor_arg_list:
[ [ t1 = SELF; "*"; t2 = SELF -> <:ctyp< $t1$ and $t2$ >>
| t = ctyp LEVEL "ctyp1" -> t
@@ -816,15 +624,12 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
value_val:
[ [ "val" -> () ] ]
;
- a_LIDENT_or_operator:
- [ [ x = a_LIDENT -> x
- | "("; x = operator_rparen -> x ] ]
- ;
label_declaration:
[ LEFTA
[ t1 = SELF; ";"; t2 = SELF -> <:ctyp< $t1$; $t2$ >>
| `ANTIQUOT (""|"typ" as n) s ->
<:ctyp< $anti:mk_anti ~c:"ctyp" n s$ >>
+ | `QUOTATION x -> Quotation.expand _loc x Quotation.DynAst.ctyp_tag
| s = a_LIDENT; ":"; t = poly_type -> <:ctyp< $lid:s$ : $t$ >>
| "mutable"; s = a_LIDENT; ":"; t = poly_type ->
<:ctyp< $lid:s$ : mutable $t$ >>
@@ -867,8 +672,8 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
] ]
;
label_expr:
- [ [ p = label_longident; "="; e = expr LEVEL "top" ->
- <:binding< $id:p$ = $e$ >> ] ]
+ [ [ i = label_longident; "="; e = expr LEVEL "top" ->
+ <:rec_binding< $i$ = $e$ >> ] ]
;
a_UIDENT:
[ [ `ANTIQUOT (""|"uid" as n) s -> mk_anti n s
@@ -878,5 +683,9 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
] ]
;
END;
+
+ (* Some other DELETE_RULE are before the grammar *)
+ DELETE_RULE Gram module_longident_with_app: SELF; SELF END;
+ DELETE_RULE Gram type_longident: SELF; SELF END;
end;
let module M = Register.OCamlSyntaxExtension Id Make in ();
diff --git a/camlp4/Camlp4Parsers/Camlp4OCamlReloadedParser.ml b/camlp4/Camlp4Parsers/Camlp4OCamlReloadedParser.ml
new file mode 100644
index 000000000..de2e9e3cb
--- /dev/null
+++ b/camlp4/Camlp4Parsers/Camlp4OCamlReloadedParser.ml
@@ -0,0 +1,94 @@
+open Camlp4; (* -*- camlp4r -*- *)
+(****************************************************************************)
+(* *)
+(* Objective Caml *)
+(* *)
+(* 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 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: Original version
+ *)
+
+module Id = struct
+ value name = "Camlp4Reloaded";
+ value version = "$Id$";
+end;
+
+module Make (Syntax : Sig.Camlp4Syntax) = struct
+ open Sig;
+ include Syntax;
+
+ Gram.Entry.clear match_case;
+ Gram.Entry.clear semi;
+
+ value mkseq _loc =
+ fun
+ [ <:expr< $_$; $_$ >> as e -> <:expr< do { $e$ } >>
+ | e -> e ]
+ ;
+
+ DELETE_RULE Gram match_case0: patt_as_patt_opt; opt_when_expr; "->"; expr END;
+
+ value revised =
+ try
+ (DELETE_RULE Gram expr: "if"; SELF; "then"; SELF; "else"; SELF END; True)
+ with [ Not_found -> begin
+ DELETE_RULE Gram expr: "if"; SELF; "then"; expr LEVEL "top"; "else"; expr LEVEL "top" END;
+ DELETE_RULE Gram expr: "if"; SELF; "then"; expr LEVEL "top" END; False
+ end ];
+
+ if revised then begin
+ DELETE_RULE Gram expr: "fun"; "["; LIST0 match_case0 SEP "|"; "]" END;
+ EXTEND Gram
+ expr: LEVEL "top"
+ [ [ "function"; a = match_case -> <:expr< fun [ $a$ ] >> ] ];
+ END;
+ DELETE_RULE Gram value_let: "value" END;
+ DELETE_RULE Gram value_val: "value" END;
+ end else begin
+ DELETE_RULE Gram value_let: "let" END;
+ DELETE_RULE Gram value_val: "val" END;
+ end;
+
+ EXTEND Gram
+ GLOBAL: match_case match_case0 expr value_let value_val semi;
+
+ match_case:
+ [ [ OPT "|"; l = LIST1 match_case0 SEP "|"; "end" -> Ast.mcOr_of_list l
+ | "end" -> <:match_case<>> ] ]
+ ;
+
+ match_case0:
+ [ [ p = patt_as_patt_opt; w = opt_when_expr; "->"; e = sequence ->
+ <:match_case< $p$ when $w$ -> $mkseq _loc e$ >> ] ]
+ ;
+
+ expr: LEVEL "top"
+ [ [ "if"; e1 = sequence; "then"; e2 = sequence; "else"; e3 = sequence; "end" ->
+ <:expr< if $mkseq _loc e1$ then $mkseq _loc e2$ else $mkseq _loc e3$ >>
+ | "if"; e1 = sequence; "then"; e2 = sequence; "end" ->
+ <:expr< if $mkseq _loc e1$ then $mkseq _loc e2$ else () >> ] ]
+ ;
+
+ value_let:
+ [ [ "val" -> () ] ]
+ ;
+ value_val:
+ [ [ "val" -> () ] ]
+ ;
+ semi:
+ [ [ ";;" -> () | ";" -> () | -> () ] ]
+ ;
+ END;
+
+end;
+
+let module M = Register.OCamlSyntaxExtension Id Make in ();
diff --git a/camlp4/Camlp4Parsers/Camlp4OCamlRevisedParser.ml b/camlp4/Camlp4Parsers/Camlp4OCamlRevisedParser.ml
index 47a299f50..23fc58f1f 100644
--- a/camlp4/Camlp4Parsers/Camlp4OCamlRevisedParser.ml
+++ b/camlp4/Camlp4Parsers/Camlp4OCamlRevisedParser.ml
@@ -34,10 +34,14 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
do {
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
@@ -56,7 +60,6 @@ Old (no more supported) syntax:
Gram.Entry.clear a_INT64;
Gram.Entry.clear a_LABEL;
Gram.Entry.clear a_LIDENT;
- Gram.Entry.clear a_LIDENT_or_operator;
Gram.Entry.clear a_NATIVEINT;
Gram.Entry.clear a_OPTLABEL;
Gram.Entry.clear a_STRING;
@@ -69,6 +72,7 @@ Old (no more supported) syntax:
Gram.Entry.clear match_case_quot;
Gram.Entry.clear binding;
Gram.Entry.clear binding_quot;
+ Gram.Entry.clear rec_binding_quot;
Gram.Entry.clear class_declaration;
Gram.Entry.clear class_description;
Gram.Entry.clear class_expr;
@@ -110,7 +114,6 @@ Old (no more supported) syntax:
Gram.Entry.clear expr;
Gram.Entry.clear expr_eoi;
Gram.Entry.clear expr_quot;
- Gram.Entry.clear field;
Gram.Entry.clear field_expr;
Gram.Entry.clear fun_binding;
Gram.Entry.clear fun_def;
@@ -162,10 +165,8 @@ Old (no more supported) syntax:
Gram.Entry.clear patt_quot;
Gram.Entry.clear patt_tcon;
Gram.Entry.clear phrase;
- Gram.Entry.clear pipe_ctyp;
Gram.Entry.clear poly_type;
Gram.Entry.clear row_field;
- Gram.Entry.clear sem_ctyp;
Gram.Entry.clear sem_expr;
Gram.Entry.clear sem_expr_for_list;
Gram.Entry.clear sem_patt;
@@ -228,8 +229,8 @@ Old (no more supported) syntax:
value mkassert _loc =
fun
[ <:expr< False >> ->
- <:expr< assert False >> (* this case take care about
- the special assert false node *)
+ <:expr< assert False >> (* this case takes care about
+ the special assert false node *)
| e -> <:expr< assert $e$ >> ]
;
@@ -242,6 +243,24 @@ Old (no more supported) syntax:
| e -> e ]
;
+ value mksequence' _loc =
+ fun
+ [ <:expr< $_$; $_$ >> as e -> <:expr< do { $e$ } >>
+ | e -> e ]
+ ;
+
+ value module_type_app mt1 mt2 =
+ match (mt1, mt2) with
+ [ (<:module_type@_loc< $id:i1$ >>, <:module_type< $id:i2$ >>) ->
+ <:module_type< $id:<:ident< $i1$ $i2$ >>$ >>
+ | _ -> raise Stream.Failure ];
+
+ value module_type_acc mt1 mt2 =
+ match (mt1, mt2) with
+ [ (<:module_type@_loc< $id:i1$ >>, <:module_type< $id:i2$ >>) ->
+ <:module_type< $id:<:ident< $i1$.$i2$ >>$ >>
+ | _ -> raise Stream.Failure ];
+
value bigarray_get _loc arr arg =
let coords =
match arg with
@@ -253,7 +272,7 @@ Old (no more supported) syntax:
[ [c1] -> <:expr< Bigarray.Array1.get $arr$ $c1$ >>
| [c1; c2] -> <:expr< Bigarray.Array2.get $arr$ $c1$ $c2$ >>
| [c1; c2; c3] -> <:expr< Bigarray.Array3.get $arr$ $c1$ $c2$ $c3$ >>
- (* | coords -> <:expr< Bigarray.Genarray.get $arr$ [| $`list:coords$ |] >> ] *)
+ (* | coords -> <:expr< Bigarray.Genarray.get $arr$ [| $list:coords$ |] >> ] *)
| coords ->
<:expr< Bigarray.Genarray.get $arr$ [| $Ast.exSem_of_list coords$ |] >> ];
@@ -269,58 +288,114 @@ Old (no more supported) syntax:
Some <:expr< Bigarray.Genarray.set $arr$ [| $coords$ |] $newval$ >>
| _ -> None ];
- value choose_tvar tpl =
- let abs = "abstract" in
- let rec find_alpha n =
- let ns = if n = 0 then "" else string_of_int n in
- let s' = abs ^ ns in
- let rec mem =
- fun
- [ [ <:ctyp< '$s$ >> | <:ctyp< +'$s$ >> | <:ctyp< -'$s$ >> :: xs ] ->
- (s = s') || mem xs
- | [] -> False
- | _ -> assert False ] in
- if mem tpl then find_alpha (succ n)
- else s'
- in find_alpha 0;
+ value test_not_left_brace_nor_do =
+ Gram.Entry.of_parser "test_not_left_brace_nor_do"
+ (fun strm ->
+ match Stream.peek strm with
+ [ Some(KEYWORD "{" | KEYWORD "do", _) -> raise Stream.Failure
+ | _ -> () ]);
value stopped_at _loc =
Some (Loc.move_line 1 _loc) (* FIXME be more precise *);
- (* value list1sep symb sep one cons =
- let rec kont al =
- parser
- [ [: v = sep; a = symb; s :] -> kont (cons al (one a)) s
- | [: :] -> al ]
+ value symbolchar =
+ let list =
+ ['$'; '!'; '%'; '&'; '*'; '+'; '-'; '.'; '/'; ':'; '<'; '='; '>'; '?';
+ '@'; '^'; '|'; '~'; '\\']
in
- parser [: a = symb; s :] -> kont (one a) s;
+ 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 list = ['!'; '?'; '~'] in
+ let excl = ["!="; "??"] in
+ Gram.Entry.setup_parser prefixop
+ (parser
+ [: `(KEYWORD x | SYMBOL x, _loc)
+ when
+ not (List.mem x excl) && String.length x >= 2 &&
+ List.mem x.[0] list && symbolchar x 1 :] ->
+ <:expr< $lid:x$ >>)
+ ;
+
+ let list_ok = ["<"; ">"; "<="; ">="; "="; "<>"; "=="; "!="; "$"] in
+ let list_first_char_ok = ['='; '<'; '>'; '|'; '&'; '$'; '!'] in
+ let excl = ["<-"; "||"; "&&"] in
+ Gram.Entry.setup_parser infixop0
+ (parser
+ [: `(KEYWORD x | SYMBOL x, _loc)
+ when
+ (List.mem x list_ok) ||
+ (not (List.mem x excl) && String.length x >= 2 &&
+ List.mem x.[0] list_first_char_ok && symbolchar x 1) :] ->
+ <:expr< $lid:x$ >>)
+ ;
+
+ let list = ['@'; '^'] in
+ Gram.Entry.setup_parser infixop1
+ (parser
+ [: `(KEYWORD x | SYMBOL x, _loc)
+ when
+ String.length x >= 1 && List.mem x.[0] list &&
+ symbolchar x 1 :] ->
+ <:expr< $lid:x$ >>)
+ ;
+
+ let list = ['+'; '-'] in
+ Gram.Entry.setup_parser infixop2
+ (parser
+ [: `(KEYWORD x | SYMBOL x, _loc)
+ when
+ x <> "->" && String.length x >= 1 && List.mem x.[0] list &&
+ symbolchar x 1 :] ->
+ <:expr< $lid:x$ >>)
+ ;
+
+ let list = ['*'; '/'; '%'; '\\'] in
+ Gram.Entry.setup_parser infixop3
+ (parser
+ [: `(KEYWORD x | SYMBOL x, _loc)
+ when
+ String.length x >= 1 && List.mem x.[0] list &&
+ (x.[0] <> '*' || String.length x < 2 || x.[1] <> '*') &&
+ symbolchar x 1 :] ->
+ <:expr< $lid:x$ >>)
+ ;
+
+ Gram.Entry.setup_parser infixop4
+ (parser
+ [: `(KEYWORD x | SYMBOL x, _loc)
+ when
+ String.length x >= 2 && x.[0] == '*' && x.[1] == '*' &&
+ symbolchar x 2 :] ->
+ <:expr< $lid:x$ >>)
+ ;
- value sem_expr =
- list1sep expr ";" (fun x -> x) (fun e1 e2 -> <:expr< $e1$; $e2$ >>) *)
(* transmit the context *)
- Gram.Entry.setup_parser sem_expr
- (let symb = Gram.parse_tokens_after_filter expr in
+ Gram.Entry.setup_parser sem_expr begin
+ let symb1 = Gram.parse_tokens_after_filter expr in
+ let symb =
+ parser
+ [ [: `(ANTIQUOT ("list" as n) s, _loc) :] -> <:expr< $anti:mk_anti ~c:"expr;" n s$ >>
+ | [: a = symb1 :] -> a ]
+ in
let rec kont al =
parser
[ [: `(KEYWORD ";", _loc); a = symb; s :] -> kont <:expr< $al$; $a$ >> s
| [: :] -> al ]
in
- parser [: a = symb; s :] -> kont a s);
- (* sem_expr_for_list:
- [ [ e = expr; ";"; el = SELF -> fun acc -> <:expr< [ $e$ :: $el acc$ ] >>
- | e = expr -> fun acc -> <:expr< [ $e$ :: $acc$ ] >>
- ] ]
- ;
- comma_expr:
- [ [ e1 = SELF; ","; e2 = SELF -> <:expr< $e1$, $e2$ >>
- | e = expr -> e ] ]
- ; *)
+ parser [: a = symb; s :] -> kont a s
+ end;
EXTEND Gram
GLOBAL:
- a_CHAR a_FLOAT a_INT a_INT32 a_INT64 a_LABEL a_LIDENT
- a_LIDENT_or_operator a_NATIVEINT a_OPTLABEL a_STRING a_UIDENT a_ident
+ a_CHAR a_FLOAT a_INT a_INT32 a_INT64 a_LABEL a_LIDENT rec_binding_quot
+ a_NATIVEINT a_OPTLABEL a_STRING a_UIDENT a_ident
amp_ctyp and_ctyp match_case match_case0 match_case_quot binding binding_quot
class_declaration class_description class_expr class_expr_quot
class_fun_binding class_fun_def class_info_for_class_expr
@@ -332,7 +407,7 @@ Old (no more supported) syntax:
comma_ctyp comma_expr comma_ipatt comma_patt comma_type_parameter
constrain constructor_arg_list constructor_declaration
constructor_declarations ctyp ctyp_quot cvalue_binding direction_flag
- dummy eq_expr expr expr_eoi expr_quot field field_expr fun_binding
+ dummy eq_expr expr expr_eoi expr_quot field_expr fun_binding
fun_def ident ident_quot implem interf ipatt ipatt_tcon label
label_declaration label_expr label_ipatt label_longident label_patt
labeled_ipatt let_binding meth_list module_binding module_binding0
@@ -342,13 +417,14 @@ Old (no more supported) syntax:
opt_class_self_patt opt_class_self_type opt_comma_ctyp opt_dot_dot opt_eq_ctyp opt_expr
opt_meth_list opt_mutable opt_polyt opt_private opt_rec
opt_virtual opt_when_expr patt patt_as_patt_opt patt_eoi
- patt_quot patt_tcon phrase pipe_ctyp poly_type row_field sem_ctyp
+ patt_quot patt_tcon phrase poly_type row_field
sem_expr sem_expr_for_list sem_patt sem_patt_for_list semi sequence
sig_item sig_item_quot sig_items star_ctyp str_item str_item_quot
str_items top_phrase type_constraint type_declaration
type_ident_and_parameters type_kind type_longident
type_longident_and_parameters type_parameter type_parameters typevars
- use_file val_longident value_let value_val with_constr with_constr_quot;
+ 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; ")"; "->";
me = SELF ->
@@ -359,6 +435,7 @@ Old (no more supported) syntax:
| "simple"
[ `ANTIQUOT (""|"mexp"|"anti"|"list" as n) s ->
<:module_expr< $anti:mk_anti ~c:"module_expr" n s$ >>
+ | `QUOTATION x -> Quotation.expand _loc x Quotation.DynAst.module_expr_tag
| i = module_longident -> <:module_expr< $id:i$ >>
| "("; me = SELF; ":"; mt = module_type; ")" ->
<:module_expr< ( $me$ : $mt$ ) >>
@@ -390,6 +467,7 @@ Old (no more supported) syntax:
<:str_item< class type $ctd$ >>
| `ANTIQUOT (""|"stri"|"anti"|"list" as n) s ->
<:str_item< $anti:mk_anti ~c:"str_item" n s$ >>
+ | `QUOTATION x -> Quotation.expand _loc x Quotation.DynAst.str_item_tag
| e = expr -> <:str_item< $exp:e$ >> ] ]
;
module_binding0:
@@ -410,6 +488,7 @@ Old (no more supported) syntax:
<:module_binding< $anti:mk_anti ~c:"module_binding" n s$ >>
| `ANTIQUOT ("" as n) m; ":"; mt = module_type; "="; me = module_expr ->
<:module_binding< $mk_anti n m$ : $mt$ = $me$ >>
+ | `QUOTATION x -> Quotation.expand _loc x Quotation.DynAst.module_binding_tag
| m = a_UIDENT; ":"; mt = module_type; "="; me = module_expr ->
<:module_binding< $m$ : $mt$ = $me$ >> ] ]
;
@@ -418,11 +497,14 @@ Old (no more supported) syntax:
<:module_type< functor ( $i$ : $t$ ) -> $mt$ >> ]
| [ 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" ->
<:module_type< sig $sg$ end >> ]
| "simple"
[ `ANTIQUOT (""|"mtyp"|"anti"|"list" as n) s ->
<:module_type< $anti:mk_anti ~c:"module_type" n s$ >>
+ | `QUOTATION x -> Quotation.expand _loc x Quotation.DynAst.module_type_tag
| i = module_longident_with_app -> <:module_type< $id:i$ >>
| "'"; i = a_ident -> <:module_type< ' $i$ >>
| "("; mt = SELF; ")" -> <:module_type< $mt$ >> ] ]
@@ -431,6 +513,7 @@ Old (no more supported) syntax:
[ "top"
[ `ANTIQUOT (""|"sigi"|"anti"|"list" as n) s ->
<:sig_item< $anti:mk_anti ~c:"sig_item" n s$ >>
+ | `QUOTATION x -> Quotation.expand _loc x Quotation.DynAst.sig_item_tag
| "exception"; t = constructor_declaration ->
<:sig_item< exception $t$ >>
| "external"; i = a_LIDENT; ":"; t = ctyp; "="; sl = string_list ->
@@ -442,10 +525,12 @@ Old (no more supported) syntax:
<:sig_item< module rec $mb$ >>
| "module"; "type"; i = a_UIDENT; "="; mt = module_type ->
<:sig_item< module type $i$ = $mt$ >>
+ | "module"; "type"; i = a_UIDENT ->
+ <:sig_item< module type $i$ >>
| "open"; i = module_longident -> <:sig_item< open $i$ >>
| "type"; t = type_declaration ->
<:sig_item< type $t$ >>
- | value_val; i = a_LIDENT_or_operator; ":"; t = ctyp ->
+ | value_val; i = a_LIDENT; ":"; t = ctyp ->
<:sig_item< value $i$ : $t$ >>
| "class"; cd = class_description ->
<:sig_item< class $cd$ >>
@@ -463,6 +548,7 @@ Old (no more supported) syntax:
[ m1 = SELF; "and"; m2 = SELF -> <:module_binding< $m1$ and $m2$ >>
| `ANTIQUOT (""|"module_binding"|"anti"|"list" as n) s ->
<:module_binding< $anti:mk_anti ~c:"module_binding" n s$ >>
+ | `QUOTATION x -> Quotation.expand _loc x Quotation.DynAst.module_binding_tag
| m = a_UIDENT; ":"; mt = module_type -> <:module_binding< $m$ : $mt$ >>
] ]
;
@@ -471,6 +557,7 @@ Old (no more supported) syntax:
[ wc1 = SELF; "and"; wc2 = SELF -> <:with_constr< $wc1$ and $wc2$ >>
| `ANTIQUOT (""|"with_constr"|"anti"|"list" as n) s ->
<:with_constr< $anti:mk_anti ~c:"with_constr" n s$ >>
+ | `QUOTATION x -> Quotation.expand _loc x Quotation.DynAst.with_constr_tag
| "type"; `ANTIQUOT (""|"typ"|"anti" as n) s; "="; t = ctyp ->
<:with_constr< type $anti:mk_anti ~c:"ctyp" n s$ = $t$ >>
| "type"; t1 = type_longident_and_parameters; "="; t2 = ctyp ->
@@ -480,31 +567,26 @@ Old (no more supported) syntax:
;
expr:
[ "top" RIGHTA
- [ "let"; r = opt_rec; bi = binding; "in";
- x = SELF ->
+ [ "let"; r = opt_rec; bi = binding; "in"; x = SELF ->
<:expr< let $rec:r$ $bi$ in $x$ >>
| "let"; "module"; m = a_UIDENT; mb = module_binding0; "in"; e = SELF ->
<:expr< let module $m$ = $mb$ in $e$ >>
- | "fun"; "["; a = match_case; "]" ->
- <:expr< fun [ $a$ ] >>
+ | "fun"; "["; a = LIST0 match_case0 SEP "|"; "]" ->
+ <:expr< fun [ $list:a$ ] >>
| "fun"; p = labeled_ipatt; e = fun_def ->
<:expr< fun $p$ -> $e$ >>
- | "match"; e = SELF; "with"; "["; a = match_case; "]" ->
- <:expr< match $e$ with [ $a$ ] >>
- | "match"; e1 = SELF; "with"; p = ipatt; "->"; e2 = SELF ->
- <:expr< match $e1$ with $p$ -> $e2$ >>
- | "try"; e = SELF; "with"; "["; a = match_case; "]" ->
- <:expr< try $e$ with [ $a$ ] >>
- | "try"; e1 = SELF; "with"; p = ipatt; "->"; e2 = SELF ->
- <:expr< try $e1$ with $p$ -> $e2$ >>
+ | "match"; e = sequence; "with"; a = match_case ->
+ <:expr< match $mksequence' _loc e$ with [ $a$ ] >>
+ | "try"; e = sequence; "with"; a = match_case ->
+ <:expr< try $mksequence' _loc e$ with [ $a$ ] >>
| "if"; e1 = SELF; "then"; e2 = SELF; "else"; e3 = SELF ->
<:expr< if $e1$ then $e2$ else $e3$ >>
- | "do"; "{"; seq = sequence; "}" -> mksequence _loc seq
- | "for"; i = a_LIDENT; "="; e1 = SELF; df = direction_flag; e2 = SELF;
- "do"; "{"; seq = sequence; "}" ->
- <:expr< for $i$ = $e1$ $to:df$ $e2$ do { $seq$ } >>
- | "while"; e = SELF; "do"; "{"; seq = sequence; "}" ->
- <:expr< while $e$ do { $seq$ } >>
+ | "do"; seq = do_sequence -> mksequence _loc seq
+ | "for"; i = a_LIDENT; "="; e1 = sequence; df = direction_flag;
+ e2 = sequence; "do"; seq = do_sequence ->
+ <:expr< for $i$ = $mksequence' _loc e1$ $to:df$ $mksequence' _loc e2$ do { $seq$ } >>
+ | "while"; e = sequence; "do"; seq = do_sequence ->
+ <:expr< while $mksequence' _loc e$ do { $seq$ } >>
| "object"; csp = opt_class_self_patt; cst = class_structure; "end" ->
<:expr< object ($csp$) $cst$ end >> ]
| "where"
@@ -516,41 +598,26 @@ Old (no more supported) syntax:
[ Some e -> e
| None -> <:expr< $e1$ := $e2$ >> ] ]
| "||" RIGHTA
- [ e1 = SELF; "||"; e2 = SELF -> <:expr< $e1$ || $e2$ >> ]
+ [ e1 = SELF; op = infixop6; e2 = SELF -> <:expr< $op$ $e1$ $e2$ >> ]
| "&&" RIGHTA
- [ e1 = SELF; "&&"; e2 = SELF -> <:expr< $e1$ && $e2$ >> ]
+ [ e1 = SELF; op = infixop5; e2 = SELF -> <:expr< $op$ $e1$ $e2$ >> ]
| "<" LEFTA
- [ e1 = SELF; "<"; e2 = SELF -> <:expr< $e1$ < $e2$ >>
- | e1 = SELF; ">"; e2 = SELF -> <:expr< $e1$ > $e2$ >>
- | e1 = SELF; "<="; e2 = SELF -> <:expr< $e1$ <= $e2$ >>
- | e1 = SELF; ">="; e2 = SELF -> <:expr< $e1$ >= $e2$ >>
- | e1 = SELF; "="; e2 = SELF -> <:expr< $e1$ = $e2$ >>
- | e1 = SELF; "<>"; e2 = SELF -> <:expr< $e1$ <> $e2$ >>
- | e1 = SELF; "=="; e2 = SELF -> <:expr< $e1$ == $e2$ >>
- | e1 = SELF; "!="; e2 = SELF -> <:expr< $e1$ != $e2$ >> ]
+ [ e1 = SELF; op = infixop0; e2 = SELF -> <:expr< $op$ $e1$ $e2$ >> ]
| "^" RIGHTA
- [ e1 = SELF; "^"; e2 = SELF -> <:expr< $e1$ ^ $e2$ >>
- | e1 = SELF; "^^"; e2 = SELF -> <:expr< $lid:"^^"$ $e1$ $e2$ >>
- | e1 = SELF; "@"; e2 = SELF -> <:expr< $e1$ @ $e2$ >> ]
+ [ e1 = SELF; op = infixop1; e2 = SELF -> <:expr< $op$ $e1$ $e2$ >> ]
| "+" LEFTA
- [ e1 = SELF; "+"; e2 = SELF -> <:expr< $e1$ + $e2$ >>
- | e1 = SELF; "-"; e2 = SELF -> <:expr< $e1$ - $e2$ >>
- | e1 = SELF; "+."; e2 = SELF -> <:expr< $e1$ +. $e2$ >>
- | e1 = SELF; "-."; e2 = SELF -> <:expr< $e1$ -. $e2$ >> ]
+ [ e1 = SELF; op = infixop2; e2 = SELF -> <:expr< $op$ $e1$ $e2$ >> ]
| "*" LEFTA
- [ e1 = SELF; "*"; e2 = SELF -> <:expr< $e1$ * $e2$ >>
- | e1 = SELF; "/"; e2 = SELF -> <:expr< $e1$ / $e2$ >>
- | e1 = SELF; "*."; e2 = SELF -> <:expr< $e1$ *. $e2$ >>
- | e1 = SELF; "/."; e2 = SELF -> <:expr< $e1$ /. $e2$ >>
- | e1 = SELF; "land"; e2 = SELF -> <:expr< $e1$ land $e2$ >>
+ [ e1 = SELF; "land"; e2 = SELF -> <:expr< $e1$ land $e2$ >>
| e1 = SELF; "lor"; e2 = SELF -> <:expr< $e1$ lor $e2$ >>
| e1 = SELF; "lxor"; e2 = SELF -> <:expr< $e1$ lxor $e2$ >>
- | e1 = SELF; "mod"; e2 = SELF -> <:expr< $e1$ mod $e2$ >> ]
+ | e1 = SELF; "mod"; e2 = SELF -> <:expr< $e1$ mod $e2$ >>
+ | e1 = SELF; op = infixop3; e2 = SELF -> <:expr< $op$ $e1$ $e2$ >> ]
| "**" RIGHTA
- [ e1 = SELF; "**"; e2 = SELF -> <:expr< $e1$ ** $e2$ >>
- | e1 = SELF; "asr"; e2 = SELF -> <:expr< $e1$ asr $e2$ >>
+ [ e1 = SELF; "asr"; e2 = SELF -> <:expr< $e1$ asr $e2$ >>
| e1 = SELF; "lsl"; e2 = SELF -> <:expr< $e1$ lsl $e2$ >>
- | e1 = SELF; "lsr"; e2 = SELF -> <:expr< $e1$ lsr $e2$ >> ]
+ | e1 = SELF; "lsr"; e2 = SELF -> <:expr< $e1$ lsr $e2$ >>
+ | e1 = SELF; op = infixop4; e2 = SELF -> <:expr< $op$ $e1$ $e2$ >> ]
| "unary minus" NONA
[ "-"; e = SELF -> mkumin _loc "-" e
| "-."; e = SELF -> mkumin _loc "-." e ]
@@ -561,9 +628,14 @@ Old (no more supported) syntax:
| "lazy"; e = SELF -> <:expr< lazy $e$ >> ]
| "label" NONA
[ "~"; i = a_LIDENT; ":"; e = SELF -> <:expr< ~ $i$ : $e$ >>
- | `LABEL i; e = SELF -> <:expr< ~ $i$ : $e$ >>
| "~"; i = a_LIDENT -> <:expr< ~ $i$ >>
+
+ (* Here it's LABEL and not tilde_label since ~a:b is different than ~a : b *)
+ | `LABEL i; e = SELF -> <:expr< ~ $i$ : $e$ >>
+
+ (* Same remark for ?a:b *)
| `OPTLABEL i; e = SELF -> <:expr< ? $i$ : $e$ >>
+
| "?"; i = a_LIDENT; ":"; e = SELF -> <:expr< ? $i$ : $e$ >>
| "?"; i = a_LIDENT -> <:expr< ? $i$ >> ]
| "." LEFTA
@@ -573,14 +645,18 @@ Old (no more supported) syntax:
| e1 = SELF; "."; e2 = SELF -> <:expr< $e1$ . $e2$ >>
| e = SELF; "#"; lab = label -> <:expr< $e$ # $lab$ >> ]
| "~-" NONA
- [ "~-"; e = SELF -> <:expr< ~- $e$ >>
- | "~-."; e = SELF -> <:expr< ~-. $e$ >> ]
+ [ "!"; e = SELF -> <:expr< $e$.val >>
+ | f = prefixop; e = SELF -> <:expr< $f$ $e$ >> ]
| "simple"
- [ `QUOTATION x -> Quotation.expand_expr (Gram.parse_string expr) _loc x
+ [ `QUOTATION x -> Quotation.expand _loc x Quotation.DynAst.expr_tag
| `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$ >>
| `ANTIQUOT ("tup" as n) s ->
- <:expr< ($tup: <:expr< $anti:mk_anti ~c:"expr" n s$ >>$) >>
+ <:expr< $tup: <:expr< $anti:mk_anti ~c:"expr" n s$ >>$ >>
+ | `ANTIQUOT ("seq" as n) s ->
+ <:expr< do $anti:mk_anti ~c:"expr" n s$ done >>
| s = a_INT -> <:expr< $int:s$ >>
| s = a_INT32 -> <:expr< $int32:s$ >>
| s = a_INT64 -> <:expr< $int64:s$ >>
@@ -605,15 +681,25 @@ Old (no more supported) syntax:
| "("; ")" -> <:expr< () >>
| "("; e = SELF; ":"; t = ctyp; ")" -> <:expr< ($e$ : $t$) >>
| "("; e = SELF; ","; el = comma_expr; ")" -> <:expr< ( $e$, $el$ ) >>
+ | "("; e = SELF; ";"; seq = sequence; ")" -> mksequence _loc <:expr< $e$; $seq$ >>
| "("; e = SELF; ":"; t = ctyp; ":>"; t2 = ctyp; ")" ->
<:expr< ($e$ : $t$ :> $t2$ ) >>
| "("; e = SELF; ":>"; t = ctyp; ")" -> <:expr< ($e$ :> $t$) >>
- | "("; e = SELF; ")" -> e ] ]
+ | "("; e = SELF; ")" -> e
+ | "begin"; seq = sequence; "end" -> mksequence _loc seq
+ | "begin"; "end" -> <:expr< () >> ] ]
+ ;
+ do_sequence:
+ [ [ "{"; seq = sequence; "}" -> seq
+ | test_not_left_brace_nor_do; seq = sequence; "done" -> seq
+ ] ]
+ ;
+ infixop5:
+ [ [ x = [ "&" | "&&" ] -> <:expr< $lid:x$ >> ] ]
+ ;
+ infixop6:
+ [ [ x = [ "or" | "||" ] -> <:expr< $lid:x$ >> ] ]
;
- (* sem_expr:
- [ [ e1 = SELF; ";"; e2 = SELF -> <:expr< $e1$; $e2$ >>
- | e = expr -> e ] ]
- ; *)
sem_expr_for_list:
[ [ e = expr; ";"; el = SELF -> fun acc -> <:expr< [ $e$ :: $el acc$ ] >>
| e = expr -> fun acc -> <:expr< [ $e$ :: $acc$ ] >>
@@ -621,6 +707,7 @@ Old (no more supported) syntax:
;
comma_expr:
[ [ e1 = SELF; ","; e2 = SELF -> <:expr< $e1$, $e2$ >>
+ | `ANTIQUOT ("list" as n) s -> <:expr< $anti:mk_anti ~c:"expr," n s$ >>
| e = expr -> e ] ]
;
dummy:
@@ -629,6 +716,7 @@ Old (no more supported) syntax:
sequence:
[ [ "let"; rf = opt_rec; bi = binding; [ "in" | ";" ]; el = SELF ->
<:expr< let $rec:rf$ $bi$ 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 ] ]
@@ -656,7 +744,8 @@ Old (no more supported) syntax:
| ":>"; t = ctyp; "="; e = expr -> <:expr< ($e$ :> $t$) >> ] ]
;
match_case:
- [ [ l = LIST0 match_case0 SEP "|" -> Ast.mcOr_of_list l ] ]
+ [ [ "["; l = LIST0 match_case0 SEP "|"; "]" -> Ast.mcOr_of_list l
+ | p = ipatt; "->"; e = expr -> <:match_case< $p$ -> $e$ >> ] ]
;
match_case0:
[ [ `ANTIQUOT ("match_case"|"list" as n) s ->
@@ -681,13 +770,16 @@ Old (no more supported) syntax:
] ]
;
label_expr:
- [ LEFTA
- [ b1 = SELF; ";"; b2 = SELF -> <:binding< $b1$ ; $b2$ >>
- | `ANTIQUOT (""|"binding"|"anti" as n) s ->
- <:binding< $anti:mk_anti ~c:"binding" n s$ >>
+ [ [ b1 = SELF; ";"; b2 = SELF -> <:rec_binding< $b1$ ; $b2$ >>
+ | `ANTIQUOT ("rec_binding" as n) s ->
+ <:rec_binding< $anti:mk_anti ~c:"rec_binding" n s$ >>
+ | `ANTIQUOT (""|"anti" as n) s ->
+ <:rec_binding< $anti:mk_anti ~c:"rec_binding" n s$ >>
+ | `ANTIQUOT (""|"anti" as n) s; "="; e = expr ->
+ <:rec_binding< $anti:mk_anti ~c:"ident" n s$ = $e$ >>
| `ANTIQUOT ("list" as n) s ->
- <:binding< $anti:mk_anti ~c:"binding;" n s$ >>
- | p = label_longident; e = fun_binding -> <:binding< $id:p$ = $e$ >> ] ]
+ <:rec_binding< $anti:mk_anti ~c:"rec_binding" n s$ >>
+ | i = label_longident; e = fun_binding -> <:rec_binding< $i$ = $e$ >> ] ]
;
fun_def:
[ RIGHTA
@@ -732,7 +824,7 @@ Old (no more supported) syntax:
| "("; p = SELF; "as"; p2 = SELF; ")" -> <:patt< ($p$ as $p2$) >>
| "("; p = SELF; ","; pl = comma_patt; ")" -> <:patt< ($p$, $pl$) >>
| "_" -> <:patt< _ >>
- | `QUOTATION x -> Quotation.expand_patt (Gram.parse_string patt) _loc x
+ | `QUOTATION x -> Quotation.expand _loc x Quotation.DynAst.patt_tag
| "`"; s = a_ident -> <:patt< ` $s$ >>
| "#"; i = type_longident -> <:patt< # $i$ >>
| `LABEL i; p = SELF -> <:patt< ~ $i$ : $p$ >>
@@ -754,11 +846,13 @@ Old (no more supported) syntax:
;
comma_patt:
[ [ p1 = SELF; ","; p2 = SELF -> <:patt< $p1$, $p2$ >>
+ | `ANTIQUOT ("list" as n) s -> <:patt< $anti:mk_anti ~c:"patt," n s$ >>
| p = patt -> p ] ]
;
sem_patt:
[ LEFTA
[ p1 = SELF; ";"; p2 = SELF -> <:patt< $p1$; $p2$ >>
+ | `ANTIQUOT ("list" as n) s -> <:patt< $anti:mk_anti ~c:"patt;" n s$ >>
| p = patt -> p ] ]
;
sem_patt_for_list:
@@ -771,9 +865,10 @@ Old (no more supported) syntax:
[ p1 = SELF; ";"; p2 = SELF -> <:patt< $p1$; $p2$ >>
| `ANTIQUOT (""|"pat"|"anti" as n) s ->
<:patt< $anti:mk_anti ~c:"patt" n s$ >>
+ | `QUOTATION x -> Quotation.expand _loc x Quotation.DynAst.patt_tag
| `ANTIQUOT ("list" as n) s ->
<:patt< $anti:mk_anti ~c:"patt;" n s$ >>
- | i = label_longident; "="; p = patt -> <:patt< $id:i$ = $p$ >>
+ | i = label_longident; "="; p = patt -> <:patt< $i$ = $p$ >>
] ]
;
ipatt:
@@ -782,6 +877,7 @@ Old (no more supported) syntax:
<:patt< $anti:mk_anti ~c:"patt" n s$ >>
| `ANTIQUOT ("tup" as n) s ->
<:patt< ($tup:<:patt< $anti:mk_anti ~c:"patt" n s$ >>$) >>
+ | `QUOTATION x -> Quotation.expand _loc x Quotation.DynAst.patt_tag
| "("; ")" -> <:patt< () >>
| "("; p = SELF; ")" -> p
| "("; p = SELF; ":"; t = ctyp; ")" -> <:patt< ($p$ : $t$) >>
@@ -796,6 +892,7 @@ Old (no more supported) syntax:
comma_ipatt:
[ LEFTA
[ p1 = SELF; ","; p2 = SELF -> <:patt< $p1$, $p2$ >>
+ | `ANTIQUOT ("list" as n) s -> <:patt< $anti:mk_anti ~c:"patt," n s$ >>
| p = ipatt -> p ] ]
;
label_ipatt:
@@ -803,7 +900,9 @@ Old (no more supported) syntax:
[ p1 = SELF; ";"; p2 = SELF -> <:patt< $p1$; $p2$ >>
| `ANTIQUOT (""|"pat"|"anti" as n) s ->
<:patt< $anti:mk_anti ~c:"patt" n s$ >>
- | i = label_longident; "="; p = ipatt -> <:patt< $id:i$ = $p$ >>
+ | `ANTIQUOT ("list" as n) s -> <:patt< $anti:mk_anti ~c:"patt;" n s$ >>
+ | `QUOTATION x -> Quotation.expand _loc x Quotation.DynAst.patt_tag
+ | i = label_longident; "="; p = ipatt -> <:patt< $i$ = $p$ >>
] ]
;
type_declaration:
@@ -812,16 +911,17 @@ Old (no more supported) syntax:
<:ctyp< $anti:mk_anti ~c:"ctyp" n s$ >>
| `ANTIQUOT ("list" as n) s ->
<:ctyp< $anti:mk_anti ~c:"ctypand" n s$ >>
+ | `QUOTATION x -> Quotation.expand _loc x Quotation.DynAst.ctyp_tag
| t1 = SELF; "and"; t2 = SELF -> <:ctyp< $t1$ and $t2$ >>
| (n, tpl) = type_ident_and_parameters; tk = opt_eq_ctyp;
- cl = LIST0 constrain -> Ast.TyDcl _loc n tpl (tk tpl) cl ] ]
+ cl = LIST0 constrain -> Ast.TyDcl _loc n tpl tk cl ] ]
;
constrain:
[ [ "constraint"; t1 = ctyp; "="; t2 = ctyp -> (t1, t2) ] ]
;
opt_eq_ctyp:
- [ [ "="; tk = type_kind -> fun _ -> tk
- | -> fun tpl -> <:ctyp< '$choose_tvar tpl$ >> ] ]
+ [ [ "="; tk = type_kind -> tk
+ | -> <:ctyp<>> ] ]
;
type_kind:
[ [ t = ctyp -> t ] ]
@@ -842,6 +942,7 @@ Old (no more supported) syntax:
;
type_parameter:
[ [ `ANTIQUOT (""|"typ"|"anti" as n) s -> <:ctyp< $anti:mk_anti n s$ >>
+ | `QUOTATION x -> Quotation.expand _loc x Quotation.DynAst.ctyp_tag
| "'"; i = a_ident -> <:ctyp< '$lid:i$ >>
| "+"; "'"; i = a_ident -> <:ctyp< +'$lid:i$ >>
| "-"; "'"; i = a_ident -> <:ctyp< -'$lid:i$ >> ] ]
@@ -880,6 +981,7 @@ Old (no more supported) syntax:
<:ctyp< ($tup:<:ctyp< $anti:mk_anti ~c:"ctyp" n s$ >>$) >>
| `ANTIQUOT ("id" as n) s ->
<:ctyp< $id:<:ident< $anti:mk_anti ~c:"ident" n s$ >>$ >>
+ | `QUOTATION x -> Quotation.expand _loc x Quotation.DynAst.ctyp_tag
| i = a_LIDENT -> <:ctyp< $lid:i$ >>
| i = a_UIDENT -> <:ctyp< $uid:i$ >>
| "("; t = SELF; "*"; tl = star_ctyp; ")" ->
@@ -906,19 +1008,37 @@ Old (no more supported) syntax:
] ]
;
star_ctyp:
- [ [ t1 = SELF; "*"; t2 = SELF -> <:ctyp< $t1$ * $t2$ >>
+ [ [ `ANTIQUOT (""|"typ" as n) s ->
+ <:ctyp< $anti:mk_anti ~c:"ctyp" n s$ >>
+ | `ANTIQUOT ("list" as n) s ->
+ <:ctyp< $anti:mk_anti ~c:"ctyp*" n s$ >>
+ | t1 = SELF; "*"; t2 = SELF ->
+ <:ctyp< $t1$ * $t2$ >>
| t = ctyp -> t
] ]
;
constructor_declarations:
- [ [ l = LIST1 constructor_declaration SEP "|" -> Ast.tyOr_of_list l ] ]
+ [ [ `ANTIQUOT (""|"typ" as n) s ->
+ <:ctyp< $anti:mk_anti ~c:"ctyp" n s$ >>
+ | `ANTIQUOT ("list" as n) s ->
+ <:ctyp< $anti:mk_anti ~c:"ctyp|" n s$ >>
+ | `QUOTATION x -> Quotation.expand _loc x Quotation.DynAst.ctyp_tag
+ | t1 = SELF; "|"; t2 = SELF ->
+ <:ctyp< $t1$ | $t2$ >>
+ | s = a_UIDENT; "of"; t = constructor_arg_list ->
+ <:ctyp< $uid:s$ of $t$ >>
+ | s = a_UIDENT ->
+ <:ctyp< $uid:s$ >>
+ ] ]
;
constructor_declaration:
[ [ `ANTIQUOT (""|"typ" as n) s ->
<:ctyp< $anti:mk_anti ~c:"ctyp" n s$ >>
+ | `QUOTATION x -> Quotation.expand _loc x Quotation.DynAst.ctyp_tag
| s = a_UIDENT; "of"; t = constructor_arg_list ->
<:ctyp< $uid:s$ of $t$ >>
- | s = a_UIDENT -> <:ctyp< $uid:s$ >>
+ | s = a_UIDENT ->
+ <:ctyp< $uid:s$ >>
] ]
;
constructor_arg_list:
@@ -933,6 +1053,9 @@ Old (no more supported) syntax:
[ t1 = SELF; ";"; t2 = SELF -> <:ctyp< $t1$; $t2$ >>
| `ANTIQUOT (""|"typ" as n) s ->
<:ctyp< $anti:mk_anti ~c:"ctyp" n s$ >>
+ | `ANTIQUOT ("list" as n) s ->
+ <:ctyp< $anti:mk_anti ~c:"ctyp;" n s$ >>
+ | `QUOTATION x -> Quotation.expand _loc x Quotation.DynAst.ctyp_tag
| s = a_LIDENT; ":"; t = poly_type -> <:ctyp< $lid:s$ : $t$ >>
| s = a_LIDENT; ":"; "mutable"; t = poly_type ->
<:ctyp< $lid:s$ : mutable $t$ >>
@@ -958,17 +1081,23 @@ Old (no more supported) syntax:
| i = a_UIDENT -> <:ident< $uid:i$ >> ] ]
;
module_longident_with_app:
- [ [ 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 = SELF; ")" -> i ] ]
;
type_longident:
- [ [ 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_LIDENT -> <:ident< $lid:i$ >>
| i = a_UIDENT -> <:ident< $uid:i$ >>
@@ -995,6 +1124,7 @@ Old (no more supported) syntax:
<:class_expr< $c1$ and $c2$ >>
| `ANTIQUOT (""|"cdcl"|"anti"|"list" as n) s ->
<:class_expr< $anti:mk_anti ~c:"class_expr" n s$ >>
+ | `QUOTATION x -> Quotation.expand _loc x Quotation.DynAst.class_expr_tag
| ci = class_info_for_class_expr; ce = class_fun_binding ->
<:class_expr< $ci$ = $ce$ >>
] ]
@@ -1009,38 +1139,12 @@ Old (no more supported) syntax:
;
class_info_for_class_type:
[ [ mv = opt_virtual; (i, ot) = class_name_and_param ->
- Ast.CtCon _loc mv (Ast.IdLid _loc i) ot
- (* <:class_type< $virtual:mv$ $lid:i$ [ $t$ ] >> *)
-
- (* | mv = opt_virtual; i = a_LIDENT -> *)
- (* Ast.CeCon (_loc, mv, Ast.IdLid (_loc, i), Ast.ONone) *)
- (* <:class_type< $lid:i$ >> *)
+ <:class_type< $virtual:mv$ $lid:i$ [ $ot$ ] >>
] ]
;
- (* [ [ "virtual"; i = a_LIDENT; "["; t = comma_type_parameter; "]" ->
- <:class_type< virtual $lid:i$ [ $t$ ] >>
- | "virtual"; i = a_LIDENT ->
- <:class_type< virtual $lid:i$ >>
- | i = a_LIDENT; "["; t = comma_type_parameter; "]" ->
- <:class_type< $lid:i$ [ $t$ ] >>
- | i = a_LIDENT -> <:class_type< $lid:i$ >>
- ] ]
- ; *)
class_info_for_class_expr:
- [ [
- (* "virtual"; i = a_LIDENT; "["; t = comma_type_parameter; "]" -> *)
- (* <:class_expr< virtual $lid:i$ [ $t$ ] >> *)
- (* | "virtual"; i = a_LIDENT -> *)
- (* <:class_expr< virtual $lid:i$ >> *)
- (* | *)
- mv = opt_virtual; (i, ot) = class_name_and_param ->
- Ast.CeCon _loc mv (Ast.IdLid _loc i) ot
- (* <:class_expr< $virtual:mv$ $lid:i$ [ $t$ ] >> *)
-
- (* <:class_expr< $lid:i$ [ $t$ ] >> *)
- (* | mv = opt_virtual; i = a_LIDENT -> *)
- (* Ast.CeCon (_loc, mv, Ast.IdLid (_loc, i), Ast.ONone) *)
- (* <:class_expr< $lid:i$ >> *)
+ [ [ mv = opt_virtual; (i, ot) = class_name_and_param ->
+ <:class_expr< $virtual:mv$ $lid:i$ [ $ot$ ] >>
] ]
;
class_name_and_param:
@@ -1049,8 +1153,8 @@ Old (no more supported) syntax:
] ]
;
comma_type_parameter:
- [ LEFTA
- [ t1 = SELF; ","; t2 = SELF -> <:ctyp< $t1$, $t2$ >>
+ [ [ t1 = SELF; ","; t2 = SELF -> <:ctyp< $t1$, $t2$ >>
+ | `ANTIQUOT ("list" as n) s -> <:ctyp< $anti:mk_anti ~c:"ctyp," n s$ >>
| t = type_parameter -> t
] ]
;
@@ -1061,6 +1165,7 @@ Old (no more supported) syntax:
;
comma_ctyp:
[ [ t1 = SELF; ","; t2 = SELF -> <:ctyp< $t1$, $t2$ >>
+ | `ANTIQUOT ("list" as n) s -> <:ctyp< $anti:mk_anti ~c:"ctyp," n s$ >>
| t = ctyp -> t
] ]
;
@@ -1070,7 +1175,7 @@ Old (no more supported) syntax:
;
class_expr:
[ "top"
- [ "fun"; p = ipatt; ce = class_fun_def ->
+ [ "fun"; p = labeled_ipatt; ce = class_fun_def ->
<:class_expr< fun $p$ -> $ce$ >>
| "let"; rf = opt_rec; bi = binding; "in"; ce = SELF ->
<:class_expr< let $rec:rf$ $bi$ in $ce$ >> ]
@@ -1080,6 +1185,7 @@ Old (no more supported) syntax:
| "simple"
[ `ANTIQUOT (""|"cexp"|"anti" as n) s ->
<:class_expr< $anti:mk_anti ~c:"class_expr" n s$ >>
+ | `QUOTATION x -> Quotation.expand _loc x Quotation.DynAst.class_expr_tag
| ce = class_longident_and_param -> ce
| "object"; csp = opt_class_self_patt; cst = class_structure; "end" ->
<:class_expr< object ($csp$) $cst$ end >>
@@ -1096,6 +1202,8 @@ Old (no more supported) syntax:
class_structure:
[ [ `ANTIQUOT (""|"cst"|"anti"|"list" as n) s ->
<:class_str_item< $anti:mk_anti ~c:"class_str_item" n s$ >>
+ | `ANTIQUOT (""|"cst"|"anti"|"list" as n) s; semi; cst = SELF ->
+ <:class_str_item< $anti:mk_anti ~c:"class_str_item" n s$; $cst$ >>
| l = LIST0 [ cst = class_str_item; semi -> cst ] -> Ast.crSem_of_list l
] ]
;
@@ -1108,6 +1216,7 @@ Old (no more supported) syntax:
[ LEFTA
[ `ANTIQUOT (""|"cst"|"anti"|"list" as n) s ->
<:class_str_item< $anti:mk_anti ~c:"class_str_item" n s$ >>
+ | `QUOTATION x -> Quotation.expand _loc x Quotation.DynAst.class_str_item_tag
| "inherit"; ce = class_expr; pb = opt_as_lident ->
<:class_str_item< inherit $ce$ as $pb$ >>
| value_val; mf = opt_mutable; lab = label; e = cvalue_binding ->
@@ -1116,6 +1225,8 @@ Old (no more supported) syntax:
<:class_str_item< value virtual $mutable:mf$ $l$ : $t$ >>
| "method"; "virtual"; pf = opt_private; l = label; ":"; t = poly_type ->
<:class_str_item< method virtual $private:pf$ $l$ : $t$ >>
+ | "method"; pf = opt_private; "virtual"; l = label; ":"; t = poly_type ->
+ <:class_str_item< method virtual $private:pf$ $l$ : $t$ >>
| "method"; pf = opt_private; l = label; topt = opt_polyt;
e = fun_binding ->
<:class_str_item< method $private:pf$ $l$ : $topt$ = $e$ >>
@@ -1145,6 +1256,7 @@ Old (no more supported) syntax:
class_type:
[ [ `ANTIQUOT (""|"ctyp"|"anti" as n) s ->
<:class_type< $anti:mk_anti ~c:"class_type" n s$ >>
+ | `QUOTATION x -> Quotation.expand _loc x Quotation.DynAst.class_type_tag
| ct = class_type_longident_and_param -> ct
| "object"; cst = opt_class_self_type; csg = class_signature; "end" ->
<:class_type< object ($cst$) $csg$ end >> ] ]
@@ -1165,12 +1277,15 @@ Old (no more supported) syntax:
class_signature:
[ [ `ANTIQUOT (""|"csg"|"anti"|"list" as n) s ->
<:class_sig_item< $anti:mk_anti ~c:"class_sig_item" n s$ >>
+ | `ANTIQUOT (""|"csg"|"anti"|"list" as n) s; semi; csg = SELF ->
+ <:class_sig_item< $anti:mk_anti ~c:"class_sig_item" n s$; $csg$ >>
| l = LIST0 [ csg = class_sig_item; semi -> csg ] -> Ast.cgSem_of_list l
] ]
;
class_sig_item:
[ [ `ANTIQUOT (""|"csg"|"anti"|"list" as n) s ->
<:class_sig_item< $anti:mk_anti ~c:"class_sig_item" n s$ >>
+ | `QUOTATION x -> Quotation.expand _loc x Quotation.DynAst.class_sig_item_tag
| "inherit"; cs = class_type -> <:class_sig_item< inherit $cs$ >>
| value_val; mf = opt_mutable; mv = opt_virtual;
l = label; ":"; t = ctyp ->
@@ -1179,16 +1294,19 @@ Old (no more supported) syntax:
<:class_sig_item< method virtual $private:pf$ $l$ : $t$ >>
| "method"; pf = opt_private; l = label; ":"; t = poly_type ->
<:class_sig_item< method $private:pf$ $l$ : $t$ >>
+ | "method"; pf = opt_private; "virtual"; l = label; ":"; t = poly_type ->
+ <:class_sig_item< method virtual $private:pf$ $l$ : $t$ >>
| type_constraint; t1 = ctyp; "="; t2 = ctyp ->
<:class_sig_item< type $t1$ = $t2$ >> ] ]
;
type_constraint:
- [ [ "type" -> () ] ]
+ [ [ "type" | "constraint" -> () ] ]
;
class_description:
[ [ cd1 = SELF; "and"; cd2 = SELF -> <:class_type< $cd1$ and $cd2$ >>
| `ANTIQUOT (""|"typ"|"anti"|"list" as n) s ->
<:class_type< $anti:mk_anti ~c:"class_type" n s$ >>
+ | `QUOTATION x -> Quotation.expand _loc x Quotation.DynAst.class_type_tag
| ci = class_info_for_class_type; ":"; ct = class_type_plus -> <:class_type< $ci$ : $ct$ >>
] ]
;
@@ -1197,32 +1315,32 @@ Old (no more supported) syntax:
[ cd1 = SELF; "and"; cd2 = SELF -> <:class_type< $cd1$ and $cd2$ >>
| `ANTIQUOT (""|"typ"|"anti"|"list" as n) s ->
<:class_type< $anti:mk_anti ~c:"class_type" n s$ >>
+ | `QUOTATION x -> Quotation.expand _loc x Quotation.DynAst.class_type_tag
| ci = class_info_for_class_type; "="; ct = class_type -> <:class_type< $ci$ = $ct$ >>
] ]
;
field_expr:
[ LEFTA
- [ b1 = SELF; ";"; b2 = SELF -> <:binding< $b1$ ; $b2$ >>
+ [ b1 = SELF; ";"; b2 = SELF -> <:rec_binding< $b1$ ; $b2$ >>
| `ANTIQUOT (""|"bi"|"anti" as n) s ->
- <:binding< $anti:mk_anti ~c:"binding" n s$ >>
+ <:rec_binding< $anti:mk_anti ~c:"rec_binding" n s$ >>
| `ANTIQUOT ("list" as n) s ->
- <:binding< $anti:mk_anti ~c:"binding;" n s$ >>
- | l = label; "="; e = expr -> <:binding< $lid:l$ = $e$ >> ] ]
+ <:rec_binding< $anti:mk_anti ~c:"rec_binding" n s$ >>
+ | l = label; "="; e = expr -> <:rec_binding< $lid:l$ = $e$ >> ] ]
;
meth_list:
- [ [ f = field; ";"; ml = SELF -> <:ctyp< $f$; $ml$ >>
- | f = field; OPT ";" -> f ] ]
+ [ LEFTA
+ [ ml1 = SELF; ";"; ml2 = SELF -> <:ctyp< $ml1$; $ml2$ >>
+ | `ANTIQUOT (""|"typ" as n) s -> <:ctyp< $anti:mk_anti ~c:"ctyp" n s$ >>
+ | `ANTIQUOT ("list" as n) s -> <:ctyp< $anti:mk_anti ~c:"ctyp;" n s$ >>
+ | `QUOTATION x -> Quotation.expand _loc x Quotation.DynAst.ctyp_tag
+ | lab = a_LIDENT; ":"; t = poly_type -> <:ctyp< $lid:lab$ : $t$ >> ] ]
;
opt_meth_list:
- [ [ ml = meth_list -> ml
+ [ [ ml = meth_list; OPT ";" -> ml
| -> <:ctyp<>>
] ]
;
- field:
- [ [ `ANTIQUOT (""|"typ" as n) s ->
- <:ctyp< $anti:mk_anti ~c:"ctyp" n s$ >>
- | lab = a_LIDENT; ":"; t = poly_type -> <:ctyp< $lid:lab$ : $t$ >> ] ]
- ;
poly_type:
[ [ t = ctyp -> t ] ]
;
@@ -1231,30 +1349,24 @@ Old (no more supported) syntax:
[ t1 = SELF; t2 = SELF -> <:ctyp< $t1$ $t2$ >>
| `ANTIQUOT (""|"typ" as n) s ->
<:ctyp< $anti:mk_anti ~c:"ctyp" n s$ >>
+ | `QUOTATION x -> Quotation.expand _loc x Quotation.DynAst.ctyp_tag
| "'"; i = a_ident -> <:ctyp< '$lid:i$ >>
] ]
;
row_field:
[ [ `ANTIQUOT (""|"typ" as n) s ->
<:ctyp< $anti:mk_anti ~c:"ctyp" n s$ >>
+ | `ANTIQUOT ("list" as n) s ->
+ <:ctyp< $anti:mk_anti ~c:"ctyp|" n s$ >>
| t1 = SELF; "|"; t2 = SELF -> <:ctyp< $t1$ | $t2$ >>
| "`"; i = a_ident -> <:ctyp< `$i$ >>
| "`"; i = a_ident; "of"; "&"; t = amp_ctyp -> <:ctyp< `$i$ of & $t$ >>
| "`"; i = a_ident; "of"; t = amp_ctyp -> <:ctyp< `$i$ of $t$ >>
| t = ctyp -> t ] ]
;
- sem_ctyp:
- [ [ t1 = SELF; ";"; t2 = SELF -> <:ctyp< $t1$ ; $t2$ >>
- | t = ctyp -> t
- ] ]
- ;
- pipe_ctyp:
- [ [ t1 = SELF; "|"; t2 = SELF -> <:ctyp< $t1$ | $t2$ >>
- | t = ctyp -> t
- ] ]
- ;
amp_ctyp:
[ [ t1 = SELF; "&"; t2 = SELF -> <:ctyp< $t1$ & $t2$ >>
+ | `ANTIQUOT ("list" as n) s -> <:ctyp< $anti:mk_anti ~c:"ctyp&" n s$ >>
| t = ctyp -> t
] ]
;
@@ -1346,6 +1458,8 @@ Old (no more supported) syntax:
sig_items:
[ [ `ANTIQUOT (""|"sigi"|"anti"|"list" as n) s ->
<:sig_item< $anti:mk_anti n ~c:"sig_item" s$ >>
+ | `ANTIQUOT (""|"sigi"|"anti"|"list" as n) s; semi; sg = SELF ->
+ <:sig_item< $anti:mk_anti n ~c:"sig_item" s$; $sg$ >>
| l = LIST0 [ sg = sig_item; semi -> sg ] -> Ast.sgSem_of_list l
] ]
;
@@ -1359,6 +1473,8 @@ Old (no more supported) syntax:
str_items:
[ [ `ANTIQUOT (""|"stri"|"anti"|"list" as n) s ->
<:str_item< $anti:mk_anti n ~c:"str_item" s$ >>
+ | `ANTIQUOT (""|"stri"|"anti"|"list" as n) s; semi; st = SELF ->
+ <:str_item< $anti:mk_anti n ~c:"str_item" s$; $st$ >>
| l = LIST0 [ st = str_item; semi -> st ] -> Ast.stSem_of_list l
] ]
;
@@ -1412,9 +1528,6 @@ Old (no more supported) syntax:
[ [ `ANTIQUOT (""|"lid" as n) s -> mk_anti n s
| `LIDENT s -> s ] ]
;
- a_LIDENT_or_operator:
- [ [ x = a_LIDENT -> x ] ]
- ;
a_LABEL:
[ [ "~"; `ANTIQUOT ("" as n) s; ":" -> mk_anti n s
| `LABEL s -> s ] ]
@@ -1451,18 +1564,30 @@ Old (no more supported) syntax:
patt_quot:
[ [ x = patt; ","; y = comma_patt -> <:patt< $x$, $y$ >>
| x = patt; ";"; y = sem_patt -> <:patt< $x$; $y$ >>
- | x = patt; "="; y = patt -> <:patt< $x$ = $y$ >>
+ | x = patt; "="; y = patt ->
+ let i =
+ match x with
+ [ <:patt@loc< $anti:s$ >> -> <:ident@loc< $anti:s$ >>
+ | p -> Ast.ident_of_patt p ]
+ in
+ <:patt< $i$ = $y$ >>
| x = patt -> x
| -> <:patt<>>
] ]
;
ctyp_quot:
[ [ x = more_ctyp; ","; y = comma_ctyp -> <:ctyp< $x$, $y$ >>
- | x = more_ctyp; ";"; y = sem_ctyp -> <:ctyp< $x$; $y$ >>
- | x = more_ctyp; "|"; y = pipe_ctyp -> <:ctyp< $x$ | $y$ >>
+ | x = more_ctyp; ";"; y = label_declaration -> <:ctyp< $x$; $y$ >>
+ | x = more_ctyp; "|"; y = constructor_declarations -> <:ctyp< $x$ | $y$ >>
| x = more_ctyp; "of"; y = constructor_arg_list -> <:ctyp< $x$ of $y$ >>
+ | x = more_ctyp; "of"; y = constructor_arg_list; "|"; z = constructor_declarations ->
+ <:ctyp< $ <:ctyp< $x$ of $y$ >> $ | $z$ >>
| x = more_ctyp; "of"; "&"; y = amp_ctyp -> <:ctyp< $x$ of & $y$ >>
+ | x = more_ctyp; "of"; "&"; y = amp_ctyp; "|"; z = row_field ->
+ <:ctyp< $ <:ctyp< $x$ of & $y$ >> $ | $z$ >>
| x = more_ctyp; ":"; y = more_ctyp -> <:ctyp< $x$ : $y$ >>
+ | x = more_ctyp; ":"; y = more_ctyp; ";"; z = label_declaration ->
+ <:ctyp< $ <:ctyp< $x$ : $y$ >> $ ; $z$ >>
| x = more_ctyp; "*"; y = star_ctyp -> <:ctyp< $x$ * $y$ >>
| x = more_ctyp; "&"; y = amp_ctyp -> <:ctyp< $x$ & $y$ >>
| x = more_ctyp; "and"; y = constructor_arg_list -> <:ctyp< $x$ and $y$ >>
@@ -1473,7 +1598,7 @@ Old (no more supported) syntax:
more_ctyp:
[ [ "mutable"; x = SELF -> <:ctyp< mutable $x$ >>
| "`"; x = a_LIDENT -> <:ctyp< `$x$ >>
- | x = ctyp -> x
+ | x = type_kind -> x
| x = type_parameter -> x
] ]
;
@@ -1491,24 +1616,27 @@ Old (no more supported) syntax:
;
module_type_quot:
[ [ x = module_type -> x
+ | -> <:module_type<>>
] ]
;
module_expr_quot:
[ [ x = module_expr -> x
+ | -> <:module_expr<>>
] ]
;
match_case_quot:
- [ [ x = match_case -> x
+ [ [ x = LIST0 match_case0 SEP "|" -> <:match_case< $list:x$ >>
| -> <:match_case<>> ] ]
;
binding_quot:
- [ [ b1 = SELF; "and"; b2 = SELF -> <:binding< $b1$ and $b2$ >>
- | b1 = SELF; ";"; b2 = SELF -> <:binding< $b1$ ; $b2$ >>
- | x = binding -> x
- | x = label_expr -> x
+ [ [ x = binding -> x
| -> <:binding<>>
] ]
;
+ rec_binding_quot:
+ [ [ x = label_expr -> x
+ | -> <:rec_binding<>> ] ]
+ ;
module_binding_quot:
[ [ b1 = SELF; "and"; b2 = SELF ->
<:module_binding< $b1$ and $b2$ >>
@@ -1541,9 +1669,10 @@ Old (no more supported) syntax:
[ [ ce1 = SELF; "and"; ce2 = SELF -> <:class_expr< $ce1$ and $ce2$ >>
| ce1 = SELF; "="; ce2 = SELF -> <:class_expr< $ce1$ = $ce2$ >>
| "virtual"; (i, ot) = class_name_and_param ->
- Ast.CeCon _loc Ast.BTrue (Ast.IdLid _loc i) ot
+ <:class_expr< virtual $lid:i$ [ $ot$ ] >>
| `ANTIQUOT ("virtual" as n) s; i = ident; ot = opt_comma_ctyp ->
- Ast.CeCon _loc (Ast.BAnt (mk_anti ~c:"class_expr" n s)) i ot
+ let anti = Ast.BAnt (mk_anti ~c:"class_expr" n s) in
+ <:class_expr< $virtual:anti$ $id:i$ [ $ot$ ] >>
| x = class_expr -> x
| -> <:class_expr<>>
] ]
@@ -1553,9 +1682,10 @@ Old (no more supported) syntax:
| ct1 = SELF; "="; ct2 = SELF -> <:class_type< $ct1$ = $ct2$ >>
| ct1 = SELF; ":"; ct2 = SELF -> <:class_type< $ct1$ : $ct2$ >>
| "virtual"; (i, ot) = class_name_and_param ->
- Ast.CtCon _loc Ast.BTrue (Ast.IdLid _loc i) ot
+ <:class_type< virtual $lid:i$ [ $ot$ ] >>
| `ANTIQUOT ("virtual" as n) s; i = ident; ot = opt_comma_ctyp ->
- Ast.CtCon _loc (Ast.BAnt (mk_anti ~c:"class_type" n s)) i ot
+ let anti = Ast.BAnt (mk_anti ~c:"class_type" n s) in
+ <:class_type< $virtual:anti$ $id:i$ [ $ot$ ] >>
| x = class_type_plus -> x
| -> <:class_type<>>
] ]
diff --git a/camlp4/Camlp4Parsers/Camlp4OCamlRevisedParserParser.ml b/camlp4/Camlp4Parsers/Camlp4OCamlRevisedParserParser.ml
index 069ee52c0..103519c99 100644
--- a/camlp4/Camlp4Parsers/Camlp4OCamlRevisedParserParser.ml
+++ b/camlp4/Camlp4Parsers/Camlp4OCamlRevisedParserParser.ml
@@ -263,6 +263,11 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
[ Some bp -> <:expr< let $bp$ = Stream.count $lid:strm_n$ in $pc$ >>
| None -> pc ]
in
+ let me =
+ match me with
+ [ <:expr@_loc< $_$; $_$ >> as e -> <:expr< do { $e$ } >>
+ | e -> e ]
+ in
match me with
[ <:expr< $lid:x$ >> when x = strm_n -> e
| _ -> <:expr< let ($lid:strm_n$ : Stream.t _) = $me$ in $e$ >> ]
@@ -316,7 +321,7 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
expr: LEVEL "top"
[ [ "parser"; po = OPT parser_ipatt; pcl = parser_case_list ->
<:expr< $cparser _loc po pcl$ >>
- | "match"; e = SELF; "with"; "parser"; po = OPT parser_ipatt;
+ | "match"; e = sequence; "with"; "parser"; po = OPT parser_ipatt;
pcl = parser_case_list ->
<:expr< $cparser_match _loc e po pcl$ >>
] ]
diff --git a/camlp4/Camlp4Parsers/Camlp4OCamlRevisedQuotationExpander.ml b/camlp4/Camlp4Parsers/Camlp4OCamlRevisedQuotationExpander.ml
index b013be256..07d2a01eb 100644
--- a/camlp4/Camlp4Parsers/Camlp4OCamlRevisedQuotationExpander.ml
+++ b/camlp4/Camlp4Parsers/Camlp4OCamlRevisedQuotationExpander.ml
@@ -19,6 +19,6 @@ open Camlp4; (* -*- camlp4r -*- *)
open PreCast;
let module Gram = MakeGram Lexer in
-let module M1 = OCamlInitSyntax.Make Warning Ast Gram Quotation in
+let module M1 = OCamlInitSyntax.Make Ast Gram Quotation in
let module M2 = Camlp4OCamlRevisedParser.Make M1 in
let module M3 = Camlp4QuotationCommon.Make M2 Syntax.AntiquotSyntax in ();
diff --git a/camlp4/Camlp4Parsers/Camlp4QuotationCommon.ml b/camlp4/Camlp4Parsers/Camlp4QuotationCommon.ml
index efac02f79..28e9bf6bf 100644
--- a/camlp4/Camlp4Parsers/Camlp4QuotationCommon.ml
+++ b/camlp4/Camlp4Parsers/Camlp4QuotationCommon.ml
@@ -76,6 +76,7 @@ module Make (Syntax : Sig.Camlp4Syntax)
| "anticlass_str_item" -> <:patt< Ast.CrAnt $mloc _loc$ $p$ >>
| "antiwith_constr" -> <:patt< Ast.WcAnt $mloc _loc$ $p$ >>
| "antibinding" -> <:patt< Ast.BiAnt $mloc _loc$ $p$ >>
+ | "antirec_binding" -> <:patt< Ast.RbAnt $mloc _loc$ $p$ >>
| "antimatch_case" -> <:patt< Ast.McAnt $mloc _loc$ $p$ >>
| "antimodule_binding" -> <:patt< Ast.MbAnt $mloc _loc$ $p$ >>
| "antiident" -> <:patt< Ast.IdAnt $mloc _loc$ $p$ >>
@@ -93,6 +94,9 @@ module Make (Syntax : Sig.Camlp4Syntax)
| "`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>>$ >>
| "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$ >>
@@ -102,13 +106,22 @@ module Make (Syntax : Sig.Camlp4Syntax)
| "listmodule_binding" -> <:expr< Ast.mbAnd_of_list $e$ >>
| "listbinding" -> <:expr< Ast.biAnd_of_list $e$ >>
| "listbinding;" -> <:expr< Ast.biSem_of_list $e$ >>
+ | "listrec_binding" -> <:expr< Ast.rbSem_of_list $e$ >>
| "listclass_type" -> <:expr< Ast.ctAnd_of_list $e$ >>
| "listclass_expr" -> <:expr< Ast.ceAnd_of_list $e$ >>
| "listident" -> <:expr< Ast.idAcc_of_list $e$ >>
| "listctypand" -> <:expr< Ast.tyAnd_of_list $e$ >>
+ | "listctyp;" -> <:expr< Ast.tySem_of_list $e$ >>
+ | "listctyp*" -> <:expr< Ast.tySta_of_list $e$ >>
+ | "listctyp|" -> <:expr< Ast.tyOr_of_list $e$ >>
+ | "listctyp," -> <:expr< Ast.tyCom_of_list $e$ >>
+ | "listctyp&" -> <:expr< Ast.tyAmp_of_list $e$ >>
| "listwith_constr" -> <:expr< Ast.wcAnd_of_list $e$ >>
| "listmatch_case" -> <:expr< Ast.mcOr_of_list $e$ >>
+ | "listpatt," -> <:expr< Ast.paCom_of_list $e$ >>
| "listpatt;" -> <:expr< Ast.paSem_of_list $e$ >>
+ | "listexpr," -> <:expr< Ast.exCom_of_list $e$ >>
+ | "listexpr;" -> <:expr< Ast.exSem_of_list $e$ >>
| "antisig_item" -> <:expr< Ast.SgAnt $mloc _loc$ $e$ >>
| "antistr_item" -> <:expr< Ast.StAnt $mloc _loc$ $e$ >>
| "antictyp" -> <:expr< Ast.TyAnt $mloc _loc$ $e$ >>
@@ -122,6 +135,7 @@ module Make (Syntax : Sig.Camlp4Syntax)
| "anticlass_str_item" -> <:expr< Ast.CrAnt $mloc _loc$ $e$ >>
| "antiwith_constr" -> <:expr< Ast.WcAnt $mloc _loc$ $e$ >>
| "antibinding" -> <:expr< Ast.BiAnt $mloc _loc$ $e$ >>
+ | "antirec_binding" -> <:expr< Ast.RbAnt $mloc _loc$ $e$ >>
| "antimatch_case" -> <:expr< Ast.McAnt $mloc _loc$ $e$ >>
| "antimodule_binding" -> <:expr< Ast.MbAnt $mloc _loc$ $e$ >>
| "antiident" -> <:expr< Ast.IdAnt $mloc _loc$ $e$ >>
@@ -131,14 +145,23 @@ module Make (Syntax : Sig.Camlp4Syntax)
value add_quotation name entry mexpr mpatt =
let entry_eoi = Gram.Entry.mk (Gram.Entry.name entry) in
+ let parse_quot_string entry loc s =
+ let q = Camlp4_config.antiquotations.val in
+ let () = Camlp4_config.antiquotations.val := True in
+ let res = Gram.parse_string entry loc s in
+ let () = Camlp4_config.antiquotations.val := q in
+ res in
let expand_expr loc loc_name_opt s =
- let ast = Gram.parse_string entry_eoi loc s in
+ let ast = parse_quot_string entry_eoi loc s in
let () = MetaLoc.loc_name.val := loc_name_opt in
let meta_ast = mexpr loc ast in
let exp_ast = antiquot_expander#expr meta_ast in
exp_ast in
+ let expand_str_item loc loc_name_opt s =
+ let exp_ast = expand_expr loc loc_name_opt s in
+ <:str_item@loc< $exp:exp_ast$ >> in
let expand_patt _loc loc_name_opt s =
- let ast = Gram.parse_string entry_eoi _loc s in
+ let ast = parse_quot_string entry_eoi _loc s in
let meta_ast = mpatt _loc ast in
let exp_ast = antiquot_expander#patt meta_ast in
match loc_name_opt with
@@ -156,7 +179,9 @@ module Make (Syntax : Sig.Camlp4Syntax)
[ [ x = entry; `EOI -> x ] ]
;
END;
- Quotation.add name (Quotation.ExAst (expand_expr, expand_patt))
+ 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;
};
add_quotation "sig_item" sig_item_quot ME.meta_sig_item MP.meta_sig_item;
@@ -174,6 +199,7 @@ module Make (Syntax : Sig.Camlp4Syntax)
class_str_item_quot ME.meta_class_str_item MP.meta_class_str_item;
add_quotation "with_constr" with_constr_quot ME.meta_with_constr MP.meta_with_constr;
add_quotation "binding" binding_quot ME.meta_binding MP.meta_binding;
+ add_quotation "rec_binding" rec_binding_quot ME.meta_rec_binding MP.meta_rec_binding;
add_quotation "match_case" match_case_quot ME.meta_match_case MP.meta_match_case;
add_quotation "module_binding"
module_binding_quot ME.meta_module_binding MP.meta_module_binding;
diff --git a/camlp4/Camlp4Top/Rprint.ml b/camlp4/Camlp4Top/Rprint.ml
index 4a95770fd..cb9e6a7be 100644
--- a/camlp4/Camlp4Top/Rprint.ml
+++ b/camlp4/Camlp4Top/Rprint.ml
@@ -198,7 +198,7 @@ and print_simple_out_type ppf =
| Otyp_record lbls ->
fprintf ppf "@[<hv 2>{ %a }@]"
(print_list print_out_label (fun ppf -> fprintf ppf ";@ ")) lbls
- | Otyp_abstract -> fprintf ppf "'abstract"
+ | Otyp_abstract -> fprintf ppf "<abstract>"
| Otyp_alias _ _ | Otyp_poly _ _
| Otyp_arrow _ _ _ | Otyp_constr _ [_ :: _] as ty ->
fprintf ppf "@[<1>(%a)@]" print_out_type ty ]
diff --git a/camlp4/Camlp4Top/Top.ml b/camlp4/Camlp4Top/Top.ml
index 9a5141362..e706efdc6 100644
--- a/camlp4/Camlp4Top/Top.ml
+++ b/camlp4/Camlp4Top/Top.ml
@@ -101,7 +101,9 @@ Toploop.parse_toplevel_phrase.val := wrap toplevel_phrase;
Toploop.parse_use_file.val := wrap use_file;
-Warning.current.val :=
+current_warning.val :=
fun loc txt ->
Toploop.print_warning (Loc.to_ocaml_location loc) Format.err_formatter
(Warnings.Camlp4 txt);
+
+Register.iter_and_take_callbacks (fun (_, f) -> f ());
diff --git a/camlp4/Camlp4_config.ml b/camlp4/Camlp4_config.ml
index 362848493..03fa1f7c1 100644
--- a/camlp4/Camlp4_config.ml
+++ b/camlp4/Camlp4_config.ml
@@ -30,6 +30,7 @@ let program_name = ref "camlp4";;
let constructors_arity = ref true;;
let unsafe = ref false;;
let verbose = ref false;;
+let antiquotations = ref false;;
let quotations = ref true;;
let inter_phrases = ref None;;
let camlp4_ast_impl_magic_number = "Camlp42006M001";;
diff --git a/camlp4/Camlp4_config.mli b/camlp4/Camlp4_config.mli
index c2647b890..175920846 100644
--- a/camlp4/Camlp4_config.mli
+++ b/camlp4/Camlp4_config.mli
@@ -28,6 +28,7 @@ val program_name : string ref;;
val unsafe : bool ref;;
val verbose : bool ref;;
val quotations : bool ref;;
+val antiquotations : bool ref;;
val constructors_arity : bool ref;;
val inter_phrases : (string option) ref;;
val current_input_file : string ref;;
diff --git a/camlp4/boot/Camlp4.ml b/camlp4/boot/Camlp4.ml
index 5944147bd..067a09933 100644
--- a/camlp4/boot/Camlp4.ml
+++ b/camlp4/boot/Camlp4.ml
@@ -350,7 +350,7 @@ module Sig =
sig
(** The name of the extension, typically the module name. *)
val name : string
- (** The version of the extension, typically $Id: Camlp4.ml,v 1.2 2007/02/26 16:32:46 ertai Exp $ with a versionning system. *)
+ (** 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. *)
val version : string
end
module type Loc =
@@ -450,13 +450,15 @@ module Sig =
the predefined quotations for OCaml syntax trees. Default: [_loc]. *)
val name : string ref
end
- module type Warning =
- sig
- module Loc : Loc
- type t = Loc.t -> string -> unit
- val default : t
- val current : t ref
- val print : t
+ 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 =
@@ -469,7 +471,7 @@ module Sig =
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; }
+ fun f { contents = x } -> { contents = f x; }
end :
object
method string : string -> string
@@ -505,6 +507,7 @@ module Sig =
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
@@ -519,6 +522,7 @@ module Sig =
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
@@ -560,6 +564,7 @@ module Sig =
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
@@ -601,6 +606,7 @@ module Sig =
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
@@ -623,7 +629,31 @@ module Sig =
It provides:
- Types for all kinds of structure.
- Map: A base class for map traversals.
- - Map classes and functions for common kinds. *)
+ - 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 *)
+ *)
module type Camlp4Ast =
sig
module Loc : Loc
@@ -632,46 +662,44 @@ module Sig =
type 'a meta_list =
| LNil | LCons of 'a * 'a meta_list | LAnt of string
type ident =
- | IdAcc of Loc.t * ident * ident | (* i . i *)
- IdApp of Loc.t * ident * ident | (* i i *) IdLid of Loc.t * string
- | (* foo *) IdUid of Loc.t * string | (* Bar *)
- IdAnt of Loc.t * string
+ | (* 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 =
- | TyNil of Loc.t | TyAli of Loc.t * ctyp * ctyp | (* t as t *)
- (* list 'a as 'a *) TyAny of Loc.t | (* _ *)
- TyApp of Loc.t * ctyp * ctyp | (* t t *) (* list 'a *)
- TyArr of Loc.t * ctyp * ctyp | (* t -> t *) (* int -> string *)
- TyCls of Loc.t * ident | (* #i *) (* #point *)
- TyLab of Loc.t * string * ctyp | (* ~s *) TyId of Loc.t * ident
- | (* i *) (* Lazy.t *) TyMan of Loc.t * ctyp * ctyp | (* t == t *)
- (* type t = [ A | B ] == Foo.t *)
+ | (* 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 t 'a 'b 'c = t constraint t = t constraint t = t *)
- TyDcl of Loc.t * string * ctyp list * ctyp * (ctyp * ctyp) list
- | (* < (t)? (..)? > *) (* < move : int -> 'a .. > as 'a *)
- TyObj of Loc.t * ctyp * meta_bool | TyOlb of Loc.t * string * ctyp
- | (* ?s *) TyPol of Loc.t * ctyp * ctyp | (* ! t . t *)
- (* ! 'a . list 'a -> 'a *) TyQuo of Loc.t * string | (* 's *)
- TyQuP of Loc.t * string | (* +'s *) TyQuM of Loc.t * string
- | (* -'s *) TyVrn of Loc.t * string | (* `s *)
- TyRec of Loc.t * ctyp | (* { t } *)
- (* { foo : int ; bar : mutable string } *)
- TyCol of Loc.t * ctyp * ctyp | (* t : t *)
- TySem of Loc.t * ctyp * ctyp | (* t; t *)
- TyCom of Loc.t * ctyp * ctyp | (* t, t *) TySum of Loc.t * ctyp
- | (* [ t ] *) (* [ A of int and string | B ] *)
- TyOf of Loc.t * ctyp * ctyp | (* t of t *) (* A of int *)
- TyAnd of Loc.t * ctyp * ctyp | (* t and t *)
- TyOr of Loc.t * ctyp * ctyp | (* t | t *) TyPrv of Loc.t * ctyp
- | (* private t *) TyMut of Loc.t * ctyp | (* mutable t *)
- TyTup of Loc.t * ctyp | (* ( t ) *) (* (int * string) *)
- TySta of Loc.t * ctyp * ctyp | (* t * t *) TyVrnEq of Loc.t * ctyp
- | (* [ = t ] *) TyVrnSup of Loc.t * ctyp | (* [ > t ] *)
- TyVrnInf of Loc.t * ctyp | (* [ < t ] *)
- TyVrnInfSup of Loc.t * ctyp * ctyp | (* [ < t > t ] *)
- TyAmp of Loc.t * ctyp * ctyp | (* t & t *)
- TyOfAmp of Loc.t * ctyp * ctyp | (* t of & t *)
- TyAnt of Loc.t * string
+ (* < (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 *)
(* p as p *)
@@ -693,7 +721,7 @@ module Sig =
(* p | p *)
(* p .. p *)
(* { p } *)
- (* p = p *)
+ (* i = p *)
(* s *)
(* ( p ) *)
(* (p : t) *)
@@ -764,10 +792,12 @@ module Sig =
(* $s$ *)
(* b and b *)
(* let a = 42 and c = 43 *)
- (* b ; b *)
(* p = e *)
(* let patt = expr *)
(* $s$ *)
+ (* b ; b *)
+ (* i = e *)
+ (* $s$ *)
(* mb and mb *)
(* module rec (s : mt) = me and (s : mt) = me *)
(* s : mt = me *)
@@ -833,7 +863,7 @@ module Sig =
| 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 * 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
@@ -854,15 +884,15 @@ module Sig =
| 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 * binding
- | ExRec of Loc.t * binding * expr | ExSeq of Loc.t * expr
+ | 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
and module_type =
- | MtId of Loc.t * ident
+ | 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
@@ -886,8 +916,10 @@ module Sig =
| WcAnt of Loc.t * string
and binding =
| BiNil of Loc.t | BiAnd of Loc.t * binding * binding
- | BiSem of Loc.t * binding * binding | BiEq of Loc.t * patt * expr
- | BiAnt of Loc.t * string
+ | BiEq of Loc.t * patt * expr | BiAnt of Loc.t * 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
and module_binding =
| MbNil of Loc.t | MbAnd of Loc.t * module_binding * module_binding
| MbColEq of Loc.t * string * module_type * module_expr
@@ -896,7 +928,7 @@ module Sig =
| McNil of Loc.t | McOr of Loc.t * match_case * match_case
| McArr of Loc.t * patt * expr * expr | McAnt of Loc.t * string
and module_expr =
- | MeId of Loc.t * ident
+ | 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
@@ -940,19 +972,18 @@ module Sig =
| CeAnd of Loc.t * class_expr * class_expr
| CeEq of Loc.t * class_expr * class_expr | CeAnt of Loc.t * string
and class_str_item =
- | CrNil of Loc.t | (* cst ; cst *)
- CrSem of Loc.t * class_str_item * class_str_item | (* type t = t *)
- CrCtr of Loc.t * ctyp * ctyp | (* inherit ce or inherit ce as s *)
- CrInh of Loc.t * class_expr * string | (* initializer e *)
- CrIni of Loc.t * expr
- | (* method (private)? s : t = e or method (private)? s = e *)
- CrMth of Loc.t * string * meta_bool * expr * ctyp
- | (* value (mutable)? s = e *)
- CrVal of Loc.t * string * meta_bool * expr
- | (* method virtual (private)? s : t *)
- CrVir of Loc.t * string * meta_bool * ctyp
- | (* value virtual (private)? s : t *)
- CrVvr of Loc.t * string * meta_bool * ctyp
+ | (* 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
@@ -967,6 +998,7 @@ module Sig =
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
@@ -1004,6 +1036,7 @@ module Sig =
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
@@ -1030,6 +1063,7 @@ module Sig =
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
@@ -1070,6 +1104,7 @@ module Sig =
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
@@ -1111,31 +1146,30 @@ module Sig =
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
end
- class c_expr : (expr -> expr) -> object inherit map end
- class c_patt : (patt -> patt) -> object inherit map end
- class c_ctyp : (ctyp -> ctyp) -> object inherit map end
- class c_str_item : (str_item -> str_item) -> object inherit map end
- class c_sig_item : (sig_item -> sig_item) -> object inherit map end
- class c_loc : (Loc.t -> Loc.t) -> object inherit map end
- val map_expr : (expr -> expr) -> expr -> expr
- val map_patt : (patt -> patt) -> patt -> patt
- val map_ctyp : (ctyp -> ctyp) -> ctyp -> ctyp
- val map_str_item : (str_item -> str_item) -> str_item -> str_item
- val map_sig_item : (sig_item -> sig_item) -> sig_item -> sig_item
- val map_loc : (Loc.t -> Loc.t) -> Loc.t -> Loc.t
+ 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 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 biSem_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
@@ -1152,6 +1186,8 @@ module Sig =
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
@@ -1198,6 +1234,7 @@ module Sig =
and type class_sig_item = M.class_sig_item
and type class_expr = M.class_expr
and type class_str_item = M.class_str_item and type binding = M.binding
+ 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) =
@@ -1242,7 +1279,7 @@ module Sig =
| 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 * 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
@@ -1263,15 +1300,15 @@ module Sig =
| 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 * binding
- | ExRec of Loc.t * binding * expr | ExSeq of Loc.t * expr
+ | 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
and module_type =
- | MtId of Loc.t * ident
+ | 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
@@ -1295,8 +1332,10 @@ module Sig =
| WcAnt of Loc.t * string
and binding =
| BiNil of Loc.t | BiAnd of Loc.t * binding * binding
- | BiSem of Loc.t * binding * binding | BiEq of Loc.t * patt * expr
- | BiAnt of Loc.t * string
+ | BiEq of Loc.t * patt * expr | BiAnt of Loc.t * 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
and module_binding =
| MbNil of Loc.t | MbAnd of Loc.t * module_binding * module_binding
| MbColEq of Loc.t * string * module_type * module_expr
@@ -1305,7 +1344,7 @@ module Sig =
| McNil of Loc.t | McOr of Loc.t * match_case * match_case
| McArr of Loc.t * patt * expr * expr | McAnt of Loc.t * string
and module_expr =
- | MeId of Loc.t * ident
+ | 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
@@ -1369,25 +1408,53 @@ module Sig =
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) :
+ 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 expander =
- | ExStr of (bool -> string expand_fun)
- | ExAst of Ast.expr expand_fun * Ast.patt expand_fun
- val add : string -> expander -> unit
- val find : string -> expander
+ 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
val translate : (string -> string) ref
- val expand_expr :
- (Loc.t -> string -> Ast.expr) -> Loc.t -> quotation -> Ast.expr
- val expand_patt :
- (Loc.t -> string -> Ast.patt) -> Loc.t -> quotation -> Ast.patt
+ val expand : Loc.t -> quotation -> 'a DynAst.tag -> 'a
val dump_file : (string option) ref
module Error : Error
end
@@ -1573,42 +1640,46 @@ module Sig =
module Error : Error
val mk : unit -> Loc.t -> char Stream.t -> (Token.t * Loc.t) Stream.t
end
- module type Parser =
- sig
- module Ast : Ast
- open Ast
- val parse_implem :
- ?directive_handler: (str_item -> str_item option) ->
- Loc.t -> char Stream.t -> Ast.str_item
- val parse_interf :
- ?directive_handler: (sig_item -> sig_item option) ->
- Loc.t -> char Stream.t -> Ast.sig_item
+ module Parser (Ast : Ast) =
+ struct
+ 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
+ val parse_interf :
+ ?directive_handler: (Ast.sig_item -> Ast.sig_item option) ->
+ Ast.Loc.t -> char Stream.t -> Ast.sig_item
+ end
end
- module type Printer =
- sig
- module Ast : Ast
- 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
+ module Printer (Ast : Ast) =
+ struct
+ module type S =
+ sig
+ 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 Warning : Warning with module Loc = Loc
module Ast : Ast with module Loc = Loc
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 Parser : Parser with module Ast = Ast
- module Printer : Printer with module Ast = Ast
+ include Warning(Loc).S
+ include Parser(Ast).S
+ include Printer(Ast).S
end
module type Camlp4Syntax =
sig
module Loc : Loc
- module Warning : Warning with 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
@@ -1616,8 +1687,9 @@ module Sig =
module AntiquotSyntax :
AntiquotSyntax with module Ast = Camlp4AstToAst(Ast)
module Quotation : Quotation with module Ast = Camlp4AstToAst(Ast)
- module Parser : Parser with module Ast = Camlp4AstToAst(Ast)
- module Printer : Printer with module Ast = Camlp4AstToAst(Ast)
+ 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
@@ -1629,7 +1701,6 @@ module Sig =
val a_INT64 : string Gram.Entry.t
val a_LABEL : string Gram.Entry.t
val a_LIDENT : string Gram.Entry.t
- val a_LIDENT_or_operator : 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
@@ -1642,6 +1713,7 @@ module Sig =
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
@@ -1683,8 +1755,7 @@ module Sig =
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 : Ast.ctyp Gram.Entry.t
- val field_expr : Ast.binding 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
@@ -1693,7 +1764,7 @@ module Sig =
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.binding 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
@@ -1718,7 +1789,7 @@ module Sig =
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 list -> Ast.ctyp) 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
@@ -1733,16 +1804,15 @@ module Sig =
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 pipe_ctyp : Ast.ctyp Gram.Entry.t
val poly_type : Ast.ctyp Gram.Entry.t
val row_field : Ast.ctyp Gram.Entry.t
- val sem_ctyp : 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
@@ -1765,11 +1835,17 @@ module Sig =
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 Warning = Syn.Warning and module Ast = Syn.Ast
- and module Token = Syn.Token and module Gram = Syn.Gram
+ 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
end
@@ -1966,10 +2042,9 @@ module Struct =
(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 start_pos = { line = 1; bol = 0; off = 0; }
let ghost =
{
-
file_name = "ghost-location";
start = start_pos;
stop = start_pos;
@@ -1977,7 +2052,6 @@ module Struct =
}
let mk file_name =
{
-
file_name = file_name;
start = start_pos;
stop = start_pos;
@@ -1987,10 +2061,9 @@ module Struct =
stop_bol, stop_off, ghost)
=
{
-
file_name = file_name;
- start = { line = start_line; bol = start_bol; off = start_off; };
- stop = { line = stop_line; bol = stop_bol; off = stop_off; };
+ start = { line = start_line; bol = start_bol; off = start_off; };
+ stop = { line = stop_line; bol = stop_bol; off = stop_off; };
ghost = ghost;
}
let to_tuple {
@@ -2010,7 +2083,6 @@ module Struct =
let pos_of_lexing_position p =
let pos =
{
-
line = p.Lexing.pos_lnum;
bol = p.Lexing.pos_bol;
off = p.Lexing.pos_cnum;
@@ -2018,7 +2090,6 @@ module Struct =
in pos
let pos_to_lexing_position p file_name =
{
-
Lexing.pos_fname = file_name;
pos_lnum = p.line;
pos_bol = p.bol;
@@ -2037,7 +2108,6 @@ module Struct =
and stop = Lexing.lexeme_end_p lb in
let loc =
{
-
file_name =
better_file_name start.Lexing.pos_fname stop.Lexing.pos_fname;
start = pos_of_lexing_position start;
@@ -2048,7 +2118,6 @@ module Struct =
let of_lexing_position pos =
let loc =
{
-
file_name = pos.Lexing.pos_fname;
start = pos_of_lexing_position pos;
stop = pos_of_lexing_position pos;
@@ -2057,7 +2126,6 @@ module Struct =
in loc
let to_ocaml_location x =
{
-
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;
@@ -2066,7 +2134,6 @@ module Struct =
let (a, b) = ((x.Location.loc_start), (x.Location.loc_end)) in
let res =
{
-
file_name =
better_file_name a.Lexing.pos_fname b.Lexing.pos_fname;
start = pos_of_lexing_position a;
@@ -2082,25 +2149,25 @@ module Struct =
else
(let r =
match ((a.ghost), (b.ghost)) with
- | (false, false) -> { (a) with stop = b.stop; }
- | (true, true) -> { (a) with stop = b.stop; }
- | (true, _) -> { (a) with stop = b.stop; }
- | (_, true) -> { (b) with start = a.start; }
+ | (false, false) -> { (a) with stop = b.stop; }
+ | (true, true) -> { (a) with stop = b.stop; }
+ | (true, _) -> { (a) with stop = b.stop; }
+ | (_, true) -> { (b) with start = a.start; }
in r)
- let join x = { (x) with stop = x.start; }
+ 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; }
+ | `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; }
+ { (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; }
+ { (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
@@ -2109,13 +2176,13 @@ module Struct =
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 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; }
+ 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)
@@ -2161,18 +2228,6 @@ module Struct =
| Exc_located (_, _) -> raise exc
| _ -> raise (Exc_located (loc, exc))
end
- module Warning =
- struct
- module Make (Loc : Sig.Loc) : Sig.Warning with module Loc = Loc =
- struct
- module Loc = Loc
- open Format
- type t = Loc.t -> string -> unit
- let default loc txt = eprintf "<W> %a: %s@." Loc.print loc txt
- let current = ref default
- let print loc txt = !current loc txt
- end
- end
module Token :
sig
module Make (Loc : Sig.Loc) : Sig.Camlp4Token with module Loc = Loc
@@ -2229,7 +2284,7 @@ module Struct =
OPTLABEL s | COMMENT s | BLANKS s | ESCAPED_IDENT s -> s
| tok ->
invalid_arg
- ("Cannot extract a string from a this token: " ^
+ ("Cannot extract a string from this token: " ^
(to_string tok))
module Error =
struct
@@ -2297,7 +2352,7 @@ module Struct =
Stream.icons x
(Stream.slazy (fun _ -> ignore_layout s)))
| _ -> Stream.sempty
- let mk is_kwd = { is_kwd = is_kwd; filter = ignore_layout; }
+ 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
@@ -2490,14 +2545,14 @@ module Struct =
open Error
type context =
{ loc : Loc.t; in_comment : bool; quotations : bool;
- lexbuf : lexbuf; buffer : Buffer.t
+ antiquots : bool; lexbuf : lexbuf; buffer : Buffer.t
}
let default_context lb =
{
-
loc = Loc.ghost;
in_comment = false;
quotations = true;
+ antiquots = false;
lexbuf = lb;
buffer = Buffer.create 256;
}
@@ -2509,28 +2564,28 @@ module Struct =
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 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 with_curr_loc f c =
- f { (c) with loc = Loc.of_lexbuf c.lexbuf; } c.lexbuf
+ { (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 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 c in
+ let s = parse_nested quotation (update_loc c) in
let contents = String.sub s 0 ((String.length s) - 2)
in
QUOTATION
{
-
q_name = name;
q_loc = loc;
q_shift = shift;
@@ -2546,7 +2601,6 @@ module Struct =
{
(pos)
with
-
pos_fname = new_file;
pos_lnum = if absolute then line else pos.pos_lnum + line;
pos_bol = pos.pos_cnum - chars;
@@ -2557,553 +2611,731 @@ module Struct =
error
let __ocaml_lex_tables =
{
-
Lexing.lex_base =
- "\000\000\227\255\228\255\001\001\001\001\231\255\232\255\160\001\
- \198\001\067\000\091\000\069\000\071\000\084\000\122\000\235\001\
- \014\002\092\000\102\001\244\255\035\002\068\002\141\002\093\003\
- \060\004\152\004\126\000\001\000\255\255\104\005\253\255\056\006\
- \252\255\245\255\246\255\247\255\023\001\001\001\088\000\091\000\
- \216\002\168\003\179\005\179\001\088\004\132\000\024\007\108\000\
- \151\000\109\000\243\255\242\255\241\255\012\005\033\001\111\000\
- \239\002\193\005\111\000\239\255\238\255\024\007\063\007\109\007\
- \148\007\183\007\174\006\015\003\004\000\233\255\093\001\199\001\
- \151\002\094\001\005\000\233\255\054\008\246\008\006\000\117\004\
- \251\255\208\009\095\000\115\000\115\000\254\255\016\010\207\010\
- \159\011\111\012\079\013\121\000\152\000\124\000\126\000\249\255\
- \248\255\144\006\197\003\127\000\060\004\128\000\200\007\129\000\
- \008\003\007\000\106\013\250\255\054\008\169\004\089\001\082\001\
- \179\004\198\008\054\008\172\013\139\014\169\014\136\015\103\016\
- \135\016\199\016\151\017\254\255\204\001\008\000\107\000\053\001\
- \215\017\150\018\102\019\054\020\018\021\062\001\236\021\197\022\
- \064\001\149\023\248\003\155\001\009\000\213\023\148\024\100\025\
- \052\026";
+ "\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";
Lexing.lex_backtrk =
- "\255\255\255\255\255\255\028\000\025\000\255\255\255\255\025\000\
- \025\000\023\000\023\000\023\000\023\000\023\000\023\000\025\000\
- \025\000\023\000\023\000\255\255\006\000\006\000\005\000\004\000\
- \025\000\025\000\001\000\000\000\255\255\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\015\000\255\255\255\255\021\000\020\000\018\000\
- \025\000\019\000\255\255\255\255\022\000\255\255\255\255\255\255\
- \255\255\255\255\022\000\255\255\026\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\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\
+ \028\000\030\000\030\000\028\000\028\000\255\255\006\000\006\000\
+ \005\000\004\000\030\000\030\000\001\000\000\000\255\255\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\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";
+ \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\076\000\255\255\000\000\000\000\255\255\
+ "\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\049\000\000\000\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\255\255\000\000\255\255\
+ \000\000\255\255\000\000\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\047\000\000\000\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\000\000\255\255\000\000\255\255\
- \000\000\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\052\000\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\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\255\255\255\255\255\255\
- \255\255\255\255\070\000\255\255\255\255\000\000\070\000\071\000\
- \070\000\073\000\255\255\000\000\076\000\052\000\255\255\091\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\
+ \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\
- \035\000\255\255\107\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\080\000\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\030\000\255\255\255\255\255\255\
- \255\255\255\255\080\000\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\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";
Lexing.lex_trans =
"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\026\000\028\000\028\000\026\000\027\000\069\000\075\000\
- \051\000\095\000\032\000\030\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\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \026\000\004\000\019\000\014\000\005\000\004\000\004\000\018\000\
- \017\000\006\000\016\000\004\000\006\000\004\000\013\000\004\000\
- \021\000\020\000\020\000\020\000\020\000\020\000\020\000\020\000\
- \020\000\020\000\012\000\011\000\015\000\004\000\007\000\024\000\
- \004\000\022\000\022\000\022\000\022\000\022\000\022\000\022\000\
- \022\000\022\000\022\000\022\000\022\000\022\000\022\000\022\000\
- \022\000\022\000\022\000\022\000\022\000\022\000\022\000\022\000\
- \022\000\022\000\022\000\010\000\003\000\006\000\004\000\023\000\
- \006\000\023\000\023\000\023\000\023\000\023\000\023\000\023\000\
- \023\000\023\000\023\000\023\000\023\000\023\000\023\000\023\000\
- \023\000\023\000\023\000\023\000\023\000\023\000\023\000\023\000\
- \023\000\023\000\023\000\009\000\008\000\006\000\025\000\006\000\
- \006\000\006\000\006\000\067\000\006\000\006\000\058\000\026\000\
- \043\000\043\000\026\000\042\000\042\000\042\000\042\000\042\000\
- \042\000\042\000\042\000\051\000\050\000\006\000\051\000\006\000\
- \059\000\087\000\067\000\030\000\085\000\028\000\026\000\086\000\
- \035\000\049\000\093\000\096\000\006\000\095\000\034\000\033\000\
- \019\000\085\000\066\000\066\000\066\000\066\000\066\000\066\000\
- \066\000\066\000\066\000\066\000\044\000\044\000\044\000\044\000\
- \044\000\044\000\044\000\044\000\044\000\044\000\050\000\096\000\
- \022\000\022\000\022\000\022\000\022\000\022\000\022\000\022\000\
- \022\000\022\000\022\000\022\000\022\000\022\000\022\000\022\000\
- \022\000\022\000\022\000\022\000\022\000\022\000\022\000\006\000\
- \022\000\022\000\022\000\022\000\022\000\022\000\022\000\023\000\
- \023\000\023\000\023\000\023\000\023\000\023\000\023\000\023\000\
- \023\000\023\000\023\000\023\000\023\000\023\000\023\000\023\000\
- \023\000\023\000\023\000\023\000\023\000\023\000\023\000\000\000\
- \023\000\023\000\023\000\023\000\023\000\023\000\023\000\023\000\
- \002\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\004\000\255\255\255\255\004\000\004\000\004\000\
- \000\000\255\255\255\255\004\000\004\000\255\255\004\000\004\000\
- \004\000\037\000\037\000\037\000\037\000\037\000\037\000\037\000\
- \037\000\037\000\037\000\004\000\255\255\004\000\004\000\004\000\
- \004\000\004\000\045\000\000\000\045\000\000\000\036\000\044\000\
- \044\000\044\000\044\000\044\000\044\000\044\000\044\000\044\000\
- \044\000\056\000\056\000\056\000\056\000\056\000\056\000\056\000\
- \056\000\056\000\056\000\111\000\255\255\255\255\255\255\004\000\
- \037\000\255\255\111\000\111\000\000\000\000\000\036\000\069\000\
- \075\000\000\000\068\000\074\000\136\000\000\000\136\000\129\000\
- \049\000\028\000\111\000\048\000\000\000\128\000\000\000\000\000\
- \085\000\111\000\085\000\000\000\255\255\004\000\255\255\004\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\004\000\046\000\000\000\004\000\004\000\004\000\000\000\
- \000\000\000\000\004\000\004\000\000\000\004\000\004\000\004\000\
- \000\000\069\000\000\000\000\000\068\000\142\000\032\000\032\000\
- \255\255\125\000\004\000\141\000\004\000\004\000\004\000\004\000\
- \004\000\000\000\000\000\043\000\043\000\000\000\000\000\004\000\
- \000\000\073\000\004\000\004\000\004\000\000\000\000\000\000\000\
- \004\000\004\000\000\000\004\000\004\000\004\000\000\000\000\000\
- \255\255\000\000\000\000\000\000\000\000\006\000\004\000\034\000\
- \004\000\255\255\004\000\004\000\004\000\004\000\004\000\000\000\
- \127\000\000\000\126\000\000\000\004\000\000\000\000\000\004\000\
- \004\000\004\000\043\000\000\000\000\000\004\000\004\000\000\000\
- \004\000\004\000\004\000\000\000\004\000\006\000\004\000\035\000\
- \000\000\033\000\000\000\006\000\004\000\061\000\000\000\063\000\
- \004\000\004\000\004\000\062\000\000\000\000\000\000\000\004\000\
- \000\000\000\000\004\000\004\000\004\000\000\000\000\000\060\000\
- \004\000\004\000\000\000\004\000\004\000\004\000\000\000\000\000\
- \000\000\000\000\004\000\000\000\004\000\000\000\000\000\000\000\
- \004\000\004\000\004\000\004\000\004\000\004\000\004\000\000\000\
- \000\000\037\000\000\000\020\000\020\000\020\000\020\000\020\000\
- \020\000\020\000\020\000\020\000\020\000\255\255\255\255\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\255\255\004\000\
- \036\000\004\000\000\000\000\000\004\000\000\000\000\000\034\000\
- \000\000\000\000\037\000\000\000\020\000\020\000\020\000\020\000\
- \020\000\020\000\020\000\020\000\020\000\020\000\000\000\000\000\
- \000\000\000\000\020\000\000\000\000\000\000\000\038\000\000\000\
- \036\000\036\000\004\000\000\000\004\000\000\000\000\000\035\000\
- \034\000\033\000\000\000\039\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\040\000\000\000\000\000\000\000\
- \072\000\069\000\000\000\020\000\068\000\000\000\038\000\000\000\
- \000\000\036\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \035\000\000\000\033\000\039\000\022\000\000\000\000\000\072\000\
- \000\000\071\000\000\000\000\000\040\000\022\000\022\000\022\000\
- \022\000\022\000\022\000\022\000\022\000\022\000\022\000\255\255\
- \000\000\000\000\000\000\000\000\030\000\000\000\022\000\022\000\
- \022\000\022\000\022\000\022\000\022\000\022\000\022\000\022\000\
- \022\000\022\000\022\000\022\000\022\000\022\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\022\000\022\000\
- \022\000\022\000\022\000\022\000\022\000\022\000\022\000\022\000\
- \022\000\022\000\022\000\022\000\022\000\022\000\022\000\022\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\
+ \023\000\022\000\022\000\022\000\022\000\022\000\022\000\022\000\
+ \022\000\022\000\013\000\012\000\017\000\006\000\007\000\026\000\
+ \009\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\011\000\003\000\005\000\009\000\025\000\
+ \015\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\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\
+ \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\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\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\
+ \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\
+ \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\
- \041\000\041\000\041\000\041\000\041\000\041\000\041\000\041\000\
- \041\000\041\000\095\000\000\000\000\000\105\000\000\000\000\000\
- \067\000\041\000\041\000\041\000\041\000\041\000\041\000\047\000\
- \047\000\047\000\047\000\047\000\047\000\047\000\047\000\047\000\
- \047\000\000\000\028\000\000\000\000\000\000\000\000\000\067\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\
+ \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\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\041\000\041\000\041\000\041\000\041\000\041\000\066\000\
- \066\000\066\000\066\000\066\000\066\000\066\000\066\000\066\000\
- \066\000\000\000\000\000\000\000\000\000\022\000\022\000\022\000\
- \022\000\022\000\022\000\022\000\022\000\022\000\022\000\022\000\
- \022\000\022\000\022\000\022\000\022\000\022\000\022\000\022\000\
- \022\000\022\000\022\000\022\000\106\000\022\000\022\000\022\000\
- \022\000\022\000\022\000\022\000\022\000\022\000\022\000\022\000\
- \022\000\022\000\022\000\022\000\022\000\022\000\022\000\022\000\
- \022\000\022\000\022\000\022\000\022\000\022\000\022\000\022\000\
- \022\000\022\000\022\000\022\000\023\000\022\000\022\000\022\000\
- \022\000\022\000\022\000\022\000\022\000\023\000\023\000\023\000\
- \023\000\023\000\023\000\023\000\023\000\023\000\023\000\255\255\
- \000\000\000\000\000\000\000\000\000\000\000\000\023\000\023\000\
- \023\000\023\000\023\000\023\000\023\000\023\000\023\000\023\000\
- \023\000\023\000\023\000\023\000\023\000\023\000\023\000\023\000\
- \023\000\023\000\023\000\023\000\023\000\023\000\023\000\023\000\
- \000\000\000\000\000\000\000\000\023\000\000\000\023\000\023\000\
- \023\000\023\000\023\000\023\000\023\000\023\000\023\000\023\000\
- \023\000\023\000\023\000\023\000\023\000\023\000\023\000\023\000\
- \023\000\023\000\023\000\023\000\023\000\023\000\023\000\023\000\
- \041\000\041\000\041\000\041\000\041\000\041\000\041\000\041\000\
- \041\000\041\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\041\000\041\000\041\000\041\000\041\000\041\000\000\000\
- \000\000\000\000\000\000\000\000\034\000\100\000\100\000\100\000\
- \100\000\100\000\100\000\100\000\100\000\100\000\100\000\000\000\
- \000\000\000\000\030\000\000\000\000\000\140\000\000\000\041\000\
- \096\000\041\000\041\000\041\000\041\000\041\000\041\000\000\000\
- \000\000\000\000\000\000\000\000\035\000\000\000\033\000\000\000\
- \000\000\000\000\000\000\000\000\028\000\023\000\023\000\023\000\
- \023\000\023\000\023\000\023\000\023\000\023\000\023\000\023\000\
- \023\000\023\000\023\000\023\000\023\000\023\000\023\000\023\000\
- \023\000\023\000\023\000\023\000\139\000\023\000\023\000\023\000\
- \023\000\023\000\023\000\023\000\023\000\023\000\023\000\023\000\
- \023\000\023\000\023\000\023\000\023\000\023\000\023\000\023\000\
- \023\000\023\000\023\000\023\000\023\000\023\000\023\000\023\000\
- \023\000\023\000\023\000\023\000\000\000\023\000\023\000\023\000\
- \023\000\023\000\023\000\023\000\023\000\004\000\000\000\000\000\
- \004\000\004\000\004\000\000\000\000\000\000\000\004\000\004\000\
- \000\000\004\000\004\000\004\000\101\000\101\000\101\000\101\000\
- \101\000\101\000\101\000\101\000\101\000\101\000\004\000\000\000\
- \004\000\004\000\004\000\004\000\004\000\000\000\000\000\093\000\
- \000\000\000\000\092\000\000\000\000\000\000\000\000\000\000\000\
- \044\000\044\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\
- \000\000\000\000\004\000\031\000\094\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\044\000\
- \004\000\004\000\004\000\000\000\004\000\004\000\004\000\000\000\
- \000\000\000\000\004\000\004\000\000\000\004\000\004\000\004\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\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\
+ \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\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\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\090\000\004\000\000\000\004\000\004\000\004\000\004\000\
- \004\000\112\000\112\000\112\000\112\000\112\000\112\000\112\000\
- \112\000\112\000\112\000\032\000\032\000\032\000\032\000\032\000\
- \032\000\032\000\032\000\032\000\032\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\004\000\029\000\
- \085\000\029\000\029\000\029\000\029\000\029\000\029\000\029\000\
- \029\000\029\000\029\000\029\000\029\000\029\000\029\000\029\000\
- \029\000\029\000\029\000\029\000\029\000\029\000\029\000\029\000\
- \029\000\029\000\029\000\000\000\004\000\000\000\004\000\000\000\
- \000\000\000\000\000\000\031\000\031\000\031\000\031\000\031\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\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\
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\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\
\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\057\000\057\000\057\000\057\000\
- \057\000\057\000\057\000\057\000\057\000\057\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\057\000\057\000\057\000\
- \057\000\057\000\057\000\000\000\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\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\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\057\000\057\000\057\000\
- \057\000\057\000\057\000\000\000\000\000\255\255\000\000\029\000\
- \029\000\029\000\029\000\029\000\029\000\029\000\029\000\029\000\
- \029\000\029\000\029\000\029\000\029\000\029\000\029\000\029\000\
- \029\000\029\000\029\000\029\000\029\000\029\000\029\000\029\000\
- \029\000\029\000\029\000\029\000\029\000\029\000\029\000\029\000\
- \029\000\029\000\029\000\029\000\029\000\029\000\029\000\029\000\
- \029\000\029\000\030\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\029\000\029\000\029\000\029\000\029\000\029\000\029\000\
- \029\000\029\000\029\000\029\000\029\000\029\000\029\000\029\000\
- \029\000\029\000\029\000\029\000\029\000\029\000\029\000\029\000\
- \029\000\029\000\029\000\000\000\000\000\000\000\000\000\029\000\
- \000\000\029\000\029\000\029\000\029\000\029\000\029\000\029\000\
- \029\000\029\000\029\000\029\000\029\000\029\000\029\000\029\000\
- \029\000\029\000\029\000\029\000\029\000\029\000\029\000\029\000\
- \029\000\029\000\029\000\042\000\042\000\042\000\042\000\042\000\
- \042\000\042\000\042\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\047\000\047\000\047\000\047\000\047\000\047\000\047\000\
- \047\000\047\000\047\000\000\000\000\000\000\000\000\000\034\000\
- \000\000\000\000\047\000\047\000\047\000\047\000\047\000\047\000\
\000\000\000\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\000\000\000\000\000\000\000\000\000\000\000\000\035\000\
- \000\000\033\000\047\000\047\000\047\000\047\000\047\000\047\000\
- \029\000\029\000\029\000\029\000\029\000\029\000\029\000\029\000\
- \029\000\029\000\029\000\029\000\029\000\029\000\029\000\029\000\
- \029\000\029\000\029\000\029\000\029\000\029\000\029\000\000\000\
- \029\000\029\000\029\000\029\000\029\000\029\000\029\000\029\000\
- \029\000\029\000\029\000\029\000\029\000\029\000\029\000\029\000\
- \029\000\029\000\029\000\029\000\029\000\029\000\029\000\029\000\
- \029\000\029\000\029\000\029\000\029\000\029\000\029\000\031\000\
- \029\000\029\000\029\000\029\000\029\000\029\000\029\000\029\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\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\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\031\000\
- \031\000\031\000\031\000\000\000\000\000\000\000\000\000\072\000\
- \069\000\000\000\000\000\068\000\000\000\000\000\000\000\000\000\
- \102\000\102\000\102\000\102\000\102\000\102\000\102\000\102\000\
- \102\000\102\000\000\000\000\000\000\000\000\000\072\000\000\000\
- \071\000\102\000\102\000\102\000\102\000\102\000\102\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\066\000\066\000\
- \066\000\066\000\066\000\066\000\066\000\066\000\066\000\066\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\102\000\102\000\102\000\102\000\102\000\102\000\000\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\031\000\031\000\000\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\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\
+ \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\
\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\
- \055\000\004\000\055\000\000\000\004\000\004\000\004\000\055\000\
- \000\000\000\000\004\000\004\000\000\000\004\000\004\000\004\000\
- \054\000\054\000\054\000\054\000\054\000\054\000\054\000\054\000\
- \054\000\054\000\004\000\000\000\004\000\004\000\004\000\004\000\
- \004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \004\000\000\000\000\000\004\000\004\000\004\000\000\000\000\000\
- \000\000\004\000\004\000\000\000\004\000\004\000\004\000\000\000\
- \000\000\000\000\000\000\000\000\055\000\000\000\004\000\000\000\
- \000\000\004\000\055\000\004\000\004\000\004\000\004\000\004\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\055\000\000\000\
- \000\000\000\000\055\000\000\000\055\000\000\000\004\000\000\000\
- \053\000\004\000\004\000\004\000\004\000\000\000\004\000\004\000\
- \004\000\000\000\004\000\004\000\004\000\004\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\
- \000\000\004\000\004\000\064\000\004\000\004\000\255\255\000\000\
- \000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\
- \004\000\004\000\004\000\004\000\000\000\004\000\004\000\004\000\
- \000\000\004\000\004\000\004\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\004\000\000\000\000\000\004\000\000\000\
- \004\000\004\000\065\000\004\000\004\000\000\000\000\000\000\000\
- \004\000\000\000\000\000\004\000\004\000\004\000\000\000\000\000\
- \000\000\004\000\004\000\000\000\004\000\004\000\004\000\000\000\
- \000\000\004\000\000\000\004\000\000\000\000\000\000\000\000\000\
- \000\000\004\000\004\000\004\000\004\000\004\000\004\000\004\000\
- \103\000\103\000\103\000\103\000\103\000\103\000\103\000\103\000\
- \103\000\103\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\103\000\103\000\103\000\103\000\103\000\103\000\000\000\
- \004\000\000\000\004\000\000\000\000\000\004\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\103\000\103\000\103\000\103\000\103\000\103\000\000\000\
- \000\000\000\000\000\000\004\000\000\000\004\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\114\000\
- \255\255\255\255\114\000\114\000\114\000\000\000\255\255\255\255\
- \114\000\114\000\255\255\114\000\114\000\114\000\113\000\113\000\
- \113\000\113\000\113\000\113\000\113\000\113\000\113\000\113\000\
- \114\000\255\255\114\000\114\000\114\000\114\000\114\000\113\000\
- \113\000\113\000\113\000\113\000\113\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\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\255\255\255\255\114\000\000\000\255\255\113\000\
- \113\000\113\000\113\000\113\000\113\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\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\114\000\255\255\114\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\080\000\080\000\
- \080\000\080\000\080\000\080\000\080\000\080\000\080\000\080\000\
- \051\000\000\000\000\000\078\000\000\000\000\000\000\000\080\000\
- \080\000\080\000\080\000\080\000\080\000\255\255\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \080\000\000\000\000\000\000\000\000\000\079\000\084\000\000\000\
- \083\000\000\000\000\000\000\000\000\000\000\000\000\000\080\000\
- \080\000\080\000\080\000\080\000\080\000\255\255\000\000\000\000\
- \000\000\000\000\082\000\000\000\000\000\000\000\255\255\081\000\
- \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
- \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
- \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
- \081\000\000\000\000\000\000\000\000\000\081\000\000\000\081\000\
- \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
- \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
- \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
- \081\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\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\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\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\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\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\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\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\
\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\
\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\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\
+ \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\
+ \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\000\000\000\000\000\000\000\000\000\000\081\000\081\000\
- \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
- \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
- \081\000\081\000\081\000\081\000\081\000\000\000\081\000\081\000\
- \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
- \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
- \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
- \081\000\081\000\081\000\081\000\081\000\000\000\081\000\081\000\
- \081\000\081\000\081\000\081\000\081\000\081\000\050\000\081\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\
- \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
- \081\000\081\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
- \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
- \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
- \081\000\081\000\081\000\000\000\000\000\000\000\000\000\081\000\
- \000\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
- \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
- \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
- \081\000\081\000\081\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\089\000\089\000\089\000\089\000\089\000\089\000\089\000\
- \089\000\089\000\089\000\089\000\089\000\089\000\089\000\089\000\
- \089\000\089\000\089\000\089\000\089\000\089\000\089\000\089\000\
- \089\000\089\000\089\000\000\000\000\000\000\000\000\000\089\000\
- \000\000\089\000\089\000\089\000\089\000\089\000\089\000\089\000\
- \089\000\089\000\089\000\089\000\089\000\089\000\089\000\089\000\
- \089\000\089\000\089\000\089\000\089\000\089\000\089\000\089\000\
- \089\000\089\000\089\000\000\000\000\000\000\000\000\000\000\000\
- \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
- \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
- \081\000\081\000\081\000\081\000\081\000\081\000\081\000\000\000\
- \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
- \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
- \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
- \081\000\081\000\081\000\081\000\081\000\081\000\081\000\000\000\
- \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
- \089\000\089\000\089\000\089\000\089\000\089\000\089\000\089\000\
- \089\000\089\000\089\000\089\000\089\000\089\000\089\000\089\000\
- \089\000\089\000\089\000\089\000\089\000\089\000\089\000\000\000\
- \089\000\089\000\089\000\089\000\089\000\089\000\089\000\089\000\
- \089\000\089\000\089\000\089\000\089\000\089\000\089\000\089\000\
- \089\000\089\000\089\000\089\000\089\000\089\000\089\000\089\000\
- \089\000\089\000\089\000\089\000\089\000\089\000\089\000\000\000\
- \089\000\089\000\089\000\089\000\089\000\089\000\089\000\089\000\
- \088\000\088\000\088\000\088\000\088\000\088\000\088\000\088\000\
- \088\000\088\000\088\000\088\000\088\000\088\000\088\000\088\000\
- \088\000\088\000\088\000\088\000\088\000\088\000\088\000\088\000\
- \088\000\088\000\000\000\000\000\000\000\000\000\088\000\000\000\
- \088\000\088\000\088\000\088\000\088\000\088\000\088\000\088\000\
- \088\000\088\000\088\000\088\000\088\000\088\000\088\000\088\000\
- \088\000\088\000\088\000\088\000\088\000\088\000\088\000\088\000\
- \088\000\088\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\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\
\000\000\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\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\000\000\088\000\
- \088\000\088\000\088\000\088\000\088\000\088\000\088\000\088\000\
- \088\000\088\000\088\000\088\000\088\000\088\000\088\000\088\000\
- \088\000\088\000\088\000\088\000\088\000\088\000\000\000\088\000\
- \088\000\088\000\088\000\088\000\088\000\088\000\088\000\088\000\
- \088\000\088\000\088\000\088\000\088\000\088\000\088\000\088\000\
- \088\000\088\000\088\000\088\000\088\000\088\000\088\000\088\000\
- \088\000\088\000\088\000\088\000\088\000\088\000\088\000\088\000\
- \088\000\088\000\088\000\088\000\088\000\088\000\088\000\088\000\
- \088\000\088\000\088\000\088\000\088\000\088\000\088\000\088\000\
- \088\000\000\000\000\000\030\000\000\000\000\000\000\000\086\000\
- \088\000\088\000\088\000\088\000\088\000\088\000\088\000\088\000\
- \088\000\088\000\088\000\088\000\088\000\088\000\088\000\088\000\
- \088\000\088\000\088\000\088\000\088\000\088\000\088\000\088\000\
- \088\000\088\000\000\000\000\000\000\000\000\000\088\000\000\000\
- \088\000\088\000\088\000\088\000\088\000\088\000\088\000\088\000\
- \088\000\088\000\088\000\088\000\088\000\088\000\088\000\088\000\
- \088\000\088\000\088\000\088\000\088\000\088\000\088\000\088\000\
- \088\000\088\000\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\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\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\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\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\000\000\088\000\
- \088\000\088\000\088\000\088\000\088\000\088\000\088\000\088\000\
- \088\000\088\000\088\000\088\000\088\000\088\000\088\000\088\000\
- \088\000\088\000\088\000\088\000\088\000\088\000\000\000\088\000\
- \088\000\088\000\088\000\088\000\088\000\088\000\088\000\088\000\
- \088\000\088\000\088\000\088\000\088\000\088\000\088\000\088\000\
- \088\000\088\000\088\000\088\000\088\000\088\000\088\000\088\000\
- \088\000\088\000\088\000\088\000\088\000\088\000\089\000\088\000\
- \088\000\088\000\088\000\088\000\088\000\088\000\088\000\089\000\
- \089\000\089\000\089\000\089\000\089\000\089\000\089\000\089\000\
- \089\000\000\000\000\000\030\000\000\000\000\000\000\000\000\000\
- \089\000\089\000\089\000\089\000\089\000\089\000\089\000\089\000\
- \089\000\089\000\089\000\089\000\089\000\089\000\089\000\089\000\
- \089\000\089\000\089\000\089\000\089\000\089\000\089\000\089\000\
- \089\000\089\000\000\000\000\000\000\000\000\000\089\000\000\000\
- \089\000\089\000\089\000\089\000\089\000\089\000\089\000\089\000\
- \089\000\089\000\089\000\089\000\089\000\089\000\089\000\089\000\
- \089\000\089\000\089\000\089\000\089\000\089\000\089\000\089\000\
- \089\000\089\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\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\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\000\000\089\000\
- \089\000\089\000\089\000\089\000\089\000\089\000\089\000\089\000\
- \089\000\089\000\089\000\089\000\089\000\089\000\089\000\089\000\
- \089\000\089\000\089\000\089\000\089\000\089\000\000\000\089\000\
- \089\000\089\000\089\000\089\000\089\000\089\000\089\000\089\000\
- \089\000\089\000\089\000\089\000\089\000\089\000\089\000\089\000\
- \089\000\089\000\089\000\089\000\089\000\089\000\089\000\089\000\
- \089\000\089\000\089\000\089\000\089\000\089\000\000\000\089\000\
- \089\000\089\000\089\000\089\000\089\000\089\000\089\000\099\000\
- \000\000\099\000\000\000\000\000\111\000\000\000\099\000\110\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\000\000\098\000\
- \098\000\098\000\098\000\098\000\098\000\098\000\098\000\098\000\
- \098\000\000\000\030\000\000\000\030\000\000\000\000\000\000\000\
- \000\000\030\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\109\000\109\000\109\000\109\000\109\000\109\000\
- \109\000\109\000\109\000\109\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\099\000\000\000\000\000\000\000\000\000\
- \000\000\099\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\099\000\000\000\000\000\
- \000\000\099\000\000\000\099\000\000\000\000\000\030\000\097\000\
- \000\000\000\000\000\000\000\000\030\000\116\000\000\000\000\000\
- \116\000\116\000\116\000\000\000\000\000\000\000\116\000\116\000\
- \030\000\116\000\116\000\116\000\030\000\000\000\030\000\000\000\
- \000\000\000\000\108\000\000\000\000\000\000\000\116\000\000\000\
- \116\000\116\000\116\000\116\000\116\000\117\000\117\000\117\000\
- \117\000\117\000\117\000\117\000\117\000\117\000\117\000\117\000\
- \117\000\117\000\117\000\117\000\117\000\117\000\117\000\117\000\
- \117\000\117\000\117\000\117\000\117\000\117\000\117\000\000\000\
- \000\000\000\000\116\000\117\000\000\000\117\000\117\000\117\000\
- \117\000\117\000\117\000\117\000\117\000\117\000\117\000\117\000\
- \117\000\117\000\117\000\117\000\117\000\117\000\117\000\117\000\
- \117\000\117\000\117\000\117\000\117\000\117\000\117\000\000\000\
- \116\000\000\000\116\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\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\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\
- \000\000\000\000\255\255\000\000\117\000\117\000\117\000\117\000\
- \117\000\117\000\117\000\117\000\117\000\117\000\117\000\117\000\
- \117\000\117\000\117\000\117\000\117\000\117\000\117\000\117\000\
- \117\000\117\000\117\000\000\000\117\000\117\000\117\000\117\000\
- \117\000\117\000\117\000\117\000\117\000\117\000\117\000\117\000\
- \117\000\117\000\117\000\117\000\117\000\117\000\117\000\117\000\
- \117\000\117\000\117\000\117\000\117\000\117\000\117\000\117\000\
- \117\000\117\000\117\000\000\000\117\000\117\000\117\000\117\000\
- \117\000\117\000\117\000\117\000\116\000\000\000\000\000\116\000\
- \116\000\116\000\000\000\000\000\000\000\116\000\116\000\000\000\
- \116\000\116\000\116\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\116\000\000\000\116\000\
- \116\000\116\000\116\000\116\000\000\000\000\000\000\000\000\000\
- \117\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\117\000\117\000\117\000\117\000\117\000\117\000\117\000\
- \117\000\117\000\117\000\000\000\000\000\028\000\000\000\000\000\
- \000\000\116\000\117\000\117\000\117\000\117\000\117\000\117\000\
- \117\000\117\000\117\000\117\000\117\000\117\000\117\000\117\000\
- \117\000\117\000\117\000\117\000\117\000\117\000\117\000\117\000\
- \117\000\117\000\117\000\117\000\000\000\000\000\000\000\116\000\
- \117\000\116\000\117\000\117\000\117\000\117\000\117\000\117\000\
- \117\000\117\000\117\000\117\000\117\000\117\000\117\000\117\000\
- \117\000\117\000\117\000\117\000\117\000\117\000\117\000\117\000\
- \117\000\117\000\117\000\117\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\
@@ -3112,176 +3344,177 @@ module Struct =
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\117\000\117\000\117\000\117\000\117\000\117\000\117\000\
- \117\000\117\000\117\000\117\000\117\000\117\000\117\000\117\000\
- \117\000\117\000\117\000\117\000\117\000\117\000\117\000\117\000\
- \000\000\117\000\117\000\117\000\117\000\117\000\117\000\117\000\
- \117\000\117\000\117\000\117\000\117\000\117\000\117\000\117\000\
- \117\000\117\000\117\000\117\000\117\000\117\000\117\000\117\000\
- \117\000\117\000\117\000\117\000\117\000\117\000\117\000\117\000\
- \000\000\117\000\117\000\117\000\117\000\117\000\117\000\117\000\
- \117\000\119\000\000\000\000\000\119\000\119\000\119\000\000\000\
- \000\000\000\000\119\000\119\000\000\000\119\000\119\000\119\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\
+ \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\
+ \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\
+ \163\000\163\000\163\000\163\000\163\000\163\000\000\000\162\000\
+ \000\000\162\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\
+ \163\000\163\000\163\000\163\000\163\000\163\000\000\000\162\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\119\000\000\000\119\000\119\000\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\000\000\000\000\000\000\119\000\120\000\
- \000\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\000\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\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\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\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\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\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\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\
+ \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\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\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\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\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\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\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\000\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\120\000\000\000\
- \120\000\120\000\120\000\120\000\120\000\120\000\120\000\120\000\
- \119\000\000\000\000\000\119\000\119\000\119\000\000\000\000\000\
- \000\000\119\000\119\000\000\000\119\000\119\000\119\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\119\000\000\000\119\000\119\000\119\000\119\000\119\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\120\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\000\000\120\000\
- \120\000\120\000\120\000\120\000\120\000\120\000\120\000\120\000\
- \120\000\000\000\000\000\028\000\000\000\119\000\000\000\121\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\000\000\119\000\000\000\119\000\120\000\000\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\000\000\000\000\000\000\000\000\000\000\000\000\
- \122\000\122\000\122\000\122\000\122\000\122\000\122\000\122\000\
- \122\000\122\000\122\000\122\000\122\000\122\000\122\000\122\000\
- \122\000\122\000\122\000\122\000\122\000\122\000\122\000\122\000\
- \122\000\122\000\000\000\000\000\000\000\000\000\122\000\000\000\
- \122\000\122\000\122\000\122\000\122\000\122\000\122\000\122\000\
- \122\000\122\000\122\000\122\000\122\000\122\000\122\000\122\000\
- \122\000\122\000\122\000\122\000\122\000\122\000\122\000\122\000\
- \122\000\122\000\000\000\000\000\000\000\000\000\000\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\000\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\120\000\000\000\120\000\
- \120\000\120\000\120\000\120\000\120\000\120\000\120\000\122\000\
- \122\000\122\000\122\000\122\000\122\000\122\000\122\000\122\000\
- \122\000\122\000\122\000\122\000\122\000\122\000\122\000\122\000\
- \122\000\122\000\122\000\122\000\122\000\122\000\000\000\122\000\
- \122\000\122\000\122\000\122\000\122\000\122\000\122\000\122\000\
- \122\000\122\000\122\000\122\000\122\000\122\000\122\000\122\000\
- \122\000\122\000\122\000\122\000\122\000\122\000\122\000\122\000\
- \122\000\122\000\122\000\122\000\122\000\122\000\122\000\122\000\
- \122\000\122\000\122\000\122\000\122\000\122\000\122\000\122\000\
- \122\000\122\000\122\000\122\000\122\000\122\000\122\000\122\000\
- \122\000\000\000\000\000\123\000\000\000\000\000\000\000\000\000\
- \122\000\122\000\122\000\122\000\122\000\122\000\122\000\122\000\
- \122\000\122\000\122\000\122\000\122\000\122\000\122\000\122\000\
- \122\000\122\000\122\000\122\000\122\000\122\000\122\000\122\000\
- \122\000\122\000\000\000\000\000\000\000\000\000\122\000\000\000\
- \122\000\122\000\122\000\122\000\122\000\122\000\122\000\122\000\
- \122\000\122\000\122\000\122\000\122\000\122\000\122\000\122\000\
- \122\000\122\000\122\000\122\000\122\000\122\000\122\000\122\000\
- \122\000\122\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\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\000\000\000\000\000\000\000\000\000\000\122\000\
- \122\000\122\000\122\000\122\000\122\000\122\000\122\000\122\000\
- \122\000\122\000\122\000\122\000\122\000\122\000\122\000\122\000\
- \122\000\122\000\122\000\122\000\122\000\122\000\000\000\122\000\
- \122\000\122\000\122\000\122\000\122\000\122\000\122\000\122\000\
- \122\000\122\000\122\000\122\000\122\000\122\000\122\000\122\000\
- \122\000\122\000\122\000\122\000\122\000\122\000\122\000\122\000\
- \122\000\122\000\122\000\122\000\122\000\122\000\000\000\122\000\
- \122\000\122\000\122\000\122\000\122\000\122\000\122\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\000\000\131\000\
- \131\000\131\000\131\000\131\000\131\000\131\000\131\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\000\000\000\000\000\000\000\000\130\000\000\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\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\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\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\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\000\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\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\
- \000\000\000\000\028\000\000\000\000\000\000\000\128\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\000\000\000\000\000\000\000\000\130\000\000\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\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\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\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\000\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\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\
- \000\000\000\000\028\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\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\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
@@ -3289,26 +3522,26 @@ module Struct =
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\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\000\000\131\000\131\000\
- \131\000\131\000\131\000\131\000\131\000\131\000\028\000\000\000\
- \000\000\134\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \133\000\000\000\134\000\134\000\134\000\134\000\134\000\134\000\
- \134\000\134\000\134\000\134\000\085\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\134\000\134\000\134\000\000\000\000\000\000\000\
- \000\000\134\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\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\
+ \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\
+ \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\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\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
@@ -3316,26 +3549,26 @@ module Struct =
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\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\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\255\255\180\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\000\000\134\000\134\000\134\000\134\000\134\000\134\000\
- \134\000\134\000\255\255\137\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\137\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\085\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\000\000\
- \000\000\000\000\000\000\137\000\000\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\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\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
@@ -3344,25 +3577,25 @@ module Struct =
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\137\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\000\000\137\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\000\000\137\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\136\000\000\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\085\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\137\000\
- \000\000\000\000\000\000\000\000\137\000\000\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\137\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\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
@@ -3371,56 +3604,56 @@ module Struct =
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\000\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\085\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\137\000\
- \000\000\000\000\000\000\000\000\137\000\000\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\137\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\
- \144\000\144\000\144\000\144\000\144\000\144\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\144\000\000\000\144\000\144\000\
- \144\000\144\000\144\000\144\000\144\000\144\000\144\000\144\000\
- \144\000\144\000\144\000\144\000\144\000\144\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\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\000\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\000\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\144\000\144\000\144\000\
- \144\000\144\000\144\000\144\000\144\000\144\000\144\000\144\000\
- \144\000\144\000\144\000\144\000\144\000\144\000\144\000\144\000\
- \144\000\144\000\144\000\144\000\000\000\144\000\144\000\144\000\
- \144\000\144\000\144\000\144\000\144\000\144\000\144\000\144\000\
- \144\000\144\000\144\000\144\000\144\000\144\000\144\000\144\000\
- \144\000\144\000\144\000\144\000\144\000\144\000\144\000\144\000\
- \144\000\144\000\144\000\144\000\000\000\144\000\144\000\144\000\
- \144\000\144\000\144\000\144\000\144\000\143\000\143\000\143\000\
- \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
- \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
- \143\000\143\000\143\000\143\000\143\000\143\000\143\000\000\000\
- \000\000\000\000\000\000\143\000\000\000\143\000\143\000\143\000\
- \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
- \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
- \143\000\143\000\143\000\143\000\143\000\143\000\143\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\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
@@ -3429,24 +3662,24 @@ module Struct =
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\143\000\143\000\143\000\143\000\
- \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
- \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
- \143\000\143\000\143\000\000\000\143\000\143\000\143\000\143\000\
- \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
- \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
- \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
- \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
- \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
- \143\000\143\000\143\000\143\000\143\000\143\000\000\000\000\000\
- \032\000\000\000\000\000\000\000\141\000\143\000\143\000\143\000\
- \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
- \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
- \143\000\143\000\143\000\143\000\143\000\143\000\143\000\000\000\
- \000\000\000\000\000\000\143\000\000\000\143\000\143\000\143\000\
- \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
- \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
- \143\000\143\000\143\000\143\000\143\000\143\000\143\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\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
@@ -3455,24 +3688,24 @@ module Struct =
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\143\000\143\000\143\000\143\000\
- \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
- \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
- \143\000\143\000\143\000\000\000\143\000\143\000\143\000\143\000\
- \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
- \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
- \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
- \143\000\143\000\143\000\144\000\143\000\143\000\143\000\143\000\
- \143\000\143\000\143\000\143\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\
- \032\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\144\000\
- \144\000\144\000\144\000\144\000\144\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\144\000\000\000\144\000\144\000\144\000\
- \144\000\144\000\144\000\144\000\144\000\144\000\144\000\144\000\
- \144\000\144\000\144\000\144\000\144\000\144\000\144\000\144\000\
- \144\000\144\000\144\000\144\000\144\000\144\000\144\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\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
@@ -3481,19 +3714,19 @@ module Struct =
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\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\144\000\144\000\144\000\
- \144\000\144\000\144\000\144\000\144\000\144\000\144\000\144\000\
- \144\000\144\000\144\000\144\000\144\000\144\000\144\000\144\000\
- \144\000\144\000\144\000\000\000\144\000\144\000\144\000\144\000\
- \144\000\144\000\144\000\144\000\144\000\144\000\144\000\144\000\
- \144\000\144\000\144\000\144\000\144\000\144\000\144\000\144\000\
- \144\000\144\000\144\000\144\000\144\000\144\000\144\000\144\000\
- \144\000\144\000\144\000\000\000\144\000\144\000\144\000\144\000\
- \144\000\144\000\144\000\144\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";
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\027\000\000\000\000\000\068\000\074\000\
- \078\000\105\000\125\000\140\000\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\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\
@@ -3506,681 +3739,874 @@ module Struct =
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\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\
- \011\000\012\000\013\000\014\000\012\000\012\000\017\000\026\000\
- \038\000\038\000\026\000\039\000\039\000\039\000\039\000\039\000\
- \039\000\039\000\039\000\047\000\049\000\010\000\055\000\010\000\
- \058\000\082\000\014\000\082\000\083\000\084\000\026\000\082\000\
- \091\000\048\000\092\000\093\000\012\000\094\000\099\000\101\000\
- \103\000\126\000\014\000\014\000\014\000\014\000\014\000\014\000\
- \014\000\014\000\014\000\014\000\045\000\045\000\045\000\045\000\
- \045\000\045\000\045\000\045\000\045\000\045\000\048\000\092\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\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\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\020\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\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\144\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
- \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
- \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
- \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
- \003\000\003\000\004\000\003\000\003\000\004\000\004\000\004\000\
- \255\255\003\000\003\000\004\000\004\000\003\000\004\000\004\000\
- \004\000\037\000\037\000\037\000\037\000\037\000\037\000\037\000\
- \037\000\037\000\037\000\004\000\003\000\004\000\004\000\004\000\
- \004\000\004\000\036\000\255\255\036\000\255\255\037\000\036\000\
- \036\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\
- \036\000\054\000\054\000\054\000\054\000\054\000\054\000\054\000\
- \054\000\054\000\054\000\111\000\003\000\003\000\003\000\004\000\
- \037\000\003\000\110\000\110\000\255\255\255\255\037\000\070\000\
- \073\000\255\255\070\000\073\000\133\000\255\255\136\000\127\000\
- \018\000\127\000\111\000\018\000\255\255\127\000\255\255\255\255\
- \133\000\110\000\136\000\255\255\003\000\004\000\003\000\004\000\
- \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
- \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
- \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
- \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
- \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
- \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
- \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
- \003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
- \003\000\007\000\018\000\255\255\007\000\007\000\007\000\255\255\
- \255\255\255\255\007\000\007\000\255\255\007\000\007\000\007\000\
- \255\255\071\000\255\255\255\255\071\000\139\000\124\000\139\000\
- \003\000\124\000\007\000\139\000\007\000\007\000\007\000\007\000\
- \007\000\255\255\255\255\043\000\043\000\255\255\255\255\008\000\
- \255\255\071\000\008\000\008\000\008\000\255\255\255\255\255\255\
- \008\000\008\000\255\255\008\000\008\000\008\000\255\255\255\255\
- \003\000\255\255\255\255\255\255\255\255\007\000\007\000\043\000\
- \008\000\003\000\008\000\008\000\008\000\008\000\008\000\255\255\
- \124\000\255\255\124\000\255\255\015\000\255\255\255\255\015\000\
- \015\000\015\000\043\000\255\255\255\255\015\000\015\000\255\255\
- \015\000\015\000\015\000\255\255\007\000\007\000\007\000\043\000\
- \255\255\043\000\255\255\008\000\008\000\015\000\255\255\015\000\
- \015\000\015\000\015\000\015\000\255\255\255\255\255\255\016\000\
- \255\255\255\255\016\000\016\000\016\000\255\255\255\255\016\000\
- \016\000\016\000\255\255\016\000\016\000\016\000\255\255\255\255\
- \255\255\255\255\008\000\255\255\008\000\255\255\255\255\255\255\
- \016\000\015\000\016\000\016\000\016\000\016\000\016\000\255\255\
- \255\255\020\000\255\255\020\000\020\000\020\000\020\000\020\000\
- \020\000\020\000\020\000\020\000\020\000\070\000\073\000\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\018\000\015\000\
- \020\000\015\000\255\255\255\255\016\000\255\255\255\255\020\000\
- \255\255\255\255\021\000\255\255\021\000\021\000\021\000\021\000\
- \021\000\021\000\021\000\021\000\021\000\021\000\255\255\255\255\
- \255\255\255\255\020\000\255\255\255\255\255\255\021\000\255\255\
- \020\000\021\000\016\000\255\255\016\000\255\255\255\255\020\000\
- \021\000\020\000\255\255\021\000\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\021\000\255\255\255\255\255\255\
- \072\000\072\000\255\255\021\000\072\000\255\255\021\000\255\255\
- \255\255\021\000\255\255\255\255\255\255\255\255\255\255\255\255\
- \021\000\255\255\021\000\021\000\022\000\255\255\255\255\072\000\
- \255\255\072\000\255\255\255\255\021\000\022\000\022\000\022\000\
- \022\000\022\000\022\000\022\000\022\000\022\000\022\000\071\000\
- \255\255\255\255\255\255\255\255\124\000\255\255\022\000\022\000\
- \022\000\022\000\022\000\022\000\022\000\022\000\022\000\022\000\
- \022\000\022\000\022\000\022\000\022\000\022\000\022\000\022\000\
- \022\000\022\000\022\000\022\000\022\000\022\000\022\000\022\000\
- \255\255\255\255\255\255\255\255\022\000\255\255\022\000\022\000\
- \022\000\022\000\022\000\022\000\022\000\022\000\022\000\022\000\
- \022\000\022\000\022\000\022\000\022\000\022\000\022\000\022\000\
- \022\000\022\000\022\000\022\000\022\000\022\000\022\000\022\000\
- \040\000\040\000\040\000\040\000\040\000\040\000\040\000\040\000\
- \040\000\040\000\104\000\255\255\255\255\104\000\255\255\255\255\
- \067\000\040\000\040\000\040\000\040\000\040\000\040\000\056\000\
- \056\000\056\000\056\000\056\000\056\000\056\000\056\000\056\000\
- \056\000\255\255\104\000\255\255\255\255\255\255\255\255\067\000\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\040\000\040\000\040\000\040\000\040\000\040\000\067\000\
- \067\000\067\000\067\000\067\000\067\000\067\000\067\000\067\000\
- \067\000\255\255\255\255\255\255\255\255\022\000\022\000\022\000\
- \022\000\022\000\022\000\022\000\022\000\022\000\022\000\022\000\
- \022\000\022\000\022\000\022\000\022\000\022\000\022\000\022\000\
- \022\000\022\000\022\000\022\000\104\000\022\000\022\000\022\000\
- \022\000\022\000\022\000\022\000\022\000\022\000\022\000\022\000\
- \022\000\022\000\022\000\022\000\022\000\022\000\022\000\022\000\
- \022\000\022\000\022\000\022\000\022\000\022\000\022\000\022\000\
- \022\000\022\000\022\000\022\000\023\000\022\000\022\000\022\000\
- \022\000\022\000\022\000\022\000\022\000\023\000\023\000\023\000\
- \023\000\023\000\023\000\023\000\023\000\023\000\023\000\072\000\
- \255\255\255\255\255\255\255\255\255\255\255\255\023\000\023\000\
- \023\000\023\000\023\000\023\000\023\000\023\000\023\000\023\000\
- \023\000\023\000\023\000\023\000\023\000\023\000\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\023\000\255\255\023\000\023\000\
- \023\000\023\000\023\000\023\000\023\000\023\000\023\000\023\000\
- \023\000\023\000\023\000\023\000\023\000\023\000\023\000\023\000\
- \023\000\023\000\023\000\023\000\023\000\023\000\023\000\023\000\
- \041\000\041\000\041\000\041\000\041\000\041\000\041\000\041\000\
- \041\000\041\000\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\041\000\041\000\041\000\041\000\041\000\041\000\255\255\
- \255\255\255\255\255\255\255\255\041\000\098\000\098\000\098\000\
- \098\000\098\000\098\000\098\000\098\000\098\000\098\000\255\255\
- \255\255\255\255\138\000\255\255\255\255\138\000\255\255\041\000\
- \104\000\041\000\041\000\041\000\041\000\041\000\041\000\255\255\
- \255\255\255\255\255\255\255\255\041\000\255\255\041\000\255\255\
- \255\255\255\255\255\255\255\255\138\000\023\000\023\000\023\000\
- \023\000\023\000\023\000\023\000\023\000\023\000\023\000\023\000\
- \023\000\023\000\023\000\023\000\023\000\023\000\023\000\023\000\
- \023\000\023\000\023\000\023\000\138\000\023\000\023\000\023\000\
- \023\000\023\000\023\000\023\000\023\000\023\000\023\000\023\000\
- \023\000\023\000\023\000\023\000\023\000\023\000\023\000\023\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\
+ \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\
+ \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\
+ \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\
+ \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\
+ \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\
+ \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\
- \023\000\023\000\023\000\023\000\255\255\023\000\023\000\023\000\
- \023\000\023\000\023\000\023\000\023\000\024\000\255\255\255\255\
- \024\000\024\000\024\000\255\255\255\255\255\255\024\000\024\000\
- \255\255\024\000\024\000\024\000\100\000\100\000\100\000\100\000\
- \100\000\100\000\100\000\100\000\100\000\100\000\024\000\255\255\
- \024\000\024\000\024\000\024\000\024\000\255\255\255\255\079\000\
- \255\255\255\255\079\000\255\255\255\255\255\255\255\255\255\255\
- \044\000\044\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\
- \255\255\255\255\024\000\024\000\079\000\024\000\024\000\024\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\
+ \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\
- \024\000\024\000\024\000\024\000\024\000\024\000\024\000\044\000\
- \024\000\025\000\024\000\255\255\025\000\025\000\025\000\255\255\
- \255\255\255\255\025\000\025\000\255\255\025\000\025\000\025\000\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\079\000\025\000\255\255\025\000\025\000\025\000\025\000\
- \025\000\109\000\109\000\109\000\109\000\109\000\109\000\109\000\
- \109\000\109\000\109\000\112\000\112\000\112\000\112\000\112\000\
- \112\000\112\000\112\000\112\000\112\000\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\025\000\025\000\
- \138\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\255\255\025\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\255\255\024\000\024\000\024\000\024\000\
- \024\000\024\000\024\000\024\000\053\000\053\000\053\000\053\000\
- \053\000\053\000\053\000\053\000\053\000\053\000\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\053\000\053\000\053\000\
- \053\000\053\000\053\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\
+ \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\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\255\255\255\255\255\255\255\255\053\000\053\000\053\000\
- \053\000\053\000\053\000\255\255\255\255\079\000\255\255\025\000\
+ \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\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\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\
\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\029\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\
- \029\000\029\000\029\000\029\000\029\000\029\000\029\000\029\000\
- \029\000\029\000\029\000\255\255\255\255\255\255\255\255\255\255\
- \255\255\029\000\029\000\029\000\029\000\029\000\029\000\029\000\
- \029\000\029\000\029\000\029\000\029\000\029\000\029\000\029\000\
- \029\000\029\000\029\000\029\000\029\000\029\000\029\000\029\000\
- \029\000\029\000\029\000\255\255\255\255\255\255\255\255\029\000\
- \255\255\029\000\029\000\029\000\029\000\029\000\029\000\029\000\
- \029\000\029\000\029\000\029\000\029\000\029\000\029\000\029\000\
- \029\000\029\000\029\000\029\000\029\000\029\000\029\000\029\000\
- \029\000\029\000\029\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\057\000\057\000\057\000\057\000\057\000\057\000\057\000\
- \057\000\057\000\057\000\255\255\255\255\255\255\255\255\042\000\
- \255\255\255\255\057\000\057\000\057\000\057\000\057\000\057\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\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\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\042\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\042\000\
- \255\255\042\000\057\000\057\000\057\000\057\000\057\000\057\000\
- \029\000\029\000\029\000\029\000\029\000\029\000\029\000\029\000\
- \029\000\029\000\029\000\029\000\029\000\029\000\029\000\029\000\
- \029\000\029\000\029\000\029\000\029\000\029\000\029\000\255\255\
- \029\000\029\000\029\000\029\000\029\000\029\000\029\000\029\000\
- \029\000\029\000\029\000\029\000\029\000\029\000\029\000\029\000\
- \029\000\029\000\029\000\029\000\029\000\029\000\029\000\029\000\
- \029\000\029\000\029\000\029\000\029\000\029\000\029\000\031\000\
- \029\000\029\000\029\000\029\000\029\000\029\000\029\000\029\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\
+ \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\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\
+ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\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\
+ \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\
+ \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\
+ \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\
\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\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\031\000\031\000\255\255\255\255\255\255\255\255\066\000\
- \066\000\255\255\255\255\066\000\255\255\255\255\255\255\255\255\
- \097\000\097\000\097\000\097\000\097\000\097\000\097\000\097\000\
- \097\000\097\000\255\255\255\255\255\255\255\255\066\000\255\255\
- \066\000\097\000\097\000\097\000\097\000\097\000\097\000\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\066\000\066\000\
- \066\000\066\000\066\000\066\000\066\000\066\000\066\000\066\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\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\097\000\097\000\097\000\097\000\097\000\097\000\255\255\
- \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
+ \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\
\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\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\255\255\
\031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
- \046\000\061\000\046\000\255\255\061\000\061\000\061\000\046\000\
- \255\255\255\255\061\000\061\000\255\255\061\000\061\000\061\000\
- \046\000\046\000\046\000\046\000\046\000\046\000\046\000\046\000\
- \046\000\046\000\061\000\255\255\061\000\061\000\061\000\061\000\
- \061\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \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\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\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\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\
- \255\255\062\000\062\000\255\255\062\000\062\000\062\000\255\255\
- \255\255\255\255\255\255\255\255\046\000\255\255\061\000\255\255\
- \255\255\062\000\046\000\062\000\062\000\062\000\062\000\062\000\
- \255\255\255\255\255\255\255\255\255\255\255\255\046\000\255\255\
- \255\255\255\255\046\000\255\255\046\000\255\255\063\000\255\255\
- \046\000\063\000\063\000\063\000\061\000\255\255\061\000\063\000\
- \063\000\255\255\063\000\063\000\063\000\062\000\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\063\000\
- \255\255\063\000\063\000\063\000\063\000\063\000\066\000\255\255\
- \255\255\255\255\255\255\255\255\255\255\064\000\255\255\255\255\
- \064\000\064\000\064\000\062\000\255\255\062\000\064\000\064\000\
- \255\255\064\000\064\000\064\000\255\255\255\255\255\255\255\255\
- \255\255\255\255\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\
- \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\063\000\255\255\063\000\255\255\255\255\255\255\255\255\
- \255\255\065\000\064\000\065\000\065\000\065\000\065\000\065\000\
- \102\000\102\000\102\000\102\000\102\000\102\000\102\000\102\000\
- \102\000\102\000\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\102\000\102\000\102\000\102\000\102\000\102\000\255\255\
- \064\000\255\255\064\000\255\255\255\255\065\000\255\255\255\255\
- \046\000\255\255\255\255\255\255\255\255\255\255\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\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\102\000\102\000\102\000\102\000\102\000\102\000\255\255\
- \255\255\255\255\255\255\065\000\255\255\065\000\076\000\076\000\
- \076\000\076\000\076\000\076\000\076\000\076\000\076\000\076\000\
- \076\000\076\000\076\000\076\000\076\000\076\000\076\000\076\000\
- \076\000\076\000\076\000\076\000\076\000\076\000\076\000\076\000\
- \076\000\076\000\076\000\076\000\076\000\076\000\076\000\114\000\
- \076\000\076\000\114\000\114\000\114\000\255\255\076\000\076\000\
- \114\000\114\000\076\000\114\000\114\000\114\000\108\000\108\000\
- \108\000\108\000\108\000\108\000\108\000\108\000\108\000\108\000\
- \114\000\076\000\114\000\114\000\114\000\114\000\114\000\108\000\
- \108\000\108\000\108\000\108\000\108\000\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\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\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\076\000\076\000\076\000\114\000\255\255\076\000\108\000\
- \108\000\108\000\108\000\108\000\108\000\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\
+ \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\
+ \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\
+ \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\
+ \088\000\088\000\255\255\088\000\088\000\088\000\255\255\255\255\
+ \086\000\086\000\086\000\255\255\255\255\087\000\087\000\087\000\
+ \088\000\255\255\088\000\088\000\088\000\088\000\088\000\255\255\
+ \255\255\255\255\255\255\255\255\089\000\255\255\255\255\089\000\
+ \089\000\089\000\255\255\255\255\089\000\089\000\089\000\255\255\
+ \089\000\089\000\089\000\255\255\255\255\087\000\087\000\087\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\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\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\076\000\114\000\076\000\114\000\076\000\076\000\076\000\
- \076\000\076\000\076\000\076\000\076\000\076\000\076\000\076\000\
- \076\000\076\000\076\000\076\000\076\000\076\000\076\000\076\000\
- \076\000\076\000\076\000\076\000\076\000\076\000\076\000\076\000\
- \076\000\076\000\076\000\076\000\076\000\076\000\076\000\076\000\
- \076\000\076\000\076\000\076\000\076\000\076\000\076\000\076\000\
- \076\000\076\000\076\000\076\000\076\000\076\000\076\000\076\000\
- \076\000\076\000\076\000\076\000\076\000\076\000\076\000\076\000\
- \076\000\076\000\076\000\076\000\076\000\076\000\113\000\113\000\
- \113\000\113\000\113\000\113\000\113\000\113\000\113\000\113\000\
- \077\000\255\255\255\255\077\000\255\255\255\255\255\255\113\000\
- \113\000\113\000\113\000\113\000\113\000\076\000\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\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \077\000\255\255\255\255\255\255\255\255\077\000\077\000\255\255\
- \077\000\255\255\255\255\255\255\255\255\255\255\255\255\113\000\
- \113\000\113\000\113\000\113\000\113\000\076\000\255\255\255\255\
- \255\255\255\255\077\000\255\255\255\255\255\255\076\000\077\000\
- \077\000\077\000\077\000\077\000\077\000\077\000\077\000\077\000\
- \077\000\077\000\077\000\077\000\077\000\077\000\077\000\077\000\
- \077\000\077\000\077\000\077\000\077\000\077\000\077\000\077\000\
- \077\000\255\255\255\255\255\255\255\255\077\000\255\255\077\000\
- \077\000\077\000\077\000\077\000\077\000\077\000\077\000\077\000\
- \077\000\077\000\077\000\077\000\077\000\077\000\077\000\077\000\
- \077\000\077\000\077\000\077\000\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\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\
\255\255\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\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\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\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\255\255\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\255\255\255\255\255\255\255\255\077\000\077\000\
- \077\000\077\000\077\000\077\000\077\000\077\000\077\000\077\000\
- \077\000\077\000\077\000\077\000\077\000\077\000\077\000\077\000\
- \077\000\077\000\077\000\077\000\077\000\255\255\077\000\077\000\
- \077\000\077\000\077\000\077\000\077\000\077\000\077\000\077\000\
- \077\000\077\000\077\000\077\000\077\000\077\000\077\000\077\000\
- \077\000\077\000\077\000\077\000\077\000\077\000\077\000\077\000\
- \077\000\077\000\077\000\077\000\077\000\255\255\077\000\077\000\
- \077\000\077\000\077\000\077\000\077\000\077\000\077\000\081\000\
+ \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\
- \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
- \081\000\081\000\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
- \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
- \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
- \081\000\081\000\081\000\255\255\255\255\255\255\255\255\081\000\
- \255\255\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
- \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
- \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
- \081\000\081\000\081\000\255\255\255\255\255\255\255\255\255\255\
- \255\255\086\000\086\000\086\000\086\000\086\000\086\000\086\000\
- \086\000\086\000\086\000\086\000\086\000\086\000\086\000\086\000\
- \086\000\086\000\086\000\086\000\086\000\086\000\086\000\086\000\
- \086\000\086\000\086\000\255\255\255\255\255\255\255\255\086\000\
- \255\255\086\000\086\000\086\000\086\000\086\000\086\000\086\000\
- \086\000\086\000\086\000\086\000\086\000\086\000\086\000\086\000\
- \086\000\086\000\086\000\086\000\086\000\086\000\086\000\086\000\
- \086\000\086\000\086\000\255\255\255\255\255\255\255\255\255\255\
- \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
- \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
- \081\000\081\000\081\000\081\000\081\000\081\000\081\000\255\255\
- \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
- \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
- \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
- \081\000\081\000\081\000\081\000\081\000\081\000\081\000\255\255\
- \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
- \086\000\086\000\086\000\086\000\086\000\086\000\086\000\086\000\
- \086\000\086\000\086\000\086\000\086\000\086\000\086\000\086\000\
- \086\000\086\000\086\000\086\000\086\000\086\000\086\000\255\255\
- \086\000\086\000\086\000\086\000\086\000\086\000\086\000\086\000\
- \086\000\086\000\086\000\086\000\086\000\086\000\086\000\086\000\
- \086\000\086\000\086\000\086\000\086\000\086\000\086\000\086\000\
- \086\000\086\000\086\000\086\000\086\000\086\000\086\000\255\255\
- \086\000\086\000\086\000\086\000\086\000\086\000\086\000\086\000\
- \087\000\087\000\087\000\087\000\087\000\087\000\087\000\087\000\
- \087\000\087\000\087\000\087\000\087\000\087\000\087\000\087\000\
- \087\000\087\000\087\000\087\000\087\000\087\000\087\000\087\000\
- \087\000\087\000\255\255\255\255\255\255\255\255\087\000\255\255\
- \087\000\087\000\087\000\087\000\087\000\087\000\087\000\087\000\
- \087\000\087\000\087\000\087\000\087\000\087\000\087\000\087\000\
- \087\000\087\000\087\000\087\000\087\000\087\000\087\000\087\000\
- \087\000\087\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\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\
+ \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\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\087\000\
- \087\000\087\000\087\000\087\000\087\000\087\000\087\000\087\000\
- \087\000\087\000\087\000\087\000\087\000\087\000\087\000\087\000\
- \087\000\087\000\087\000\087\000\087\000\087\000\255\255\087\000\
- \087\000\087\000\087\000\087\000\087\000\087\000\087\000\087\000\
- \087\000\087\000\087\000\087\000\087\000\087\000\087\000\087\000\
- \087\000\087\000\087\000\087\000\087\000\087\000\087\000\087\000\
- \087\000\087\000\087\000\087\000\087\000\087\000\088\000\087\000\
- \087\000\087\000\087\000\087\000\087\000\087\000\087\000\088\000\
- \088\000\088\000\088\000\088\000\088\000\088\000\088\000\088\000\
- \088\000\255\255\255\255\088\000\255\255\255\255\255\255\088\000\
- \088\000\088\000\088\000\088\000\088\000\088\000\088\000\088\000\
- \088\000\088\000\088\000\088\000\088\000\088\000\088\000\088\000\
- \088\000\088\000\088\000\088\000\088\000\088\000\088\000\088\000\
- \088\000\088\000\255\255\255\255\255\255\255\255\088\000\255\255\
- \088\000\088\000\088\000\088\000\088\000\088\000\088\000\088\000\
- \088\000\088\000\088\000\088\000\088\000\088\000\088\000\088\000\
- \088\000\088\000\088\000\088\000\088\000\088\000\088\000\088\000\
- \088\000\088\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\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\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\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\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\088\000\
- \088\000\088\000\088\000\088\000\088\000\088\000\088\000\088\000\
- \088\000\088\000\088\000\088\000\088\000\088\000\088\000\088\000\
- \088\000\088\000\088\000\088\000\088\000\088\000\255\255\088\000\
- \088\000\088\000\088\000\088\000\088\000\088\000\088\000\088\000\
- \088\000\088\000\088\000\088\000\088\000\088\000\088\000\088\000\
- \088\000\088\000\088\000\088\000\088\000\088\000\088\000\088\000\
- \088\000\088\000\088\000\088\000\088\000\088\000\089\000\088\000\
- \088\000\088\000\088\000\088\000\088\000\088\000\088\000\089\000\
- \089\000\089\000\089\000\089\000\089\000\089\000\089\000\089\000\
- \089\000\255\255\255\255\089\000\255\255\255\255\255\255\255\255\
- \089\000\089\000\089\000\089\000\089\000\089\000\089\000\089\000\
- \089\000\089\000\089\000\089\000\089\000\089\000\089\000\089\000\
- \089\000\089\000\089\000\089\000\089\000\089\000\089\000\089\000\
- \089\000\089\000\255\255\255\255\255\255\255\255\089\000\255\255\
- \089\000\089\000\089\000\089\000\089\000\089\000\089\000\089\000\
- \089\000\089\000\089\000\089\000\089\000\089\000\089\000\089\000\
- \089\000\089\000\089\000\089\000\089\000\089\000\089\000\089\000\
- \089\000\089\000\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\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\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\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\089\000\
- \089\000\089\000\089\000\089\000\089\000\089\000\089\000\089\000\
- \089\000\089\000\089\000\089\000\089\000\089\000\089\000\089\000\
- \089\000\089\000\089\000\089\000\089\000\089\000\255\255\089\000\
- \089\000\089\000\089\000\089\000\089\000\089\000\089\000\089\000\
- \089\000\089\000\089\000\089\000\089\000\089\000\089\000\089\000\
- \089\000\089\000\089\000\089\000\089\000\089\000\089\000\089\000\
- \089\000\089\000\089\000\089\000\089\000\089\000\255\255\089\000\
- \089\000\089\000\089\000\089\000\089\000\089\000\089\000\090\000\
- \255\255\090\000\255\255\255\255\106\000\255\255\090\000\106\000\
- \255\255\255\255\255\255\255\255\255\255\255\255\255\255\090\000\
- \090\000\090\000\090\000\090\000\090\000\090\000\090\000\090\000\
- \090\000\255\255\106\000\255\255\106\000\255\255\255\255\255\255\
- \255\255\106\000\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\106\000\106\000\106\000\106\000\106\000\106\000\
- \106\000\106\000\106\000\106\000\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\090\000\255\255\255\255\255\255\255\255\
- \255\255\090\000\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\090\000\255\255\255\255\
- \255\255\090\000\255\255\090\000\255\255\255\255\106\000\090\000\
- \255\255\255\255\255\255\255\255\106\000\115\000\255\255\255\255\
- \115\000\115\000\115\000\255\255\255\255\255\255\115\000\115\000\
- \106\000\115\000\115\000\115\000\106\000\255\255\106\000\255\255\
- \255\255\255\255\106\000\255\255\255\255\255\255\115\000\255\255\
- \115\000\115\000\115\000\115\000\115\000\115\000\115\000\115\000\
- \115\000\115\000\115\000\115\000\115\000\115\000\115\000\115\000\
- \115\000\115\000\115\000\115\000\115\000\115\000\115\000\115\000\
- \115\000\115\000\115\000\115\000\115\000\115\000\115\000\255\255\
- \255\255\255\255\115\000\115\000\255\255\115\000\115\000\115\000\
- \115\000\115\000\115\000\115\000\115\000\115\000\115\000\115\000\
- \115\000\115\000\115\000\115\000\115\000\115\000\115\000\115\000\
- \115\000\115\000\115\000\115\000\115\000\115\000\115\000\255\255\
- \115\000\255\255\115\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\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\
+ \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\
+ \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\255\255\161\000\
+ \255\255\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\255\255\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\106\000\255\255\115\000\115\000\115\000\115\000\
- \115\000\115\000\115\000\115\000\115\000\115\000\115\000\115\000\
- \115\000\115\000\115\000\115\000\115\000\115\000\115\000\115\000\
- \115\000\115\000\115\000\255\255\115\000\115\000\115\000\115\000\
- \115\000\115\000\115\000\115\000\115\000\115\000\115\000\115\000\
- \115\000\115\000\115\000\115\000\115\000\115\000\115\000\115\000\
- \115\000\115\000\115\000\115\000\115\000\115\000\115\000\115\000\
- \115\000\115\000\115\000\255\255\115\000\115\000\115\000\115\000\
- \115\000\115\000\115\000\115\000\116\000\255\255\255\255\116\000\
- \116\000\116\000\255\255\255\255\255\255\116\000\116\000\255\255\
- \116\000\116\000\116\000\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\255\255\116\000\255\255\116\000\
- \116\000\116\000\116\000\116\000\255\255\255\255\255\255\255\255\
- \117\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\117\000\117\000\117\000\117\000\117\000\117\000\117\000\
- \117\000\117\000\117\000\255\255\255\255\117\000\255\255\255\255\
- \255\255\116\000\117\000\117\000\117\000\117\000\117\000\117\000\
- \117\000\117\000\117\000\117\000\117\000\117\000\117\000\117\000\
- \117\000\117\000\117\000\117\000\117\000\117\000\117\000\117\000\
- \117\000\117\000\117\000\117\000\255\255\255\255\255\255\116\000\
- \117\000\116\000\117\000\117\000\117\000\117\000\117\000\117\000\
- \117\000\117\000\117\000\117\000\117\000\117\000\117\000\117\000\
- \117\000\117\000\117\000\117\000\117\000\117\000\117\000\117\000\
- \117\000\117\000\117\000\117\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\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\255\255\161\000\161\000\161\000\161\000\161\000\
+ \161\000\161\000\161\000\162\000\255\255\255\255\162\000\162\000\
+ \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\
+ \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\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\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\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\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\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\117\000\117\000\117\000\117\000\117\000\117\000\117\000\
- \117\000\117\000\117\000\117\000\117\000\117\000\117\000\117\000\
- \117\000\117\000\117\000\117\000\117\000\117\000\117\000\117\000\
- \255\255\117\000\117\000\117\000\117\000\117\000\117\000\117\000\
- \117\000\117\000\117\000\117\000\117\000\117\000\117\000\117\000\
- \117\000\117\000\117\000\117\000\117\000\117\000\117\000\117\000\
- \117\000\117\000\117\000\117\000\117\000\117\000\117\000\117\000\
- \255\255\117\000\117\000\117\000\117\000\117\000\117\000\117\000\
- \117\000\118\000\255\255\255\255\118\000\118\000\118\000\255\255\
- \255\255\255\255\118\000\118\000\255\255\118\000\118\000\118\000\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\118\000\255\255\118\000\118\000\118\000\118\000\
- \118\000\118\000\118\000\118\000\118\000\118\000\118\000\118\000\
- \118\000\118\000\118\000\118\000\118\000\118\000\118\000\118\000\
- \118\000\118\000\118\000\118\000\118\000\118\000\118\000\118\000\
- \118\000\118\000\118\000\255\255\255\255\255\255\118\000\118\000\
- \255\255\118\000\118\000\118\000\118\000\118\000\118\000\118\000\
- \118\000\118\000\118\000\118\000\118\000\118\000\118\000\118\000\
- \118\000\118\000\118\000\118\000\118\000\118\000\118\000\118\000\
- \118\000\118\000\118\000\255\255\118\000\255\255\118\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\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\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\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\118\000\118\000\118\000\118\000\118\000\
- \118\000\118\000\118\000\118\000\118\000\118\000\118\000\118\000\
- \118\000\118\000\118\000\118\000\118\000\118\000\118\000\255\255\
- \118\000\118\000\118\000\118\000\118\000\118\000\118\000\118\000\
- \118\000\118\000\118\000\118\000\118\000\118\000\118\000\118\000\
- \118\000\118\000\118\000\118\000\118\000\118\000\118\000\118\000\
- \118\000\118\000\118\000\118\000\118\000\118\000\118\000\255\255\
- \118\000\118\000\118\000\118\000\118\000\118\000\118\000\118\000\
- \119\000\255\255\255\255\119\000\119\000\119\000\255\255\255\255\
- \255\255\119\000\119\000\255\255\119\000\119\000\119\000\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\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\120\000\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\255\255\255\255\120\000\255\255\119\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\255\255\119\000\255\255\119\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\255\255\255\255\255\255\255\255\255\255\255\255\
- \121\000\121\000\121\000\121\000\121\000\121\000\121\000\121\000\
- \121\000\121\000\121\000\121\000\121\000\121\000\121\000\121\000\
- \121\000\121\000\121\000\121\000\121\000\121\000\121\000\121\000\
- \121\000\121\000\255\255\255\255\255\255\255\255\121\000\255\255\
- \121\000\121\000\121\000\121\000\121\000\121\000\121\000\121\000\
- \121\000\121\000\121\000\121\000\121\000\121\000\121\000\121\000\
- \121\000\121\000\121\000\121\000\121\000\121\000\121\000\121\000\
- \121\000\121\000\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\121\000\
- \121\000\121\000\121\000\121\000\121\000\121\000\121\000\121\000\
- \121\000\121\000\121\000\121\000\121\000\121\000\121\000\121\000\
- \121\000\121\000\121\000\121\000\121\000\121\000\255\255\121\000\
- \121\000\121\000\121\000\121\000\121\000\121\000\121\000\121\000\
- \121\000\121\000\121\000\121\000\121\000\121\000\121\000\121\000\
- \121\000\121\000\121\000\121\000\121\000\121\000\121\000\121\000\
- \121\000\121\000\121\000\121\000\121\000\121\000\122\000\121\000\
- \121\000\121\000\121\000\121\000\121\000\121\000\121\000\122\000\
- \122\000\122\000\122\000\122\000\122\000\122\000\122\000\122\000\
- \122\000\255\255\255\255\122\000\255\255\255\255\255\255\255\255\
- \122\000\122\000\122\000\122\000\122\000\122\000\122\000\122\000\
- \122\000\122\000\122\000\122\000\122\000\122\000\122\000\122\000\
- \122\000\122\000\122\000\122\000\122\000\122\000\122\000\122\000\
- \122\000\122\000\255\255\255\255\255\255\255\255\122\000\255\255\
- \122\000\122\000\122\000\122\000\122\000\122\000\122\000\122\000\
- \122\000\122\000\122\000\122\000\122\000\122\000\122\000\122\000\
- \122\000\122\000\122\000\122\000\122\000\122\000\122\000\122\000\
- \122\000\122\000\255\255\255\255\255\255\255\255\255\255\255\255\
- \128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\
- \128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\
- \128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\
- \128\000\128\000\255\255\255\255\255\255\255\255\128\000\255\255\
- \128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\
- \128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\
- \128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\
- \128\000\128\000\255\255\255\255\255\255\255\255\255\255\122\000\
- \122\000\122\000\122\000\122\000\122\000\122\000\122\000\122\000\
- \122\000\122\000\122\000\122\000\122\000\122\000\122\000\122\000\
- \122\000\122\000\122\000\122\000\122\000\122\000\255\255\122\000\
- \122\000\122\000\122\000\122\000\122\000\122\000\122\000\122\000\
- \122\000\122\000\122\000\122\000\122\000\122\000\122\000\122\000\
- \122\000\122\000\122\000\122\000\122\000\122\000\122\000\122\000\
- \122\000\122\000\122\000\122\000\122\000\122\000\255\255\122\000\
- \122\000\122\000\122\000\122\000\122\000\122\000\122\000\128\000\
- \128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\
- \128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\
- \128\000\128\000\128\000\128\000\128\000\128\000\255\255\128\000\
- \128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\
- \128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\
- \128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\
- \128\000\128\000\128\000\128\000\128\000\128\000\255\255\128\000\
- \128\000\128\000\128\000\128\000\128\000\128\000\128\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\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\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\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\
+ \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\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\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\130\000\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\
- \255\255\255\255\130\000\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\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\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\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\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\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\
+ \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\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\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\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\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\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\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
+ \255\255\255\255\255\255\255\255\255\255\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\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\255\255\175\000\175\000\
+ \175\000\175\000\175\000\175\000\175\000\175\000\175\000\177\000\
\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\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\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\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\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\255\255\131\000\131\000\
- \131\000\131\000\131\000\131\000\131\000\131\000\132\000\255\255\
- \255\255\132\000\255\255\255\255\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\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\132\000\132\000\132\000\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\
- \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\
@@ -4188,111 +4614,83 @@ module Struct =
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\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\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\134\000\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\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\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\255\255\
- \255\255\255\255\255\255\255\255\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\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\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\
+ \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\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\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\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\255\255\134\000\134\000\134\000\134\000\
- \134\000\134\000\134\000\134\000\135\000\255\255\255\255\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\
- \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\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\255\255\255\255\255\255\255\255\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\137\000\135\000\135\000\135\000\
- \135\000\135\000\135\000\135\000\135\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\137\000\
- \255\255\255\255\255\255\255\255\255\255\255\255\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\137\000\
- \255\255\255\255\255\255\255\255\137\000\255\255\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\137\000\
- \255\255\255\255\255\255\255\255\255\255\255\255\141\000\141\000\
- \141\000\141\000\141\000\141\000\141\000\141\000\141\000\141\000\
- \141\000\141\000\141\000\141\000\141\000\141\000\141\000\141\000\
- \141\000\141\000\141\000\141\000\141\000\141\000\141\000\141\000\
- \255\255\255\255\255\255\255\255\141\000\255\255\141\000\141\000\
- \141\000\141\000\141\000\141\000\141\000\141\000\141\000\141\000\
- \141\000\141\000\141\000\141\000\141\000\141\000\141\000\141\000\
- \141\000\141\000\141\000\141\000\141\000\141\000\141\000\141\000\
- \255\255\255\255\255\255\255\255\255\255\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\255\255\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\255\255\137\000\137\000\137\000\
- \137\000\137\000\137\000\137\000\137\000\141\000\141\000\141\000\
- \141\000\141\000\141\000\141\000\141\000\141\000\141\000\141\000\
- \141\000\141\000\141\000\141\000\141\000\141\000\141\000\141\000\
- \141\000\141\000\141\000\141\000\255\255\141\000\141\000\141\000\
- \141\000\141\000\141\000\141\000\141\000\141\000\141\000\141\000\
- \141\000\141\000\141\000\141\000\141\000\141\000\141\000\141\000\
- \141\000\141\000\141\000\141\000\141\000\141\000\141\000\141\000\
- \141\000\141\000\141\000\141\000\255\255\141\000\141\000\141\000\
- \141\000\141\000\141\000\141\000\141\000\142\000\142\000\142\000\
- \142\000\142\000\142\000\142\000\142\000\142\000\142\000\142\000\
- \142\000\142\000\142\000\142\000\142\000\142\000\142\000\142\000\
- \142\000\142\000\142\000\142\000\142\000\142\000\142\000\255\255\
- \255\255\255\255\255\255\142\000\255\255\142\000\142\000\142\000\
- \142\000\142\000\142\000\142\000\142\000\142\000\142\000\142\000\
- \142\000\142\000\142\000\142\000\142\000\142\000\142\000\142\000\
- \142\000\142\000\142\000\142\000\142\000\142\000\142\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\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\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\
+ \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\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\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\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\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
@@ -4301,24 +4699,24 @@ module Struct =
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\142\000\142\000\142\000\142\000\
- \142\000\142\000\142\000\142\000\142\000\142\000\142\000\142\000\
- \142\000\142\000\142\000\142\000\142\000\142\000\142\000\142\000\
- \142\000\142\000\142\000\255\255\142\000\142\000\142\000\142\000\
- \142\000\142\000\142\000\142\000\142\000\142\000\142\000\142\000\
- \142\000\142\000\142\000\142\000\142\000\142\000\142\000\142\000\
- \142\000\142\000\142\000\142\000\142\000\142\000\142\000\142\000\
- \142\000\142\000\142\000\143\000\142\000\142\000\142\000\142\000\
- \142\000\142\000\142\000\142\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\
- \143\000\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\143\000\143\000\
- \143\000\143\000\143\000\143\000\143\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\143\000\255\255\143\000\143\000\143\000\
- \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
- \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
- \143\000\143\000\143\000\143\000\143\000\143\000\143\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\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\
@@ -4327,24 +4725,24 @@ module Struct =
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\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\143\000\143\000\143\000\143\000\143\000\143\000\
- \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
- \143\000\143\000\143\000\255\255\143\000\143\000\143\000\143\000\
- \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
- \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
- \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
- \143\000\143\000\143\000\144\000\143\000\143\000\143\000\143\000\
- \143\000\143\000\143\000\143\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\
- \144\000\255\255\255\255\255\255\255\255\144\000\144\000\144\000\
- \144\000\144\000\144\000\144\000\144\000\144\000\144\000\144\000\
- \144\000\144\000\144\000\144\000\144\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\144\000\255\255\144\000\144\000\144\000\
- \144\000\144\000\144\000\144\000\144\000\144\000\144\000\144\000\
- \144\000\144\000\144\000\144\000\144\000\144\000\144\000\144\000\
- \144\000\144\000\144\000\144\000\144\000\144\000\144\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\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\
@@ -4353,35 +4751,40 @@ module Struct =
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\144\000\144\000\144\000\144\000\
- \144\000\144\000\144\000\144\000\144\000\144\000\144\000\144\000\
- \144\000\144\000\144\000\144\000\144\000\144\000\144\000\144\000\
- \144\000\144\000\144\000\255\255\144\000\144\000\144\000\144\000\
- \144\000\144\000\144\000\144\000\144\000\144\000\144\000\144\000\
- \144\000\144\000\144\000\144\000\144\000\144\000\144\000\144\000\
- \144\000\144\000\144\000\144\000\144\000\144\000\144\000\144\000\
- \144\000\144\000\144\000\255\255\144\000\144\000\144\000\144\000\
- \144\000\144\000\144\000\144\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\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";
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\027\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\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\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\010\000\036\000\000\000\012\000\000\000\000\000\
- \002\000\000\000\000\000\027\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\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\
- \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\041\000\000\000\
- \249\000\000\000\000\000\039\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\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\
@@ -4391,17 +4794,22 @@ module Struct =
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\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\000\000\000\000\000\000\
- \000\000\000\000\027\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\039\000\039\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\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000";
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\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\000\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \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\
@@ -4411,39 +4819,107 @@ module Struct =
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\000\000\019\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\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\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000";
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \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\036\000\036\000\000\000\036\000\000\000\
+ \000\000\001\000\000\000\058\000\058\000\000\000\058\000\000\000\
\000\000\000\000\000\000\000\000\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\001\000\022\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\007\000\001\000\000\000\000\000\
+ \001\000\000\000\000\000\001\000\007\000\044\000\000\000\007\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\004\000\004\000\004\000\004\000\004\000\004\000\004\000\004\000\
+ \004\000\004\000\000\000\007\000\012\000\000\000\000\000\012\000\
+ \012\000\012\000\000\000\000\000\000\000\000\000\012\000\000\000\
+ \012\000\012\000\012\000\007\000\000\000\000\000\007\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\012\000\000\000\012\000\
+ \012\000\012\000\012\000\012\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\007\000\015\000\000\000\000\000\015\000\015\000\
+ \015\000\000\000\000\000\000\000\015\000\015\000\000\000\015\000\
+ \015\000\015\000\000\000\000\000\000\000\000\000\000\000\012\000\
+ \000\000\012\000\000\000\000\000\015\000\000\000\015\000\015\000\
+ \015\000\015\000\015\000\000\000\000\000\000\000\012\000\000\000\
+ \000\000\012\000\012\000\012\000\000\000\000\000\000\000\012\000\
+ \012\000\000\000\012\000\012\000\012\000\000\000\000\000\012\000\
+ \000\000\012\000\000\000\000\000\000\000\000\000\015\000\012\000\
+ \015\000\012\000\012\000\012\000\012\000\012\000\000\000\000\000\
+ \000\000\012\000\000\000\000\000\012\000\012\000\012\000\000\000\
+ \000\000\000\000\012\000\012\000\000\000\012\000\012\000\012\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\015\000\000\000\
+ \015\000\012\000\012\000\012\000\012\000\012\000\012\000\012\000\
+ \012\000\000\000\000\000\000\000\012\000\000\000\000\000\012\000\
+ \012\000\012\000\000\000\000\000\000\000\012\000\012\000\000\000\
+ \012\000\012\000\012\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\012\000\000\000\012\000\012\000\012\000\012\000\012\000\
+ \012\000\012\000\012\000\012\000\000\000\000\000\000\000\012\000\
+ \000\000\000\000\012\000\012\000\012\000\000\000\000\000\000\000\
+ \012\000\012\000\000\000\012\000\012\000\012\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\012\000\000\000\012\000\012\000\
+ \012\000\012\000\012\000\012\000\012\000\012\000\012\000\000\000\
+ \000\000\000\000\012\000\000\000\000\000\012\000\012\000\012\000\
+ \000\000\000\000\000\000\012\000\012\000\000\000\012\000\012\000\
+ \012\000\000\000\000\000\000\000\000\000\000\000\000\000\012\000\
+ \000\000\012\000\012\000\012\000\012\000\012\000\012\000\012\000\
+ \012\000\012\000\000\000\000\000\000\000\012\000\000\000\000\000\
+ \012\000\012\000\012\000\000\000\000\000\000\000\012\000\012\000\
+ \000\000\012\000\012\000\012\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\012\000\000\000\012\000\012\000\012\000\012\000\
+ \012\000\012\000\012\000\012\000\012\000\000\000\000\000\000\000\
+ \012\000\000\000\000\000\012\000\012\000\012\000\000\000\000\000\
+ \000\000\012\000\012\000\000\000\012\000\012\000\012\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\012\000\000\000\012\000\
+ \012\000\012\000\012\000\012\000\012\000\012\000\012\000\012\000\
+ \000\000\000\000\000\000\012\000\000\000\000\000\012\000\012\000\
+ \012\000\000\000\000\000\000\000\012\000\012\000\000\000\012\000\
+ \012\000\012\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \012\000\000\000\012\000\012\000\012\000\012\000\012\000\012\000\
+ \012\000\012\000\012\000\000\000\000\000\000\000\012\000\000\000\
+ \000\000\012\000\012\000\012\000\000\000\000\000\000\000\012\000\
+ \012\000\000\000\012\000\012\000\012\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\012\000\000\000\012\000\012\000\012\000\
+ \012\000\012\000\012\000\012\000\012\000\012\000\000\000\000\000\
+ \000\000\012\000\000\000\000\000\012\000\012\000\012\000\000\000\
+ \000\000\000\000\012\000\012\000\000\000\012\000\012\000\012\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\012\000\000\000\
+ \012\000\012\000\012\000\012\000\012\000\012\000\012\000\012\000\
+ \012\000\000\000\000\000\000\000\015\000\000\000\000\000\015\000\
+ \015\000\015\000\000\000\000\000\000\000\015\000\015\000\000\000\
+ \015\000\015\000\015\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\012\000\000\000\012\000\012\000\015\000\012\000\015\000\
+ \015\000\015\000\015\000\015\000\000\000\000\000\000\000\015\000\
+ \000\000\000\000\015\000\015\000\015\000\000\000\000\000\000\000\
+ \015\000\015\000\000\000\015\000\015\000\015\000\000\000\000\000\
+ \000\000\029\000\000\000\000\000\012\000\000\000\012\000\015\000\
+ \015\000\015\000\015\000\015\000\015\000\015\000\015\000\004\000\
\004\000\004\000\004\000\004\000\004\000\004\000\004\000\004\000\
- \004\000\004\000\004\000\004\000\001\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\000\000\000\000\004\000\004\000\004\000\004\000\
- \004\000\004\000\004\000\004\000\004\000\004\000\000\000\000\000\
+ \004\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\015\000\
+ \000\000\015\000\015\000\000\000\015\000\000\000\000\000\000\000\
+ \001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\036\000\036\000\036\000\036\000\036\000\036\000\
- \036\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\
- \036\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\
- \036\000\036\000\036\000\036\000\000\000\000\000\000\000\000\000\
- \036\000\000\000\036\000\036\000\036\000\036\000\036\000\036\000\
- \036\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\
- \036\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\
- \036\000\036\000\036\000\036\000\000\000\000\000\000\000\000\000\
+ \004\000\004\000\004\000\004\000\004\000\004\000\004\000\004\000\
+ \004\000\004\000\015\000\000\000\015\000\058\000\058\000\058\000\
+ \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\
+ \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\
+ \058\000\058\000\058\000\058\000\058\000\058\000\058\000\000\000\
+ \000\000\000\000\000\000\058\000\000\000\058\000\058\000\058\000\
+ \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\
+ \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\
+ \058\000\058\000\058\000\058\000\058\000\058\000\058\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
@@ -4452,24 +4928,24 @@ module Struct =
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\
- \036\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\
- \036\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\
- \000\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\
- \036\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\
- \036\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\
- \036\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\
- \036\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\
- \036\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\
- \036\000\036\000\036\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\000\000\036\000\036\000\036\000\036\000\036\000\036\000\
- \036\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\
- \036\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\
- \036\000\036\000\036\000\036\000\000\000\000\000\000\000\000\000\
- \036\000\000\000\036\000\036\000\036\000\036\000\036\000\036\000\
- \036\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\
- \036\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\
- \036\000\036\000\036\000\036\000\000\000\000\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\058\000\058\000\058\000\058\000\
+ \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\
+ \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\
+ \058\000\058\000\058\000\000\000\058\000\058\000\058\000\058\000\
+ \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\
+ \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\
+ \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\
+ \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\
+ \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\
+ \058\000\058\000\058\000\058\000\058\000\058\000\000\000\000\000\
+ \000\000\000\000\000\000\000\000\000\000\058\000\058\000\058\000\
+ \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\
+ \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\
+ \058\000\058\000\058\000\058\000\058\000\058\000\058\000\000\000\
+ \000\000\000\000\000\000\058\000\000\000\058\000\058\000\058\000\
+ \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\
+ \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\
+ \058\000\058\000\058\000\058\000\058\000\058\000\058\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
@@ -4478,37 +4954,100 @@ module Struct =
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
- \000\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\
- \036\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\
- \036\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\
- \000\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\
- \036\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\
- \036\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\
- \036\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\
- \000\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\
- \036\000\000\000";
+ \000\000\000\000\000\000\000\000\058\000\058\000\058\000\058\000\
+ \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\
+ \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\
+ \058\000\058\000\058\000\000\000\058\000\058\000\058\000\058\000\
+ \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\
+ \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\
+ \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\
+ \058\000\058\000\058\000\000\000\058\000\058\000\058\000\058\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\014\000\071\000\106\000\110\000\071\000\106\000\255\255\
+ \255\255\016\000\100\000\149\000\153\000\100\000\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\255\255\255\255\255\255\255\255\255\255\
- \014\000\255\255\071\000\000\000\072\000\255\255\255\255\255\255\
- \255\255\255\255\255\255\255\255\066\000\067\000\255\255\255\255\
- \014\000\014\000\014\000\014\000\014\000\014\000\014\000\014\000\
- \014\000\014\000\066\000\066\000\066\000\066\000\066\000\066\000\
- \066\000\066\000\066\000\066\000\067\000\255\255\255\255\255\255\
+ \016\000\255\255\100\000\000\000\019\000\101\000\255\255\019\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\067\000\067\000\067\000\067\000\
- \067\000\067\000\067\000\067\000\067\000\067\000\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\
+ \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\255\255\255\255\255\255\255\255\255\255\255\255\
- \255\255\255\255\118\000\118\000\118\000\118\000\118\000\118\000\
- \118\000\118\000\118\000\118\000\118\000\118\000\118\000\118\000\
- \118\000\118\000\118\000\118\000\118\000\118\000\118\000\118\000\
- \118\000\118\000\118\000\118\000\255\255\255\255\255\255\255\255\
- \118\000\255\255\118\000\118\000\118\000\118\000\118\000\118\000\
- \118\000\118\000\118\000\118\000\118\000\118\000\118\000\118\000\
- \118\000\118\000\118\000\118\000\118\000\118\000\118\000\118\000\
- \118\000\118\000\118\000\118\000\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\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
@@ -4517,24 +5056,24 @@ module Struct =
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\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\118\000\118\000\118\000\118\000\
- \118\000\118\000\118\000\118\000\118\000\118\000\118\000\118\000\
- \118\000\118\000\118\000\118\000\118\000\118\000\118\000\118\000\
- \071\000\118\000\118\000\118\000\118\000\118\000\118\000\118\000\
- \118\000\118\000\118\000\118\000\118\000\118\000\118\000\118\000\
- \118\000\118\000\118\000\118\000\118\000\118\000\118\000\118\000\
- \118\000\118\000\118\000\118\000\118\000\118\000\118\000\118\000\
- \120\000\118\000\118\000\118\000\118\000\118\000\118\000\118\000\
- \118\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\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\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\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\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
@@ -4543,22 +5082,24 @@ module Struct =
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\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\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\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";
Lexing.lex_code =
- "\255\004\255\255\005\255\255\007\255\006\255\255\003\255\000\004\
- \001\005\255\007\255\255\006\255\007\255\255\000\004\001\005\003\
- \006\002\007\255\001\255\255\000\001\255";
+ "\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\255\003\255\000\004\001\009\255\011\255\255\010\255\011\255\
+ \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 8 (-1);
+ (lexbuf.Lexing.lex_mem <- Array.create 12 (-1);
__ocaml_lex_token_rec c lexbuf 0)
and __ocaml_lex_token_rec c lexbuf __ocaml_lex_state =
match Lexing.new_engine __ocaml_lex_tables __ocaml_lex_state
@@ -4683,7 +5224,6 @@ module Struct =
then
QUOTATION
{
-
q_name = "";
q_loc = "";
q_shift = 2;
@@ -4710,45 +5250,65 @@ module Struct =
(update_loc c name inum true 0;
LINE_DIRECTIVE (inum, name))
| 23 ->
+ let op =
+ Lexing.sub_lexeme_char lexbuf
+ (lexbuf.Lexing.lex_start_pos + 1)
+ in ESCAPED_IDENT (String.make 1 op)
+ | 24 ->
+ let op =
+ Lexing.sub_lexeme lexbuf
+ (lexbuf.Lexing.lex_start_pos + 1)
+ (lexbuf.Lexing.lex_curr_pos + (-1))
+ in ESCAPED_IDENT op
+ | 25 ->
+ let op =
+ Lexing.sub_lexeme lexbuf
+ (lexbuf.Lexing.lex_start_pos + 1)
+ lexbuf.Lexing.lex_mem.(0)
+ in ESCAPED_IDENT op
+ | 26 ->
+ let op =
+ Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_mem.(0)
+ (lexbuf.Lexing.lex_curr_pos + (-1))
+ in ESCAPED_IDENT op
+ | 27 ->
+ let op =
+ Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_mem.(0)
+ lexbuf.Lexing.lex_mem.(1)
+ in ESCAPED_IDENT op
+ | 28 ->
let x =
Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos
lexbuf.Lexing.lex_curr_pos
in SYMBOL x
- | 24 ->
- if quotations c
+ | 29 ->
+ if antiquots c
then with_curr_loc dollar (shift 1 c)
else parse (symbolchar_star "$") c
- | 25 ->
+ | 30 ->
let x =
Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos
lexbuf.Lexing.lex_curr_pos
in SYMBOL x
- | 26 ->
- let x =
- Lexing.sub_lexeme lexbuf
- (lexbuf.Lexing.lex_start_pos + 1)
- lexbuf.Lexing.lex_curr_pos
- in ESCAPED_IDENT x
- | 27 ->
+ | 31 ->
let pos = lexbuf.lex_curr_p
in
(lexbuf.lex_curr_p <-
{
(pos)
with
-
pos_bol = pos.pos_bol + 1;
pos_cnum = pos.pos_cnum + 1;
};
EOI)
- | 28 ->
+ | 32 ->
let c =
Lexing.sub_lexeme_char lexbuf lexbuf.Lexing.lex_start_pos
in err (Illegal_character c) (Loc.of_lexbuf lexbuf)
| __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 77
+ and comment c lexbuf = __ocaml_lex_comment_rec c lexbuf 120
and __ocaml_lex_comment_rec c lexbuf __ocaml_lex_state =
match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf
with
@@ -4782,7 +5342,7 @@ module Struct =
__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 104)
+ __ocaml_lex_string_rec c lexbuf 147)
and __ocaml_lex_string_rec c lexbuf __ocaml_lex_state =
match Lexing.new_engine __ocaml_lex_tables __ocaml_lex_state
lexbuf
@@ -4816,7 +5376,7 @@ module Struct =
(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 114
+ __ocaml_lex_symbolchar_star_rec beginning c lexbuf 157
and
__ocaml_lex_symbolchar_star_rec beginning c lexbuf
__ocaml_lex_state =
@@ -4834,7 +5394,7 @@ module Struct =
__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 115
+ __ocaml_lex_maybe_quotation_at_rec c lexbuf 158
and
__ocaml_lex_maybe_quotation_at_rec c lexbuf __ocaml_lex_state =
match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf
@@ -4856,7 +5416,7 @@ module Struct =
__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 118)
+ __ocaml_lex_maybe_quotation_colon_rec c lexbuf 161)
and
__ocaml_lex_maybe_quotation_colon_rec c lexbuf
__ocaml_lex_state =
@@ -4889,7 +5449,7 @@ module Struct =
(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 124
+ and quotation c lexbuf = __ocaml_lex_quotation_rec c lexbuf 167
and __ocaml_lex_quotation_rec c lexbuf __ocaml_lex_state =
match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf
with
@@ -4901,7 +5461,7 @@ module Struct =
| __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 132
+ and dollar c lexbuf = __ocaml_lex_dollar_rec c lexbuf 175
and __ocaml_lex_dollar_rec c lexbuf __ocaml_lex_state =
match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf
with
@@ -4918,7 +5478,7 @@ module Struct =
(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 138
+ __ocaml_lex_antiquot_rec name c lexbuf 181
and __ocaml_lex_antiquot_rec name c lexbuf __ocaml_lex_state =
match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf
with
@@ -4954,8 +5514,8 @@ module Struct =
{
(default_context lb)
with
-
loc = Loc.of_lexbuf lb;
+ antiquots = !Camlp4_config.antiquotations;
quotations = quotations;
}
in from_context c
@@ -5005,10 +5565,384 @@ module Struct =
"%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
+ | Ast.IdApp (_, i1, i2) ->
+ (is_module_longident i1) && (is_module_longident i2)
+ | Ast.IdUid (_, _) -> true
+ | _ -> false
+ let ident_of_expr =
+ let error () =
+ invalid_arg
+ "ident_of_expr: this expression is not an identifier" in
+ let rec self =
+ function
+ | Ast.ExApp (_loc, e1, e2) ->
+ Ast.IdApp (_loc, self e1, self e2)
+ | Ast.ExAcc (_loc, e1, e2) ->
+ Ast.IdAcc (_loc, self e1, self e2)
+ | Ast.ExId (_, (Ast.IdLid (_, _))) -> error ()
+ | Ast.ExId (_, i) ->
+ if is_module_longident i then i else error ()
+ | _ -> error ()
+ in
+ function
+ | 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
+ let rec self =
+ function
+ | Ast.TyApp (_loc, t1, t2) ->
+ Ast.IdApp (_loc, self t1, self t2)
+ | Ast.TyId (_, (Ast.IdLid (_, _))) -> error ()
+ | Ast.TyId (_, i) ->
+ 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
+ "ident_of_patt: this pattern is not an identifier" in
+ let rec self =
+ function
+ | Ast.PaApp (_loc, p1, p2) ->
+ Ast.IdApp (_loc, self p1, self p2)
+ | Ast.PaId (_, (Ast.IdLid (_, _))) -> error ()
+ | Ast.PaId (_, i) ->
+ 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.PaId (_, (Ast.IdUid (_, "()"))) -> true
+ | 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.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
+ | Ast.PaTup (_, pl) -> is_irrefut_patt pl
+ | Ast.PaOlb (_, _, (Ast.PaNil _)) -> true
+ | Ast.PaOlb (_, _, p) -> is_irrefut_patt p
+ | Ast.PaOlbi (_, _, p, _) -> is_irrefut_patt p
+ | 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
+ | Ast.ExAcc (_, e1, e2) ->
+ (is_expr_constructor e1) && (is_expr_constructor e2)
+ | Ast.ExVrn (_, _) -> true
+ | _ -> false
+ let rec tyOr_of_list =
+ function
+ | [] -> Ast.TyNil ghost
+ | [ t ] -> t
+ | 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 ] -> t
+ | 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 ] -> t
+ | 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 ] -> t
+ | 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 ] -> t
+ | 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 ] -> t
+ | 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 ] -> t
+ | 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 ] -> t
+ | 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 ] -> b
+ | 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 ] -> b
+ | 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 ] -> w
+ | 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 ] -> i
+ | 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 ] -> i
+ | 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 ] -> x
+ | 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 ] -> x
+ | 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 ] -> x
+ | 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 ] -> x
+ | 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 ] -> x
+ | 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 ] -> x
+ | 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 ] -> x
+ | 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 ] -> x
+ | 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 ] -> x
+ | 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 ] -> x
+ | 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 ] -> x
+ | 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.TyCol (_loc, Ast.TyId (_loc, Ast.IdLid (_loc, s)),
+ 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.TyAmp (_, x, y) | Ast.TyCom (_, x, y) |
+ Ast.TySta (_, x, y) | Ast.TySem (_, x, y) |
+ 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 =
@@ -5129,17 +6063,6 @@ module Struct =
meta_acc_Loc_t _loc x0),
meta_patt _loc x1),
meta_expr _loc x2)
- | Ast.BiSem (x0, x1, x2) ->
- Ast.ExApp (_loc,
- Ast.ExApp (_loc,
- Ast.ExApp (_loc,
- Ast.ExId (_loc,
- Ast.IdAcc (_loc,
- Ast.IdUid (_loc, "Ast"),
- Ast.IdUid (_loc, "BiSem"))),
- meta_acc_Loc_t _loc x0),
- meta_binding _loc x1),
- meta_binding _loc x2)
| Ast.BiAnd (x0, x1, x2) ->
Ast.ExApp (_loc,
Ast.ExApp (_loc,
@@ -5973,7 +6896,7 @@ module Struct =
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExRec"))),
meta_acc_Loc_t _loc x0),
- meta_binding _loc x1),
+ meta_rec_binding _loc x1),
meta_expr _loc x2)
| Ast.ExOvr (x0, x1) ->
Ast.ExApp (_loc,
@@ -5982,7 +6905,7 @@ module Struct =
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExOvr"))),
meta_acc_Loc_t _loc x0),
- meta_binding _loc x1)
+ meta_rec_binding _loc x1)
| Ast.ExOlb (x0, x1, x2) ->
Ast.ExApp (_loc,
Ast.ExApp (_loc,
@@ -6471,6 +7394,12 @@ module Struct =
Ast.IdUid (_loc, "MeId"))),
meta_acc_Loc_t _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)
and meta_module_type _loc =
function
| Ast.MtAnt (x0, x1) -> Ast.ExAnt (x0, x1)
@@ -6522,6 +7451,12 @@ module Struct =
Ast.IdUid (_loc, "MtId"))),
meta_acc_Loc_t _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)
and meta_patt _loc =
function
| Ast.PaVrn (x0, x1) ->
@@ -6576,7 +7511,7 @@ module Struct =
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaEq"))),
meta_acc_Loc_t _loc x0),
- meta_patt _loc x1),
+ meta_ident _loc x1),
meta_patt _loc x2)
| Ast.PaRec (x0, x1) ->
Ast.ExApp (_loc,
@@ -6764,6 +7699,37 @@ module Struct =
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaNil"))),
meta_acc_Loc_t _loc x0)
+ and meta_rec_binding _loc =
+ function
+ | Ast.RbAnt (x0, x1) -> Ast.ExAnt (x0, x1)
+ | Ast.RbEq (x0, x1, x2) ->
+ Ast.ExApp (_loc,
+ Ast.ExApp (_loc,
+ Ast.ExApp (_loc,
+ Ast.ExId (_loc,
+ Ast.IdAcc (_loc,
+ Ast.IdUid (_loc, "Ast"),
+ Ast.IdUid (_loc, "RbEq"))),
+ meta_acc_Loc_t _loc x0),
+ meta_ident _loc x1),
+ meta_expr _loc x2)
+ | Ast.RbSem (x0, x1, x2) ->
+ Ast.ExApp (_loc,
+ Ast.ExApp (_loc,
+ Ast.ExApp (_loc,
+ Ast.ExId (_loc,
+ Ast.IdAcc (_loc,
+ Ast.IdUid (_loc, "Ast"),
+ Ast.IdUid (_loc, "RbSem"))),
+ meta_acc_Loc_t _loc x0),
+ meta_rec_binding _loc x1),
+ meta_rec_binding _loc x2)
+ | Ast.RbNil x0 ->
+ Ast.ExApp (_loc,
+ Ast.ExId (_loc,
+ Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
+ Ast.IdUid (_loc, "RbNil"))),
+ meta_acc_Loc_t _loc x0)
and meta_sig_item _loc =
function
| Ast.SgAnt (x0, x1) -> Ast.ExAnt (x0, x1)
@@ -7119,17 +8085,6 @@ module Struct =
meta_acc_Loc_t _loc x0),
meta_patt _loc x1),
meta_expr _loc x2)
- | Ast.BiSem (x0, x1, x2) ->
- Ast.PaApp (_loc,
- Ast.PaApp (_loc,
- Ast.PaApp (_loc,
- Ast.PaId (_loc,
- Ast.IdAcc (_loc,
- Ast.IdUid (_loc, "Ast"),
- Ast.IdUid (_loc, "BiSem"))),
- meta_acc_Loc_t _loc x0),
- meta_binding _loc x1),
- meta_binding _loc x2)
| Ast.BiAnd (x0, x1, x2) ->
Ast.PaApp (_loc,
Ast.PaApp (_loc,
@@ -7963,7 +8918,7 @@ module Struct =
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExRec"))),
meta_acc_Loc_t _loc x0),
- meta_binding _loc x1),
+ meta_rec_binding _loc x1),
meta_expr _loc x2)
| Ast.ExOvr (x0, x1) ->
Ast.PaApp (_loc,
@@ -7972,7 +8927,7 @@ module Struct =
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "ExOvr"))),
meta_acc_Loc_t _loc x0),
- meta_binding _loc x1)
+ meta_rec_binding _loc x1)
| Ast.ExOlb (x0, x1, x2) ->
Ast.PaApp (_loc,
Ast.PaApp (_loc,
@@ -8461,6 +9416,12 @@ module Struct =
Ast.IdUid (_loc, "MeId"))),
meta_acc_Loc_t _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)
and meta_module_type _loc =
function
| Ast.MtAnt (x0, x1) -> Ast.PaAnt (x0, x1)
@@ -8512,6 +9473,12 @@ module Struct =
Ast.IdUid (_loc, "MtId"))),
meta_acc_Loc_t _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)
and meta_patt _loc =
function
| Ast.PaVrn (x0, x1) ->
@@ -8566,7 +9533,7 @@ module Struct =
Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaEq"))),
meta_acc_Loc_t _loc x0),
- meta_patt _loc x1),
+ meta_ident _loc x1),
meta_patt _loc x2)
| Ast.PaRec (x0, x1) ->
Ast.PaApp (_loc,
@@ -8754,6 +9721,37 @@ module Struct =
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdUid (_loc, "PaNil"))),
meta_acc_Loc_t _loc x0)
+ and meta_rec_binding _loc =
+ function
+ | Ast.RbAnt (x0, x1) -> Ast.PaAnt (x0, x1)
+ | Ast.RbEq (x0, x1, x2) ->
+ Ast.PaApp (_loc,
+ Ast.PaApp (_loc,
+ Ast.PaApp (_loc,
+ Ast.PaId (_loc,
+ Ast.IdAcc (_loc,
+ Ast.IdUid (_loc, "Ast"),
+ Ast.IdUid (_loc, "RbEq"))),
+ meta_acc_Loc_t _loc x0),
+ meta_ident _loc x1),
+ meta_expr _loc x2)
+ | Ast.RbSem (x0, x1, x2) ->
+ Ast.PaApp (_loc,
+ Ast.PaApp (_loc,
+ Ast.PaApp (_loc,
+ Ast.PaId (_loc,
+ Ast.IdAcc (_loc,
+ Ast.IdUid (_loc, "Ast"),
+ Ast.IdUid (_loc, "RbSem"))),
+ meta_acc_Loc_t _loc x0),
+ meta_rec_binding _loc x1),
+ meta_rec_binding _loc x2)
+ | Ast.RbNil x0 ->
+ Ast.PaApp (_loc,
+ Ast.PaId (_loc,
+ Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
+ Ast.IdUid (_loc, "RbNil"))),
+ meta_acc_Loc_t _loc x0)
and meta_sig_item _loc =
function
| Ast.SgAnt (x0, x1) -> Ast.PaAnt (x0, x1)
@@ -9089,7 +10087,7 @@ module Struct =
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; }
+ fun f { contents = x } -> { contents = f x; }
method _Loc_t : Loc.t -> Loc.t = fun x -> x
method with_constr : with_constr -> with_constr =
function
@@ -9161,6 +10159,15 @@ module Struct =
| 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)
+ 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)
method patt : patt -> patt =
function
| PaNil _x0 -> PaNil (o#_Loc_t _x0)
@@ -9198,7 +10205,7 @@ module Struct =
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#patt _x1, o#patt _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) ->
@@ -9207,6 +10214,7 @@ module Struct =
| PaVrn (_x0, _x1) -> PaVrn (o#_Loc_t _x0, o#string _x1)
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,
@@ -9219,6 +10227,7 @@ module Struct =
| MtAnt (_x0, _x1) -> MtAnt (o#_Loc_t _x0, o#string _x1)
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,
@@ -9335,9 +10344,10 @@ module Struct =
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#binding _x1)
+ | ExOvr (_x0, _x1) ->
+ ExOvr (o#_Loc_t _x0, o#rec_binding _x1)
| ExRec (_x0, _x1, _x2) ->
- ExRec (o#_Loc_t _x0, o#binding _x1, o#expr _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)
@@ -9509,8 +10519,6 @@ module Struct =
| BiNil _x0 -> BiNil (o#_Loc_t _x0)
| BiAnd (_x0, _x1, _x2) ->
BiAnd (o#_Loc_t _x0, o#binding _x1, o#binding _x2)
- | BiSem (_x0, _x1, _x2) ->
- BiSem (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)
@@ -9601,6 +10609,14 @@ module Struct =
| SgVal (_x0, _x1, _x2) ->
((o#_Loc_t _x0)#string _x1)#ctyp _x2
| SgAnt (_x0, _x1) -> (o#_Loc_t _x0)#string _x1
+ 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
method patt : patt -> 'self_type =
function
| PaNil _x0 -> o#_Loc_t _x0
@@ -9634,7 +10650,7 @@ module Struct =
((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)#patt _x1)#patt _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) ->
@@ -9643,6 +10659,7 @@ module Struct =
| PaVrn (_x0, _x1) -> (o#_Loc_t _x0)#string _x1
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)#
@@ -9654,6 +10671,7 @@ module Struct =
| MtAnt (_x0, _x1) -> (o#_Loc_t _x0)#string _x1
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
@@ -9763,9 +10781,9 @@ module Struct =
((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)#binding _x1
+ | ExOvr (_x0, _x1) -> (o#_Loc_t _x0)#rec_binding _x1
| ExRec (_x0, _x1, _x2) ->
- ((o#_Loc_t _x0)#binding _x1)#expr _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
@@ -9921,379 +10939,104 @@ module Struct =
| BiNil _x0 -> o#_Loc_t _x0
| BiAnd (_x0, _x1, _x2) ->
((o#_Loc_t _x0)#binding _x1)#binding _x2
- | BiSem (_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
end
- class c_expr f =
- object inherit map as super
+ let map_expr f =
+ object
+ inherit map as super
method expr = fun x -> f (super#expr x)
end
- class c_patt f =
- object inherit map as super
+ let map_patt f =
+ object
+ inherit map as super
method patt = fun x -> f (super#patt x)
end
- class c_ctyp f =
- object inherit map as super
+ let map_ctyp f =
+ object
+ inherit map as super
method ctyp = fun x -> f (super#ctyp x)
end
- class c_str_item f =
- object inherit map as super
+ let map_str_item f =
+ object
+ inherit map as super
method str_item = fun x -> f (super#str_item x)
end
- class c_sig_item f =
- object inherit map as super
+ let map_sig_item f =
+ object
+ inherit map as super
method sig_item = fun x -> f (super#sig_item x)
end
- class c_loc f =
- object inherit map as super
+ let map_loc f =
+ object
+ inherit map as super
method _Loc_t = fun x -> f (super#_Loc_t x)
end
- let map_patt f ast = (new c_patt f)#patt ast
- let map_loc f ast = (new c_loc f)#_Loc_t ast
- let map_sig_item f ast = (new c_sig_item f)#sig_item ast
- let map_str_item f ast = (new c_str_item f)#str_item ast
- let map_ctyp f ast = (new c_ctyp f)#ctyp ast
- let map_expr f ast = (new c_expr f)#expr ast
- let ghost = Loc.ghost
- let rec is_module_longident =
- function
- | Ast.IdAcc (_, _, i) -> is_module_longident i
- | Ast.IdApp (_, i1, i2) ->
- (is_module_longident i1) && (is_module_longident i2)
- | Ast.IdUid (_, _) -> true
- | _ -> false
- let rec is_irrefut_patt =
- function
- | Ast.PaId (_, (Ast.IdLid (_, _))) -> true
- | Ast.PaId (_, (Ast.IdUid (_, "()"))) -> true
- | 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.PaId (_, (Ast.IdLid (_, _)))), 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
- | Ast.PaTup (_, pl) -> is_irrefut_patt pl
- | Ast.PaOlb (_, _, (Ast.PaNil _)) -> true
- | Ast.PaOlb (_, _, p) -> is_irrefut_patt p
- | Ast.PaOlbi (_, _, p, _) -> is_irrefut_patt p
- | 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
- | Ast.ExAcc (_, e1, e2) ->
- (is_expr_constructor e1) && (is_expr_constructor e2)
- | Ast.ExVrn (_, _) -> true
- | _ -> false
- let ident_of_expr =
- let error () =
- invalid_arg
- "ident_of_expr: this expression is not an identifier" in
- let rec self =
- function
- | Ast.ExApp (_loc, e1, e2) ->
- Ast.IdApp (_loc, self e1, self e2)
- | Ast.ExAcc (_loc, e1, e2) ->
- Ast.IdAcc (_loc, self e1, self e2)
- | Ast.ExId (_, (Ast.IdLid (_, _))) -> error ()
- | Ast.ExId (_, i) ->
- if is_module_longident i then i else error ()
- | _ -> error ()
- in
- function
- | 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
- let rec self =
- function
- | Ast.TyApp (_loc, t1, t2) ->
- Ast.IdApp (_loc, self t1, self t2)
- | Ast.TyId (_, (Ast.IdLid (_, _))) -> error ()
- | Ast.TyId (_, i) ->
- if is_module_longident i then i else error ()
- | _ -> error ()
- in function | Ast.TyId (_, i) -> i | t -> self t
- let rec tyOr_of_list =
- function
- | [] -> Ast.TyNil ghost
- | [ t ] -> t
- | 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 ] -> t
- | 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 ] -> t
- | t :: ts ->
- let _loc = loc_of_ctyp t
- in Ast.TySem (_loc, t, tySem_of_list ts)
- let rec stSem_of_list =
- function
- | [] -> Ast.StNil ghost
- | [ t ] -> t
- | 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 ] -> t
- | 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 ] -> b
- | b :: bs ->
- let _loc = loc_of_binding b
- in Ast.BiAnd (_loc, b, biAnd_of_list bs)
- let rec wcAnd_of_list =
- function
- | [] -> Ast.WcNil ghost
- | [ w ] -> w
- | 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 ] -> i
- | 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 ] -> i
- | 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 ] -> x
- | 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 ] -> x
- | 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 ] -> x
- | 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 ] -> x
- | 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 ] -> x
- | 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 ] -> x
- | 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 ] -> x
- | 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 ] -> x
- | 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 ] -> x
- | x :: xs ->
- let _loc = loc_of_patt x
- in Ast.PaCom (_loc, x, paCom_of_list xs)
- let rec biSem_of_list =
- function
- | [] -> Ast.BiNil ghost
- | [ x ] -> x
- | x :: xs ->
- let _loc = loc_of_binding x
- in Ast.BiSem (_loc, x, biSem_of_list xs)
- let rec exSem_of_list =
- function
- | [] -> Ast.ExNil ghost
- | [ x ] -> x
- | 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 ] -> x
- | 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.TyCol (_loc, Ast.TyId (_loc, Ast.IdLid (_loc, s)),
- 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 =
+ 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_module_binding
+ let string_of_tag =
function
- | Ast.BiAnd (_, b1, b2) ->
- (pel_of_binding b1) @ (pel_of_binding b2)
- | Ast.BiEq (_, p, e) -> [ (p, e) ]
- | Ast.BiSem (_, b1, b2) ->
- (pel_of_binding b1) @ (pel_of_binding b2)
- | _ -> assert false
- let rec list_of_binding x acc =
- match x with
- | Ast.BiAnd (_, b1, b2) | Ast.BiSem (_, b1, b2) ->
- list_of_binding b1 (list_of_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.TyAmp (_, x, y) | Ast.TyCom (_, x, y) |
- Ast.TySta (_, x, y) | Ast.TySem (_, x, y) |
- 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
+ | Tag_ctyp -> "ctyp"
+ | Tag_patt -> "patt"
+ | Tag_expr -> "expr"
+ | Tag_module_type -> "module_type"
+ | Tag_sig_item -> "sig_item"
+ | Tag_with_constr -> "with_constr"
+ | Tag_module_expr -> "module_expr"
+ | Tag_str_item -> "str_item"
+ | Tag_class_type -> "class_type"
+ | Tag_class_sig_item -> "class_sig_item"
+ | Tag_class_expr -> "class_expr"
+ | Tag_class_str_item -> "class_str_item"
+ | Tag_match_case -> "match_case"
+ | Tag_ident -> "ident"
+ | 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) =
+ 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 =
@@ -10301,37 +11044,49 @@ module Struct =
module Make (Ast : Sig.Ast) : 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
- type expander =
- | ExStr of (bool -> string expand_fun)
- | ExAst of Ast.expr expand_fun * Ast.patt expand_fun
- let expanders_table = ref []
+ module Exp_key = DynAst.Pack(struct type 'a t = unit end)
+ module Exp_fun =
+ 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 = List.assoc (expander_name name) !expanders_table
- let add name f = expanders_table := (name, f) :: !expanders_table
+ 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
| Locating
- type t = (string * error * exn)
+ type t = (string * string * error * exn)
exception E of t
- let print ppf (name, ctx, exn) =
+ let print ppf (name, position, ctx, exn) =
let name = if name = "" then !default else name in
- let pp x = fprintf ppf "@?@[<2>While %s %S:" x name in
+ let pp x =
+ fprintf ppf "@?@[<2>While %s %S in a position of %S:" x
+ name position in
let () =
match ctx with
| Finding ->
(pp "finding quotation";
- fprintf ppf " available quotations are:\n@[<2>";
- List.iter (fun (s, _) -> fprintf ppf "%s@ " s)
+ 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 "@]")
| Expanding -> pp "expanding quotation"
@@ -10367,54 +11122,50 @@ module Struct =
end
let _ = let module M = ErrorHandler.Register(Error) in ()
open Error
- let expand_quotation loc expander quot =
+ let expand_quotation loc expander pos_tag quot =
let loc_name_opt =
if quot.q_loc = "" then None else Some quot.q_loc
in
try expander loc loc_name_opt quot.q_contents
with | (Loc.Exc_located (_, (Error.E _)) as exc) -> raise exc
| Loc.Exc_located (iloc, exc) ->
- let exc1 = Error.E (((quot.q_name), Expanding, exc))
+ let exc1 =
+ Error.E (((quot.q_name), pos_tag, Expanding, exc))
in raise (Loc.Exc_located (iloc, exc1))
| exc ->
- let exc1 = Error.E (((quot.q_name), Expanding, exc))
+ 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 str =
+ let parse_quotation_result parse loc quot pos_tag str =
try parse loc str
with
- | Loc.Exc_located (iloc, (Error.E ((n, Expanding, exc)))) ->
+ | Loc.Exc_located (iloc,
+ (Error.E ((n, pos_tag, Expanding, exc)))) ->
let ctx = ParsingResult (iloc, quot.q_contents) in
- let exc1 = Error.E ((n, ctx, exc))
+ let exc1 = Error.E ((n, pos_tag, ctx, exc))
in raise (Loc.Exc_located (iloc, exc1))
| Loc.Exc_located (iloc, ((Error.E _ as exc))) ->
raise (Loc.Exc_located (iloc, exc))
| Loc.Exc_located (iloc, exc) ->
let ctx = ParsingResult (iloc, quot.q_contents) in
- let exc1 = Error.E (((quot.q_name), ctx, exc))
+ let exc1 = Error.E (((quot.q_name), pos_tag, ctx, exc))
in raise (Loc.Exc_located (iloc, exc1))
- let handle_quotation loc proj in_expr parse quotation =
+ let expand loc quotation tag =
+ let pos_tag = DynAst.string_of_tag tag in
let name = quotation.q_name in
let expander =
- try find name
+ try find name tag
with | (Loc.Exc_located (_, (Error.E _)) as exc) -> raise exc
| Loc.Exc_located (qloc, exc) ->
raise
- (Loc.Exc_located (qloc, Error.E ((name, Finding, exc))))
+ (Loc.Exc_located (qloc,
+ Error.E ((name, pos_tag, Finding, exc))))
| exc ->
raise
- (Loc.Exc_located (loc, Error.E ((name, Finding, exc)))) in
+ (Loc.Exc_located (loc,
+ Error.E ((name, pos_tag, Finding, exc)))) in
let loc = Loc.join (Loc.move `start quotation.q_shift loc)
- in
- match expander with
- | ExStr f ->
- let new_str = expand_quotation loc (f in_expr) quotation
- in parse_quotation_result parse loc quotation new_str
- | ExAst (fe, fp) ->
- expand_quotation loc (proj (fe, fp)) quotation
- let expand_expr parse loc x =
- handle_quotation loc fst true parse x
- let expand_patt parse loc x =
- handle_quotation loc snd false parse x
+ in expand_quotation loc expander pos_tag quotation
end
end
module AstFilters =
@@ -10458,23 +11209,33 @@ module Struct =
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 =
+ if src >= l
+ then if dst >= l then s else String.sub s 0 dst
+ else
+ (match s.[src] with
+ | '_' -> 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 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); }
+ | _ -> { (t) with ptyp_desc = Ptyp_poly ([], t); }
let mb2b =
function
| Ast.BTrue -> true
@@ -10684,7 +11445,6 @@ module Struct =
let (params, variance) = List.split tl
in
{
-
ptype_params = params;
ptype_cstrs = cl;
ptype_kind = tk;
@@ -10712,15 +11472,15 @@ module Struct =
| _ -> assert false
let rec type_decl tl cl loc m pflag =
function
- | TyMan (_, t1, t2) ->
+ | Ast.TyMan (_, t1, t2) ->
type_decl tl cl loc (Some (ctyp t1)) pflag t2
- | TyPrv (_, t) -> type_decl tl cl loc m true t
- | TyRec (_, t) ->
+ | Ast.TyPrv (_, t) -> type_decl tl cl loc m true t
+ | Ast.TyRec (_, t) ->
mktype loc tl cl
(Ptype_record (List.map mktrecord (list_of_ctyp t []),
mkprivate' pflag))
m
- | TySum (_, t) ->
+ | Ast.TySum (_, t) ->
mktype loc tl cl
(Ptype_variant (List.map mkvariant (list_of_ctyp t []),
mkprivate' pflag))
@@ -10732,16 +11492,13 @@ module Struct =
else
(let m =
match t with
- | TyQuo (_, s) ->
- if List.mem_assoc s tl
- then Some (ctyp t)
- else None
+ | Ast.TyNil _ -> None
| _ -> 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 mkvalue_desc t p = { pval_type = ctyp t; pval_prim = p; }
let rec list_of_meta_list =
function
| Ast.LNil -> []
@@ -10793,7 +11550,6 @@ module Struct =
(id,
(Pwith_type
{
-
ptype_params = params;
ptype_cstrs = [];
ptype_kind = kind;
@@ -10916,7 +11672,9 @@ module Struct =
error loc
"Integer literal exceeds the range of representable integers of type nativeint")
in mkpat loc (Ppat_constant (Const_nativeint nati))
- | PaFlo (loc, s) -> mkpat loc (Ppat_constant (Const_float s))
+ | PaFlo (loc, s) ->
+ mkpat loc
+ (Ppat_constant (Const_float (remove_underscores s)))
| PaLab (loc, _, _) ->
error loc "labeled pattern not allowed here"
| PaOlb (loc, _, _) | PaOlbi (loc, _, _, _) ->
@@ -10950,7 +11708,7 @@ module Struct =
as p) -> error (loc_of_patt p) "invalid pattern"
and mklabpat =
function
- | Ast.PaEq (_, (Ast.PaId (_, i)), p) ->
+ | 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 =
@@ -11092,7 +11850,9 @@ module Struct =
let t1 =
(match t1 with | Ast.TyNil _ -> None | t -> Some (ctyp t))
in mkexp loc (Pexp_constraint (expr e, t1, Some (ctyp t2)))
- | ExFlo (loc, s) -> mkexp loc (Pexp_constant (Const_float s))
+ | ExFlo (loc, s) ->
+ mkexp loc
+ (Pexp_constant (Const_float (remove_underscores s)))
| ExFor (loc, i, e1, e2, df, el) ->
let e3 = ExSeq (loc, el) in
let df = if mb2b df then Upto else Downto
@@ -11174,7 +11934,7 @@ module Struct =
mkexp loc (Pexp_override (mkideexp iel []))
| ExRec (loc, lel, eo) ->
(match lel with
- | Ast.BiNil _ -> error loc "empty record"
+ | Ast.RbNil _ -> error loc "empty record"
| _ ->
let eo =
(match eo with
@@ -11244,8 +12004,7 @@ module Struct =
| e -> ("", (expr e))
and binding x acc =
match x with
- | Ast.BiAnd (_, x, y) | Ast.BiSem (_, x, y) ->
- binding x (binding y acc)
+ | Ast.BiAnd (_, x, y) -> binding x (binding y acc)
| Ast.BiEq (_, p, e) -> ((patt p), (expr e)) :: acc
| Ast.BiNil _ -> acc
| _ -> assert false
@@ -11261,17 +12020,14 @@ module Struct =
| w -> mkexp (loc_of_expr w) (Pexp_when (expr w, expr e))
and mklabexp x acc =
match x with
- | Ast.BiAnd (_, x, y) | Ast.BiSem (_, x, y) ->
- mklabexp x (mklabexp y acc)
- | Ast.BiEq (_, (Ast.PaId (_, i)), e) ->
+ | Ast.RbSem (_, x, y) -> mklabexp x (mklabexp y acc)
+ | Ast.RbEq (_, i, e) ->
((ident ~conv_lid: conv_lab i), (expr e)) :: acc
| _ -> assert false
and mkideexp x acc =
match x with
- | Ast.BiAnd (_, x, y) | Ast.BiSem (_, x, y) ->
- mkideexp x (mkideexp y acc)
- | Ast.BiEq (_, (Ast.PaId (_, (Ast.IdLid (_, s)))), e) ->
- (s, (expr e)) :: acc
+ | Ast.RbSem (_, x, y) -> mkideexp x (mkideexp y acc)
+ | Ast.RbEq (_, (Ast.IdLid (_, s)), e) -> (s, (expr e)) :: acc
| _ -> assert false
and mktype_decl x acc =
match x with
@@ -11291,15 +12047,17 @@ module Struct =
| _ -> assert false
and module_type =
function
- | MtId (loc, i) -> mkmty loc (Pmty_ident (long_uident i))
- | MtFun (loc, n, nt, mt) ->
+ | Ast.MtNil loc ->
+ error loc "abstract/nil module type not allowed here"
+ | Ast.MtId (loc, i) -> mkmty loc (Pmty_ident (long_uident i))
+ | Ast.MtFun (loc, n, nt, mt) ->
mkmty loc
(Pmty_functor (n, module_type nt, module_type mt))
- | MtQuo (loc, _) ->
- error loc "abstract module type not allowed here"
- | MtSig (loc, sl) ->
+ | Ast.MtQuo (loc, _) ->
+ error loc "module type variable not allowed here"
+ | Ast.MtSig (loc, sl) ->
mkmty loc (Pmty_signature (sig_item sl []))
- | MtWit (loc, mt, wc) ->
+ | Ast.MtWit (loc, mt, wc) ->
mkmty loc (Pmty_with (module_type mt, mkwithc wc []))
| Ast.MtAnt (_, _) -> assert false
and sig_item s l =
@@ -11367,15 +12125,16 @@ module Struct =
| _ -> assert false
and module_expr =
function
- | MeId (loc, i) -> mkmod loc (Pmod_ident (long_uident i))
- | MeApp (loc, me1, me2) ->
+ | Ast.MeNil loc -> error loc "nil module expression"
+ | Ast.MeId (loc, i) -> mkmod loc (Pmod_ident (long_uident i))
+ | Ast.MeApp (loc, me1, me2) ->
mkmod loc (Pmod_apply (module_expr me1, module_expr me2))
- | MeFun (loc, n, mt, me) ->
+ | Ast.MeFun (loc, n, mt, me) ->
mkmod loc
(Pmod_functor (n, module_type mt, module_expr me))
- | MeStr (loc, sl) ->
+ | Ast.MeStr (loc, sl) ->
mkmod loc (Pmod_structure (str_item sl []))
- | MeTyc (loc, me, mt) ->
+ | Ast.MeTyc (loc, me, mt) ->
mkmod loc
(Pmod_constraint (module_expr me, module_type mt))
| Ast.MeAnt (loc, _) ->
@@ -11469,7 +12228,6 @@ module Struct =
(List.split (class_parameters t []))))
in
{
-
pci_virt = if mb2b vir then Virtual else Concrete;
pci_params = (params, (mkloc loc_params));
pci_name = name;
@@ -11492,7 +12250,6 @@ module Struct =
(List.split (class_parameters t []))))
in
{
-
pci_virt = if mb2b vir then Virtual else Concrete;
pci_params = (params, (mkloc loc_params));
pci_name = name;
@@ -11625,7 +12382,7 @@ module Struct =
method expr =
function
| Ast.ExLet (_, _, (Ast.BiNil _), e) |
- Ast.ExRec (_, (Ast.BiNil _), e) |
+ Ast.ExRec (_, (Ast.RbNil _), e) |
Ast.ExCom (_, (Ast.ExNil _), e) |
Ast.ExCom (_, e, (Ast.ExNil _)) |
Ast.ExSem (_, (Ast.ExNil _), e) |
@@ -11649,10 +12406,13 @@ module Struct =
method binding =
function
| Ast.BiAnd (_, (Ast.BiNil _), bi) |
- Ast.BiAnd (_, bi, (Ast.BiNil _)) |
- Ast.BiSem (_, (Ast.BiNil _), bi) |
- Ast.BiSem (_, bi, (Ast.BiNil _)) -> self#binding bi
+ Ast.BiAnd (_, bi, (Ast.BiNil _)) -> self#binding bi
| bi -> super#binding bi
+ method rec_binding =
+ function
+ | Ast.RbSem (_, (Ast.RbNil _), bi) |
+ Ast.RbSem (_, bi, (Ast.RbNil _)) -> self#rec_binding bi
+ | bi -> super#rec_binding bi
method module_binding =
function
| Ast.MbAnd (_, (Ast.MbNil _), mb) |
@@ -11826,11 +12586,10 @@ module Struct =
let to_string _ = assert false
end
module EmptyPrinter :
- sig module Make (Ast : Sig.Ast) : Sig.Printer with module Ast = Ast end =
+ sig module Make (Ast : Sig.Ast) : Sig.Printer(Ast).S end =
struct
module Make (Ast : Sig.Ast) =
struct
- module Ast = Ast
let print_interf ?input_file:(_) ?output_file:(_) _ =
failwith "No interface printer"
let print_implem ?input_file:(_) ?output_file:(_) _ =
@@ -11874,24 +12633,20 @@ module Struct =
module S = Set.Make(String)
let rec fold_binding_vars f bi acc =
match bi with
- | Ast.BiAnd (_, bi1, bi2) | Ast.BiSem (_, bi1, bi2) ->
+ | Ast.BiAnd (_, bi1, bi2) ->
fold_binding_vars f bi1 (fold_binding_vars f bi2 acc)
| Ast.BiEq (_, (Ast.PaId (_, (Ast.IdLid (_, i)))), _) ->
f i acc
| _ -> assert false
class ['accu] c_fold_pattern_vars f init =
- object (o)
- inherit Ast.fold as super
+ 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; >}
- | Ast.PaEq (_, (Ast.PaId (_, (Ast.IdLid (_, _)))), p) ->
- o#patt p
+ Ast.PaOlb (_, s, (Ast.PaNil _)) -> {< acc = f s acc; >}
| p -> super#patt p
end
let fold_pattern_vars f p init =
@@ -11903,18 +12658,18 @@ module Struct =
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 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; >}
+ fun p -> {< env = fold_pattern_vars S.add p env; >}
method add_binding =
- fun bi -> {< env = fold_binding_vars S.add bi env; >}
+ fun bi -> {< env = fold_binding_vars S.add bi env; >}
method expr =
function
| Ast.ExId (_, (Ast.IdLid (_, s))) |
Ast.ExLab (_, s, (Ast.ExNil _)) |
Ast.ExOlb (_, s, (Ast.ExNil _)) ->
- if S.mem s env then o else {< free = f s free; >}
+ if S.mem s env then o else {< free = f s free; >}
| Ast.ExLet (_, Ast.BFalse, bi, e) ->
(((o#add_binding bi)#expr e)#set_env env)#binding bi
| Ast.ExLet (_, Ast.BTrue, bi, e) ->
@@ -12007,8 +12762,8 @@ module Struct =
| None -> ()
let mk strm =
match Stream.peek strm with
- | Some ((_, loc)) -> { strm = strm; loc = loc; }
- | None -> { strm = strm; loc = Loc.ghost; }
+ | 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
@@ -12206,11 +12961,7 @@ module Struct =
| Some t ->
Some
(Node
- {
-
- node = Sself;
- son = t;
- brother = DeadEnd;
+ { node = Sself; son = t; brother = DeadEnd;
})
| None -> search_tree level.lprefix)
and search_tree t =
@@ -12224,7 +12975,6 @@ module Struct =
Some
(Node
{
-
node = symb;
son = n.son;
brother = DeadEnd;
@@ -12235,7 +12985,6 @@ module Struct =
Some
(Node
{
-
node = n.node;
son = t;
brother = DeadEnd;
@@ -12760,7 +13509,7 @@ module Struct =
txt ^ (" (in [" ^ (entry.ename ^ "])")))
let symb_failed entry prev_symb_result prev_symb symb =
let tree =
- Node { node = symb; brother = DeadEnd; son = DeadEnd; }
+ 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
@@ -12808,7 +13557,7 @@ module Struct =
function
| Node { node = s; brother = bro; son = son } ->
Node
- { node = top_symb entry s; brother = bro; son = son;
+ { node = top_symb entry s; brother = bro; son = son;
}
| LocAct (_, _) | DeadEnd -> raise Stream.Failure
let entry_of_symb entry =
@@ -13298,7 +14047,6 @@ module Struct =
let assoc = match assoc with | Some a -> a | None -> LeftA
in
{
-
assoc = assoc;
lname = lname;
lsuffix = DeadEnd;
@@ -13330,7 +14078,6 @@ module Struct =
else ()
| None -> ());
{
-
assoc = a;
lname = lev.lname;
lsuffix = lev.lsuffix;
@@ -13466,7 +14213,6 @@ module Struct =
| Node { node = s; son = son; brother = bro } ->
Node
{
-
node = s;
son = son;
brother = insert [] bro;
@@ -13487,7 +14233,6 @@ module Struct =
| None ->
Node
{
-
node = s;
son = insert sl DeadEnd;
brother = tree;
@@ -13500,7 +14245,6 @@ module Struct =
(let t =
Node
{
-
node = s1;
son = insert sl son;
brother = bro;
@@ -13517,21 +14261,19 @@ module Struct =
| None ->
Node
{
-
node = s;
son = insert sl DeadEnd;
brother = bro;
} in
let t =
- Node { node = s1; son = son; brother = bro; }
+ Node { node = s1; son = son; brother = bro; }
in Some t)
else
(match try_insert s sl bro with
| Some bro ->
let t =
Node
- { node = s1; son = son; brother = bro;
- }
+ { node = s1; son = son; brother = bro; }
in Some t
| None -> None)
| LocAct (_, _) | DeadEnd -> None
@@ -13539,11 +14281,7 @@ module Struct =
function
| s :: sl ->
Node
- {
-
- node = s;
- son = insert_new sl;
- brother = DeadEnd;
+ { node = s; son = insert_new sl; brother = DeadEnd;
}
| [] -> LocAct (action, [])
in insert gsymbols tree
@@ -13551,7 +14289,6 @@ module Struct =
match e1 with
| true ->
{
-
assoc = slev.assoc;
lname = slev.lname;
lsuffix =
@@ -13560,7 +14297,6 @@ module Struct =
}
| false ->
{
-
assoc = slev.assoc;
lname = slev.lname;
lsuffix = slev.lsuffix;
@@ -13638,7 +14374,6 @@ module Struct =
((dsl,
(Node
{
-
node = n.node;
son = n.son;
brother = t;
@@ -13652,7 +14387,6 @@ module Struct =
((dsl,
(Node
{
-
node = n.node;
son = n.son;
brother = t;
@@ -13669,12 +14403,12 @@ module Struct =
| Some ((Some dsl, t)) ->
let t =
Node
- { node = n.node; son = t; brother = n.brother; }
+ { node = n.node; son = t; brother = n.brother; }
in Some (((Some (n.node :: dsl)), t))
| Some ((None, t)) ->
let t =
Node
- { node = n.node; son = t; brother = n.brother; }
+ { node = n.node; son = t; brother = n.brother; }
in Some ((None, t))
| None -> None
in delete_in_tree
@@ -13714,7 +14448,6 @@ module Struct =
| _ ->
let lev =
{
-
assoc = lev.assoc;
lname = lev.lname;
lsuffix = t;
@@ -13741,7 +14474,6 @@ module Struct =
| _ ->
let lev =
{
-
assoc = lev.assoc;
lname = lev.lname;
lsuffix = lev.lsuffix;
@@ -13894,7 +14626,6 @@ module Struct =
let dump ppf e = fprintf ppf "%a@\n" Dump.entry e
let mk g n =
{
-
egram = g;
ename = n;
estart = Tools.empty_entry n;
@@ -13930,7 +14661,6 @@ module Struct =
let of_parser g n (p : (Token.t * Loc.t) Stream.t -> 'a) :
'a t =
{
-
egram = g;
ename = n;
estart = (fun _ _ ts -> Action.mk (p ts));
@@ -13972,7 +14702,6 @@ module Struct =
let gkeywords = Hashtbl.create 301
in
{
-
gkeywords = gkeywords;
gfilter = Token.Filter.mk (Hashtbl.mem gkeywords);
glexer = Lexer.mk ();
@@ -14034,7 +14763,6 @@ module Struct =
let gkeywords = Hashtbl.create 301
in
{
-
gkeywords = gkeywords;
gfilter = Token.Filter.mk (Hashtbl.mem gkeywords);
glexer = Lexer.mk ();
@@ -14075,18 +14803,16 @@ module Printers =
module DumpCamlp4Ast :
sig
module Id : Sig.Id
- module Make (Syntax : Sig.Syntax) :
- Sig.Printer with module Ast = Syntax.Ast
+ module Make (Syntax : Sig.Syntax) : Sig.Printer(Syntax.Ast).S
end =
struct
module Id =
struct
let name = "Camlp4Printers.DumpCamlp4Ast"
let version =
- "$Id: Camlp4.ml,v 1.2 2007/02/26 16:32:46 ertai Exp $"
+ "$Id: DumpCamlp4Ast.ml,v 1.5.4.1 2007/03/30 15:50:12 pouillar Exp $"
end
- module Make (Syntax : Sig.Syntax) :
- Sig.Printer with module Ast = Syntax.Ast =
+ module Make (Syntax : Sig.Syntax) : Sig.Printer(Syntax.Ast).S =
struct
include Syntax
let with_open_out_file x f =
@@ -14109,18 +14835,16 @@ module Printers =
module DumpOCamlAst :
sig
module Id : Sig.Id
- module Make (Syntax : Sig.Camlp4Syntax) :
- Sig.Printer with module Ast = Syntax.Ast
+ module Make (Syntax : Sig.Camlp4Syntax) : Sig.Printer(Syntax.Ast).S
end =
struct
module Id : Sig.Id =
struct
let name = "Camlp4Printers.DumpOCamlAst"
let version =
- "$Id: Camlp4.ml,v 1.2 2007/02/26 16:32:46 ertai Exp $"
+ "$Id: DumpOCamlAst.ml,v 1.5.4.1 2007/03/30 15:50:12 pouillar Exp $"
end
- module Make (Syntax : Sig.Camlp4Syntax) :
- Sig.Printer with module Ast = Syntax.Ast =
+ module Make (Syntax : Sig.Camlp4Syntax) : Sig.Printer(Syntax.Ast).S =
struct
include Syntax
module Ast2pt = Struct.Camlp4Ast2OCamlAst.Make(Ast)
@@ -14152,15 +14876,14 @@ module Printers =
module Null :
sig
module Id : Sig.Id
- module Make (Syntax : Sig.Syntax) :
- Sig.Printer with module Ast = Syntax.Ast
+ module Make (Syntax : Sig.Syntax) : Sig.Printer(Syntax.Ast).S
end =
struct
module Id =
struct
let name = "Camlp4.Printers.Null"
let version =
- "$Id: Camlp4.ml,v 1.2 2007/02/26 16:32:46 ertai Exp $"
+ "$Id: Null.ml,v 1.2 2007/02/07 10:09:21 ertai Exp $"
end
module Make (Syntax : Sig.Syntax) =
struct
@@ -14176,7 +14899,6 @@ module Printers =
sig
open Format
include Sig.Camlp4Syntax with module Loc = Syntax.Loc
- and module Warning = Syntax.Warning
and module Token = Syntax.Token and module Ast = Syntax.Ast
and module Gram = Syntax.Gram
val list' :
@@ -14227,6 +14949,7 @@ module Printers =
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 :
@@ -14239,7 +14962,7 @@ module Printers =
method intlike : formatter -> string -> unit
method binding : formatter -> Ast.binding -> unit
method record_binding :
- formatter -> Ast.binding -> unit
+ formatter -> Ast.rec_binding -> unit
method match_case : formatter -> Ast.match_case -> unit
method match_case_aux :
formatter -> Ast.match_case -> unit
@@ -14312,15 +15035,9 @@ module Printers =
val print :
string option ->
(printer -> formatter -> 'a -> unit) -> 'a -> unit
- 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
- module MakeMore (Syntax : Sig.Camlp4Syntax) :
- Sig.Printer with module Ast = Syntax.Ast
+ module MakeMore (Syntax : Sig.Camlp4Syntax) : Sig.Printer(Syntax.
+ Ast).S
end =
struct
open Format
@@ -14328,7 +15045,7 @@ module Printers =
struct
let name = "Camlp4.Printers.OCaml"
let version =
- "$Id: Camlp4.ml,v 1.2 2007/02/26 16:32:46 ertai Exp $"
+ "$Id: OCaml.ml,v 1.21.2.7 2007/05/10 13:31:20 pouillar Exp $"
end
module Make (Syntax : Sig.Camlp4Syntax) =
struct
@@ -14459,10 +15176,10 @@ module Printers =
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; >}
+ 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)
@@ -14472,13 +15189,12 @@ module Printers =
val curry_constr = init_curry_constr
val var_conversion = false
method semisep = semisep
- method set_semisep = fun s -> {< semisep = s; >}
+ 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; >}
+ {< 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
@@ -14591,21 +15307,19 @@ module Printers =
| _ ->
pp f "%a @[<0>%a=@]@ %a" o#simple_patt p
(list' o#simple_patt "" "@ ") pl o#expr e)
- | Ast.BiSem (_, _, _) -> assert false
| Ast.BiAnt (_, s) -> o#anti f s
method record_binding =
fun f bi ->
- let () = o#node f bi Ast.loc_of_binding
+ let () = o#node f bi Ast.loc_of_rec_binding
in
match bi with
- | Ast.BiNil _ -> ()
- | Ast.BiEq (_, p, e) ->
- pp f "@ @[<2>%a =@ %a@];" o#simple_patt p o#expr e
- | Ast.BiSem (_, b1, b2) ->
+ | Ast.RbNil _ -> ()
+ | Ast.RbEq (_, i, e) ->
+ pp f "@ @[<2>%a =@ %a@];" o#var_ident i o#expr e
+ | Ast.RbSem (_, b1, b2) ->
(o#under_semi#record_binding f b1;
o#under_semi#record_binding f b2)
- | Ast.BiAnd (_, _, _) -> assert false
- | Ast.BiAnt (_, s) -> o#anti f s
+ | Ast.RbAnt (_, s) -> o#anti f s
method object_dup =
fun f ->
list
@@ -14731,8 +15445,7 @@ module Printers =
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 private var_ident = {< var_conversion = true; >}#ident
method expr =
fun f e ->
let () = o#node f e Ast.loc_of_expr
@@ -14756,8 +15469,8 @@ module Printers =
(Ast.ExApp (_, (Ast.ExId (_, (Ast.IdLid (_, n)))),
x)),
y) when is_infix n ->
- pp f "@[<2>%a@ %s@ %a@]" o#dot_expr x n o#dot_expr
- y
+ pp f "@[<2>%a@ %s@ %a@]" o#apply_expr x n
+ o#apply_expr y
| Ast.ExApp (_, x, y) ->
let (a, al) = get_expr_args x [ y ]
in
@@ -14767,16 +15480,16 @@ module Printers =
then
(match al with
| [ Ast.ExTup (_, _) ] ->
- pp f "@[<2>%a@ (%a)@]" o#dot_expr x
+ pp f "@[<2>%a@ (%a)@]" o#apply_expr x
o#expr y
| [ _ ] ->
- pp f "@[<2>%a@ %a@]" o#dot_expr x
- o#dot_expr y
+ pp f "@[<2>%a@ %a@]" o#apply_expr x
+ o#apply_expr y
| al ->
- pp f "@[<2>%a@ (%a)@]" o#dot_expr a
+ pp f "@[<2>%a@ (%a)@]" o#apply_expr a
(list o#under_pipe#expr ",@ ") al)
else
- pp f "@[<2>%a@]" (list o#dot_expr "@ ")
+ pp f "@[<2>%a@]" (list o#apply_expr "@ ")
(a :: al)
| Ast.ExAss (_,
(Ast.ExAcc (_, e1,
@@ -14817,10 +15530,18 @@ module Printers =
pp f "@[<0>@[<hv2>try@ %a@]@ @[<0>with%a@]@]"
o#expr e o#match_case a
| Ast.ExAsf _ -> pp f "@[<2>assert@ false@]"
- | Ast.ExAsr (_, e) -> pp f "@[<2>assert@ %a@]" o#expr e
+ | Ast.ExAsr (_, e) ->
+ 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
+ | e -> o#apply_expr f e
+ method apply_expr =
+ fun f e ->
+ let () = o#node f e Ast.loc_of_expr
+ in
+ 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 ->
@@ -14874,10 +15595,9 @@ module Printers =
| Ast.ExChr (_, s) -> pp f "'%s'" (ocaml_char s)
| Ast.ExId (_, i) -> o#var_ident f i
| Ast.ExRec (_, b, (Ast.ExNil _)) ->
- pp f "@[<hv0>@[<hv2>{@ %a@]@ }@]" o#record_binding
- b
+ pp f "@[<hv0>@[<hv2>{%a@]@ }@]" o#record_binding b
| Ast.ExRec (_, b, e) ->
- pp f "@[<hv0>@[<hv2>{@ (%a)@ with@ %a@]@ }@]"
+ pp f "@[<hv0>@[<hv2>{@ (%a)@ with%a@]@ }@]"
o#expr e o#record_binding b
| Ast.ExStr (_, s) -> pp f "\"%s\"" s
| Ast.ExWhi (_, e1, e2) ->
@@ -14891,8 +15611,8 @@ module Printers =
pp f "@[<2>?%s:@ %a@]" s o#dot_expr e
| Ast.ExVrn (_, s) -> pp f "`%a" o#var s
| Ast.ExOvr (_, b) ->
- pp f "@[<hv0>@[<hv2>{<@ %a@]@ >}@]"
- o#record_binding b
+ pp f "@[<hv0>@[<hv2>{<%a@]@ >}@]" o#record_binding
+ b
| Ast.ExObj (_, (Ast.PaNil _), cst) ->
pp f "@[<hv0>@[<hv2>object@ %a@]@ end@]"
o#class_str_item cst
@@ -14904,7 +15624,6 @@ module Printers =
pp f
"@[<hv0>@[<hv2>object @[<2>(%a)@]@ %a@]@ end@]"
o#patt p o#class_str_item cst
- | Ast.ExNew (_, i) -> pp f "@[<2>new@ %a@]" o#ident i
| Ast.ExCom (_, e1, e2) ->
pp f "%a,@ %a" o#simple_expr e1 o#simple_expr e2
| Ast.ExSem (_, e1, e2) ->
@@ -14915,8 +15634,8 @@ module Printers =
Ast.ExFun (_, _) | Ast.ExMat (_, _, _) |
Ast.ExTry (_, _, _) | Ast.ExIfe (_, _, _, _) |
Ast.ExLet (_, _, _, _) | Ast.ExLmd (_, _, _, _) |
- Ast.ExAsr (_, _) | Ast.ExAsf _ | Ast.ExLaz (_, _)
- -> pp f "(%a)" o#reset#expr e
+ Ast.ExAsr (_, _) | Ast.ExAsf _ | Ast.ExLaz (_, _) |
+ Ast.ExNew (_, _) -> pp f "(%a)" o#reset#expr e
method direction_flag =
fun f b ->
match b with
@@ -14930,8 +15649,8 @@ module Printers =
match p with
| Ast.PaAli (_, p1, p2) ->
pp f "@[<1>(%a@ as@ %a)@]" o#patt p1 o#patt p2
- | Ast.PaEq (_, p1, p2) ->
- pp f "@[<2>%a =@ %a@]" o#patt p1 o#patt p2
+ | Ast.PaEq (_, i, p) ->
+ pp f "@[<2>%a =@ %a@]" o#var_ident i o#patt p
| Ast.PaSem (_, p1, p2) ->
pp f "%a;@ %a" o#patt p1 o#patt p2
| p -> o#patt1 f p
@@ -15052,7 +15771,7 @@ module Printers =
| Ast.TyObj (_, (Ast.TyNil _), Ast.BTrue) ->
pp f "< .. >"
| Ast.TyObj (_, t, Ast.BTrue) ->
- pp f "@[<0>@[<2><@ %a@ ..@]@ >@]" o#ctyp t
+ pp f "@[<0>@[<2><@ %a;@ ..@]@ >@]" o#ctyp t
| Ast.TyObj (_, t, Ast.BFalse) ->
pp f "@[<0>@[<2><@ %a@]@ >@]" o#ctyp t
| Ast.TyQuo (_, s) -> pp f "'%a" o#var s
@@ -15110,14 +15829,7 @@ module Printers =
| Ast.TyDcl (_, tn, tp, te, cl) ->
(pp f "@[<2>%a%a@]" o#type_params tp o#var tn;
(match te with
- | Ast.TyQuo (_, s) when
- not
- (List.exists
- (function
- | Ast.TyQuo (_, s') -> s = s'
- | _ -> false)
- tp)
- -> ()
+ | Ast.TyNil _ -> ()
| _ -> pp f " =@ %a" o#ctyp te);
if cl <> []
then pp f "@ %a" (list o#constrain "@ ") cl
@@ -15182,6 +15894,8 @@ module Printers =
| Ast.SgMod (_, s, mt) ->
pp f "@[<2>module %a :@ %a%s@]" o#var s
o#module_type mt semisep
+ | Ast.SgMty (_, s, (Ast.MtNil _)) ->
+ pp f "@[<2>module type %a%s@]" o#var s semisep
| Ast.SgMty (_, s, mt) ->
pp f "@[<2>module type %a =@ %a%s@]" o#var s
o#module_type mt semisep
@@ -15275,6 +15989,7 @@ module Printers =
let () = o#node f mt Ast.loc_of_module_type
in
match mt with
+ | Ast.MtNil _ -> assert false
| Ast.MtId (_, i) -> o#ident f i
| Ast.MtAnt (_, s) -> o#anti f s
| Ast.MtFun (_, s, mt1, mt2) ->
@@ -15307,6 +16022,7 @@ module Printers =
let () = o#node f me Ast.loc_of_module_expr
in
match me with
+ | Ast.MeNil _ -> assert false
| Ast.MeId (_, i) -> o#ident f i
| Ast.MeAnt (_, s) -> o#anti f s
| Ast.MeApp (_, me1, me2) ->
@@ -15338,11 +16054,11 @@ module Printers =
| Ast.CeCon (_, Ast.BFalse, i, t) ->
pp f "@[<2>@[<1>[%a]@]@ %a@]" o#class_params t
o#ident i
- | Ast.CeCon (_, Ast.BTrue, i, (Ast.TyNil _)) ->
- pp f "@[<2>virtual@ %a@]" o#ident i
- | Ast.CeCon (_, Ast.BTrue, i, t) ->
+ | Ast.CeCon (_, Ast.BTrue, (Ast.IdLid (_, i)),
+ (Ast.TyNil _)) -> pp f "@[<2>virtual@ %a@]" o#var i
+ | Ast.CeCon (_, Ast.BTrue, (Ast.IdLid (_, i)), t) ->
pp f "@[<2>virtual@ @[<1>[%a]@]@ %a@]"
- o#class_params t o#ident i
+ o#class_params t o#var i
| Ast.CeFun (_, p, ce) ->
pp f "@[<2>fun@ %a@ ->@ %a@]" o#patt p o#class_expr
ce
@@ -15382,11 +16098,11 @@ module Printers =
| Ast.CtCon (_, Ast.BFalse, i, t) ->
pp f "@[<2>[@,%a@]@,]@ %a" o#class_params t
o#ident i
- | Ast.CtCon (_, Ast.BTrue, i, (Ast.TyNil _)) ->
- pp f "@[<2>virtual@ %a@]" o#ident i
- | Ast.CtCon (_, Ast.BTrue, i, t) ->
+ | Ast.CtCon (_, Ast.BTrue, (Ast.IdLid (_, i)),
+ (Ast.TyNil _)) -> pp f "@[<2>virtual@ %a@]" o#var i
+ | Ast.CtCon (_, Ast.BTrue, (Ast.IdLid (_, i)), t) ->
pp f "@[<2>virtual@ [@,%a@]@,]@ %a" o#class_params
- t o#ident i
+ t o#var i
| Ast.CtFun (_, t, ct) ->
pp f "@[<2>%a@ ->@ %a@]" o#simple_ctyp t
o#class_type ct
@@ -15502,8 +16218,8 @@ module Printers =
let print_implem ?input_file:(_) ?output_file st =
print output_file (fun o -> o#implem) st
end
- module MakeMore (Syntax : Sig.Camlp4Syntax) :
- Sig.Printer with module Ast = Syntax.Ast =
+ module MakeMore (Syntax : Sig.Camlp4Syntax) : Sig.Printer(Syntax.
+ Ast).S =
struct
include Make(Syntax)
let semisep = ref false
@@ -15553,7 +16269,6 @@ module Printers =
sig
open Format
include Sig.Camlp4Syntax with module Loc = Syntax.Loc
- and module Warning = Syntax.Warning
and module Token = Syntax.Token and module Ast = Syntax.Ast
and module Gram = Syntax.Gram
class printer :
@@ -15565,15 +16280,9 @@ module Printers =
val print :
string option ->
(printer -> formatter -> 'a -> unit) -> 'a -> unit
- 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
- module MakeMore (Syntax : Sig.Camlp4Syntax) :
- Sig.Printer with module Ast = Syntax.Ast
+ module MakeMore (Syntax : Sig.Camlp4Syntax) : Sig.Printer(Syntax.
+ Ast).S
end =
struct
open Format
@@ -15581,7 +16290,7 @@ module Printers =
struct
let name = "Camlp4.Printers.OCamlr"
let version =
- "$Id: Camlp4.ml,v 1.2 2007/02/26 16:32:46 ertai Exp $"
+ "$Id: OCamlr.ml,v 1.17.4.3 2007/05/10 13:31:20 pouillar Exp $"
end
module Make (Syntax : Sig.Camlp4Syntax) =
struct
@@ -15590,6 +16299,13 @@ module Printers =
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" ]
+ in
+ 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)
@@ -15609,9 +16325,9 @@ module Printers =
method reset_semi = o
method reset = o
method private unset_first_match_case =
- {< first_match_case = false; >}
+ {< first_match_case = false; >}
method private set_first_match_case =
- {< first_match_case = true; >}
+ {< first_match_case = true; >}
method seq =
fun f e ->
let rec self right f e =
@@ -15646,8 +16362,8 @@ module Printers =
| v ->
(match lex_string v with
| LIDENT s | UIDENT s | ESCAPED_IDENT s when
- is_keyword s -> pp f "\\%s" s
- | SYMBOL s -> pp f "\\%s" s
+ is_keyword s -> pp f "%s__" s
+ | SYMBOL s -> pp f "( %s )" s
| LIDENT s | UIDENT s | ESCAPED_IDENT s ->
pp_print_string f s
| tok ->
@@ -15753,25 +16469,6 @@ module Printers =
(Ast.ExId (_, (Ast.IdLid (_, "val"))))) ->
pp f "@[<2>%a.@,val@]" o#simple_expr e
| e -> super#dot_expr f e
- method simple_expr =
- fun f e ->
- let () = o#node f e Ast.loc_of_expr
- in
- match e with
- | Ast.ExFor (_, s, e1, e2, Ast.BTrue, e3) ->
- pp f
- "@[<hv0>@[<hv2>@[<2>for %a@ =@ %a@ to@ %a@ do {@]@ %a@]@ }@]"
- o#var s o#expr e1 o#expr e2 o#seq e3
- | Ast.ExFor (_, s, e1, e2, Ast.BFalse, e3) ->
- pp f
- "@[<hv0>@[<hv2>@[<2>for %a@ =@ %a@ downto@ %a@ do {@]@ %a@]@ }@]"
- o#var s o#expr e1 o#expr e2 o#seq e3
- | Ast.ExWhi (_, e1, e2) ->
- pp f "@[<2>while@ %a@ do {@ %a@ }@]" o#expr e1
- o#seq e2
- | Ast.ExSeq (_, e) ->
- pp f "@[<hv0>@[<hv2>do {@ %a@]@ }@]" o#seq e
- | e -> super#simple_expr f e
method ctyp =
fun f t ->
let () = o#node f t Ast.loc_of_ctyp
@@ -15780,14 +16477,7 @@ module Printers =
| Ast.TyDcl (_, tn, tp, te, cl) ->
(pp f "@[<2>%a%a@]" o#var tn o#type_params tp;
(match te with
- | Ast.TyQuo (_, s) when
- not
- (List.exists
- (function
- | Ast.TyQuo (_, s') -> s = s'
- | _ -> false)
- tp)
- -> ()
+ | Ast.TyNil _ -> ()
| _ -> pp f " =@ %a" o#ctyp te);
if cl <> []
then pp f "@ %a" (list o#constrain "@ ") cl
@@ -15868,10 +16558,10 @@ module Printers =
| Ast.CtCon (_, Ast.BFalse, i, t) ->
pp f "@[<2>%a [@,%a@]@,]" o#ident i o#class_params
t
- | Ast.CtCon (_, Ast.BTrue, i, (Ast.TyNil _)) ->
- pp f "@[<2>virtual@ %a@]" o#ident i
- | Ast.CtCon (_, Ast.BTrue, i, t) ->
- pp f "@[<2>virtual@ %a@ [@,%a@]@,]" o#ident i
+ | Ast.CtCon (_, Ast.BTrue, (Ast.IdLid (_, i)),
+ (Ast.TyNil _)) -> pp f "@[<2>virtual@ %a@]" o#var i
+ | Ast.CtCon (_, Ast.BTrue, (Ast.IdLid (_, i)), t) ->
+ pp f "@[<2>virtual@ %a@ [@,%a@]@,]" o#var i
o#class_params t
| ct -> super#class_type f ct
method class_expr =
@@ -15884,10 +16574,10 @@ module Printers =
| Ast.CeCon (_, Ast.BFalse, i, t) ->
pp f "@[<2>%a@ @[<1>[%a]@]@]" o#ident i
o#class_params t
- | Ast.CeCon (_, Ast.BTrue, i, (Ast.TyNil _)) ->
- pp f "@[<2>virtual@ %a@]" o#ident i
- | Ast.CeCon (_, Ast.BTrue, i, t) ->
- pp f "@[<2>virtual@ %a@ @[<1>[%a]@]@]" o#ident i
+ | Ast.CeCon (_, Ast.BTrue, (Ast.IdLid (_, i)),
+ (Ast.TyNil _)) -> pp f "@[<2>virtual@ %a@]" o#var i
+ | Ast.CeCon (_, Ast.BTrue, (Ast.IdLid (_, i)), t) ->
+ pp f "@[<2>virtual@ %a@ @[<1>[%a]@]@]" o#var i
o#ctyp t
| ce -> super#class_expr f ce
end
@@ -15896,8 +16586,8 @@ module Printers =
let print_interf = print_interf
let print_implem = print_implem
end
- module MakeMore (Syntax : Sig.Camlp4Syntax) :
- Sig.Printer with module Ast = Syntax.Ast =
+ module MakeMore (Syntax : Sig.Camlp4Syntax) : Sig.Printer(Syntax.
+ Ast).S =
struct
include Make(Syntax)
let margin = ref 78
@@ -15933,10 +16623,9 @@ module Printers =
module OCamlInitSyntax =
struct
module Make
- (Warning : Sig.Warning)
- (Ast : Sig.Camlp4Ast with module Loc = Warning.Loc)
+ (Ast : Sig.Camlp4Ast)
(Gram :
- Sig.Grammar.Static with module Loc = Warning.Loc with
+ Sig.Grammar.Static with module Loc = Ast.Loc with
type Token.t = Sig.camlp4_token)
(Quotation : Sig.Quotation with module Ast = Sig.Camlp4AstToAst(Ast)) :
Sig.Camlp4Syntax with module Loc = Ast.Loc and module Ast = Ast
@@ -15944,12 +16633,16 @@ module OCamlInitSyntax =
and module AntiquotSyntax.Ast = Sig.Camlp4AstToAst(Ast)
and module Quotation = Quotation =
struct
- module Warning = Warning
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"
@@ -15957,7 +16650,6 @@ module OCamlInitSyntax =
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_LIDENT_or_operator = Gram.Entry.mk "a_LIDENT_or_operator"
let a_NATIVEINT = Gram.Entry.mk "a_NATIVEINT"
let a_OPTLABEL = Gram.Entry.mk "a_OPTLABEL"
let a_STRING = Gram.Entry.mk "a_STRING"
@@ -16009,7 +16701,6 @@ module OCamlInitSyntax =
let eq_expr = Gram.Entry.mk "eq_expr"
let expr = Gram.Entry.mk "expr"
let expr_eoi = Gram.Entry.mk "expr_eoi"
- let field = Gram.Entry.mk "field"
let field_expr = Gram.Entry.mk "field_expr"
let fun_binding = Gram.Entry.mk "fun_binding"
let fun_def = Gram.Entry.mk "fun_def"
@@ -16061,16 +16752,15 @@ module OCamlInitSyntax =
let patt_eoi = Gram.Entry.mk "patt_eoi"
let patt_tcon = Gram.Entry.mk "patt_tcon"
let phrase = Gram.Entry.mk "phrase"
- let pipe_ctyp = Gram.Entry.mk "pipe_ctyp"
let poly_type = Gram.Entry.mk "poly_type"
let row_field = Gram.Entry.mk "row_field"
- let sem_ctyp = Gram.Entry.mk "sem_ctyp"
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"
@@ -16108,11 +16798,26 @@ module OCamlInitSyntax =
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 () ->
@@ -16170,33 +16875,32 @@ module OCamlInitSyntax =
let parse_patt loc str = Gram.parse_string antiquot_patt loc str
end
module Quotation = Quotation
- module Parser =
- struct
- module Ast = Ast
- let wrap directive_handler pa init_loc cs =
- let rec loop loc =
- let (pl, stopped_at_directive) = pa loc cs
- in
- match stopped_at_directive with
- | Some new_loc ->
- let pl =
- (match List.rev pl with
- | [] -> assert false
- | x :: xs ->
- (match directive_handler x with
- | None -> xs
- | Some x -> x :: xs))
- 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
- end
- module Printer = Struct.EmptyPrinter.Make(Ast)
+ let wrap directive_handler pa init_loc cs =
+ let rec loop loc =
+ let (pl, stopped_at_directive) = pa loc cs
+ in
+ match stopped_at_directive with
+ | Some new_loc ->
+ let pl =
+ (match List.rev pl with
+ | [] -> assert false
+ | x :: xs ->
+ (match directive_handler x with
+ | None -> xs
+ | Some x -> x :: xs))
+ 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 :
@@ -16213,7 +16917,6 @@ module PreCast :
| NEWLINE | LINE_DIRECTIVE of int * string option | EOI
module Id : Sig.Id
module Loc : Sig.Loc
- module Warning : Sig.Warning with module Loc = 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
@@ -16224,18 +16927,15 @@ module PreCast :
module DynLoader : Sig.DynLoader
module AstFilters : Sig.AstFilters with module Ast = Ast
module Syntax : Sig.Camlp4Syntax with module Loc = Loc
- and module Warning = Warning and module Token = Token
- and module Ast = Ast and module Gram = Gram
+ and module Token = Token and module Ast = Ast and module Gram = Gram
and module Quotation = Quotation
module Printers :
sig
- module OCaml : Sig.Printer with module Ast = Sig.Camlp4AstToAst(Ast)
- module OCamlr : Sig.Printer with module Ast = Sig.Camlp4AstToAst(Ast)
- module DumpOCamlAst :
- Sig.Printer with module Ast = Sig.Camlp4AstToAst(Ast)
- module DumpCamlp4Ast :
- Sig.Printer with module Ast = Sig.Camlp4AstToAst(Ast)
- module Null : Sig.Printer with module Ast = Sig.Camlp4AstToAst(Ast)
+ 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
@@ -16245,7 +16945,8 @@ module PreCast :
module Id =
struct
let name = "Camlp4.PreCast"
- let version = "$Id: Camlp4.ml,v 1.2 2007/02/26 16:32:46 ertai Exp $"
+ let version =
+ "$Id: PreCast.ml,v 1.4.4.1 2007/03/30 15:50:12 pouillar Exp $"
end
type camlp4_token =
Sig.camlp4_token =
@@ -16258,7 +16959,6 @@ module PreCast :
| ANTIQUOT of string * string | COMMENT of string | BLANKS of string
| NEWLINE | LINE_DIRECTIVE of int * string option | EOI
module Loc = Struct.Loc
- module Warning = Struct.Warning.Make(Loc)
module Ast = Struct.Camlp4Ast.Make(Loc)
module Token = Struct.Token.Make(Loc)
module Lexer = Struct.Lexer.Make(Token)
@@ -16266,7 +16966,7 @@ module PreCast :
module DynLoader = Struct.DynLoader
module Quotation = Struct.Quotation.Make(Ast)
module MakeSyntax (U : sig end) =
- OCamlInitSyntax.Make(Warning)(Ast)(Gram)(Quotation)
+ OCamlInitSyntax.Make(Ast)(Gram)(Quotation)
module Syntax = MakeSyntax(struct end)
module AstFilters = Struct.AstFilters.Make(Ast)
module MakeGram = Struct.Grammar.Static.Make
@@ -16303,17 +17003,14 @@ module Register :
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 with module Ast = Ast) :
+ (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 with module Ast = Ast) :
+ (Maker : functor (Ast : Sig.Camlp4Ast) -> Sig.Parser(Ast).S) :
sig end
module OCamlPreCastParser
- (Id : Sig.Id) (Parser : Sig.Parser with module Ast = PreCast.Ast) :
- sig end
+ (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
@@ -16323,25 +17020,22 @@ module Register :
PreCast.Ast.sig_item printer_fun -> unit
module Printer
(Id : Sig.Id)
- (Maker :
- functor (Syn : Sig.Syntax) -> Sig.Printer with module Ast = Syn.Ast) :
+ (Maker : functor (Syn : Sig.Syntax) -> Sig.Printer(Syn.Ast).S) :
sig end
module OCamlPrinter
(Id : Sig.Id)
- (Maker :
- functor (Syn : Sig.Camlp4Syntax) ->
- Sig.Printer with module Ast = Syn.Ast) :
+ (Maker : functor (Syn : Sig.Camlp4Syntax) -> Sig.Printer(Syn.Ast).S) :
sig end
module OCamlPreCastPrinter
- (Id : Sig.Id) (Printer : Sig.Printer with module Ast = PreCast.Ast) :
- sig end
+ (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
- module CurrentParser : Sig.Parser with module Ast = PreCast.Ast
- module CurrentPrinter : Sig.Printer with module Ast = PreCast.Ast
+ 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
@@ -16371,10 +17065,12 @@ module Register :
(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 = Queue.add (m, f) callbacks
+ 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)
@@ -16411,8 +17107,7 @@ module Register :
end
module Printer
(Id : Sig.Id)
- (Maker :
- functor (Syn : Sig.Syntax) -> Sig.Printer with module Ast = Syn.Ast) =
+ (Maker : functor (Syn : Sig.Syntax) -> Sig.Printer(Syn.Ast).S) =
struct
let _ =
declare_dyn_module Id.name
@@ -16421,9 +17116,7 @@ module Register :
end
module OCamlPrinter
(Id : Sig.Id)
- (Maker :
- functor (Syn : Sig.Camlp4Syntax) ->
- Sig.Printer with module Ast = Syn.Ast) =
+ (Maker : functor (Syn : Sig.Camlp4Syntax) -> Sig.Printer(Syn.Ast).S) =
struct
let _ =
declare_dyn_module Id.name
@@ -16431,15 +17124,14 @@ module Register :
in register_printer M.print_implem M.print_interf)
end
module OCamlPreCastPrinter
- (Id : Sig.Id) (P : Sig.Printer with module Ast = PreCast.Ast) =
+ (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 with module Ast = Ast) =
+ (Id : Sig.Id) (Maker : functor (Ast : Sig.Ast) -> Sig.Parser(Ast).S) =
struct
let _ =
declare_dyn_module Id.name
@@ -16448,16 +17140,14 @@ module Register :
end
module OCamlParser
(Id : Sig.Id)
- (Maker :
- functor (Ast : Sig.Camlp4Ast) -> Sig.Parser with module Ast = Ast) =
+ (Maker : functor (Ast : Sig.Camlp4Ast) -> Sig.Parser(Ast).S) =
struct
let _ =
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 with module Ast = PreCast.Ast) =
+ module OCamlPreCastParser (Id : Sig.Id) (P : Sig.Parser(PreCast.Ast).S) =
struct
let _ =
declare_dyn_module Id.name
@@ -16470,10 +17160,8 @@ module Register :
declare_dyn_module Id.name
(fun _ -> let module M = Maker(AstFilters) in ())
end
- let _ = let module M = Syntax.Parser
- in
- (sig_item_parser := M.parse_interf;
- str_item_parser := M.parse_implem)
+ let _ = sig_item_parser := Syntax.parse_interf
+ let _ = str_item_parser := Syntax.parse_implem
module CurrentParser =
struct
module Ast = Ast
diff --git a/camlp4/boot/Camlp4.ml4 b/camlp4/boot/Camlp4.ml4
index 597f42914..d3ea1c7a0 100644
--- a/camlp4/boot/Camlp4.ml4
+++ b/camlp4/boot/Camlp4.ml4
@@ -7,12 +7,12 @@ module Struct = struct
module Loc :
sig INCLUDE "camlp4/Camlp4/Struct/Loc.mli"; end =
struct INCLUDE "camlp4/Camlp4/Struct/Loc.ml"; end;
- module Warning = struct INCLUDE "camlp4/Camlp4/Struct/Warning.ml"; end;
module Token :
sig INCLUDE "camlp4/Camlp4/Struct/Token.mli"; end =
struct INCLUDE "camlp4/Camlp4/Struct/Token.ml"; end;
module Lexer = struct INCLUDE "camlp4/boot/Lexer.ml"; end;
module Camlp4Ast = struct INCLUDE "camlp4/Camlp4/Struct/Camlp4Ast.ml"; end;
+ module DynAst = struct INCLUDE "camlp4/Camlp4/Struct/DynAst.ml"; end;
module Quotation = struct INCLUDE "camlp4/Camlp4/Struct/Quotation.ml"; end;
module AstFilters = struct INCLUDE "camlp4/Camlp4/Struct/AstFilters.ml"; end;
module Camlp4Ast2OCamlAst :
diff --git a/camlp4/boot/Camlp4Ast.ml b/camlp4/boot/Camlp4Ast.ml
index 91b3d51c5..e2a77ecca 100644
--- a/camlp4/boot/Camlp4Ast.ml
+++ b/camlp4/boot/Camlp4Ast.ml
@@ -40,9 +40,341 @@ module Make (Loc : Sig.Loc) : Sig.Camlp4Ast with module Loc = Loc =
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";
+ value ghost = Loc.ghost;
+ value rec is_module_longident =
+ fun
+ [ Ast.IdAcc _ _ i -> is_module_longident i
+ | Ast.IdApp _ i1 i2 ->
+ (is_module_longident i1) && (is_module_longident i2)
+ | Ast.IdUid _ _ -> True
+ | _ -> False ];
+ value ident_of_expr =
+ let error () =
+ invalid_arg "ident_of_expr: this expression is not an identifier" in
+ let rec self =
+ fun
+ [ Ast.ExApp _loc e1 e2 -> Ast.IdApp _loc (self e1) (self e2)
+ | Ast.ExAcc _loc e1 e2 -> Ast.IdAcc _loc (self e1) (self e2)
+ | Ast.ExId _ (Ast.IdLid _ _) -> error ()
+ | Ast.ExId _ i -> if is_module_longident i then i else error ()
+ | _ -> error () ]
+ in
+ fun [ Ast.ExId _ i -> i | Ast.ExApp _ _ _ -> error () | t -> self t ];
+ value ident_of_ctyp =
+ let error () =
+ invalid_arg "ident_of_ctyp: this type is not an identifier" in
+ let rec self =
+ fun
+ [ Ast.TyApp _loc t1 t2 -> Ast.IdApp _loc (self t1) (self t2)
+ | Ast.TyId _ (Ast.IdLid _ _) -> error ()
+ | Ast.TyId _ i -> if is_module_longident i then i else error ()
+ | _ -> error () ]
+ in fun [ Ast.TyId _ i -> i | t -> self t ];
+ value ident_of_patt =
+ let error () =
+ invalid_arg "ident_of_patt: this pattern is not an identifier" in
+ let rec self =
+ fun
+ [ Ast.PaApp _loc p1 p2 -> Ast.IdApp _loc (self p1) (self p2)
+ | Ast.PaId _ (Ast.IdLid _ _) -> error ()
+ | Ast.PaId _ i -> if is_module_longident i then i else error ()
+ | _ -> error () ]
+ in fun [ Ast.PaId _ i -> i | p -> self p ];
+ value rec is_irrefut_patt =
+ fun
+ [ Ast.PaId _ (Ast.IdLid _ _) -> True
+ | Ast.PaId _ (Ast.IdUid _ "()") -> True
+ | 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.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
+ | Ast.PaTup _ pl -> is_irrefut_patt pl
+ | Ast.PaOlb _ _ (Ast.PaNil _) -> True
+ | Ast.PaOlb _ _ p -> is_irrefut_patt p
+ | Ast.PaOlbi _ _ p _ -> is_irrefut_patt p
+ | Ast.PaLab _ _ (Ast.PaNil _) -> True
+ | Ast.PaLab _ _ p -> is_irrefut_patt p
+ | _ -> False ];
+ value rec is_constructor =
+ fun
+ [ Ast.IdAcc _ _ i -> is_constructor i
+ | Ast.IdUid _ _ -> True
+ | Ast.IdLid _ _ | Ast.IdApp _ _ _ -> False
+ | Ast.IdAnt _ _ -> assert False ];
+ value is_patt_constructor =
+ fun
+ [ Ast.PaId _ i -> is_constructor i
+ | Ast.PaVrn _ _ -> True
+ | _ -> False ];
+ value rec is_expr_constructor =
+ fun
+ [ Ast.ExId _ i -> is_constructor i
+ | Ast.ExAcc _ e1 e2 ->
+ (is_expr_constructor e1) && (is_expr_constructor e2)
+ | Ast.ExVrn _ _ -> True
+ | _ -> False ];
+ value rec tyOr_of_list =
+ fun
+ [ [] -> Ast.TyNil ghost
+ | [ t ] -> t
+ | [ t :: ts ] ->
+ let _loc = loc_of_ctyp t in Ast.TyOr _loc t (tyOr_of_list ts) ];
+ value rec tyAnd_of_list =
+ fun
+ [ [] -> Ast.TyNil ghost
+ | [ t ] -> t
+ | [ t :: ts ] ->
+ let _loc = loc_of_ctyp t in Ast.TyAnd _loc t (tyAnd_of_list ts) ];
+ value rec tySem_of_list =
+ fun
+ [ [] -> Ast.TyNil ghost
+ | [ t ] -> t
+ | [ t :: ts ] ->
+ let _loc = loc_of_ctyp t in Ast.TySem _loc t (tySem_of_list ts) ];
+ value rec tyCom_of_list =
+ fun
+ [ [] -> Ast.TyNil ghost
+ | [ t ] -> t
+ | [ t :: ts ] ->
+ let _loc = loc_of_ctyp t in Ast.TyCom _loc t (tyCom_of_list ts) ];
+ value rec tyAmp_of_list =
+ fun
+ [ [] -> Ast.TyNil ghost
+ | [ t ] -> t
+ | [ t :: ts ] ->
+ let _loc = loc_of_ctyp t in Ast.TyAmp _loc t (tyAmp_of_list ts) ];
+ value rec tySta_of_list =
+ fun
+ [ [] -> Ast.TyNil ghost
+ | [ t ] -> t
+ | [ t :: ts ] ->
+ let _loc = loc_of_ctyp t in Ast.TySta _loc t (tySta_of_list ts) ];
+ value rec stSem_of_list =
+ fun
+ [ [] -> Ast.StNil ghost
+ | [ t ] -> t
+ | [ t :: ts ] ->
+ let _loc = loc_of_str_item t in Ast.StSem _loc t (stSem_of_list ts) ];
+ value rec sgSem_of_list =
+ fun
+ [ [] -> Ast.SgNil ghost
+ | [ t ] -> t
+ | [ t :: ts ] ->
+ let _loc = loc_of_sig_item t in Ast.SgSem _loc t (sgSem_of_list ts) ];
+ value rec biAnd_of_list =
+ fun
+ [ [] -> Ast.BiNil ghost
+ | [ b ] -> b
+ | [ b :: bs ] ->
+ let _loc = loc_of_binding b in Ast.BiAnd _loc b (biAnd_of_list bs) ];
+ value rec rbSem_of_list =
+ fun
+ [ [] -> Ast.RbNil ghost
+ | [ b ] -> b
+ | [ b :: bs ] ->
+ let _loc = loc_of_rec_binding b
+ in Ast.RbSem _loc b (rbSem_of_list bs) ];
+ value rec wcAnd_of_list =
+ fun
+ [ [] -> Ast.WcNil ghost
+ | [ w ] -> w
+ | [ w :: ws ] ->
+ let _loc = loc_of_with_constr w
+ in Ast.WcAnd _loc w (wcAnd_of_list ws) ];
+ value rec idAcc_of_list =
+ fun
+ [ [] -> assert False
+ | [ i ] -> i
+ | [ i :: is ] ->
+ let _loc = loc_of_ident i in Ast.IdAcc _loc i (idAcc_of_list is) ];
+ value rec idApp_of_list =
+ fun
+ [ [] -> assert False
+ | [ i ] -> i
+ | [ i :: is ] ->
+ let _loc = loc_of_ident i in Ast.IdApp _loc i (idApp_of_list is) ];
+ value rec mcOr_of_list =
+ fun
+ [ [] -> Ast.McNil ghost
+ | [ x ] -> x
+ | [ x :: xs ] ->
+ let _loc = loc_of_match_case x in Ast.McOr _loc x (mcOr_of_list xs) ];
+ value rec mbAnd_of_list =
+ fun
+ [ [] -> Ast.MbNil ghost
+ | [ x ] -> x
+ | [ x :: xs ] ->
+ let _loc = loc_of_module_binding x
+ in Ast.MbAnd _loc x (mbAnd_of_list xs) ];
+ value rec meApp_of_list =
+ fun
+ [ [] -> assert False
+ | [ x ] -> x
+ | [ x :: xs ] ->
+ let _loc = loc_of_module_expr x
+ in Ast.MeApp _loc x (meApp_of_list xs) ];
+ value rec ceAnd_of_list =
+ fun
+ [ [] -> Ast.CeNil ghost
+ | [ x ] -> x
+ | [ x :: xs ] ->
+ let _loc = loc_of_class_expr x
+ in Ast.CeAnd _loc x (ceAnd_of_list xs) ];
+ value rec ctAnd_of_list =
+ fun
+ [ [] -> Ast.CtNil ghost
+ | [ x ] -> x
+ | [ x :: xs ] ->
+ let _loc = loc_of_class_type x
+ in Ast.CtAnd _loc x (ctAnd_of_list xs) ];
+ value rec cgSem_of_list =
+ fun
+ [ [] -> Ast.CgNil ghost
+ | [ x ] -> x
+ | [ x :: xs ] ->
+ let _loc = loc_of_class_sig_item x
+ in Ast.CgSem _loc x (cgSem_of_list xs) ];
+ value rec crSem_of_list =
+ fun
+ [ [] -> Ast.CrNil ghost
+ | [ x ] -> x
+ | [ x :: xs ] ->
+ let _loc = loc_of_class_str_item x
+ in Ast.CrSem _loc x (crSem_of_list xs) ];
+ value rec paSem_of_list =
+ fun
+ [ [] -> Ast.PaNil ghost
+ | [ x ] -> x
+ | [ x :: xs ] ->
+ let _loc = loc_of_patt x in Ast.PaSem _loc x (paSem_of_list xs) ];
+ value rec paCom_of_list =
+ fun
+ [ [] -> Ast.PaNil ghost
+ | [ x ] -> x
+ | [ x :: xs ] ->
+ let _loc = loc_of_patt x in Ast.PaCom _loc x (paCom_of_list xs) ];
+ value rec exSem_of_list =
+ fun
+ [ [] -> Ast.ExNil ghost
+ | [ x ] -> x
+ | [ x :: xs ] ->
+ let _loc = loc_of_expr x in Ast.ExSem _loc x (exSem_of_list xs) ];
+ value rec exCom_of_list =
+ fun
+ [ [] -> Ast.ExNil ghost
+ | [ x ] -> x
+ | [ x :: xs ] ->
+ let _loc = loc_of_expr x in Ast.ExCom _loc x (exCom_of_list xs) ];
+ value ty_of_stl =
+ fun
+ [ (_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) ];
+ value ty_of_sbt =
+ fun
+ [ (_loc, s, True, t) ->
+ Ast.TyCol _loc (Ast.TyId _loc (Ast.IdLid _loc s))
+ (Ast.TyMut _loc t)
+ | (_loc, s, False, t) ->
+ Ast.TyCol _loc (Ast.TyId _loc (Ast.IdLid _loc s)) t ];
+ value bi_of_pe (p, e) = let _loc = loc_of_patt p in Ast.BiEq _loc p e;
+ value sum_type_of_list l = tyOr_of_list (List.map ty_of_stl l);
+ value record_type_of_list l = tySem_of_list (List.map ty_of_sbt l);
+ value binding_of_pel l = biAnd_of_list (List.map bi_of_pe l);
+ value rec pel_of_binding =
+ fun
+ [ Ast.BiAnd _ b1 b2 -> (pel_of_binding b1) @ (pel_of_binding b2)
+ | Ast.BiEq _ p e -> [ (p, e) ]
+ | _ -> assert False ];
+ value 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 ] ];
+ value 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 ] ];
+ value 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 ] ];
+ value rec list_of_ctyp x acc =
+ match x with
+ [ Ast.TyNil _ -> acc
+ | Ast.TyAmp _ x y | Ast.TyCom _ x y | Ast.TySta _ x y | Ast.TySem _ x y
+ | Ast.TyAnd _ x y | Ast.TyOr _ x y ->
+ list_of_ctyp x (list_of_ctyp y acc)
+ | x -> [ x :: acc ] ];
+ value 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 ] ];
+ value 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 ] ];
+ value 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 ] ];
+ value 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 ] ];
+ value 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 ] ];
+ value 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 ] ];
+ value 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 ] ];
+ value 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 ] ];
+ value 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 ] ];
+ value 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 ] ];
+ value 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 ] ];
+ value 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 =
@@ -162,16 +494,6 @@ module Make (Loc : Sig.Loc) : Sig.Camlp4Ast with module Loc = Loc =
(meta_acc_Loc_t _loc x0))
(meta_patt _loc x1))
(meta_expr _loc x2)
- | Ast.BiSem x0 x1 x2 ->
- Ast.ExApp _loc
- (Ast.ExApp _loc
- (Ast.ExApp _loc
- (Ast.ExId _loc
- (Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
- (Ast.IdUid _loc "BiSem")))
- (meta_acc_Loc_t _loc x0))
- (meta_binding _loc x1))
- (meta_binding _loc x2)
| Ast.BiAnd x0 x1 x2 ->
Ast.ExApp _loc
(Ast.ExApp _loc
@@ -952,7 +1274,7 @@ module Make (Loc : Sig.Loc) : Sig.Camlp4Ast with module Loc = Loc =
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExRec")))
(meta_acc_Loc_t _loc x0))
- (meta_binding _loc x1))
+ (meta_rec_binding _loc x1))
(meta_expr _loc x2)
| Ast.ExOvr x0 x1 ->
Ast.ExApp _loc
@@ -961,7 +1283,7 @@ module Make (Loc : Sig.Loc) : Sig.Camlp4Ast with module Loc = Loc =
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExOvr")))
(meta_acc_Loc_t _loc x0))
- (meta_binding _loc x1)
+ (meta_rec_binding _loc x1)
| Ast.ExOlb x0 x1 x2 ->
Ast.ExApp _loc
(Ast.ExApp _loc
@@ -1426,7 +1748,13 @@ module Make (Loc : Sig.Loc) : Sig.Camlp4Ast with module Loc = Loc =
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "MeId")))
(meta_acc_Loc_t _loc x0))
- (meta_ident _loc x1) ]
+ (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) ]
and meta_module_type _loc =
fun
[ Ast.MtAnt x0 x1 -> Ast.ExAnt x0 x1
@@ -1475,7 +1803,13 @@ module Make (Loc : Sig.Loc) : Sig.Camlp4Ast with module Loc = Loc =
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "MtId")))
(meta_acc_Loc_t _loc x0))
- (meta_ident _loc x1) ]
+ (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) ]
and meta_patt _loc =
fun
[ Ast.PaVrn x0 x1 ->
@@ -1528,7 +1862,7 @@ module Make (Loc : Sig.Loc) : Sig.Camlp4Ast with module Loc = Loc =
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaEq")))
(meta_acc_Loc_t _loc x0))
- (meta_patt _loc x1))
+ (meta_ident _loc x1))
(meta_patt _loc x2)
| Ast.PaRec x0 x1 ->
Ast.ExApp _loc
@@ -1707,6 +2041,35 @@ module Make (Loc : Sig.Loc) : Sig.Camlp4Ast with module Loc = Loc =
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaNil")))
(meta_acc_Loc_t _loc x0) ]
+ and meta_rec_binding _loc =
+ fun
+ [ Ast.RbAnt x0 x1 -> Ast.ExAnt x0 x1
+ | Ast.RbEq x0 x1 x2 ->
+ Ast.ExApp _loc
+ (Ast.ExApp _loc
+ (Ast.ExApp _loc
+ (Ast.ExId _loc
+ (Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
+ (Ast.IdUid _loc "RbEq")))
+ (meta_acc_Loc_t _loc x0))
+ (meta_ident _loc x1))
+ (meta_expr _loc x2)
+ | Ast.RbSem x0 x1 x2 ->
+ Ast.ExApp _loc
+ (Ast.ExApp _loc
+ (Ast.ExApp _loc
+ (Ast.ExId _loc
+ (Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
+ (Ast.IdUid _loc "RbSem")))
+ (meta_acc_Loc_t _loc x0))
+ (meta_rec_binding _loc x1))
+ (meta_rec_binding _loc x2)
+ | Ast.RbNil x0 ->
+ Ast.ExApp _loc
+ (Ast.ExId _loc
+ (Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
+ (Ast.IdUid _loc "RbNil")))
+ (meta_acc_Loc_t _loc x0) ]
and meta_sig_item _loc =
fun
[ Ast.SgAnt x0 x1 -> Ast.ExAnt x0 x1
@@ -2043,16 +2406,6 @@ module Make (Loc : Sig.Loc) : Sig.Camlp4Ast with module Loc = Loc =
(meta_acc_Loc_t _loc x0))
(meta_patt _loc x1))
(meta_expr _loc x2)
- | Ast.BiSem x0 x1 x2 ->
- Ast.PaApp _loc
- (Ast.PaApp _loc
- (Ast.PaApp _loc
- (Ast.PaId _loc
- (Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
- (Ast.IdUid _loc "BiSem")))
- (meta_acc_Loc_t _loc x0))
- (meta_binding _loc x1))
- (meta_binding _loc x2)
| Ast.BiAnd x0 x1 x2 ->
Ast.PaApp _loc
(Ast.PaApp _loc
@@ -2833,7 +3186,7 @@ module Make (Loc : Sig.Loc) : Sig.Camlp4Ast with module Loc = Loc =
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExRec")))
(meta_acc_Loc_t _loc x0))
- (meta_binding _loc x1))
+ (meta_rec_binding _loc x1))
(meta_expr _loc x2)
| Ast.ExOvr x0 x1 ->
Ast.PaApp _loc
@@ -2842,7 +3195,7 @@ module Make (Loc : Sig.Loc) : Sig.Camlp4Ast with module Loc = Loc =
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "ExOvr")))
(meta_acc_Loc_t _loc x0))
- (meta_binding _loc x1)
+ (meta_rec_binding _loc x1)
| Ast.ExOlb x0 x1 x2 ->
Ast.PaApp _loc
(Ast.PaApp _loc
@@ -3307,7 +3660,13 @@ module Make (Loc : Sig.Loc) : Sig.Camlp4Ast with module Loc = Loc =
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "MeId")))
(meta_acc_Loc_t _loc x0))
- (meta_ident _loc x1) ]
+ (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) ]
and meta_module_type _loc =
fun
[ Ast.MtAnt x0 x1 -> Ast.PaAnt x0 x1
@@ -3356,7 +3715,13 @@ module Make (Loc : Sig.Loc) : Sig.Camlp4Ast with module Loc = Loc =
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "MtId")))
(meta_acc_Loc_t _loc x0))
- (meta_ident _loc x1) ]
+ (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) ]
and meta_patt _loc =
fun
[ Ast.PaVrn x0 x1 ->
@@ -3409,7 +3774,7 @@ module Make (Loc : Sig.Loc) : Sig.Camlp4Ast with module Loc = Loc =
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaEq")))
(meta_acc_Loc_t _loc x0))
- (meta_patt _loc x1))
+ (meta_ident _loc x1))
(meta_patt _loc x2)
| Ast.PaRec x0 x1 ->
Ast.PaApp _loc
@@ -3588,6 +3953,35 @@ module Make (Loc : Sig.Loc) : Sig.Camlp4Ast with module Loc = Loc =
(Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
(Ast.IdUid _loc "PaNil")))
(meta_acc_Loc_t _loc x0) ]
+ and meta_rec_binding _loc =
+ fun
+ [ Ast.RbAnt x0 x1 -> Ast.PaAnt x0 x1
+ | Ast.RbEq x0 x1 x2 ->
+ Ast.PaApp _loc
+ (Ast.PaApp _loc
+ (Ast.PaApp _loc
+ (Ast.PaId _loc
+ (Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
+ (Ast.IdUid _loc "RbEq")))
+ (meta_acc_Loc_t _loc x0))
+ (meta_ident _loc x1))
+ (meta_expr _loc x2)
+ | Ast.RbSem x0 x1 x2 ->
+ Ast.PaApp _loc
+ (Ast.PaApp _loc
+ (Ast.PaApp _loc
+ (Ast.PaId _loc
+ (Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
+ (Ast.IdUid _loc "RbSem")))
+ (meta_acc_Loc_t _loc x0))
+ (meta_rec_binding _loc x1))
+ (meta_rec_binding _loc x2)
+ | Ast.RbNil x0 ->
+ Ast.PaApp _loc
+ (Ast.PaId _loc
+ (Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
+ (Ast.IdUid _loc "RbNil")))
+ (meta_acc_Loc_t _loc x0) ]
and meta_sig_item _loc =
fun
[ Ast.SgAnt x0 x1 -> Ast.PaAnt x0 x1
@@ -3906,7 +4300,7 @@ module Make (Loc : Sig.Loc) : Sig.Camlp4Ast with module Loc = Loc =
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; };
+ fun f { val = x } -> { val = f x; };
method _Loc_t : Loc.t -> Loc.t = fun x -> x;
method with_constr : with_constr -> with_constr =
fun
@@ -3970,6 +4364,14 @@ module Make (Loc : Sig.Loc) : Sig.Camlp4Ast with module Loc = Loc =
| 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) ];
+ 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) ];
method patt : patt -> patt =
fun
[ PaNil _x0 -> PaNil (o#_Loc_t _x0)
@@ -4002,7 +4404,8 @@ module Make (Loc : Sig.Loc) : Sig.Camlp4Ast with module Loc = Loc =
| 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#patt _x1) (o#patt _x2)
+ | 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 ->
@@ -4011,7 +4414,8 @@ module Make (Loc : Sig.Loc) : Sig.Camlp4Ast with module Loc = Loc =
| PaVrn _x0 _x1 -> PaVrn (o#_Loc_t _x0) (o#string _x1) ];
method module_type : module_type -> module_type =
fun
- [ MtId _x0 _x1 -> MtId (o#_Loc_t _x0) (o#ident _x1)
+ [ 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)
@@ -4022,7 +4426,8 @@ module Make (Loc : Sig.Loc) : Sig.Camlp4Ast with module Loc = Loc =
| MtAnt _x0 _x1 -> MtAnt (o#_Loc_t _x0) (o#string _x1) ];
method module_expr : module_expr -> module_expr =
fun
- [ MeId _x0 _x1 -> MeId (o#_Loc_t _x0) (o#ident _x1)
+ [ 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 ->
@@ -4128,9 +4533,9 @@ module Make (Loc : Sig.Loc) : Sig.Camlp4Ast with module Loc = Loc =
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#binding _x1)
+ | ExOvr _x0 _x1 -> ExOvr (o#_Loc_t _x0) (o#rec_binding _x1)
| ExRec _x0 _x1 _x2 ->
- ExRec (o#_Loc_t _x0) (o#binding _x1) (o#expr _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)
@@ -4291,8 +4696,6 @@ module Make (Loc : Sig.Loc) : Sig.Camlp4Ast with module Loc = Loc =
[ BiNil _x0 -> BiNil (o#_Loc_t _x0)
| BiAnd _x0 _x1 _x2 ->
BiAnd (o#_Loc_t _x0) (o#binding _x1) (o#binding _x2)
- | BiSem _x0 _x1 _x2 ->
- BiSem (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) ];
end;
@@ -4313,7 +4716,7 @@ module Make (Loc : Sig.Loc) : Sig.Camlp4Ast with module Loc = Loc =
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;
+ fun f { val = x } -> f o x;
method _Loc_t : Loc.t -> 'self_type = fun _ -> o;
method with_constr : with_constr -> 'self_type =
fun
@@ -4363,6 +4766,13 @@ module Make (Loc : Sig.Loc) : Sig.Camlp4Ast with module Loc = Loc =
| 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 ];
+ 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 ];
method patt : patt -> 'self_type =
fun
[ PaNil _x0 -> o#_Loc_t _x0
@@ -4387,7 +4797,7 @@ module Make (Loc : Sig.Loc) : Sig.Camlp4Ast with module Loc = Loc =
| 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)#patt _x1)#patt _x2
+ | 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
@@ -4395,7 +4805,8 @@ module Make (Loc : Sig.Loc) : Sig.Camlp4Ast with module Loc = Loc =
| PaVrn _x0 _x1 -> (o#_Loc_t _x0)#string _x1 ];
method module_type : module_type -> 'self_type =
fun
- [ MtId _x0 _x1 -> (o#_Loc_t _x0)#ident _x1
+ [ 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
@@ -4405,7 +4816,8 @@ module Make (Loc : Sig.Loc) : Sig.Camlp4Ast with module Loc = Loc =
| MtAnt _x0 _x1 -> (o#_Loc_t _x0)#string _x1 ];
method module_expr : module_expr -> 'self_type =
fun
- [ MeId _x0 _x1 -> (o#_Loc_t _x0)#ident _x1
+ [ 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 ->
@@ -4494,8 +4906,8 @@ module Make (Loc : Sig.Loc) : Sig.Camlp4Ast with module Loc = Loc =
| 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)#binding _x1
- | ExRec _x0 _x1 _x2 -> ((o#_Loc_t _x0)#binding _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
@@ -4614,335 +5026,32 @@ module Make (Loc : Sig.Loc) : Sig.Camlp4Ast with module Loc = Loc =
fun
[ BiNil _x0 -> o#_Loc_t _x0
| BiAnd _x0 _x1 _x2 -> ((o#_Loc_t _x0)#binding _x1)#binding _x2
- | BiSem _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 ];
end;
- class c_expr f =
+ value map_expr f =
object inherit map as super; method expr = fun x -> f (super#expr x);
end;
- class c_patt f =
+ value map_patt f =
object inherit map as super; method patt = fun x -> f (super#patt x);
end;
- class c_ctyp f =
+ value map_ctyp f =
object inherit map as super; method ctyp = fun x -> f (super#ctyp x);
end;
- class c_str_item f =
- object inherit map as super;
+ value map_str_item f =
+ object
+ inherit map as super;
method str_item = fun x -> f (super#str_item x);
end;
- class c_sig_item f =
- object inherit map as super;
+ value map_sig_item f =
+ object
+ inherit map as super;
method sig_item = fun x -> f (super#sig_item x);
end;
- class c_loc f =
- object inherit map as super;
+ value map_loc f =
+ object
+ inherit map as super;
method _Loc_t = fun x -> f (super#_Loc_t x);
end;
- value map_patt f ast = (new c_patt f)#patt ast;
- value map_loc f ast = (new c_loc f)#_Loc_t ast;
- value map_sig_item f ast = (new c_sig_item f)#sig_item ast;
- value map_str_item f ast = (new c_str_item f)#str_item ast;
- value map_ctyp f ast = (new c_ctyp f)#ctyp ast;
- value map_expr f ast = (new c_expr f)#expr ast;
- value ghost = Loc.ghost;
- value rec is_module_longident =
- fun
- [ Ast.IdAcc _ _ i -> is_module_longident i
- | Ast.IdApp _ i1 i2 ->
- (is_module_longident i1) && (is_module_longident i2)
- | Ast.IdUid _ _ -> True
- | _ -> False ];
- value rec is_irrefut_patt =
- fun
- [ Ast.PaId _ (Ast.IdLid _ _) -> True
- | Ast.PaId _ (Ast.IdUid _ "()") -> True
- | 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.PaId _ (Ast.IdLid _ _)) 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
- | Ast.PaTup _ pl -> is_irrefut_patt pl
- | Ast.PaOlb _ _ (Ast.PaNil _) -> True
- | Ast.PaOlb _ _ p -> is_irrefut_patt p
- | Ast.PaOlbi _ _ p _ -> is_irrefut_patt p
- | Ast.PaLab _ _ (Ast.PaNil _) -> True
- | Ast.PaLab _ _ p -> is_irrefut_patt p
- | _ -> False ];
- value rec is_constructor =
- fun
- [ Ast.IdAcc _ _ i -> is_constructor i
- | Ast.IdUid _ _ -> True
- | Ast.IdLid _ _ | Ast.IdApp _ _ _ -> False
- | Ast.IdAnt _ _ -> assert False ];
- value is_patt_constructor =
- fun
- [ Ast.PaId _ i -> is_constructor i
- | Ast.PaVrn _ _ -> True
- | _ -> False ];
- value rec is_expr_constructor =
- fun
- [ Ast.ExId _ i -> is_constructor i
- | Ast.ExAcc _ e1 e2 ->
- (is_expr_constructor e1) && (is_expr_constructor e2)
- | Ast.ExVrn _ _ -> True
- | _ -> False ];
- value ident_of_expr =
- let error () =
- invalid_arg "ident_of_expr: this expression is not an identifier" in
- let rec self =
- fun
- [ Ast.ExApp _loc e1 e2 -> Ast.IdApp _loc (self e1) (self e2)
- | Ast.ExAcc _loc e1 e2 -> Ast.IdAcc _loc (self e1) (self e2)
- | Ast.ExId _ (Ast.IdLid _ _) -> error ()
- | Ast.ExId _ i -> if is_module_longident i then i else error ()
- | _ -> error () ]
- in
- fun [ Ast.ExId _ i -> i | Ast.ExApp _ _ _ -> error () | t -> self t ];
- value ident_of_ctyp =
- let error () =
- invalid_arg "ident_of_ctyp: this type is not an identifier" in
- let rec self =
- fun
- [ Ast.TyApp _loc t1 t2 -> Ast.IdApp _loc (self t1) (self t2)
- | Ast.TyId _ (Ast.IdLid _ _) -> error ()
- | Ast.TyId _ i -> if is_module_longident i then i else error ()
- | _ -> error () ]
- in fun [ Ast.TyId _ i -> i | t -> self t ];
- value rec tyOr_of_list =
- fun
- [ [] -> Ast.TyNil ghost
- | [ t ] -> t
- | [ t :: ts ] ->
- let _loc = loc_of_ctyp t in Ast.TyOr _loc t (tyOr_of_list ts) ];
- value rec tyAnd_of_list =
- fun
- [ [] -> Ast.TyNil ghost
- | [ t ] -> t
- | [ t :: ts ] ->
- let _loc = loc_of_ctyp t in Ast.TyAnd _loc t (tyAnd_of_list ts) ];
- value rec tySem_of_list =
- fun
- [ [] -> Ast.TyNil ghost
- | [ t ] -> t
- | [ t :: ts ] ->
- let _loc = loc_of_ctyp t in Ast.TySem _loc t (tySem_of_list ts) ];
- value rec stSem_of_list =
- fun
- [ [] -> Ast.StNil ghost
- | [ t ] -> t
- | [ t :: ts ] ->
- let _loc = loc_of_str_item t in Ast.StSem _loc t (stSem_of_list ts) ];
- value rec sgSem_of_list =
- fun
- [ [] -> Ast.SgNil ghost
- | [ t ] -> t
- | [ t :: ts ] ->
- let _loc = loc_of_sig_item t in Ast.SgSem _loc t (sgSem_of_list ts) ];
- value rec biAnd_of_list =
- fun
- [ [] -> Ast.BiNil ghost
- | [ b ] -> b
- | [ b :: bs ] ->
- let _loc = loc_of_binding b in Ast.BiAnd _loc b (biAnd_of_list bs) ];
- value rec wcAnd_of_list =
- fun
- [ [] -> Ast.WcNil ghost
- | [ w ] -> w
- | [ w :: ws ] ->
- let _loc = loc_of_with_constr w
- in Ast.WcAnd _loc w (wcAnd_of_list ws) ];
- value rec idAcc_of_list =
- fun
- [ [] -> assert False
- | [ i ] -> i
- | [ i :: is ] ->
- let _loc = loc_of_ident i in Ast.IdAcc _loc i (idAcc_of_list is) ];
- value rec idApp_of_list =
- fun
- [ [] -> assert False
- | [ i ] -> i
- | [ i :: is ] ->
- let _loc = loc_of_ident i in Ast.IdApp _loc i (idApp_of_list is) ];
- value rec mcOr_of_list =
- fun
- [ [] -> Ast.McNil ghost
- | [ x ] -> x
- | [ x :: xs ] ->
- let _loc = loc_of_match_case x in Ast.McOr _loc x (mcOr_of_list xs) ];
- value rec mbAnd_of_list =
- fun
- [ [] -> Ast.MbNil ghost
- | [ x ] -> x
- | [ x :: xs ] ->
- let _loc = loc_of_module_binding x
- in Ast.MbAnd _loc x (mbAnd_of_list xs) ];
- value rec meApp_of_list =
- fun
- [ [] -> assert False
- | [ x ] -> x
- | [ x :: xs ] ->
- let _loc = loc_of_module_expr x
- in Ast.MeApp _loc x (meApp_of_list xs) ];
- value rec ceAnd_of_list =
- fun
- [ [] -> Ast.CeNil ghost
- | [ x ] -> x
- | [ x :: xs ] ->
- let _loc = loc_of_class_expr x
- in Ast.CeAnd _loc x (ceAnd_of_list xs) ];
- value rec ctAnd_of_list =
- fun
- [ [] -> Ast.CtNil ghost
- | [ x ] -> x
- | [ x :: xs ] ->
- let _loc = loc_of_class_type x
- in Ast.CtAnd _loc x (ctAnd_of_list xs) ];
- value rec cgSem_of_list =
- fun
- [ [] -> Ast.CgNil ghost
- | [ x ] -> x
- | [ x :: xs ] ->
- let _loc = loc_of_class_sig_item x
- in Ast.CgSem _loc x (cgSem_of_list xs) ];
- value rec crSem_of_list =
- fun
- [ [] -> Ast.CrNil ghost
- | [ x ] -> x
- | [ x :: xs ] ->
- let _loc = loc_of_class_str_item x
- in Ast.CrSem _loc x (crSem_of_list xs) ];
- value rec paSem_of_list =
- fun
- [ [] -> Ast.PaNil ghost
- | [ x ] -> x
- | [ x :: xs ] ->
- let _loc = loc_of_patt x in Ast.PaSem _loc x (paSem_of_list xs) ];
- value rec paCom_of_list =
- fun
- [ [] -> Ast.PaNil ghost
- | [ x ] -> x
- | [ x :: xs ] ->
- let _loc = loc_of_patt x in Ast.PaCom _loc x (paCom_of_list xs) ];
- value rec biSem_of_list =
- fun
- [ [] -> Ast.BiNil ghost
- | [ x ] -> x
- | [ x :: xs ] ->
- let _loc = loc_of_binding x in Ast.BiSem _loc x (biSem_of_list xs) ];
- value rec exSem_of_list =
- fun
- [ [] -> Ast.ExNil ghost
- | [ x ] -> x
- | [ x :: xs ] ->
- let _loc = loc_of_expr x in Ast.ExSem _loc x (exSem_of_list xs) ];
- value rec exCom_of_list =
- fun
- [ [] -> Ast.ExNil ghost
- | [ x ] -> x
- | [ x :: xs ] ->
- let _loc = loc_of_expr x in Ast.ExCom _loc x (exCom_of_list xs) ];
- value ty_of_stl =
- fun
- [ (_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) ];
- value ty_of_sbt =
- fun
- [ (_loc, s, True, t) ->
- Ast.TyCol _loc (Ast.TyId _loc (Ast.IdLid _loc s))
- (Ast.TyMut _loc t)
- | (_loc, s, False, t) ->
- Ast.TyCol _loc (Ast.TyId _loc (Ast.IdLid _loc s)) t ];
- value bi_of_pe (p, e) = let _loc = loc_of_patt p in Ast.BiEq _loc p e;
- value sum_type_of_list l = tyOr_of_list (List.map ty_of_stl l);
- value record_type_of_list l = tySem_of_list (List.map ty_of_sbt l);
- value binding_of_pel l = biAnd_of_list (List.map bi_of_pe l);
- value rec pel_of_binding =
- fun
- [ Ast.BiAnd _ b1 b2 -> (pel_of_binding b1) @ (pel_of_binding b2)
- | Ast.BiEq _ p e -> [ (p, e) ]
- | Ast.BiSem _ b1 b2 -> (pel_of_binding b1) @ (pel_of_binding b2)
- | _ -> assert False ];
- value rec list_of_binding x acc =
- match x with
- [ Ast.BiAnd _ b1 b2 | Ast.BiSem _ b1 b2 ->
- list_of_binding b1 (list_of_binding b2 acc)
- | t -> [ t :: acc ] ];
- value 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 ] ];
- value rec list_of_ctyp x acc =
- match x with
- [ Ast.TyNil _ -> acc
- | Ast.TyAmp _ x y | Ast.TyCom _ x y | Ast.TySta _ x y | Ast.TySem _ x y
- | Ast.TyAnd _ x y | Ast.TyOr _ x y ->
- list_of_ctyp x (list_of_ctyp y acc)
- | x -> [ x :: acc ] ];
- value 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 ] ];
- value 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 ] ];
- value 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 ] ];
- value 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 ] ];
- value 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 ] ];
- value 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 ] ];
- value 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 ] ];
- value 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 ] ];
- value 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 ] ];
- value 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 ] ];
- value 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 ] ];
- value 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 ] ];
end;
diff --git a/camlp4/boot/camlp4boot.ml b/camlp4/boot/camlp4boot.ml
index ba9a83a8e..0985599a4 100644
--- a/camlp4/boot/camlp4boot.ml
+++ b/camlp4/boot/camlp4boot.ml
@@ -23,7 +23,7 @@ module R =
struct
let name = "Camlp4RevisedParserParser"
let version =
- "$Id: Camlp4OCamlRevisedParser.ml,v 1.1 2007/02/07 10:09:22 ertai Exp $"
+ "$Id: Camlp4OCamlRevisedParser.ml,v 1.2.2.17 2007/05/10 14:24:22 pouillar Exp $"
end
module Make (Syntax : Sig.Camlp4Syntax) =
struct
@@ -55,7 +55,6 @@ Old (no more supported) syntax:
let _ = Gram.Entry.clear a_INT64
let _ = Gram.Entry.clear a_LABEL
let _ = Gram.Entry.clear a_LIDENT
- let _ = Gram.Entry.clear a_LIDENT_or_operator
let _ = Gram.Entry.clear a_NATIVEINT
let _ = Gram.Entry.clear a_OPTLABEL
let _ = Gram.Entry.clear a_STRING
@@ -68,6 +67,7 @@ Old (no more supported) syntax:
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
@@ -109,7 +109,6 @@ Old (no more supported) syntax:
let _ = Gram.Entry.clear expr
let _ = Gram.Entry.clear expr_eoi
let _ = Gram.Entry.clear expr_quot
- let _ = Gram.Entry.clear field
let _ = Gram.Entry.clear field_expr
let _ = Gram.Entry.clear fun_binding
let _ = Gram.Entry.clear fun_def
@@ -161,10 +160,8 @@ Old (no more supported) syntax:
let _ = Gram.Entry.clear patt_quot
let _ = Gram.Entry.clear patt_tcon
let _ = Gram.Entry.clear phrase
- let _ = Gram.Entry.clear pipe_ctyp
let _ = Gram.Entry.clear poly_type
let _ = Gram.Entry.clear row_field
- let _ = Gram.Entry.clear sem_ctyp
let _ = Gram.Entry.clear sem_expr
let _ = Gram.Entry.clear sem_expr_for_list
let _ = Gram.Entry.clear sem_patt
@@ -229,8 +226,8 @@ Old (no more supported) syntax:
let mkassert _loc =
function
| Ast.ExId (_, (Ast.IdUid (_, "False"))) -> Ast.ExAsf _loc
- | (* this case take care about
- the special assert false node *)
+ | (* 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)))
@@ -239,6 +236,20 @@ Old (no more supported) syntax:
| (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
@@ -280,7 +291,7 @@ Old (no more supported) syntax:
c1),
c2),
c3)
- | (* | coords -> <:expr< Bigarray.Genarray.get $arr$ [| $`list:coords$ |] >> ] *)
+ | (* | coords -> <:expr< Bigarray.Genarray.get $arr$ [| $list:coords$ |] >> ] *)
coords ->
Ast.ExApp (_loc,
Ast.ExApp (_loc,
@@ -381,35 +392,121 @@ Old (no more supported) syntax:
Ast.ExArr (_loc, coords)),
newval))
| _ -> None
- let choose_tvar tpl =
- let abs = "abstract" in
- let rec find_alpha n =
- let ns = if n = 0 then "" else string_of_int n in
- let s' = abs ^ ns in
- let rec mem =
- function
- | (Ast.TyQuo (_, s) | Ast.TyQuP (_, s) | Ast.TyQuM (_, s)) ::
- xs -> (s = s') || (mem xs)
- | [] -> false
- | _ -> assert false
- in if mem tpl then find_alpha (succ n) else s'
- in find_alpha 0
+ let test_not_left_brace_nor_do =
+ Gram.Entry.of_parser "test_not_left_brace_nor_do"
+ (fun strm ->
+ match Stream.peek strm with
+ | Some (((KEYWORD "{" | KEYWORD "do"), _)) ->
+ raise Stream.Failure
+ | _ -> ())
let stopped_at _loc = Some (Loc.move_line 1 _loc)
(* FIXME be more precise *)
- (* value list1sep symb sep one cons =
- let rec kont al =
- parser
- [ [: v = sep; a = symb; s :] -> kont (cons al (one a)) s
- | [: :] -> al ]
- in
- parser [: a = symb; s :] -> kont (one a) s;
-
- value sem_expr =
- list1sep expr ";" (fun x -> x) (fun e1 e2 -> <:expr< $e1$; $e2$ >>) *)
+ let symbolchar =
+ let list =
+ [ '!'; '$'; '%'; '&'; '*'; '+'; '-'; '.'; '/'; ':'; '<'; '=';
+ '>'; '?'; '@'; '^'; '|'; '~' ] 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 = [ "!="; "??" ]
+ in
+ Gram.Entry.setup_parser prefixop
+ (fun (__strm : _ Stream.t) ->
+ match Stream.peek __strm with
+ | Some (((KEYWORD x | SYMBOL x), _loc)) when
+ (not (List.mem x excl)) &&
+ (((String.length x) >= 2) &&
+ ((List.mem x.[0] list) && (symbolchar x 1)))
+ ->
+ (Stream.junk __strm;
+ Ast.ExId (_loc, Ast.IdLid (_loc, x)))
+ | _ -> raise Stream.Failure)
+ let _ =
+ let list_ok =
+ [ "<"; ">"; "<="; ">="; "="; "<>"; "=="; "!="; "$" ] in
+ let list_first_char_ok = [ '='; '<'; '>'; '|'; '&'; '$'; '!' ] in
+ let excl = [ "<-"; "||"; "&&" ]
+ in
+ Gram.Entry.setup_parser infixop0
+ (fun (__strm : _ Stream.t) ->
+ match Stream.peek __strm with
+ | Some (((KEYWORD x | SYMBOL x), _loc)) when
+ (List.mem x list_ok) ||
+ ((not (List.mem x excl)) &&
+ (((String.length x) >= 2) &&
+ ((List.mem x.[0] list_first_char_ok) &&
+ (symbolchar x 1))))
+ ->
+ (Stream.junk __strm;
+ Ast.ExId (_loc, Ast.IdLid (_loc, x)))
+ | _ -> raise Stream.Failure)
+ let _ =
+ let list = [ '@'; '^' ]
+ in
+ Gram.Entry.setup_parser infixop1
+ (fun (__strm : _ Stream.t) ->
+ match Stream.peek __strm with
+ | Some (((KEYWORD x | SYMBOL x), _loc)) when
+ ((String.length x) >= 1) &&
+ ((List.mem x.[0] list) && (symbolchar x 1))
+ ->
+ (Stream.junk __strm;
+ Ast.ExId (_loc, Ast.IdLid (_loc, x)))
+ | _ -> raise Stream.Failure)
+ let _ =
+ let list = [ '+'; '-' ]
+ in
+ Gram.Entry.setup_parser infixop2
+ (fun (__strm : _ Stream.t) ->
+ match Stream.peek __strm with
+ | Some (((KEYWORD x | SYMBOL x), _loc)) when
+ (x <> "->") &&
+ (((String.length x) >= 1) &&
+ ((List.mem x.[0] list) && (symbolchar x 1)))
+ ->
+ (Stream.junk __strm;
+ Ast.ExId (_loc, Ast.IdLid (_loc, x)))
+ | _ -> raise Stream.Failure)
+ let _ =
+ let list = [ '*'; '/'; '%' ]
+ in
+ Gram.Entry.setup_parser infixop3
+ (fun (__strm : _ Stream.t) ->
+ match Stream.peek __strm with
+ | Some (((KEYWORD x | SYMBOL x), _loc)) when
+ ((String.length x) >= 1) &&
+ ((List.mem x.[0] list) &&
+ (((x.[0] <> '*') ||
+ (((String.length x) < 2) || (x.[1] <> '*')))
+ && (symbolchar x 1)))
+ ->
+ (Stream.junk __strm;
+ Ast.ExId (_loc, Ast.IdLid (_loc, x)))
+ | _ -> raise Stream.Failure)
+ let _ =
+ Gram.Entry.setup_parser infixop4
+ (fun (__strm : _ Stream.t) ->
+ match Stream.peek __strm with
+ | Some (((KEYWORD x | SYMBOL x), _loc)) when
+ ((String.length x) >= 2) &&
+ ((x.[0] == '*') && ((x.[1] == '*') && (symbolchar x 2)))
+ ->
+ (Stream.junk __strm; Ast.ExId (_loc, Ast.IdLid (_loc, x)))
+ | _ -> raise Stream.Failure)
(* transmit the context *)
let _ =
Gram.Entry.setup_parser sem_expr
- (let symb = Gram.parse_tokens_after_filter expr in
+ (let symb1 = Gram.parse_tokens_after_filter expr in
+ let symb (__strm : _ Stream.t) =
+ match Stream.peek __strm with
+ | Some ((ANTIQUOT ((("list" as n)), s), _loc)) ->
+ (Stream.junk __strm;
+ Ast.ExAnt (_loc, mk_anti ~c: "expr;" n s))
+ | _ -> symb1 __strm in
let rec kont al (__strm : _ Stream.t) =
match Stream.peek __strm with
| Some ((KEYWORD ";", _loc)) ->
@@ -422,17 +519,14 @@ Old (no more supported) syntax:
in
fun (__strm : _ Stream.t) ->
let a = symb __strm in kont a __strm)
- (* sem_expr_for_list:
- [ [ e = expr; ";"; el = SELF -> fun acc -> <:expr< [ $e$ :: $el acc$ ] >>
- | e = expr -> fun acc -> <:expr< [ $e$ :: $acc$ ] >>
- ] ]
- ;
- comma_expr:
- [ [ e1 = SELF; ","; e2 = SELF -> <:expr< $e1$, $e2$ >>
- | e = expr -> e ] ]
- ; *)
let _ =
let _ = (a_CHAR : 'a_CHAR Gram.Entry.t)
+ and _ = (do_sequence : 'do_sequence Gram.Entry.t)
+ and _ = (infixop4 : 'infixop4 Gram.Entry.t)
+ and _ = (infixop3 : 'infixop3 Gram.Entry.t)
+ and _ = (infixop2 : 'infixop2 Gram.Entry.t)
+ and _ = (infixop1 : 'infixop1 Gram.Entry.t)
+ and _ = (infixop0 : 'infixop0 Gram.Entry.t)
and _ = (with_constr_quot : 'with_constr_quot Gram.Entry.t)
and _ = (with_constr : 'with_constr Gram.Entry.t)
and _ = (value_val : 'value_val Gram.Entry.t)
@@ -466,10 +560,8 @@ Old (no more supported) syntax:
and _ = (sem_patt : 'sem_patt Gram.Entry.t)
and _ = (sem_expr_for_list : 'sem_expr_for_list Gram.Entry.t)
and _ = (sem_expr : 'sem_expr Gram.Entry.t)
- and _ = (sem_ctyp : 'sem_ctyp Gram.Entry.t)
and _ = (row_field : 'row_field Gram.Entry.t)
and _ = (poly_type : 'poly_type Gram.Entry.t)
- and _ = (pipe_ctyp : 'pipe_ctyp Gram.Entry.t)
and _ = (phrase : 'phrase Gram.Entry.t)
and _ = (patt_tcon : 'patt_tcon Gram.Entry.t)
and _ = (patt_quot : 'patt_quot Gram.Entry.t)
@@ -524,7 +616,6 @@ Old (no more supported) syntax:
and _ = (fun_def : 'fun_def Gram.Entry.t)
and _ = (fun_binding : 'fun_binding Gram.Entry.t)
and _ = (field_expr : 'field_expr Gram.Entry.t)
- and _ = (field : 'field Gram.Entry.t)
and _ = (expr_quot : 'expr_quot Gram.Entry.t)
and _ = (expr_eoi : 'expr_eoi Gram.Entry.t)
and _ = (expr : 'expr Gram.Entry.t)
@@ -590,7 +681,7 @@ Old (no more supported) syntax:
and _ = (a_STRING : 'a_STRING Gram.Entry.t)
and _ = (a_OPTLABEL : 'a_OPTLABEL Gram.Entry.t)
and _ = (a_NATIVEINT : 'a_NATIVEINT Gram.Entry.t)
- and _ = (a_LIDENT_or_operator : 'a_LIDENT_or_operator Gram.Entry.t)
+ and _ = (rec_binding_quot : 'rec_binding_quot Gram.Entry.t)
and _ = (a_LIDENT : 'a_LIDENT Gram.Entry.t)
and _ = (a_LABEL : 'a_LABEL Gram.Entry.t)
and _ = (a_INT64 : 'a_INT64 Gram.Entry.t)
@@ -598,40 +689,19 @@ Old (no more supported) syntax:
and _ = (a_INT : 'a_INT Gram.Entry.t)
and _ = (a_FLOAT : 'a_FLOAT Gram.Entry.t) in
let grammar_entry_create = Gram.Entry.mk in
- let (* sem_expr:
- [ [ e1 = SELF; ";"; e2 = SELF -> <:expr< $e1$; $e2$ >>
- | e = expr -> e ] ]
- ; *)
- (* | i = opt_label; "("; p = patt_tcon; ")" -> *)
+ let (* Here it's LABEL and not tilde_label since ~a:b is different than ~a : b *)
+ (* Same remark for ?a:b *) infixop5 : 'infixop5 Gram.Entry.t =
+ grammar_entry_create "infixop5"
+ and (* | i = opt_label; "("; p = patt_tcon; ")" -> *)
(* <:patt< ? $i$ : ($p$) >> *)
- (* <:class_type< $virtual:mv$ $lid:i$ [ $t$ ] >> *)
- (* | mv = opt_virtual; i = a_LIDENT -> *)
- (* Ast.CeCon (_loc, mv, Ast.IdLid (_loc, i), Ast.ONone) *)
- (* <:class_type< $lid:i$ >> *)
- (* [ [ "virtual"; i = a_LIDENT; "["; t = comma_type_parameter; "]" ->
- <:class_type< virtual $lid:i$ [ $t$ ] >>
- | "virtual"; i = a_LIDENT ->
- <:class_type< virtual $lid:i$ >>
- | i = a_LIDENT; "["; t = comma_type_parameter; "]" ->
- <:class_type< $lid:i$ [ $t$ ] >>
- | i = a_LIDENT -> <:class_type< $lid:i$ >>
- ] ]
- ; *)
- (* "virtual"; i = a_LIDENT; "["; t = comma_type_parameter; "]" -> *)
- (* <:class_expr< virtual $lid:i$ [ $t$ ] >> *)
- (* | "virtual"; i = a_LIDENT -> *)
- (* <:class_expr< virtual $lid:i$ >> *) (* | *)
- (* <:class_expr< $virtual:mv$ $lid:i$ [ $t$ ] >> *)
- (* <:class_expr< $lid:i$ [ $t$ ] >> *)
- (* | mv = opt_virtual; i = a_LIDENT -> *)
- (* Ast.CeCon (_loc, mv, Ast.IdLid (_loc, i), Ast.ONone) *)
- (* <:class_expr< $lid:i$ >> *)
(* | i = opt_label; "("; p = ipatt_tcon; ")" ->
<:patt< ? $i$ : ($p$) >>
| i = opt_label; "("; p = ipatt_tcon; "="; e = expr; ")" ->
<:patt< ? $i$ : ($p$ = $e$) >> *)
string_list : 'string_list Gram.Entry.t =
grammar_entry_create "string_list"
+ and infixop6 : 'infixop6 Gram.Entry.t =
+ grammar_entry_create "infixop6"
in
(Gram.extend (module_expr : 'module_expr Gram.Entry.t)
((fun () ->
@@ -686,6 +756,18 @@ Old (no more supported) syntax:
(fun (i : 'module_longident) (_loc : 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)
+ ->
+ match __camlp4_0 with
+ | QUOTATION x ->
+ (Quotation.expand _loc x Quotation.
+ DynAst.module_expr_tag :
+ 'module_expr)
+ | _ -> assert false)));
+ ([ Gram.Stoken
(((function
| ANTIQUOT (("" | "mexp" | "anti" | "list"),
_) -> true
@@ -713,6 +795,18 @@ Old (no more supported) syntax:
(fun (e : 'expr) (_loc : 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)
+ ->
+ match __camlp4_0 with
+ | QUOTATION x ->
+ (Quotation.expand _loc x Quotation.
+ DynAst.str_item_tag :
+ 'str_item)
+ | _ -> assert false)));
+ ([ Gram.Stoken
(((function
| ANTIQUOT (("" | "stri" | "anti" | "list"),
_) -> true
@@ -915,6 +1009,18 @@ Old (no more supported) syntax:
(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)
+ ->
+ match __camlp4_0 with
+ | QUOTATION x ->
+ (Quotation.expand _loc x Quotation.
+ DynAst.module_binding_tag :
+ 'module_binding)
+ | _ -> assert false)));
+ ([ Gram.Stoken
(((function
| ANTIQUOT ("", _) -> true
| _ -> false),
@@ -998,6 +1104,18 @@ Old (no more supported) syntax:
(_loc : Loc.t) ->
(Ast.MtWit (_loc, mt, wc) : 'module_type)))) ]);
(None, None,
+ [ ([ Gram.Sself; Gram.Sself ],
+ (Gram.Action.mk
+ (fun (mt2 : 'module_type) (mt1 : 'module_type)
+ (_loc : Loc.t) ->
+ (module_type_app mt1 mt2 : 'module_type)))) ]);
+ (None, None,
+ [ ([ Gram.Sself; Gram.Skeyword "."; Gram.Sself ],
+ (Gram.Action.mk
+ (fun (mt2 : 'module_type) _ (mt1 : 'module_type)
+ (_loc : Loc.t) ->
+ (module_type_acc mt1 mt2 : 'module_type)))) ]);
+ (None, None,
[ ([ Gram.Skeyword "sig";
Gram.Snterm
(Gram.Entry.obj
@@ -1027,6 +1145,18 @@ Old (no more supported) syntax:
(_loc : 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)
+ ->
+ match __camlp4_0 with
+ | QUOTATION x ->
+ (Quotation.expand _loc x Quotation.
+ DynAst.module_type_tag :
+ 'module_type)
+ | _ -> assert false)));
+ ([ Gram.Stoken
(((function
| ANTIQUOT (("" | "mtyp" | "anti" | "list"),
_) -> true
@@ -1070,13 +1200,12 @@ Old (no more supported) syntax:
(value_val : 'value_val Gram.Entry.t));
Gram.Snterm
(Gram.Entry.obj
- (a_LIDENT_or_operator :
- 'a_LIDENT_or_operator Gram.Entry.t));
+ (a_LIDENT : 'a_LIDENT Gram.Entry.t));
Gram.Skeyword ":";
Gram.Snterm
(Gram.Entry.obj (ctyp : 'ctyp Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (t : 'ctyp) _ (i : 'a_LIDENT_or_operator) _
+ (fun (t : 'ctyp) _ (i : 'a_LIDENT) _
(_loc : Loc.t) ->
(Ast.SgVal (_loc, i, t) : 'sig_item))));
([ Gram.Skeyword "type";
@@ -1098,6 +1227,14 @@ Old (no more supported) syntax:
([ 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) ->
+ (Ast.SgMty (_loc, i, Ast.MtNil _loc) :
+ 'sig_item))));
+ ([ Gram.Skeyword "module"; Gram.Skeyword "type";
+ Gram.Snterm
+ (Gram.Entry.obj
(a_UIDENT : 'a_UIDENT Gram.Entry.t));
Gram.Skeyword "=";
Gram.Snterm
@@ -1160,6 +1297,18 @@ Old (no more supported) syntax:
(_loc : 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)
+ ->
+ match __camlp4_0 with
+ | QUOTATION x ->
+ (Quotation.expand _loc x Quotation.
+ DynAst.sig_item_tag :
+ 'sig_item)
+ | _ -> assert false)));
+ ([ Gram.Stoken
(((function
| ANTIQUOT (("" | "sigi" | "anti" | "list"),
_) -> true
@@ -1224,6 +1373,18 @@ Old (no more supported) syntax:
(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)
+ ->
+ match __camlp4_0 with
+ | QUOTATION x ->
+ (Quotation.expand _loc x Quotation.
+ DynAst.module_binding_tag :
+ 'module_rec_declaration)
+ | _ -> assert false)));
+ ([ Gram.Stoken
(((function
| ANTIQUOT
(("" | "module_binding" | "anti" |
@@ -1307,6 +1468,18 @@ Old (no more supported) syntax:
'with_constr)
| _ -> assert false)));
([ Gram.Stoken
+ (((function | QUOTATION _ -> true | _ -> false),
+ "QUOTATION _")) ],
+ (Gram.Action.mk
+ (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
+ ->
+ match __camlp4_0 with
+ | QUOTATION x ->
+ (Quotation.expand _loc x Quotation.
+ DynAst.with_constr_tag :
+ 'with_constr)
+ | _ -> assert false)));
+ ([ Gram.Stoken
(((function
| ANTIQUOT
(("" | "with_constr" | "anti" | "list"),
@@ -1349,44 +1522,51 @@ Old (no more supported) syntax:
(fun _ (cst : 'class_structure)
(csp : 'opt_class_self_patt) _ (_loc : Loc.t)
-> (Ast.ExObj (_loc, csp, cst) : 'expr))));
- ([ Gram.Skeyword "while"; Gram.Sself;
- Gram.Skeyword "do"; Gram.Skeyword "{";
+ ([ Gram.Skeyword "while";
Gram.Snterm
(Gram.Entry.obj
(sequence : 'sequence Gram.Entry.t));
- Gram.Skeyword "}" ],
+ Gram.Skeyword "do";
+ Gram.Snterm
+ (Gram.Entry.obj
+ (do_sequence : 'do_sequence Gram.Entry.t)) ],
(Gram.Action.mk
- (fun _ (seq : 'sequence) _ _ (e : 'expr) _
+ (fun (seq : 'do_sequence) _ (e : 'sequence) _
(_loc : Loc.t) ->
- (Ast.ExWhi (_loc, e, seq) : 'expr))));
+ (Ast.ExWhi (_loc, mksequence' _loc e, seq) :
+ 'expr))));
([ Gram.Skeyword "for";
Gram.Snterm
(Gram.Entry.obj
(a_LIDENT : 'a_LIDENT Gram.Entry.t));
- Gram.Skeyword "="; Gram.Sself;
+ Gram.Skeyword "=";
+ Gram.Snterm
+ (Gram.Entry.obj
+ (sequence : 'sequence Gram.Entry.t));
Gram.Snterm
(Gram.Entry.obj
(direction_flag :
'direction_flag Gram.Entry.t));
- Gram.Sself; Gram.Skeyword "do";
- Gram.Skeyword "{";
Gram.Snterm
(Gram.Entry.obj
(sequence : 'sequence Gram.Entry.t));
- Gram.Skeyword "}" ],
+ Gram.Skeyword "do";
+ Gram.Snterm
+ (Gram.Entry.obj
+ (do_sequence : 'do_sequence Gram.Entry.t)) ],
(Gram.Action.mk
- (fun _ (seq : 'sequence) _ _ (e2 : 'expr)
- (df : 'direction_flag) (e1 : 'expr) _
+ (fun (seq : 'do_sequence) _ (e2 : 'sequence)
+ (df : 'direction_flag) (e1 : 'sequence) _
(i : 'a_LIDENT) _ (_loc : Loc.t) ->
- (Ast.ExFor (_loc, i, e1, e2, df, seq) :
+ (Ast.ExFor (_loc, i, mksequence' _loc e1,
+ mksequence' _loc e2, df, seq) :
'expr))));
- ([ Gram.Skeyword "do"; Gram.Skeyword "{";
+ ([ Gram.Skeyword "do";
Gram.Snterm
(Gram.Entry.obj
- (sequence : 'sequence Gram.Entry.t));
- Gram.Skeyword "}" ],
+ (do_sequence : 'do_sequence Gram.Entry.t)) ],
(Gram.Action.mk
- (fun _ (seq : 'sequence) _ _ (_loc : Loc.t) ->
+ (fun (seq : 'do_sequence) _ (_loc : Loc.t) ->
(mksequence _loc seq : 'expr))));
([ Gram.Skeyword "if"; Gram.Sself;
Gram.Skeyword "then"; Gram.Sself;
@@ -1395,48 +1575,32 @@ Old (no more supported) syntax:
(fun (e3 : 'expr) _ (e2 : 'expr) _ (e1 : 'expr)
_ (_loc : Loc.t) ->
(Ast.ExIfe (_loc, e1, e2, e3) : 'expr))));
- ([ Gram.Skeyword "try"; Gram.Sself;
+ ([ Gram.Skeyword "try";
+ Gram.Snterm
+ (Gram.Entry.obj
+ (sequence : 'sequence Gram.Entry.t));
Gram.Skeyword "with";
Gram.Snterm
- (Gram.Entry.obj (ipatt : 'ipatt Gram.Entry.t));
- Gram.Skeyword "->"; Gram.Sself ],
+ (Gram.Entry.obj
+ (match_case : 'match_case Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (e2 : 'expr) _ (p : 'ipatt) _ (e1 : 'expr)
- _ (_loc : Loc.t) ->
- (Ast.ExTry (_loc, e1,
- Ast.McArr (_loc, p, Ast.ExNil _loc, e2)) :
+ (fun (a : 'match_case) _ (e : 'sequence) _
+ (_loc : Loc.t) ->
+ (Ast.ExTry (_loc, mksequence' _loc e, a) :
'expr))));
- ([ Gram.Skeyword "try"; Gram.Sself;
- Gram.Skeyword "with"; Gram.Skeyword "[";
+ ([ Gram.Skeyword "match";
Gram.Snterm
(Gram.Entry.obj
- (match_case : 'match_case Gram.Entry.t));
- Gram.Skeyword "]" ],
- (Gram.Action.mk
- (fun _ (a : 'match_case) _ _ (e : 'expr) _
- (_loc : Loc.t) ->
- (Ast.ExTry (_loc, e, a) : 'expr))));
- ([ Gram.Skeyword "match"; Gram.Sself;
+ (sequence : 'sequence Gram.Entry.t));
Gram.Skeyword "with";
Gram.Snterm
- (Gram.Entry.obj (ipatt : 'ipatt Gram.Entry.t));
- Gram.Skeyword "->"; Gram.Sself ],
- (Gram.Action.mk
- (fun (e2 : 'expr) _ (p : 'ipatt) _ (e1 : 'expr)
- _ (_loc : Loc.t) ->
- (Ast.ExMat (_loc, e1,
- Ast.McArr (_loc, p, Ast.ExNil _loc, e2)) :
- 'expr))));
- ([ Gram.Skeyword "match"; Gram.Sself;
- Gram.Skeyword "with"; Gram.Skeyword "[";
- Gram.Snterm
(Gram.Entry.obj
- (match_case : 'match_case Gram.Entry.t));
- Gram.Skeyword "]" ],
+ (match_case : 'match_case Gram.Entry.t)) ],
(Gram.Action.mk
- (fun _ (a : 'match_case) _ _ (e : 'expr) _
+ (fun (a : 'match_case) _ (e : 'sequence) _
(_loc : Loc.t) ->
- (Ast.ExMat (_loc, e, a) : 'expr))));
+ (Ast.ExMat (_loc, mksequence' _loc e, a) :
+ 'expr))));
([ Gram.Skeyword "fun";
Gram.Snterm
(Gram.Entry.obj
@@ -1452,13 +1616,17 @@ Old (no more supported) syntax:
Ast.McArr (_loc, p, Ast.ExNil _loc, e)) :
'expr))));
([ Gram.Skeyword "fun"; Gram.Skeyword "[";
- Gram.Snterm
- (Gram.Entry.obj
- (match_case : 'match_case Gram.Entry.t));
+ Gram.Slist0sep
+ (Gram.Snterm
+ (Gram.Entry.obj
+ (match_case0 : 'match_case0 Gram.Entry.t)),
+ Gram.Skeyword "|");
Gram.Skeyword "]" ],
(Gram.Action.mk
- (fun _ (a : 'match_case) _ _ (_loc : Loc.t) ->
- (Ast.ExFun (_loc, a) : 'expr))));
+ (fun _ (a : 'match_case0 list) _ _
+ (_loc : Loc.t) ->
+ (Ast.ExFun (_loc, Ast.mcOr_of_list a) :
+ 'expr))));
([ Gram.Skeyword "let"; Gram.Skeyword "module";
Gram.Snterm
(Gram.Entry.obj
@@ -1507,182 +1675,78 @@ Old (no more supported) syntax:
| Some e -> e
| None -> Ast.ExAss (_loc, e1, e2) : 'expr)))) ]);
((Some "||"), (Some Camlp4.Sig.Grammar.RightA),
- [ ([ Gram.Sself; Gram.Skeyword "||"; Gram.Sself ],
+ [ ([ Gram.Sself;
+ Gram.Snterm
+ (Gram.Entry.obj
+ (infixop6 : 'infixop6 Gram.Entry.t));
+ Gram.Sself ],
(Gram.Action.mk
- (fun (e2 : 'expr) _ (e1 : 'expr) (_loc : Loc.t)
- ->
- (Ast.ExApp (_loc,
- Ast.ExApp (_loc,
- Ast.ExId (_loc, Ast.IdLid (_loc, "||")),
- e1),
+ (fun (e2 : 'expr) (op : 'infixop6) (e1 : 'expr)
+ (_loc : Loc.t) ->
+ (Ast.ExApp (_loc, Ast.ExApp (_loc, op, e1),
e2) :
'expr)))) ]);
((Some "&&"), (Some Camlp4.Sig.Grammar.RightA),
- [ ([ Gram.Sself; Gram.Skeyword "&&"; Gram.Sself ],
+ [ ([ Gram.Sself;
+ Gram.Snterm
+ (Gram.Entry.obj
+ (infixop5 : 'infixop5 Gram.Entry.t));
+ Gram.Sself ],
(Gram.Action.mk
- (fun (e2 : 'expr) _ (e1 : 'expr) (_loc : Loc.t)
- ->
- (Ast.ExApp (_loc,
- Ast.ExApp (_loc,
- Ast.ExId (_loc, Ast.IdLid (_loc, "&&")),
- e1),
+ (fun (e2 : 'expr) (op : 'infixop5) (e1 : 'expr)
+ (_loc : Loc.t) ->
+ (Ast.ExApp (_loc, Ast.ExApp (_loc, op, e1),
e2) :
'expr)))) ]);
((Some "<"), (Some Camlp4.Sig.Grammar.LeftA),
- [ ([ Gram.Sself; Gram.Skeyword "!="; Gram.Sself ],
- (Gram.Action.mk
- (fun (e2 : 'expr) _ (e1 : 'expr) (_loc : Loc.t)
- ->
- (Ast.ExApp (_loc,
- Ast.ExApp (_loc,
- Ast.ExId (_loc, Ast.IdLid (_loc, "!=")),
- e1),
- e2) :
- 'expr))));
- ([ Gram.Sself; Gram.Skeyword "=="; Gram.Sself ],
- (Gram.Action.mk
- (fun (e2 : 'expr) _ (e1 : 'expr) (_loc : Loc.t)
- ->
- (Ast.ExApp (_loc,
- Ast.ExApp (_loc,
- Ast.ExId (_loc, Ast.IdLid (_loc, "==")),
- e1),
- e2) :
- 'expr))));
- ([ Gram.Sself; Gram.Skeyword "<>"; Gram.Sself ],
- (Gram.Action.mk
- (fun (e2 : 'expr) _ (e1 : 'expr) (_loc : Loc.t)
- ->
- (Ast.ExApp (_loc,
- Ast.ExApp (_loc,
- Ast.ExId (_loc, Ast.IdLid (_loc, "<>")),
- e1),
- e2) :
- 'expr))));
- ([ Gram.Sself; Gram.Skeyword "="; Gram.Sself ],
- (Gram.Action.mk
- (fun (e2 : 'expr) _ (e1 : 'expr) (_loc : Loc.t)
- ->
- (Ast.ExApp (_loc,
- Ast.ExApp (_loc,
- Ast.ExId (_loc, Ast.IdLid (_loc, "=")),
- e1),
- e2) :
- 'expr))));
- ([ Gram.Sself; Gram.Skeyword ">="; Gram.Sself ],
- (Gram.Action.mk
- (fun (e2 : 'expr) _ (e1 : 'expr) (_loc : Loc.t)
- ->
- (Ast.ExApp (_loc,
- Ast.ExApp (_loc,
- Ast.ExId (_loc, Ast.IdLid (_loc, ">=")),
- e1),
- e2) :
- 'expr))));
- ([ Gram.Sself; Gram.Skeyword "<="; Gram.Sself ],
- (Gram.Action.mk
- (fun (e2 : 'expr) _ (e1 : 'expr) (_loc : Loc.t)
- ->
- (Ast.ExApp (_loc,
- Ast.ExApp (_loc,
- Ast.ExId (_loc, Ast.IdLid (_loc, "<=")),
- e1),
- e2) :
- 'expr))));
- ([ Gram.Sself; Gram.Skeyword ">"; Gram.Sself ],
- (Gram.Action.mk
- (fun (e2 : 'expr) _ (e1 : 'expr) (_loc : Loc.t)
- ->
- (Ast.ExApp (_loc,
- Ast.ExApp (_loc,
- Ast.ExId (_loc, Ast.IdLid (_loc, ">")),
- e1),
- e2) :
- 'expr))));
- ([ Gram.Sself; Gram.Skeyword "<"; Gram.Sself ],
+ [ ([ Gram.Sself;
+ Gram.Snterm
+ (Gram.Entry.obj
+ (infixop0 : 'infixop0 Gram.Entry.t));
+ Gram.Sself ],
(Gram.Action.mk
- (fun (e2 : 'expr) _ (e1 : 'expr) (_loc : Loc.t)
- ->
- (Ast.ExApp (_loc,
- Ast.ExApp (_loc,
- Ast.ExId (_loc, Ast.IdLid (_loc, "<")),
- e1),
+ (fun (e2 : 'expr) (op : 'infixop0) (e1 : 'expr)
+ (_loc : Loc.t) ->
+ (Ast.ExApp (_loc, Ast.ExApp (_loc, op, e1),
e2) :
'expr)))) ]);
((Some "^"), (Some Camlp4.Sig.Grammar.RightA),
- [ ([ Gram.Sself; Gram.Skeyword "@"; Gram.Sself ],
- (Gram.Action.mk
- (fun (e2 : 'expr) _ (e1 : 'expr) (_loc : Loc.t)
- ->
- (Ast.ExApp (_loc,
- Ast.ExApp (_loc,
- Ast.ExId (_loc, Ast.IdLid (_loc, "@")),
- e1),
- e2) :
- 'expr))));
- ([ Gram.Sself; Gram.Skeyword "^^"; Gram.Sself ],
- (Gram.Action.mk
- (fun (e2 : 'expr) _ (e1 : 'expr) (_loc : Loc.t)
- ->
- (Ast.ExApp (_loc,
- Ast.ExApp (_loc,
- Ast.ExId (_loc, Ast.IdLid (_loc, "^^")),
- e1),
- e2) :
- 'expr))));
- ([ Gram.Sself; Gram.Skeyword "^"; Gram.Sself ],
+ [ ([ Gram.Sself;
+ Gram.Snterm
+ (Gram.Entry.obj
+ (infixop1 : 'infixop1 Gram.Entry.t));
+ Gram.Sself ],
(Gram.Action.mk
- (fun (e2 : 'expr) _ (e1 : 'expr) (_loc : Loc.t)
- ->
- (Ast.ExApp (_loc,
- Ast.ExApp (_loc,
- Ast.ExId (_loc, Ast.IdLid (_loc, "^")),
- e1),
+ (fun (e2 : 'expr) (op : 'infixop1) (e1 : 'expr)
+ (_loc : Loc.t) ->
+ (Ast.ExApp (_loc, Ast.ExApp (_loc, op, e1),
e2) :
'expr)))) ]);
((Some "+"), (Some Camlp4.Sig.Grammar.LeftA),
- [ ([ Gram.Sself; Gram.Skeyword "-."; Gram.Sself ],
- (Gram.Action.mk
- (fun (e2 : 'expr) _ (e1 : 'expr) (_loc : Loc.t)
- ->
- (Ast.ExApp (_loc,
- Ast.ExApp (_loc,
- Ast.ExId (_loc, Ast.IdLid (_loc, "-.")),
- e1),
- e2) :
- 'expr))));
- ([ Gram.Sself; Gram.Skeyword "+."; Gram.Sself ],
+ [ ([ Gram.Sself;
+ Gram.Snterm
+ (Gram.Entry.obj
+ (infixop2 : 'infixop2 Gram.Entry.t));
+ Gram.Sself ],
(Gram.Action.mk
- (fun (e2 : 'expr) _ (e1 : 'expr) (_loc : Loc.t)
- ->
- (Ast.ExApp (_loc,
- Ast.ExApp (_loc,
- Ast.ExId (_loc, Ast.IdLid (_loc, "+.")),
- e1),
+ (fun (e2 : 'expr) (op : 'infixop2) (e1 : 'expr)
+ (_loc : Loc.t) ->
+ (Ast.ExApp (_loc, Ast.ExApp (_loc, op, e1),
e2) :
- 'expr))));
- ([ Gram.Sself; Gram.Skeyword "-"; Gram.Sself ],
+ 'expr)))) ]);
+ ((Some "*"), (Some Camlp4.Sig.Grammar.LeftA),
+ [ ([ Gram.Sself;
+ Gram.Snterm
+ (Gram.Entry.obj
+ (infixop3 : 'infixop3 Gram.Entry.t));
+ Gram.Sself ],
(Gram.Action.mk
- (fun (e2 : 'expr) _ (e1 : 'expr) (_loc : Loc.t)
- ->
- (Ast.ExApp (_loc,
- Ast.ExApp (_loc,
- Ast.ExId (_loc, Ast.IdLid (_loc, "-")),
- e1),
+ (fun (e2 : 'expr) (op : 'infixop3) (e1 : 'expr)
+ (_loc : Loc.t) ->
+ (Ast.ExApp (_loc, Ast.ExApp (_loc, op, e1),
e2) :
'expr))));
- ([ Gram.Sself; Gram.Skeyword "+"; Gram.Sself ],
- (Gram.Action.mk
- (fun (e2 : 'expr) _ (e1 : 'expr) (_loc : Loc.t)
- ->
- (Ast.ExApp (_loc,
- Ast.ExApp (_loc,
- Ast.ExId (_loc, Ast.IdLid (_loc, "+")),
- e1),
- e2) :
- 'expr)))) ]);
- ((Some "*"), (Some Camlp4.Sig.Grammar.LeftA),
- [ ([ Gram.Sself; Gram.Skeyword "mod"; Gram.Sself ],
+ ([ Gram.Sself; Gram.Skeyword "mod"; Gram.Sself ],
(Gram.Action.mk
(fun (e2 : 'expr) _ (e1 : 'expr) (_loc : Loc.t)
->
@@ -1723,49 +1787,20 @@ Old (no more supported) syntax:
Ast.IdLid (_loc, "land")),
e1),
e2) :
- 'expr))));
- ([ Gram.Sself; Gram.Skeyword "/."; Gram.Sself ],
- (Gram.Action.mk
- (fun (e2 : 'expr) _ (e1 : 'expr) (_loc : Loc.t)
- ->
- (Ast.ExApp (_loc,
- Ast.ExApp (_loc,
- Ast.ExId (_loc, Ast.IdLid (_loc, "/.")),
- e1),
- e2) :
- 'expr))));
- ([ Gram.Sself; Gram.Skeyword "*."; Gram.Sself ],
- (Gram.Action.mk
- (fun (e2 : 'expr) _ (e1 : 'expr) (_loc : Loc.t)
- ->
- (Ast.ExApp (_loc,
- Ast.ExApp (_loc,
- Ast.ExId (_loc, Ast.IdLid (_loc, "*.")),
- e1),
- e2) :
- 'expr))));
- ([ Gram.Sself; Gram.Skeyword "/"; Gram.Sself ],
+ 'expr)))) ]);
+ ((Some "**"), (Some Camlp4.Sig.Grammar.RightA),
+ [ ([ Gram.Sself;
+ Gram.Snterm
+ (Gram.Entry.obj
+ (infixop4 : 'infixop4 Gram.Entry.t));
+ Gram.Sself ],
(Gram.Action.mk
- (fun (e2 : 'expr) _ (e1 : 'expr) (_loc : Loc.t)
- ->
- (Ast.ExApp (_loc,
- Ast.ExApp (_loc,
- Ast.ExId (_loc, Ast.IdLid (_loc, "/")),
- e1),
+ (fun (e2 : 'expr) (op : 'infixop4) (e1 : 'expr)
+ (_loc : Loc.t) ->
+ (Ast.ExApp (_loc, Ast.ExApp (_loc, op, e1),
e2) :
'expr))));
- ([ Gram.Sself; Gram.Skeyword "*"; Gram.Sself ],
- (Gram.Action.mk
- (fun (e2 : 'expr) _ (e1 : 'expr) (_loc : Loc.t)
- ->
- (Ast.ExApp (_loc,
- Ast.ExApp (_loc,
- Ast.ExId (_loc, Ast.IdLid (_loc, "*")),
- e1),
- e2) :
- 'expr)))) ]);
- ((Some "**"), (Some Camlp4.Sig.Grammar.RightA),
- [ ([ Gram.Sself; Gram.Skeyword "lsr"; Gram.Sself ],
+ ([ Gram.Sself; Gram.Skeyword "lsr"; Gram.Sself ],
(Gram.Action.mk
(fun (e2 : 'expr) _ (e1 : 'expr) (_loc : Loc.t)
->
@@ -1794,16 +1829,6 @@ Old (no more supported) syntax:
Ast.ExId (_loc, Ast.IdLid (_loc, "asr")),
e1),
e2) :
- 'expr))));
- ([ Gram.Sself; Gram.Skeyword "**"; Gram.Sself ],
- (Gram.Action.mk
- (fun (e2 : 'expr) _ (e1 : 'expr) (_loc : Loc.t)
- ->
- (Ast.ExApp (_loc,
- Ast.ExApp (_loc,
- Ast.ExId (_loc, Ast.IdLid (_loc, "**")),
- e1),
- e2) :
'expr)))) ]);
((Some "unary minus"), (Some Camlp4.Sig.Grammar.NonA),
[ ([ Gram.Skeyword "-."; Gram.Sself ],
@@ -1863,13 +1888,6 @@ Old (no more supported) syntax:
| OPTLABEL i ->
(Ast.ExOlb (_loc, i, e) : 'expr)
| _ -> assert false)));
- ([ Gram.Skeyword "~";
- Gram.Snterm
- (Gram.Entry.obj
- (a_LIDENT : 'a_LIDENT Gram.Entry.t)) ],
- (Gram.Action.mk
- (fun (i : 'a_LIDENT) _ (_loc : Loc.t) ->
- (Ast.ExLab (_loc, i, Ast.ExNil _loc) : 'expr))));
([ Gram.Stoken
(((function | LABEL _ -> true | _ -> false),
"LABEL _"));
@@ -1883,6 +1901,13 @@ Old (no more supported) syntax:
([ Gram.Skeyword "~";
Gram.Snterm
(Gram.Entry.obj
+ (a_LIDENT : 'a_LIDENT Gram.Entry.t)) ],
+ (Gram.Action.mk
+ (fun (i : 'a_LIDENT) _ (_loc : Loc.t) ->
+ (Ast.ExLab (_loc, i, Ast.ExNil _loc) : 'expr))));
+ ([ Gram.Skeyword "~";
+ Gram.Snterm
+ (Gram.Entry.obj
(a_LIDENT : 'a_LIDENT Gram.Entry.t));
Gram.Skeyword ":"; Gram.Sself ],
(Gram.Action.mk
@@ -1922,22 +1947,34 @@ Old (no more supported) syntax:
(_loc : Loc.t) ->
(Ast.ExAre (_loc, e1, e2) : 'expr)))) ]);
((Some "~-"), (Some Camlp4.Sig.Grammar.NonA),
- [ ([ Gram.Skeyword "~-."; Gram.Sself ],
+ [ ([ Gram.Snterm
+ (Gram.Entry.obj
+ (prefixop : 'prefixop Gram.Entry.t));
+ Gram.Sself ],
(Gram.Action.mk
- (fun (e : 'expr) _ (_loc : Loc.t) ->
- (Ast.ExApp (_loc,
- Ast.ExId (_loc, Ast.IdLid (_loc, "~-.")),
- e) :
- 'expr))));
- ([ Gram.Skeyword "~-"; Gram.Sself ],
+ (fun (e : 'expr) (f : 'prefixop) (_loc : Loc.t)
+ -> (Ast.ExApp (_loc, f, e) : 'expr))));
+ ([ Gram.Skeyword "!"; Gram.Sself ],
(Gram.Action.mk
(fun (e : 'expr) _ (_loc : Loc.t) ->
- (Ast.ExApp (_loc,
- Ast.ExId (_loc, Ast.IdLid (_loc, "~-")),
- e) :
+ (Ast.ExAcc (_loc, e,
+ Ast.ExId (_loc, Ast.IdLid (_loc, "val"))) :
'expr)))) ]);
((Some "simple"), None,
- [ ([ Gram.Skeyword "("; Gram.Sself; Gram.Skeyword ")" ],
+ [ ([ Gram.Skeyword "begin"; Gram.Skeyword "end" ],
+ (Gram.Action.mk
+ (fun _ _ (_loc : Loc.t) ->
+ (Ast.ExId (_loc, Ast.IdUid (_loc, "()")) :
+ 'expr))));
+ ([ Gram.Skeyword "begin";
+ Gram.Snterm
+ (Gram.Entry.obj
+ (sequence : 'sequence Gram.Entry.t));
+ Gram.Skeyword "end" ],
+ (Gram.Action.mk
+ (fun _ (seq : 'sequence) _ (_loc : Loc.t) ->
+ (mksequence _loc seq : 'expr))));
+ ([ Gram.Skeyword "("; Gram.Sself; Gram.Skeyword ")" ],
(Gram.Action.mk
(fun _ (e : 'expr) _ (_loc : Loc.t) ->
(e : 'expr))));
@@ -1962,6 +1999,16 @@ Old (no more supported) syntax:
(fun _ (t2 : 'ctyp) _ (t : 'ctyp) _ (e : 'expr)
_ (_loc : Loc.t) ->
(Ast.ExCoe (_loc, e, t, t2) : 'expr))));
+ ([ Gram.Skeyword "("; Gram.Sself; Gram.Skeyword ";";
+ Gram.Snterm
+ (Gram.Entry.obj
+ (sequence : 'sequence Gram.Entry.t));
+ Gram.Skeyword ")" ],
+ (Gram.Action.mk
+ (fun _ (seq : 'sequence) _ (e : 'expr) _
+ (_loc : Loc.t) ->
+ (mksequence _loc (Ast.ExSem (_loc, e, seq)) :
+ 'expr))));
([ Gram.Skeyword "("; Gram.Sself; Gram.Skeyword ",";
Gram.Snterm
(Gram.Entry.obj
@@ -1996,7 +2043,7 @@ Old (no more supported) syntax:
([ Gram.Skeyword "{<"; Gram.Skeyword ">}" ],
(Gram.Action.mk
(fun _ _ (_loc : Loc.t) ->
- (Ast.ExOvr (_loc, Ast.BiNil _loc) : 'expr))));
+ (Ast.ExOvr (_loc, Ast.RbNil _loc) : 'expr))));
([ Gram.Skeyword "{"; Gram.Skeyword "("; Gram.Sself;
Gram.Skeyword ")"; Gram.Skeyword "with";
Gram.Snterm
@@ -2111,6 +2158,21 @@ Old (no more supported) syntax:
(Ast.ExInt (_loc, s) : 'expr))));
([ Gram.Stoken
(((function
+ | ANTIQUOT ("seq", _) -> true
+ | _ -> false),
+ "ANTIQUOT (\"seq\", _)")) ],
+ (Gram.Action.mk
+ (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
+ ->
+ match __camlp4_0 with
+ | ANTIQUOT ((("seq" as n)), s) ->
+ (Ast.ExSeq (_loc,
+ Ast.ExAnt (_loc,
+ mk_anti ~c: "expr" n s)) :
+ 'expr)
+ | _ -> assert false)));
+ ([ Gram.Stoken
+ (((function
| ANTIQUOT ("tup", _) -> true
| _ -> false),
"ANTIQUOT (\"tup\", _)")) ],
@@ -2126,6 +2188,18 @@ Old (no more supported) syntax:
| _ -> assert false)));
([ Gram.Stoken
(((function
+ | ANTIQUOT ("`bool", _) -> true
+ | _ -> false),
+ "ANTIQUOT (\"`bool\", _)")) ],
+ (Gram.Action.mk
+ (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
+ ->
+ match __camlp4_0 with
+ | ANTIQUOT ((("`bool" as n)), s) ->
+ (Ast.ExAnt (_loc, mk_anti n s) : 'expr)
+ | _ -> assert false)));
+ ([ Gram.Stoken
+ (((function
| ANTIQUOT (("exp" | "" | "anti"), _) ->
true
| _ -> false),
@@ -2147,11 +2221,71 @@ Old (no more supported) syntax:
->
match __camlp4_0 with
| QUOTATION x ->
- (Quotation.expand_expr
- (Gram.parse_string expr) _loc x :
+ (Quotation.expand _loc x Quotation.
+ DynAst.expr_tag :
'expr)
| _ -> assert false))) ]) ]))
());
+ Gram.extend (do_sequence : 'do_sequence Gram.Entry.t)
+ ((fun () ->
+ (None,
+ [ (None, None,
+ [ ([ Gram.Snterm
+ (Gram.Entry.obj
+ (test_not_left_brace_nor_do :
+ 'test_not_left_brace_nor_do Gram.Entry.t));
+ Gram.Snterm
+ (Gram.Entry.obj
+ (sequence : 'sequence Gram.Entry.t));
+ Gram.Skeyword "done" ],
+ (Gram.Action.mk
+ (fun _ (seq : 'sequence) _ (_loc : 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)))) ]) ]))
+ ());
+ Gram.extend (infixop5 : 'infixop5 Gram.Entry.t)
+ ((fun () ->
+ (None,
+ [ (None, None,
+ [ ([ Gram.srules infixop5
+ [ ([ Gram.Skeyword "&&" ],
+ (Gram.Action.mk
+ (fun (x : Gram.Token.t) (_loc : Loc.t) ->
+ (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)))) ] ],
+ (Gram.Action.mk
+ (fun (x : 'e__1) (_loc : Loc.t) ->
+ (Ast.ExId (_loc, Ast.IdLid (_loc, x)) :
+ 'infixop5)))) ]) ]))
+ ());
+ Gram.extend (infixop6 : 'infixop6 Gram.Entry.t)
+ ((fun () ->
+ (None,
+ [ (None, None,
+ [ ([ Gram.srules infixop6
+ [ ([ Gram.Skeyword "||" ],
+ (Gram.Action.mk
+ (fun (x : Gram.Token.t) (_loc : Loc.t) ->
+ (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)))) ] ],
+ (Gram.Action.mk
+ (fun (x : 'e__2) (_loc : Loc.t) ->
+ (Ast.ExId (_loc, Ast.IdLid (_loc, x)) :
+ 'infixop6)))) ]) ]))
+ ());
Gram.extend
(sem_expr_for_list : 'sem_expr_for_list Gram.Entry.t)
((fun () ->
@@ -2193,6 +2327,20 @@ Old (no more supported) syntax:
(Gram.Action.mk
(fun (e : 'expr) (_loc : Loc.t) ->
(e : 'comma_expr))));
+ ([ Gram.Stoken
+ (((function
+ | ANTIQUOT ("list", _) -> true
+ | _ -> false),
+ "ANTIQUOT (\"list\", _)")) ],
+ (Gram.Action.mk
+ (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
+ ->
+ match __camlp4_0 with
+ | ANTIQUOT ((("list" as n)), s) ->
+ (Ast.ExAnt (_loc,
+ mk_anti ~c: "expr," n s) :
+ 'comma_expr)
+ | _ -> assert false)));
([ Gram.Sself; Gram.Skeyword ","; Gram.Sself ],
(Gram.Action.mk
(fun (e2 : 'comma_expr) _ (e1 : 'comma_expr)
@@ -2229,6 +2377,20 @@ Old (no more supported) syntax:
(fun (el : 'sequence) _ (e : 'expr)
(_loc : Loc.t) ->
(Ast.ExSem (_loc, e, el) : 'sequence))));
+ ([ Gram.Stoken
+ (((function
+ | ANTIQUOT ("list", _) -> true
+ | _ -> false),
+ "ANTIQUOT (\"list\", _)")) ],
+ (Gram.Action.mk
+ (fun (__camlp4_0 : Gram.Token.t) (_loc : 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.Snterm
(Gram.Entry.obj
@@ -2240,11 +2402,11 @@ Old (no more supported) syntax:
[ ([ Gram.Skeyword ";" ],
(Gram.Action.mk
(fun (x : Gram.Token.t) (_loc : Loc.t) ->
- (Token.extract_string x : 'e__1))));
+ (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__1)))) ];
+ (Token.extract_string x : 'e__3)))) ];
Gram.Sself ],
(Gram.Action.mk
(fun (el : 'sequence) _ (bi : 'binding)
@@ -2376,14 +2538,26 @@ Old (no more supported) syntax:
((fun () ->
(None,
[ (None, None,
- [ ([ Gram.Slist0sep
+ [ ([ Gram.Snterm
+ (Gram.Entry.obj (ipatt : 'ipatt Gram.Entry.t));
+ Gram.Skeyword "->";
+ Gram.Snterm
+ (Gram.Entry.obj (expr : 'expr Gram.Entry.t)) ],
+ (Gram.Action.mk
+ (fun (e : 'expr) _ (p : 'ipatt) (_loc : Loc.t)
+ ->
+ (Ast.McArr (_loc, p, Ast.ExNil _loc, e) :
+ 'match_case))));
+ ([ Gram.Skeyword "[";
+ Gram.Slist0sep
(Gram.Snterm
(Gram.Entry.obj
(match_case0 : 'match_case0 Gram.Entry.t)),
- 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 : Loc.t)
+ -> (Ast.mcOr_of_list l : 'match_case)))) ]) ]))
());
Gram.extend (match_case0 : 'match_case0 Gram.Entry.t)
((fun () ->
@@ -2514,7 +2688,7 @@ Old (no more supported) syntax:
Gram.extend (label_expr : 'label_expr Gram.Entry.t)
((fun () ->
(None,
- [ (None, (Some Camlp4.Sig.Grammar.LeftA),
+ [ (None, None,
[ ([ Gram.Snterm
(Gram.Entry.obj
(label_longident :
@@ -2523,10 +2697,9 @@ Old (no more supported) syntax:
(Gram.Entry.obj
(fun_binding : 'fun_binding Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (e : 'fun_binding) (p : 'label_longident)
+ (fun (e : 'fun_binding) (i : 'label_longident)
(_loc : Loc.t) ->
- (Ast.BiEq (_loc, Ast.PaId (_loc, p), e) :
- 'label_expr))));
+ (Ast.RbEq (_loc, i, e) : 'label_expr))));
([ Gram.Stoken
(((function
| ANTIQUOT ("list", _) -> true
@@ -2537,31 +2710,62 @@ Old (no more supported) syntax:
->
match __camlp4_0 with
| ANTIQUOT ((("list" as n)), s) ->
- (Ast.BiAnt (_loc,
- mk_anti ~c: "binding;" n s) :
+ (Ast.RbAnt (_loc,
+ mk_anti ~c: "rec_binding" n s) :
'label_expr)
| _ -> assert false)));
([ Gram.Stoken
(((function
- | ANTIQUOT (("" | "binding" | "anti"), _) ->
- true
+ | ANTIQUOT (("" | "anti"), _) -> true
| _ -> false),
- "ANTIQUOT ((\"\" | \"binding\" | \"anti\"), _)")) ],
+ "ANTIQUOT ((\"\" | \"anti\"), _)"));
+ Gram.Skeyword "=";
+ Gram.Snterm
+ (Gram.Entry.obj (expr : 'expr Gram.Entry.t)) ],
+ (Gram.Action.mk
+ (fun (e : 'expr) _ (__camlp4_0 : Gram.Token.t)
+ (_loc : Loc.t) ->
+ match __camlp4_0 with
+ | ANTIQUOT ((("" | "anti" as n)), s) ->
+ (Ast.RbEq (_loc,
+ Ast.IdAnt (_loc,
+ mk_anti ~c: "ident" n s),
+ e) :
+ 'label_expr)
+ | _ -> assert false)));
+ ([ Gram.Stoken
+ (((function
+ | ANTIQUOT (("" | "anti"), _) -> true
+ | _ -> false),
+ "ANTIQUOT ((\"\" | \"anti\"), _)")) ],
(Gram.Action.mk
(fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
->
match __camlp4_0 with
- | ANTIQUOT ((("" | "binding" | "anti" as n)),
- s) ->
- (Ast.BiAnt (_loc,
- mk_anti ~c: "binding" n s) :
+ | ANTIQUOT ((("" | "anti" as n)), s) ->
+ (Ast.RbAnt (_loc,
+ mk_anti ~c: "rec_binding" n s) :
+ 'label_expr)
+ | _ -> assert false)));
+ ([ Gram.Stoken
+ (((function
+ | ANTIQUOT ("rec_binding", _) -> true
+ | _ -> false),
+ "ANTIQUOT (\"rec_binding\", _)")) ],
+ (Gram.Action.mk
+ (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
+ ->
+ match __camlp4_0 with
+ | ANTIQUOT ((("rec_binding" as n)), s) ->
+ (Ast.RbAnt (_loc,
+ mk_anti ~c: "rec_binding" n s) :
'label_expr)
| _ -> assert false)));
([ Gram.Sself; Gram.Skeyword ";"; Gram.Sself ],
(Gram.Action.mk
(fun (b2 : 'label_expr) _ (b1 : 'label_expr)
(_loc : Loc.t) ->
- (Ast.BiSem (_loc, b1, b2) : 'label_expr)))) ]) ]))
+ (Ast.RbSem (_loc, b1, b2) : 'label_expr)))) ]) ]))
());
Gram.extend (fun_def : 'fun_def Gram.Entry.t)
((fun () ->
@@ -2765,8 +2969,8 @@ Old (no more supported) syntax:
->
match __camlp4_0 with
| QUOTATION x ->
- (Quotation.expand_patt
- (Gram.parse_string patt) _loc x :
+ (Quotation.expand _loc x Quotation.
+ DynAst.patt_tag :
'patt)
| _ -> assert false)));
([ Gram.Skeyword "_" ],
@@ -2973,6 +3177,20 @@ Old (no more supported) syntax:
(Gram.Action.mk
(fun (p : 'patt) (_loc : Loc.t) ->
(p : 'comma_patt))));
+ ([ Gram.Stoken
+ (((function
+ | ANTIQUOT ("list", _) -> true
+ | _ -> false),
+ "ANTIQUOT (\"list\", _)")) ],
+ (Gram.Action.mk
+ (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
+ ->
+ match __camlp4_0 with
+ | ANTIQUOT ((("list" as n)), s) ->
+ (Ast.PaAnt (_loc,
+ mk_anti ~c: "patt," n s) :
+ 'comma_patt)
+ | _ -> assert false)));
([ Gram.Sself; Gram.Skeyword ","; Gram.Sself ],
(Gram.Action.mk
(fun (p2 : 'comma_patt) _ (p1 : 'comma_patt)
@@ -2988,6 +3206,20 @@ Old (no more supported) syntax:
(Gram.Action.mk
(fun (p : 'patt) (_loc : Loc.t) ->
(p : 'sem_patt))));
+ ([ Gram.Stoken
+ (((function
+ | ANTIQUOT ("list", _) -> true
+ | _ -> false),
+ "ANTIQUOT (\"list\", _)")) ],
+ (Gram.Action.mk
+ (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
+ ->
+ match __camlp4_0 with
+ | ANTIQUOT ((("list" as n)), s) ->
+ (Ast.PaAnt (_loc,
+ mk_anti ~c: "patt;" n s) :
+ 'sem_patt)
+ | _ -> assert false)));
([ Gram.Sself; Gram.Skeyword ";"; Gram.Sself ],
(Gram.Action.mk
(fun (p2 : 'sem_patt) _ (p1 : 'sem_patt)
@@ -3040,8 +3272,7 @@ Old (no more supported) syntax:
(Gram.Action.mk
(fun (p : 'patt) _ (i : 'label_longident)
(_loc : Loc.t) ->
- (Ast.PaEq (_loc, Ast.PaId (_loc, i), p) :
- 'label_patt))));
+ (Ast.PaEq (_loc, i, p) : 'label_patt))));
([ Gram.Stoken
(((function
| ANTIQUOT ("list", _) -> true
@@ -3057,6 +3288,18 @@ Old (no more supported) syntax:
'label_patt)
| _ -> assert false)));
([ Gram.Stoken
+ (((function | QUOTATION _ -> true | _ -> false),
+ "QUOTATION _")) ],
+ (Gram.Action.mk
+ (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
+ ->
+ match __camlp4_0 with
+ | QUOTATION x ->
+ (Quotation.expand _loc x Quotation.
+ DynAst.patt_tag :
+ 'label_patt)
+ | _ -> assert false)));
+ ([ Gram.Stoken
(((function
| ANTIQUOT (("" | "pat" | "anti"), _) ->
true
@@ -3126,6 +3369,18 @@ Old (no more supported) syntax:
(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)
+ ->
+ match __camlp4_0 with
+ | QUOTATION x ->
+ (Quotation.expand _loc x Quotation.
+ DynAst.patt_tag :
+ 'ipatt)
+ | _ -> assert false)));
+ ([ Gram.Stoken
(((function
| ANTIQUOT ("tup", _) -> true
| _ -> false),
@@ -3183,6 +3438,20 @@ Old (no more supported) syntax:
(Gram.Action.mk
(fun (p : 'ipatt) (_loc : Loc.t) ->
(p : 'comma_ipatt))));
+ ([ Gram.Stoken
+ (((function
+ | ANTIQUOT ("list", _) -> true
+ | _ -> false),
+ "ANTIQUOT (\"list\", _)")) ],
+ (Gram.Action.mk
+ (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
+ ->
+ match __camlp4_0 with
+ | ANTIQUOT ((("list" as n)), s) ->
+ (Ast.PaAnt (_loc,
+ mk_anti ~c: "patt," n s) :
+ 'comma_ipatt)
+ | _ -> assert false)));
([ Gram.Sself; Gram.Skeyword ","; Gram.Sself ],
(Gram.Action.mk
(fun (p2 : 'comma_ipatt) _ (p1 : 'comma_ipatt)
@@ -3203,8 +3472,33 @@ Old (no more supported) syntax:
(Gram.Action.mk
(fun (p : 'ipatt) _ (i : 'label_longident)
(_loc : Loc.t) ->
- (Ast.PaEq (_loc, Ast.PaId (_loc, i), p) :
- 'label_ipatt))));
+ (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)
+ ->
+ match __camlp4_0 with
+ | QUOTATION x ->
+ (Quotation.expand _loc x Quotation.
+ DynAst.patt_tag :
+ 'label_ipatt)
+ | _ -> assert false)));
+ ([ Gram.Stoken
+ (((function
+ | ANTIQUOT ("list", _) -> true
+ | _ -> false),
+ "ANTIQUOT (\"list\", _)")) ],
+ (Gram.Action.mk
+ (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
+ ->
+ match __camlp4_0 with
+ | ANTIQUOT ((("list" as n)), s) ->
+ (Ast.PaAnt (_loc,
+ mk_anti ~c: "patt;" n s) :
+ 'label_ipatt)
+ | _ -> assert false)));
([ Gram.Stoken
(((function
| ANTIQUOT (("" | "pat" | "anti"), _) ->
@@ -3245,7 +3539,7 @@ Old (no more supported) syntax:
(fun (cl : 'constrain list) (tk : 'opt_eq_ctyp)
((n, tpl) : 'type_ident_and_parameters)
(_loc : Loc.t) ->
- (Ast.TyDcl (_loc, n, tpl, tk tpl, cl) :
+ (Ast.TyDcl (_loc, n, tpl, tk, cl) :
'type_declaration))));
([ Gram.Sself; Gram.Skeyword "and"; Gram.Sself ],
(Gram.Action.mk
@@ -3254,6 +3548,18 @@ Old (no more supported) syntax:
(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)
+ ->
+ match __camlp4_0 with
+ | QUOTATION x ->
+ (Quotation.expand _loc x Quotation.
+ DynAst.ctyp_tag :
+ 'type_declaration)
+ | _ -> assert false)));
+ ([ Gram.Stoken
(((function
| ANTIQUOT ("list", _) -> true
| _ -> false),
@@ -3304,15 +3610,14 @@ Old (no more supported) syntax:
[ ([],
(Gram.Action.mk
(fun (_loc : Loc.t) ->
- (fun tpl -> Ast.TyQuo (_loc, choose_tvar tpl) :
- 'opt_eq_ctyp))));
+ (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 : 'opt_eq_ctyp)))) ]) ]))
+ (tk : 'opt_eq_ctyp)))) ]) ]))
());
Gram.extend (type_kind : 'type_kind Gram.Entry.t)
((fun () ->
@@ -3416,6 +3721,18 @@ Old (no more supported) syntax:
(fun (i : 'a_ident) _ (_loc : 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)
+ ->
+ match __camlp4_0 with
+ | QUOTATION x ->
+ (Quotation.expand _loc x Quotation.
+ DynAst.ctyp_tag :
+ 'type_parameter)
+ | _ -> assert false)));
+ ([ Gram.Stoken
(((function
| ANTIQUOT (("" | "typ" | "anti"), _) ->
true
@@ -3657,6 +3974,18 @@ Old (no more supported) syntax:
(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)
+ ->
+ match __camlp4_0 with
+ | QUOTATION x ->
+ (Quotation.expand _loc x Quotation.
+ DynAst.ctyp_tag :
+ 'ctyp)
+ | _ -> assert false)));
+ ([ Gram.Stoken
(((function
| ANTIQUOT ("id", _) -> true
| _ -> false),
@@ -3726,7 +4055,34 @@ Old (no more supported) syntax:
(Gram.Action.mk
(fun (t2 : 'star_ctyp) _ (t1 : 'star_ctyp)
(_loc : Loc.t) ->
- (Ast.TySta (_loc, t1, t2) : 'star_ctyp)))) ]) ]))
+ (Ast.TySta (_loc, t1, t2) : 'star_ctyp))));
+ ([ Gram.Stoken
+ (((function
+ | ANTIQUOT ("list", _) -> true
+ | _ -> false),
+ "ANTIQUOT (\"list\", _)")) ],
+ (Gram.Action.mk
+ (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
+ ->
+ match __camlp4_0 with
+ | ANTIQUOT ((("list" as n)), s) ->
+ (Ast.TyAnt (_loc,
+ mk_anti ~c: "ctyp*" n s) :
+ 'star_ctyp)
+ | _ -> assert false)));
+ ([ Gram.Stoken
+ (((function
+ | ANTIQUOT (("" | "typ"), _) -> true
+ | _ -> false),
+ "ANTIQUOT ((\"\" | \"typ\"), _)")) ],
+ (Gram.Action.mk
+ (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
+ ->
+ match __camlp4_0 with
+ | ANTIQUOT ((("" | "typ" as n)), s) ->
+ (Ast.TyAnt (_loc, mk_anti ~c: "ctyp" n s) :
+ 'star_ctyp)
+ | _ -> assert false))) ]) ]))
());
Gram.extend
(constructor_declarations :
@@ -3734,17 +4090,73 @@ Old (no more supported) syntax:
((fun () ->
(None,
[ (None, None,
- [ ([ Gram.Slist1sep
- (Gram.Snterm
- (Gram.Entry.obj
- (constructor_declaration :
- 'constructor_declaration Gram.Entry.t)),
- Gram.Skeyword "|") ],
+ [ ([ Gram.Snterm
+ (Gram.Entry.obj
+ (a_UIDENT : 'a_UIDENT Gram.Entry.t)) ],
+ (Gram.Action.mk
+ (fun (s : 'a_UIDENT) (_loc : Loc.t) ->
+ (Ast.TyId (_loc, Ast.IdUid (_loc, s)) :
+ 'constructor_declarations))));
+ ([ Gram.Snterm
+ (Gram.Entry.obj
+ (a_UIDENT : 'a_UIDENT Gram.Entry.t));
+ Gram.Skeyword "of";
+ Gram.Snterm
+ (Gram.Entry.obj
+ (constructor_arg_list :
+ 'constructor_arg_list Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (l : 'constructor_declaration list)
+ (fun (t : 'constructor_arg_list) _
+ (s : 'a_UIDENT) (_loc : Loc.t) ->
+ (Ast.TyOf (_loc,
+ Ast.TyId (_loc, Ast.IdUid (_loc, s)), t) :
+ 'constructor_declarations))));
+ ([ Gram.Sself; Gram.Skeyword "|"; Gram.Sself ],
+ (Gram.Action.mk
+ (fun (t2 : 'constructor_declarations) _
+ (t1 : 'constructor_declarations)
(_loc : Loc.t) ->
- (Ast.tyOr_of_list l :
- 'constructor_declarations)))) ]) ]))
+ (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)
+ ->
+ match __camlp4_0 with
+ | QUOTATION x ->
+ (Quotation.expand _loc x Quotation.
+ DynAst.ctyp_tag :
+ 'constructor_declarations)
+ | _ -> assert false)));
+ ([ Gram.Stoken
+ (((function
+ | ANTIQUOT ("list", _) -> true
+ | _ -> false),
+ "ANTIQUOT (\"list\", _)")) ],
+ (Gram.Action.mk
+ (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
+ ->
+ match __camlp4_0 with
+ | ANTIQUOT ((("list" as n)), s) ->
+ (Ast.TyAnt (_loc,
+ mk_anti ~c: "ctyp|" n s) :
+ 'constructor_declarations)
+ | _ -> assert false)));
+ ([ Gram.Stoken
+ (((function
+ | ANTIQUOT (("" | "typ"), _) -> true
+ | _ -> false),
+ "ANTIQUOT ((\"\" | \"typ\"), _)")) ],
+ (Gram.Action.mk
+ (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
+ ->
+ match __camlp4_0 with
+ | ANTIQUOT ((("" | "typ" as n)), s) ->
+ (Ast.TyAnt (_loc, mk_anti ~c: "ctyp" n s) :
+ 'constructor_declarations)
+ | _ -> assert false))) ]) ]))
());
Gram.extend
(constructor_declaration :
@@ -3774,6 +4186,18 @@ Old (no more supported) syntax:
Ast.TyId (_loc, Ast.IdUid (_loc, s)), t) :
'constructor_declaration))));
([ Gram.Stoken
+ (((function | QUOTATION _ -> true | _ -> false),
+ "QUOTATION _")) ],
+ (Gram.Action.mk
+ (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
+ ->
+ match __camlp4_0 with
+ | QUOTATION x ->
+ (Quotation.expand _loc x Quotation.
+ DynAst.ctyp_tag :
+ 'constructor_declaration)
+ | _ -> assert false)));
+ ([ Gram.Stoken
(((function
| ANTIQUOT (("" | "typ"), _) -> true
| _ -> false),
@@ -3852,6 +4276,32 @@ Old (no more supported) syntax:
Ast.TyId (_loc, Ast.IdLid (_loc, s)), t) :
'label_declaration))));
([ Gram.Stoken
+ (((function | QUOTATION _ -> true | _ -> false),
+ "QUOTATION _")) ],
+ (Gram.Action.mk
+ (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
+ ->
+ match __camlp4_0 with
+ | QUOTATION x ->
+ (Quotation.expand _loc x Quotation.
+ DynAst.ctyp_tag :
+ 'label_declaration)
+ | _ -> assert false)));
+ ([ Gram.Stoken
+ (((function
+ | ANTIQUOT ("list", _) -> true
+ | _ -> false),
+ "ANTIQUOT (\"list\", _)")) ],
+ (Gram.Action.mk
+ (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
+ ->
+ match __camlp4_0 with
+ | ANTIQUOT ((("list" as n)), s) ->
+ (Ast.TyAnt (_loc,
+ mk_anti ~c: "ctyp;" n s) :
+ 'label_declaration)
+ | _ -> assert false)));
+ ([ Gram.Stoken
(((function
| ANTIQUOT (("" | "typ"), _) -> true
| _ -> false),
@@ -3993,7 +4443,7 @@ Old (no more supported) syntax:
'module_longident_with_app Gram.Entry.t)
((fun () ->
(None,
- [ (None, None,
+ [ ((Some "apply"), None,
[ ([ Gram.Sself; Gram.Sself ],
(Gram.Action.mk
(fun (j : 'module_longident_with_app)
@@ -4001,7 +4451,7 @@ Old (no more supported) syntax:
(_loc : Loc.t) ->
(Ast.IdApp (_loc, i, j) :
'module_longident_with_app)))) ]);
- (None, None,
+ ((Some "."), None,
[ ([ Gram.Sself; Gram.Skeyword "."; Gram.Sself ],
(Gram.Action.mk
(fun (j : 'module_longident_with_app) _
@@ -4009,7 +4459,7 @@ Old (no more supported) syntax:
(_loc : Loc.t) ->
(Ast.IdAcc (_loc, i, j) :
'module_longident_with_app)))) ]);
- (None, None,
+ ((Some "simple"), None,
[ ([ Gram.Skeyword "("; Gram.Sself; Gram.Skeyword ")" ],
(Gram.Action.mk
(fun _ (i : 'module_longident_with_app) _
@@ -4043,19 +4493,19 @@ Old (no more supported) syntax:
Gram.extend (type_longident : 'type_longident Gram.Entry.t)
((fun () ->
(None,
- [ (None, None,
+ [ ((Some "apply"), None,
[ ([ Gram.Sself; Gram.Sself ],
(Gram.Action.mk
(fun (j : 'type_longident) (i : 'type_longident)
(_loc : Loc.t) ->
(Ast.IdApp (_loc, i, j) : 'type_longident)))) ]);
- (None, None,
+ ((Some "."), None,
[ ([ Gram.Sself; Gram.Skeyword "."; Gram.Sself ],
(Gram.Action.mk
(fun (j : 'type_longident) _
(i : 'type_longident) (_loc : Loc.t) ->
(Ast.IdAcc (_loc, i, j) : 'type_longident)))) ]);
- (None, None,
+ ((Some "simple"), None,
[ ([ Gram.Skeyword "("; Gram.Sself; Gram.Skeyword ")" ],
(Gram.Action.mk
(fun _ (i : 'type_longident) _ (_loc : Loc.t) ->
@@ -4182,6 +4632,18 @@ Old (no more supported) syntax:
(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)
+ ->
+ match __camlp4_0 with
+ | QUOTATION x ->
+ (Quotation.expand _loc x Quotation.
+ DynAst.class_expr_tag :
+ 'class_declaration)
+ | _ -> assert false)));
+ ([ Gram.Stoken
(((function
| ANTIQUOT (("" | "cdcl" | "anti" | "list"),
_) -> true
@@ -4312,7 +4774,7 @@ Old (no more supported) syntax:
(comma_type_parameter : 'comma_type_parameter Gram.Entry.t)
((fun () ->
(None,
- [ (None, (Some Camlp4.Sig.Grammar.LeftA),
+ [ (None, None,
[ ([ Gram.Snterm
(Gram.Entry.obj
(type_parameter :
@@ -4320,6 +4782,20 @@ Old (no more supported) syntax:
(Gram.Action.mk
(fun (t : 'type_parameter) (_loc : 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)
+ ->
+ match __camlp4_0 with
+ | ANTIQUOT ((("list" as n)), s) ->
+ (Ast.TyAnt (_loc,
+ mk_anti ~c: "ctyp," n s) :
+ 'comma_type_parameter)
+ | _ -> assert false)));
([ Gram.Sself; Gram.Skeyword ","; Gram.Sself ],
(Gram.Action.mk
(fun (t2 : 'comma_type_parameter) _
@@ -4354,6 +4830,20 @@ Old (no more supported) syntax:
(Gram.Action.mk
(fun (t : 'ctyp) (_loc : Loc.t) ->
(t : 'comma_ctyp))));
+ ([ Gram.Stoken
+ (((function
+ | ANTIQUOT ("list", _) -> true
+ | _ -> false),
+ "ANTIQUOT (\"list\", _)")) ],
+ (Gram.Action.mk
+ (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
+ ->
+ match __camlp4_0 with
+ | ANTIQUOT ((("list" as n)), s) ->
+ (Ast.TyAnt (_loc,
+ mk_anti ~c: "ctyp," n s) :
+ 'comma_ctyp)
+ | _ -> assert false)));
([ Gram.Sself; Gram.Skeyword ","; Gram.Sself ],
(Gram.Action.mk
(fun (t2 : 'comma_ctyp) _ (t1 : 'comma_ctyp)
@@ -4399,14 +4889,16 @@ Old (no more supported) syntax:
(Ast.CeLet (_loc, rf, bi, ce) : 'class_expr))));
([ Gram.Skeyword "fun";
Gram.Snterm
- (Gram.Entry.obj (ipatt : 'ipatt Gram.Entry.t));
+ (Gram.Entry.obj
+ (labeled_ipatt :
+ 'labeled_ipatt Gram.Entry.t));
Gram.Snterm
(Gram.Entry.obj
(class_fun_def :
'class_fun_def Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (ce : 'class_fun_def) (p : 'ipatt) _
- (_loc : Loc.t) ->
+ (fun (ce : 'class_fun_def) (p : 'labeled_ipatt)
+ _ (_loc : Loc.t) ->
(Ast.CeFun (_loc, p, ce) : 'class_expr)))) ]);
((Some "apply"), (Some Camlp4.Sig.Grammar.NonA),
[ ([ Gram.Sself;
@@ -4453,6 +4945,18 @@ Old (no more supported) syntax:
(fun (ce : 'class_longident_and_param)
(_loc : Loc.t) -> (ce : 'class_expr))));
([ Gram.Stoken
+ (((function | QUOTATION _ -> true | _ -> false),
+ "QUOTATION _")) ],
+ (Gram.Action.mk
+ (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
+ ->
+ match __camlp4_0 with
+ | QUOTATION x ->
+ (Quotation.expand _loc x Quotation.
+ DynAst.class_expr_tag :
+ 'class_expr)
+ | _ -> assert false)));
+ ([ Gram.Stoken
(((function
| ANTIQUOT (("" | "cexp" | "anti"), _) ->
true
@@ -4514,15 +5018,37 @@ Old (no more supported) syntax:
(semi : 'semi Gram.Entry.t)) ],
(Gram.Action.mk
(fun _ (cst : 'class_str_item)
- (_loc : Loc.t) -> (cst : 'e__2)))) ]) ],
+ (_loc : Loc.t) -> (cst : 'e__4)))) ]) ],
(Gram.Action.mk
- (fun (l : 'e__2 list) (_loc : Loc.t) ->
+ (fun (l : 'e__4 list) (_loc : Loc.t) ->
(Ast.crSem_of_list l : 'class_structure))));
([ Gram.Stoken
(((function
| ANTIQUOT (("" | "cst" | "anti" | "list"),
_) -> true
| _ -> false),
+ "ANTIQUOT ((\"\" | \"cst\" | \"anti\" | \"list\"), _)"));
+ Gram.Snterm
+ (Gram.Entry.obj (semi : 'semi Gram.Entry.t));
+ Gram.Sself ],
+ (Gram.Action.mk
+ (fun (cst : 'class_structure) _
+ (__camlp4_0 : Gram.Token.t) (_loc : Loc.t) ->
+ match __camlp4_0 with
+ | ANTIQUOT
+ ((("" | "cst" | "anti" | "list" as n)),
+ s) ->
+ (Ast.CrSem (_loc,
+ Ast.CrAnt (_loc,
+ mk_anti ~c: "class_str_item" n s),
+ cst) :
+ 'class_structure)
+ | _ -> assert false)));
+ ([ Gram.Stoken
+ (((function
+ | ANTIQUOT (("" | "cst" | "anti" | "list"),
+ _) -> true
+ | _ -> false),
"ANTIQUOT ((\"\" | \"cst\" | \"anti\" | \"list\"), _)")) ],
(Gram.Action.mk
(fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
@@ -4603,6 +5129,22 @@ Old (no more supported) syntax:
(_loc : Loc.t) ->
(Ast.CrMth (_loc, l, pf, e, topt) :
'class_str_item))));
+ ([ Gram.Skeyword "method";
+ Gram.Snterm
+ (Gram.Entry.obj
+ (opt_private : 'opt_private Gram.Entry.t));
+ Gram.Skeyword "virtual";
+ 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 : Loc.t) ->
+ (Ast.CrVir (_loc, l, pf, t) :
+ 'class_str_item))));
([ Gram.Skeyword "method"; Gram.Skeyword "virtual";
Gram.Snterm
(Gram.Entry.obj
@@ -4666,6 +5208,18 @@ Old (no more supported) syntax:
(_loc : 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)
+ ->
+ match __camlp4_0 with
+ | QUOTATION x ->
+ (Quotation.expand _loc x Quotation.
+ DynAst.class_str_item_tag :
+ 'class_str_item)
+ | _ -> assert false)));
+ ([ Gram.Stoken
(((function
| ANTIQUOT (("" | "cst" | "anti" | "list"),
_) -> true
@@ -4797,6 +5351,18 @@ Old (no more supported) syntax:
(fun (ct : 'class_type_longident_and_param)
(_loc : Loc.t) -> (ct : 'class_type))));
([ Gram.Stoken
+ (((function | QUOTATION _ -> true | _ -> false),
+ "QUOTATION _")) ],
+ (Gram.Action.mk
+ (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
+ ->
+ match __camlp4_0 with
+ | QUOTATION x ->
+ (Quotation.expand _loc x Quotation.
+ DynAst.class_type_tag :
+ 'class_type)
+ | _ -> assert false)));
+ ([ Gram.Stoken
(((function
| ANTIQUOT (("" | "ctyp" | "anti"), _) ->
true
@@ -4895,15 +5461,37 @@ Old (no more supported) syntax:
(semi : 'semi Gram.Entry.t)) ],
(Gram.Action.mk
(fun _ (csg : 'class_sig_item)
- (_loc : Loc.t) -> (csg : 'e__3)))) ]) ],
+ (_loc : Loc.t) -> (csg : 'e__5)))) ]) ],
(Gram.Action.mk
- (fun (l : 'e__3 list) (_loc : Loc.t) ->
+ (fun (l : 'e__5 list) (_loc : Loc.t) ->
(Ast.cgSem_of_list l : 'class_signature))));
([ Gram.Stoken
(((function
| ANTIQUOT (("" | "csg" | "anti" | "list"),
_) -> true
| _ -> false),
+ "ANTIQUOT ((\"\" | \"csg\" | \"anti\" | \"list\"), _)"));
+ Gram.Snterm
+ (Gram.Entry.obj (semi : 'semi Gram.Entry.t));
+ Gram.Sself ],
+ (Gram.Action.mk
+ (fun (csg : 'class_signature) _
+ (__camlp4_0 : Gram.Token.t) (_loc : Loc.t) ->
+ match __camlp4_0 with
+ | ANTIQUOT
+ ((("" | "csg" | "anti" | "list" as n)),
+ s) ->
+ (Ast.CgSem (_loc,
+ Ast.CgAnt (_loc,
+ mk_anti ~c: "class_sig_item" n s),
+ csg) :
+ 'class_signature)
+ | _ -> assert false)));
+ ([ Gram.Stoken
+ (((function
+ | ANTIQUOT (("" | "csg" | "anti" | "list"),
+ _) -> true
+ | _ -> false),
"ANTIQUOT ((\"\" | \"csg\" | \"anti\" | \"list\"), _)")) ],
(Gram.Action.mk
(fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
@@ -4938,6 +5526,22 @@ Old (no more supported) syntax:
Gram.Snterm
(Gram.Entry.obj
(opt_private : 'opt_private Gram.Entry.t));
+ Gram.Skeyword "virtual";
+ 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 : Loc.t) ->
+ (Ast.CgVir (_loc, l, pf, t) :
+ 'class_sig_item))));
+ ([ Gram.Skeyword "method";
+ Gram.Snterm
+ (Gram.Entry.obj
+ (opt_private : 'opt_private Gram.Entry.t));
Gram.Snterm
(Gram.Entry.obj (label : 'label Gram.Entry.t));
Gram.Skeyword ":";
@@ -4992,6 +5596,18 @@ Old (no more supported) syntax:
(fun (cs : 'class_type) _ (_loc : 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)
+ ->
+ match __camlp4_0 with
+ | QUOTATION x ->
+ (Quotation.expand _loc x Quotation.
+ DynAst.class_sig_item_tag :
+ 'class_sig_item)
+ | _ -> assert false)));
+ ([ Gram.Stoken
(((function
| ANTIQUOT (("" | "csg" | "anti" | "list"),
_) -> true
@@ -5013,7 +5629,10 @@ Old (no more supported) syntax:
((fun () ->
(None,
[ (None, None,
- [ ([ Gram.Skeyword "type" ],
+ [ ([ Gram.Skeyword "constraint" ],
+ (Gram.Action.mk
+ (fun _ (_loc : Loc.t) -> (() : 'type_constraint))));
+ ([ Gram.Skeyword "type" ],
(Gram.Action.mk
(fun _ (_loc : Loc.t) -> (() : 'type_constraint)))) ]) ]))
());
@@ -5038,6 +5657,18 @@ Old (no more supported) syntax:
(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)
+ ->
+ match __camlp4_0 with
+ | QUOTATION x ->
+ (Quotation.expand _loc x Quotation.
+ DynAst.class_type_tag :
+ 'class_description)
+ | _ -> assert false)));
+ ([ Gram.Stoken
(((function
| ANTIQUOT (("" | "typ" | "anti" | "list"),
_) -> true
@@ -5082,6 +5713,18 @@ Old (no more supported) syntax:
(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)
+ ->
+ match __camlp4_0 with
+ | QUOTATION x ->
+ (Quotation.expand _loc x Quotation.
+ DynAst.class_type_tag :
+ 'class_type_declaration)
+ | _ -> assert false)));
+ ([ Gram.Stoken
(((function
| ANTIQUOT (("" | "typ" | "anti" | "list"),
_) -> true
@@ -5118,8 +5761,7 @@ Old (no more supported) syntax:
(Gram.Action.mk
(fun (e : 'expr) _ (l : 'label) (_loc : Loc.t)
->
- (Ast.BiEq (_loc,
- Ast.PaId (_loc, Ast.IdLid (_loc, l)), e) :
+ (Ast.RbEq (_loc, Ast.IdLid (_loc, l), e) :
'field_expr))));
([ Gram.Stoken
(((function
@@ -5131,8 +5773,8 @@ Old (no more supported) syntax:
->
match __camlp4_0 with
| ANTIQUOT ((("list" as n)), s) ->
- (Ast.BiAnt (_loc,
- mk_anti ~c: "binding;" n s) :
+ (Ast.RbAnt (_loc,
+ mk_anti ~c: "rec_binding" n s) :
'field_expr)
| _ -> assert false)));
([ Gram.Stoken
@@ -5146,53 +5788,20 @@ Old (no more supported) syntax:
match __camlp4_0 with
| ANTIQUOT ((("" | "bi" | "anti" as n)), s)
->
- (Ast.BiAnt (_loc,
- mk_anti ~c: "binding" n s) :
+ (Ast.RbAnt (_loc,
+ mk_anti ~c: "rec_binding" n s) :
'field_expr)
| _ -> assert false)));
([ Gram.Sself; Gram.Skeyword ";"; Gram.Sself ],
(Gram.Action.mk
(fun (b2 : 'field_expr) _ (b1 : 'field_expr)
(_loc : Loc.t) ->
- (Ast.BiSem (_loc, b1, b2) : 'field_expr)))) ]) ]))
+ (Ast.RbSem (_loc, b1, b2) : 'field_expr)))) ]) ]))
());
Gram.extend (meth_list : 'meth_list Gram.Entry.t)
((fun () ->
(None,
- [ (None, None,
- [ ([ Gram.Snterm
- (Gram.Entry.obj (field : 'field Gram.Entry.t));
- Gram.Sopt (Gram.Skeyword ";") ],
- (Gram.Action.mk
- (fun _ (f : 'field) (_loc : Loc.t) ->
- (f : 'meth_list))));
- ([ Gram.Snterm
- (Gram.Entry.obj (field : 'field Gram.Entry.t));
- Gram.Skeyword ";"; Gram.Sself ],
- (Gram.Action.mk
- (fun (ml : 'meth_list) _ (f : 'field)
- (_loc : Loc.t) ->
- (Ast.TySem (_loc, f, ml) : 'meth_list)))) ]) ]))
- ());
- Gram.extend (opt_meth_list : 'opt_meth_list Gram.Entry.t)
- ((fun () ->
- (None,
- [ (None, None,
- [ ([],
- (Gram.Action.mk
- (fun (_loc : Loc.t) ->
- (Ast.TyNil _loc : 'opt_meth_list))));
- ([ Gram.Snterm
- (Gram.Entry.obj
- (meth_list : 'meth_list Gram.Entry.t)) ],
- (Gram.Action.mk
- (fun (ml : 'meth_list) (_loc : Loc.t) ->
- (ml : 'opt_meth_list)))) ]) ]))
- ());
- Gram.extend (field : 'field Gram.Entry.t)
- ((fun () ->
- (None,
- [ (None, None,
+ [ (None, (Some Camlp4.Sig.Grammar.LeftA),
[ ([ Gram.Snterm
(Gram.Entry.obj
(a_LIDENT : 'a_LIDENT Gram.Entry.t));
@@ -5205,7 +5814,33 @@ Old (no more supported) syntax:
(_loc : Loc.t) ->
(Ast.TyCol (_loc,
Ast.TyId (_loc, Ast.IdLid (_loc, lab)), t) :
- 'field))));
+ 'meth_list))));
+ ([ Gram.Stoken
+ (((function | QUOTATION _ -> true | _ -> false),
+ "QUOTATION _")) ],
+ (Gram.Action.mk
+ (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
+ ->
+ match __camlp4_0 with
+ | QUOTATION x ->
+ (Quotation.expand _loc x Quotation.
+ DynAst.ctyp_tag :
+ 'meth_list)
+ | _ -> assert false)));
+ ([ Gram.Stoken
+ (((function
+ | ANTIQUOT ("list", _) -> true
+ | _ -> false),
+ "ANTIQUOT (\"list\", _)")) ],
+ (Gram.Action.mk
+ (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
+ ->
+ match __camlp4_0 with
+ | ANTIQUOT ((("list" as n)), s) ->
+ (Ast.TyAnt (_loc,
+ mk_anti ~c: "ctyp;" n s) :
+ 'meth_list)
+ | _ -> assert false)));
([ Gram.Stoken
(((function
| ANTIQUOT (("" | "typ"), _) -> true
@@ -5217,8 +5852,29 @@ Old (no more supported) syntax:
match __camlp4_0 with
| ANTIQUOT ((("" | "typ" as n)), s) ->
(Ast.TyAnt (_loc, mk_anti ~c: "ctyp" n s) :
- 'field)
- | _ -> assert false))) ]) ]))
+ 'meth_list)
+ | _ -> assert false)));
+ ([ Gram.Sself; Gram.Skeyword ";"; Gram.Sself ],
+ (Gram.Action.mk
+ (fun (ml2 : 'meth_list) _ (ml1 : 'meth_list)
+ (_loc : Loc.t) ->
+ (Ast.TySem (_loc, ml1, ml2) : 'meth_list)))) ]) ]))
+ ());
+ Gram.extend (opt_meth_list : 'opt_meth_list Gram.Entry.t)
+ ((fun () ->
+ (None,
+ [ (None, None,
+ [ ([],
+ (Gram.Action.mk
+ (fun (_loc : 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) ->
+ (ml : 'opt_meth_list)))) ]) ]))
());
Gram.extend (poly_type : 'poly_type Gram.Entry.t)
((fun () ->
@@ -5242,6 +5898,18 @@ Old (no more supported) syntax:
(fun (i : 'a_ident) _ (_loc : 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)
+ ->
+ match __camlp4_0 with
+ | QUOTATION x ->
+ (Quotation.expand _loc x Quotation.
+ DynAst.ctyp_tag :
+ 'typevars)
+ | _ -> assert false)));
+ ([ Gram.Stoken
(((function
| ANTIQUOT (("" | "typ"), _) -> true
| _ -> false),
@@ -5309,6 +5977,20 @@ Old (no more supported) syntax:
(Ast.TyOr (_loc, t1, t2) : 'row_field))));
([ Gram.Stoken
(((function
+ | ANTIQUOT ("list", _) -> true
+ | _ -> false),
+ "ANTIQUOT (\"list\", _)")) ],
+ (Gram.Action.mk
+ (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
+ ->
+ match __camlp4_0 with
+ | ANTIQUOT ((("list" as n)), s) ->
+ (Ast.TyAnt (_loc,
+ mk_anti ~c: "ctyp|" n s) :
+ 'row_field)
+ | _ -> assert false)));
+ ([ Gram.Stoken
+ (((function
| ANTIQUOT (("" | "typ"), _) -> true
| _ -> false),
"ANTIQUOT ((\"\" | \"typ\"), _)")) ],
@@ -5321,36 +6003,6 @@ Old (no more supported) syntax:
'row_field)
| _ -> assert false))) ]) ]))
());
- Gram.extend (sem_ctyp : 'sem_ctyp Gram.Entry.t)
- ((fun () ->
- (None,
- [ (None, None,
- [ ([ Gram.Snterm
- (Gram.Entry.obj (ctyp : 'ctyp Gram.Entry.t)) ],
- (Gram.Action.mk
- (fun (t : 'ctyp) (_loc : Loc.t) ->
- (t : 'sem_ctyp))));
- ([ Gram.Sself; Gram.Skeyword ";"; Gram.Sself ],
- (Gram.Action.mk
- (fun (t2 : 'sem_ctyp) _ (t1 : 'sem_ctyp)
- (_loc : Loc.t) ->
- (Ast.TySem (_loc, t1, t2) : 'sem_ctyp)))) ]) ]))
- ());
- Gram.extend (pipe_ctyp : 'pipe_ctyp Gram.Entry.t)
- ((fun () ->
- (None,
- [ (None, None,
- [ ([ Gram.Snterm
- (Gram.Entry.obj (ctyp : 'ctyp Gram.Entry.t)) ],
- (Gram.Action.mk
- (fun (t : 'ctyp) (_loc : Loc.t) ->
- (t : 'pipe_ctyp))));
- ([ Gram.Sself; Gram.Skeyword "|"; Gram.Sself ],
- (Gram.Action.mk
- (fun (t2 : 'pipe_ctyp) _ (t1 : 'pipe_ctyp)
- (_loc : Loc.t) ->
- (Ast.TyOr (_loc, t1, t2) : 'pipe_ctyp)))) ]) ]))
- ());
Gram.extend (amp_ctyp : 'amp_ctyp Gram.Entry.t)
((fun () ->
(None,
@@ -5360,6 +6012,20 @@ Old (no more supported) syntax:
(Gram.Action.mk
(fun (t : 'ctyp) (_loc : Loc.t) ->
(t : 'amp_ctyp))));
+ ([ Gram.Stoken
+ (((function
+ | ANTIQUOT ("list", _) -> true
+ | _ -> false),
+ "ANTIQUOT (\"list\", _)")) ],
+ (Gram.Action.mk
+ (fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
+ ->
+ match __camlp4_0 with
+ | ANTIQUOT ((("list" as n)), s) ->
+ (Ast.TyAnt (_loc,
+ mk_anti ~c: "ctyp&" n s) :
+ 'amp_ctyp)
+ | _ -> assert false)));
([ Gram.Sself; Gram.Skeyword "&"; Gram.Sself ],
(Gram.Action.mk
(fun (t2 : 'amp_ctyp) _ (t1 : 'amp_ctyp)
@@ -5808,15 +6474,37 @@ Old (no more supported) syntax:
(semi : 'semi Gram.Entry.t)) ],
(Gram.Action.mk
(fun _ (sg : 'sig_item) (_loc : Loc.t)
- -> (sg : 'e__4)))) ]) ],
+ -> (sg : 'e__6)))) ]) ],
(Gram.Action.mk
- (fun (l : 'e__4 list) (_loc : Loc.t) ->
+ (fun (l : 'e__6 list) (_loc : Loc.t) ->
(Ast.sgSem_of_list l : 'sig_items))));
([ Gram.Stoken
(((function
| ANTIQUOT (("" | "sigi" | "anti" | "list"),
_) -> true
| _ -> false),
+ "ANTIQUOT ((\"\" | \"sigi\" | \"anti\" | \"list\"), _)"));
+ Gram.Snterm
+ (Gram.Entry.obj (semi : 'semi Gram.Entry.t));
+ Gram.Sself ],
+ (Gram.Action.mk
+ (fun (sg : 'sig_items) _
+ (__camlp4_0 : Gram.Token.t) (_loc : Loc.t) ->
+ match __camlp4_0 with
+ | ANTIQUOT
+ ((("" | "sigi" | "anti" | "list" as n)),
+ s) ->
+ (Ast.SgSem (_loc,
+ Ast.SgAnt (_loc,
+ mk_anti n ~c: "sig_item" s),
+ sg) :
+ 'sig_items)
+ | _ -> assert false)));
+ ([ Gram.Stoken
+ (((function
+ | ANTIQUOT (("" | "sigi" | "anti" | "list"),
+ _) -> true
+ | _ -> false),
"ANTIQUOT ((\"\" | \"sigi\" | \"anti\" | \"list\"), _)")) ],
(Gram.Action.mk
(fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
@@ -5882,15 +6570,37 @@ Old (no more supported) syntax:
(semi : 'semi Gram.Entry.t)) ],
(Gram.Action.mk
(fun _ (st : 'str_item) (_loc : Loc.t)
- -> (st : 'e__5)))) ]) ],
+ -> (st : 'e__7)))) ]) ],
(Gram.Action.mk
- (fun (l : 'e__5 list) (_loc : Loc.t) ->
+ (fun (l : 'e__7 list) (_loc : Loc.t) ->
(Ast.stSem_of_list l : 'str_items))));
([ Gram.Stoken
(((function
| ANTIQUOT (("" | "stri" | "anti" | "list"),
_) -> true
| _ -> false),
+ "ANTIQUOT ((\"\" | \"stri\" | \"anti\" | \"list\"), _)"));
+ Gram.Snterm
+ (Gram.Entry.obj (semi : 'semi Gram.Entry.t));
+ Gram.Sself ],
+ (Gram.Action.mk
+ (fun (st : 'str_items) _
+ (__camlp4_0 : Gram.Token.t) (_loc : Loc.t) ->
+ match __camlp4_0 with
+ | ANTIQUOT
+ ((("" | "stri" | "anti" | "list" as n)),
+ s) ->
+ (Ast.StSem (_loc,
+ Ast.StAnt (_loc,
+ mk_anti n ~c: "str_item" s),
+ st) :
+ 'str_items)
+ | _ -> assert false)));
+ ([ Gram.Stoken
+ (((function
+ | ANTIQUOT (("" | "stri" | "anti" | "list"),
+ _) -> true
+ | _ -> false),
"ANTIQUOT ((\"\" | \"stri\" | \"anti\" | \"list\"), _)")) ],
(Gram.Action.mk
(fun (__camlp4_0 : Gram.Token.t) (_loc : Loc.t)
@@ -6203,18 +6913,6 @@ Old (no more supported) syntax:
(mk_anti n s : 'a_LIDENT)
| _ -> assert false))) ]) ]))
());
- Gram.extend
- (a_LIDENT_or_operator : 'a_LIDENT_or_operator Gram.Entry.t)
- ((fun () ->
- (None,
- [ (None, None,
- [ ([ Gram.Snterm
- (Gram.Entry.obj
- (a_LIDENT : 'a_LIDENT Gram.Entry.t)) ],
- (Gram.Action.mk
- (fun (x : 'a_LIDENT) (_loc : Loc.t) ->
- (x : 'a_LIDENT_or_operator)))) ]) ]))
- ());
Gram.extend (a_LABEL : 'a_LABEL Gram.Entry.t)
((fun () ->
(None,
@@ -6421,7 +7119,11 @@ Old (no more supported) syntax:
(Gram.Entry.obj (patt : 'patt Gram.Entry.t)) ],
(Gram.Action.mk
(fun (y : 'patt) _ (x : 'patt) (_loc : Loc.t) ->
- (Ast.PaEq (_loc, x, y) : 'patt_quot))));
+ (let i =
+ match x with
+ | Ast.PaAnt (loc, s) -> Ast.IdAnt (loc, s)
+ | p -> Ast.ident_of_patt p
+ in Ast.PaEq (_loc, i, y) : 'patt_quot))));
([ Gram.Snterm
(Gram.Entry.obj (patt : 'patt Gram.Entry.t));
Gram.Skeyword ";";
@@ -6497,6 +7199,23 @@ Old (no more supported) syntax:
Gram.Skeyword ":";
Gram.Snterm
(Gram.Entry.obj
+ (more_ctyp : 'more_ctyp Gram.Entry.t));
+ Gram.Skeyword ";";
+ Gram.Snterm
+ (Gram.Entry.obj
+ (label_declaration :
+ 'label_declaration Gram.Entry.t)) ],
+ (Gram.Action.mk
+ (fun (z : 'label_declaration) _ (y : 'more_ctyp)
+ _ (x : 'more_ctyp) (_loc : Loc.t) ->
+ (Ast.TySem (_loc, Ast.TyCol (_loc, x, y), z) :
+ 'ctyp_quot))));
+ ([ Gram.Snterm
+ (Gram.Entry.obj
+ (more_ctyp : 'more_ctyp Gram.Entry.t));
+ Gram.Skeyword ":";
+ Gram.Snterm
+ (Gram.Entry.obj
(more_ctyp : 'more_ctyp Gram.Entry.t)) ],
(Gram.Action.mk
(fun (y : 'more_ctyp) _ (x : 'more_ctyp)
@@ -6508,6 +7227,22 @@ Old (no more supported) syntax:
Gram.Skeyword "of"; Gram.Skeyword "&";
Gram.Snterm
(Gram.Entry.obj
+ (amp_ctyp : 'amp_ctyp Gram.Entry.t));
+ Gram.Skeyword "|";
+ 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) ->
+ (Ast.TyOr (_loc, Ast.TyOfAmp (_loc, x, y), z) :
+ 'ctyp_quot))));
+ ([ Gram.Snterm
+ (Gram.Entry.obj
+ (more_ctyp : 'more_ctyp Gram.Entry.t));
+ Gram.Skeyword "of"; Gram.Skeyword "&";
+ Gram.Snterm
+ (Gram.Entry.obj
(amp_ctyp : 'amp_ctyp Gram.Entry.t)) ],
(Gram.Action.mk
(fun (y : 'amp_ctyp) _ _ (x : 'more_ctyp)
@@ -6520,6 +7255,25 @@ Old (no more supported) syntax:
Gram.Snterm
(Gram.Entry.obj
(constructor_arg_list :
+ 'constructor_arg_list Gram.Entry.t));
+ Gram.Skeyword "|";
+ Gram.Snterm
+ (Gram.Entry.obj
+ (constructor_declarations :
+ 'constructor_declarations Gram.Entry.t)) ],
+ (Gram.Action.mk
+ (fun (z : 'constructor_declarations) _
+ (y : 'constructor_arg_list) _
+ (x : 'more_ctyp) (_loc : Loc.t) ->
+ (Ast.TyOr (_loc, Ast.TyOf (_loc, x, y), z) :
+ 'ctyp_quot))));
+ ([ Gram.Snterm
+ (Gram.Entry.obj
+ (more_ctyp : 'more_ctyp Gram.Entry.t));
+ Gram.Skeyword "of";
+ Gram.Snterm
+ (Gram.Entry.obj
+ (constructor_arg_list :
'constructor_arg_list Gram.Entry.t)) ],
(Gram.Action.mk
(fun (y : 'constructor_arg_list) _
@@ -6531,10 +7285,11 @@ Old (no more supported) syntax:
Gram.Skeyword "|";
Gram.Snterm
(Gram.Entry.obj
- (pipe_ctyp : 'pipe_ctyp Gram.Entry.t)) ],
+ (constructor_declarations :
+ 'constructor_declarations Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (y : 'pipe_ctyp) _ (x : 'more_ctyp)
- (_loc : Loc.t) ->
+ (fun (y : 'constructor_declarations) _
+ (x : 'more_ctyp) (_loc : Loc.t) ->
(Ast.TyOr (_loc, x, y) : 'ctyp_quot))));
([ Gram.Snterm
(Gram.Entry.obj
@@ -6542,9 +7297,10 @@ Old (no more supported) syntax:
Gram.Skeyword ";";
Gram.Snterm
(Gram.Entry.obj
- (sem_ctyp : 'sem_ctyp Gram.Entry.t)) ],
+ (label_declaration :
+ 'label_declaration Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (y : 'sem_ctyp) _ (x : 'more_ctyp)
+ (fun (y : 'label_declaration) _ (x : 'more_ctyp)
(_loc : Loc.t) ->
(Ast.TySem (_loc, x, y) : 'ctyp_quot))));
([ Gram.Snterm
@@ -6571,9 +7327,10 @@ Old (no more supported) syntax:
(fun (x : 'type_parameter) (_loc : Loc.t) ->
(x : 'more_ctyp))));
([ Gram.Snterm
- (Gram.Entry.obj (ctyp : 'ctyp Gram.Entry.t)) ],
+ (Gram.Entry.obj
+ (type_kind : 'type_kind Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (x : 'ctyp) (_loc : Loc.t) ->
+ (fun (x : 'type_kind) (_loc : Loc.t) ->
(x : 'more_ctyp))));
([ Gram.Skeyword "`";
Gram.Snterm
@@ -6663,7 +7420,11 @@ Old (no more supported) syntax:
((fun () ->
(None,
[ (None, None,
- [ ([ Gram.Snterm
+ [ ([],
+ (Gram.Action.mk
+ (fun (_loc : Loc.t) ->
+ (Ast.MtNil _loc : 'module_type_quot))));
+ ([ Gram.Snterm
(Gram.Entry.obj
(module_type : 'module_type Gram.Entry.t)) ],
(Gram.Action.mk
@@ -6674,7 +7435,11 @@ Old (no more supported) syntax:
((fun () ->
(None,
[ (None, None,
- [ ([ Gram.Snterm
+ [ ([],
+ (Gram.Action.mk
+ (fun (_loc : Loc.t) ->
+ (Ast.MeNil _loc : 'module_expr_quot))));
+ ([ Gram.Snterm
(Gram.Entry.obj
(module_expr : 'module_expr Gram.Entry.t)) ],
(Gram.Action.mk
@@ -6689,12 +7454,14 @@ Old (no more supported) syntax:
(Gram.Action.mk
(fun (_loc : Loc.t) ->
(Ast.McNil _loc : 'match_case_quot))));
- ([ Gram.Snterm
- (Gram.Entry.obj
- (match_case : 'match_case Gram.Entry.t)) ],
+ ([ Gram.Slist0sep
+ (Gram.Snterm
+ (Gram.Entry.obj
+ (match_case0 : 'match_case0 Gram.Entry.t)),
+ Gram.Skeyword "|") ],
(Gram.Action.mk
- (fun (x : 'match_case) (_loc : Loc.t) ->
- (x : 'match_case_quot)))) ]) ]))
+ (fun (x : 'match_case0 list) (_loc : Loc.t) ->
+ (Ast.mcOr_of_list x : 'match_case_quot)))) ]) ]))
());
Gram.extend (binding_quot : 'binding_quot Gram.Entry.t)
((fun () ->
@@ -6706,26 +7473,25 @@ Old (no more supported) syntax:
(Ast.BiNil _loc : 'binding_quot))));
([ Gram.Snterm
(Gram.Entry.obj
- (label_expr : 'label_expr Gram.Entry.t)) ],
- (Gram.Action.mk
- (fun (x : 'label_expr) (_loc : Loc.t) ->
- (x : 'binding_quot))));
- ([ Gram.Snterm
- (Gram.Entry.obj
(binding : 'binding Gram.Entry.t)) ],
(Gram.Action.mk
(fun (x : 'binding) (_loc : Loc.t) ->
- (x : 'binding_quot))));
- ([ Gram.Sself; Gram.Skeyword ";"; Gram.Sself ],
+ (x : 'binding_quot)))) ]) ]))
+ ());
+ Gram.extend (rec_binding_quot : 'rec_binding_quot Gram.Entry.t)
+ ((fun () ->
+ (None,
+ [ (None, None,
+ [ ([],
(Gram.Action.mk
- (fun (b2 : 'binding_quot) _ (b1 : 'binding_quot)
- (_loc : Loc.t) ->
- (Ast.BiSem (_loc, b1, b2) : 'binding_quot))));
- ([ Gram.Sself; Gram.Skeyword "and"; Gram.Sself ],
+ (fun (_loc : Loc.t) ->
+ (Ast.RbNil _loc : 'rec_binding_quot))));
+ ([ Gram.Snterm
+ (Gram.Entry.obj
+ (label_expr : 'label_expr Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (b2 : 'binding_quot) _ (b1 : 'binding_quot)
- (_loc : Loc.t) ->
- (Ast.BiAnd (_loc, b1, b2) : 'binding_quot)))) ]) ]))
+ (fun (x : 'label_expr) (_loc : Loc.t) ->
+ (x : 'rec_binding_quot)))) ]) ]))
());
Gram.extend
(module_binding_quot : 'module_binding_quot Gram.Entry.t)
@@ -6940,10 +7706,10 @@ Old (no more supported) syntax:
(__camlp4_0 : Gram.Token.t) (_loc : Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("virtual" as n)), s) ->
- (Ast.CeCon (_loc,
+ (let anti =
Ast.BAnt
- (mk_anti ~c: "class_expr" n s),
- i, ot) :
+ (mk_anti ~c: "class_expr" n s)
+ in Ast.CeCon (_loc, anti, i, ot) :
'class_expr_quot)
| _ -> assert false)));
([ Gram.Skeyword "virtual";
@@ -7001,10 +7767,10 @@ Old (no more supported) syntax:
(__camlp4_0 : Gram.Token.t) (_loc : Loc.t) ->
match __camlp4_0 with
| ANTIQUOT ((("virtual" as n)), s) ->
- (Ast.CtCon (_loc,
+ (let anti =
Ast.BAnt
- (mk_anti ~c: "class_type" n s),
- i, ot) :
+ (mk_anti ~c: "class_type" n s)
+ in Ast.CtCon (_loc, anti, i, ot) :
'class_type_quot)
| _ -> assert false)));
([ Gram.Skeyword "virtual";
@@ -7167,7 +7933,7 @@ module Camlp4QuotationCommon =
struct
let name = "Camlp4QuotationCommon"
let version =
- "$Id: Camlp4QuotationCommon.ml,v 1.1 2007/02/07 10:09:22 ertai Exp $"
+ "$Id: Camlp4QuotationCommon.ml,v 1.1.4.5 2007/05/10 14:24:22 pouillar Exp $"
end
module Make
(Syntax : Sig.Camlp4Syntax)
@@ -7320,6 +8086,14 @@ module Camlp4QuotationCommon =
Ast.IdUid (_loc, "BiAnt"))),
mloc _loc),
p)
+ | "antirec_binding" ->
+ Ast.PaApp (_loc,
+ Ast.PaApp (_loc,
+ Ast.PaId (_loc,
+ Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
+ Ast.IdUid (_loc, "RbAnt"))),
+ mloc _loc),
+ p)
| "antimatch_case" ->
Ast.PaApp (_loc,
Ast.PaApp (_loc,
@@ -7396,6 +8170,12 @@ module Camlp4QuotationCommon =
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Char"),
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"))))
| "liststr_item" ->
Ast.ExApp (_loc,
Ast.ExId (_loc,
@@ -7450,6 +8230,12 @@ module Camlp4QuotationCommon =
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdLid (_loc, "biSem_of_list"))),
e)
+ | "listrec_binding" ->
+ Ast.ExApp (_loc,
+ Ast.ExId (_loc,
+ Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
+ Ast.IdLid (_loc, "rbSem_of_list"))),
+ e)
| "listclass_type" ->
Ast.ExApp (_loc,
Ast.ExId (_loc,
@@ -7474,6 +8260,36 @@ module Camlp4QuotationCommon =
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdLid (_loc, "tyAnd_of_list"))),
e)
+ | "listctyp;" ->
+ Ast.ExApp (_loc,
+ Ast.ExId (_loc,
+ Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
+ Ast.IdLid (_loc, "tySem_of_list"))),
+ e)
+ | "listctyp*" ->
+ Ast.ExApp (_loc,
+ Ast.ExId (_loc,
+ Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
+ Ast.IdLid (_loc, "tySta_of_list"))),
+ e)
+ | "listctyp|" ->
+ Ast.ExApp (_loc,
+ Ast.ExId (_loc,
+ Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
+ Ast.IdLid (_loc, "tyOr_of_list"))),
+ e)
+ | "listctyp," ->
+ Ast.ExApp (_loc,
+ Ast.ExId (_loc,
+ Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
+ Ast.IdLid (_loc, "tyCom_of_list"))),
+ e)
+ | "listctyp&" ->
+ Ast.ExApp (_loc,
+ Ast.ExId (_loc,
+ Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
+ Ast.IdLid (_loc, "tyAmp_of_list"))),
+ e)
| "listwith_constr" ->
Ast.ExApp (_loc,
Ast.ExId (_loc,
@@ -7486,12 +8302,30 @@ module Camlp4QuotationCommon =
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdLid (_loc, "mcOr_of_list"))),
e)
+ | "listpatt," ->
+ Ast.ExApp (_loc,
+ Ast.ExId (_loc,
+ Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
+ Ast.IdLid (_loc, "paCom_of_list"))),
+ e)
| "listpatt;" ->
Ast.ExApp (_loc,
Ast.ExId (_loc,
Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
Ast.IdLid (_loc, "paSem_of_list"))),
e)
+ | "listexpr," ->
+ Ast.ExApp (_loc,
+ Ast.ExId (_loc,
+ Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
+ Ast.IdLid (_loc, "exCom_of_list"))),
+ e)
+ | "listexpr;" ->
+ Ast.ExApp (_loc,
+ Ast.ExId (_loc,
+ Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
+ Ast.IdLid (_loc, "exSem_of_list"))),
+ e)
| "antisig_item" ->
Ast.ExApp (_loc,
Ast.ExApp (_loc,
@@ -7596,6 +8430,14 @@ module Camlp4QuotationCommon =
Ast.IdUid (_loc, "BiAnt"))),
mloc _loc),
e)
+ | "antirec_binding" ->
+ Ast.ExApp (_loc,
+ Ast.ExApp (_loc,
+ Ast.ExId (_loc,
+ Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
+ Ast.IdUid (_loc, "RbAnt"))),
+ mloc _loc),
+ e)
| "antimatch_case" ->
Ast.ExApp (_loc,
Ast.ExApp (_loc,
@@ -7625,13 +8467,21 @@ module Camlp4QuotationCommon =
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 =
+ let q = !Camlp4_config.antiquotations in
+ let () = Camlp4_config.antiquotations := true in
+ let res = Gram.parse_string entry loc s in
+ let () = Camlp4_config.antiquotations := q in res in
let expand_expr loc loc_name_opt s =
- let ast = Gram.parse_string entry_eoi loc s in
+ let ast = parse_quot_string entry_eoi loc s in
let () = MetaLoc.loc_name := loc_name_opt in
let meta_ast = mexpr loc ast in
let exp_ast = antiquot_expander#expr meta_ast in exp_ast in
+ let expand_str_item loc loc_name_opt s =
+ let exp_ast = expand_expr loc loc_name_opt s
+ in Ast.StExp (loc, exp_ast) in
let expand_patt _loc loc_name_opt s =
- let ast = Gram.parse_string entry_eoi _loc s in
+ let ast = parse_quot_string entry_eoi _loc s in
let meta_ast = mpatt _loc ast in
let exp_ast = antiquot_expander#patt meta_ast
in
@@ -7670,8 +8520,9 @@ module Camlp4QuotationCommon =
| EOI -> (x : 'entry_eoi)
| _ -> assert false))) ]) ]))
());
- Quotation.add name
- (Quotation.ExAst ((expand_expr, expand_patt))))
+ 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
@@ -7706,6 +8557,9 @@ module Camlp4QuotationCommon =
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 _ =
@@ -7773,7 +8627,7 @@ module Rp =
struct
let name = "Camlp4OCamlRevisedParserParser"
let version =
- "$Id: Camlp4OCamlRevisedParserParser.ml,v 1.1 2007/02/07 10:09:22 ertai Exp $"
+ "$Id: Camlp4OCamlRevisedParserParser.ml,v 1.1.4.2 2007/04/05 18:06:36 pouillar Exp $"
end
module Make (Syntax : Sig.Camlp4Syntax) =
struct
@@ -8157,7 +9011,11 @@ module Rp =
Ast.IdLid (_loc, "count"))),
Ast.ExId (_loc, Ast.IdLid (_loc, strm_n)))),
pc)
- | None -> pc
+ | None -> pc in
+ let me =
+ match me with
+ | (Ast.ExSem (_loc, _, _) as e) -> Ast.ExSeq (_loc, e)
+ | e -> e
in
match me with
| Ast.ExId (_, (Ast.IdLid (_, x))) when x = strm_n -> e
@@ -8297,7 +9155,10 @@ module Rp =
((fun () ->
((Some (Camlp4.Sig.Grammar.Level "top")),
[ (None, None,
- [ ([ Gram.Skeyword "match"; Gram.Sself;
+ [ ([ Gram.Skeyword "match";
+ Gram.Snterm
+ (Gram.Entry.obj
+ (sequence : 'sequence Gram.Entry.t));
Gram.Skeyword "with"; Gram.Skeyword "parser";
Gram.Sopt
(Gram.Snterm
@@ -8310,8 +9171,8 @@ module Rp =
'parser_case_list Gram.Entry.t)) ],
(Gram.Action.mk
(fun (pcl : 'parser_case_list)
- (po : 'parser_ipatt option) _ _ (e : 'expr) _
- (_loc : Loc.t) ->
+ (po : 'parser_ipatt option) _ _
+ (e : 'sequence) _ (_loc : Loc.t) ->
(cparser_match _loc e po pcl : 'expr))));
([ Gram.Skeyword "parser";
Gram.Sopt
@@ -8455,9 +9316,9 @@ module Rp =
'stream_expr Gram.Entry.t)) ],
(Gram.Action.mk
(fun (e : 'stream_expr) _
- (_loc : Loc.t) -> (e : 'e__6)))) ]) ],
+ (_loc : Loc.t) -> (e : 'e__8)))) ]) ],
(Gram.Action.mk
- (fun (eo : 'e__6 option)
+ (fun (eo : 'e__8 option)
(spc : 'stream_patt_comp) (_loc : Loc.t) ->
((spc, eo) : 'stream_patt_comp_err)))) ]) ]))
());
@@ -8527,9 +9388,9 @@ module Rp =
'stream_expr Gram.Entry.t)) ],
(Gram.Action.mk
(fun (e : 'stream_expr) _
- (_loc : Loc.t) -> (e : 'e__7)))) ]) ],
+ (_loc : Loc.t) -> (e : 'e__9)))) ]) ],
(Gram.Action.mk
- (fun (eo : 'e__7 option) (p : 'patt) _
+ (fun (eo : 'e__9 option) (p : 'patt) _
(_loc : Loc.t) ->
(SpTrm (_loc, p, eo) : 'stream_patt_comp)))) ]) ]))
());
@@ -8670,7 +9531,7 @@ module G =
struct
let name = "Camlp4GrammarParser"
let version =
- "$Id: Camlp4GrammarParser.ml,v 1.1 2007/02/07 10:09:22 ertai Exp $"
+ "$Id: Camlp4GrammarParser.ml,v 1.1.4.4 2007/04/20 14:57:28 pouillar Exp $"
end
module Make (Syntax : Sig.Camlp4Syntax) =
struct
@@ -8779,7 +9640,7 @@ module G =
(fun s (r, e) ->
if !r = Unused
then
- Warning.print e.name.loc
+ print_warning e.name.loc
("Unused local entry \"" ^ (s ^ "\""))
else ())
ht)
@@ -8800,12 +9661,10 @@ module G =
prod = [ ({ pattern = None; styp = STtok _ } as s) ];
action = None } ->
{
-
prod =
[ {
(s)
with
-
pattern =
Some (Ast.PaId (_loc, Ast.IdLid (_loc, "x")));
} ];
@@ -8819,12 +9678,10 @@ module G =
}
| { prod = [ ({ pattern = None } as s) ]; action = None } ->
{
-
prod =
[ {
(s)
with
-
pattern =
Some (Ast.PaId (_loc, Ast.IdLid (_loc, "x")));
} ];
@@ -9211,13 +10068,13 @@ module G =
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; }
+ { 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; }
+ { used = []; text = s; styp = t; pattern = Some p; }
let sslist _loc min sep s =
let rl =
let r1 =
@@ -9227,7 +10084,7 @@ module G =
[ 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
+ in { prod = prod; action = Some act; } in
let r2 =
let prod =
[ mk_symbol (Ast.PaId (_loc, Ast.IdLid (_loc, "a")))
@@ -9239,14 +10096,14 @@ module G =
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 { 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; }
+ in { used = used; text = text; styp = styp; pattern = None; }
let ssopt _loc s =
let rl =
let r1 =
@@ -9256,19 +10113,17 @@ module G =
[ 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
+ 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")));
@@ -9289,7 +10144,6 @@ module G =
let t = new_type_var ()
in
{
-
used = [];
text = TXrules (_loc, srules _loc t rl "");
styp = STquo (_loc, t);
@@ -9306,12 +10160,12 @@ module G =
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 { 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; }
+ in { used = used; text = text; styp = styp; pattern = None; }
let text_of_entry _loc e =
let ent =
let x = e.name in
@@ -9513,7 +10367,6 @@ module G =
function
| Ast.PaId (_loc, (Ast.IdLid (_, _))) -> Ast.PaAny _loc
| Ast.PaAli (_, p, _) -> self#patt p
- | Ast.PaEq (_loc, p1, p2) -> Ast.PaEq (_loc, p1, self#patt p2)
| p -> super#patt p
end
let mk_tok _loc p t =
@@ -9533,7 +10386,7 @@ module G =
Ast.ExId (_loc, Ast.IdUid (_loc, "False"))))) in
let descr = string_of_patt p' in
let text = TXtok (_loc, match_fun, descr)
- in { used = []; text = text; styp = t; pattern = Some p; }
+ in { used = []; text = text; styp = t; pattern = Some p; }
let symbol = Gram.Entry.mk "symbol"
let check_not_tok s =
match s with
@@ -9543,6 +10396,7 @@ module G =
("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
@@ -9662,9 +10516,9 @@ module G =
'semi_sep Gram.Entry.t)) ],
(Gram.Action.mk
(fun _ (e : 'entry) (_loc : Loc.t) ->
- (e : 'e__8)))) ]) ],
+ (e : 'e__10)))) ]) ],
(Gram.Action.mk
- (fun (el : 'e__8 list)
+ (fun (el : 'e__10 list)
(global_list : 'global option)
((gram, g) : 'extend_header) (_loc : Loc.t)
->
@@ -9720,7 +10574,7 @@ module G =
(fun (__camlp4_0 : Gram.Token.t)
(_loc : Loc.t) ->
match __camlp4_0 with
- | UIDENT "GLOBAL" -> (() : 'e__9)
+ | UIDENT "GLOBAL" -> (() : 'e__11)
| _ -> assert false)));
([ Gram.Stoken
(((function
@@ -9731,7 +10585,7 @@ module G =
(fun (__camlp4_0 : Gram.Token.t)
(_loc : Loc.t) ->
match __camlp4_0 with
- | LIDENT ((_)) -> (() : 'e__9)
+ | LIDENT ((_)) -> (() : 'e__11)
| _ -> assert false))) ] ],
(Gram.Action.mk
(fun _ (_loc : Loc.t) ->
@@ -9772,7 +10626,7 @@ module G =
(fun (__camlp4_0 : Gram.Token.t)
(_loc : Loc.t) ->
match __camlp4_0 with
- | UIDENT "GLOBAL" -> (() : 'e__10)
+ | UIDENT "GLOBAL" -> (() : 'e__12)
| _ -> assert false)));
([ Gram.Stoken
(((function
@@ -9783,7 +10637,7 @@ module G =
(fun (__camlp4_0 : Gram.Token.t)
(_loc : Loc.t) ->
match __camlp4_0 with
- | LIDENT ((_)) -> (() : 'e__10)
+ | LIDENT ((_)) -> (() : 'e__12)
| _ -> assert false))) ] ],
(Gram.Action.mk
(fun _ (_loc : Loc.t) ->
@@ -9926,7 +10780,7 @@ module G =
(Gram.Action.mk
(fun (ll : 'level_list) (pos : 'position option)
_ (n : 'name) (_loc : Loc.t) ->
- ({ name = n; pos = pos; levels = ll; } :
+ ({ name = n; pos = pos; levels = ll; } :
'entry)))) ]) ]))
());
Gram.extend (position : 'position Gram.Entry.t)
@@ -10077,7 +10931,7 @@ module G =
->
(let x =
Gram.Token.extract_string x
- in x : 'e__11)))) ]);
+ in x : 'e__13)))) ]);
Gram.Sopt
(Gram.Snterm
(Gram.Entry.obj
@@ -10087,9 +10941,9 @@ module G =
(rule_list : 'rule_list Gram.Entry.t)) ],
(Gram.Action.mk
(fun (rules : 'rule_list) (ass : 'assoc option)
- (lab : 'e__11 option) (_loc : Loc.t) ->
- ({ label = lab; assoc = ass; rules = rules;
- } : 'level)))) ]) ]))
+ (lab : 'e__13 option) (_loc : Loc.t) ->
+ ({ label = lab; assoc = ass; rules = rules; } :
+ 'level)))) ]) ]))
());
Gram.extend (assoc : 'assoc Gram.Entry.t)
((fun () ->
@@ -10187,7 +11041,7 @@ module G =
(semi_sep : 'semi_sep Gram.Entry.t))) ],
(Gram.Action.mk
(fun (psl : 'psymbol list) (_loc : Loc.t) ->
- ({ prod = psl; action = None; } : 'rule))));
+ ({ prod = psl; action = None; } : 'rule))));
([ Gram.Slist0sep
(Gram.Snterm
(Gram.Entry.obj
@@ -10201,7 +11055,7 @@ module G =
(Gram.Action.mk
(fun (act : 'expr) _ (psl : 'psymbol list)
(_loc : Loc.t) ->
- ({ prod = psl; action = Some act; } : 'rule)))) ]) ]))
+ ({ prod = psl; action = Some act; } : 'rule)))) ]) ]))
());
Gram.extend (psymbol : 'psymbol Gram.Entry.t)
((fun () ->
@@ -10233,7 +11087,7 @@ module G =
Ast.IdUid (_loc, u)),
p))
s.styp
- | _ -> { (s) with pattern = Some p; } :
+ | _ -> { (s) with pattern = Some p; } :
'psymbol))));
([ Gram.Stoken
(((function | LIDENT ((_)) -> true | _ -> false),
@@ -10258,10 +11112,10 @@ module G =
| UIDENT "LEVEL" ->
(let s =
Gram.Token.extract_string s
- in s : 'e__12)
+ in s : 'e__14)
| _ -> assert false))) ]) ],
(Gram.Action.mk
- (fun (lev : 'e__12 option) (i : Gram.Token.t)
+ (fun (lev : 'e__14 option) (i : Gram.Token.t)
(_loc : Loc.t) ->
(let i = Gram.Token.extract_string i in
let name =
@@ -10270,7 +11124,6 @@ module G =
let styp = STquo (_loc, i)
in
{
-
used = [ i ];
text = text;
styp = styp;
@@ -10317,7 +11170,6 @@ module G =
{
(s)
with
-
text = text;
pattern = Some p';
}
@@ -10325,7 +11177,6 @@ module G =
{
(s)
with
-
pattern =
Some
(Ast.PaId (_loc,
@@ -10353,7 +11204,6 @@ module G =
let text = TXopt (_loc, s.text)
in
{
-
used = s.used;
text = text;
styp = styp;
@@ -10382,10 +11232,10 @@ module G =
(__camlp4_0 : Gram.Token.t)
(_loc : Loc.t) ->
match __camlp4_0 with
- | UIDENT "SEP" -> (t : 'e__14)
+ | UIDENT "SEP" -> (t : 'e__16)
| _ -> assert false))) ]) ],
(Gram.Action.mk
- (fun (sep : 'e__14 option) (s : 'symbol)
+ (fun (sep : 'e__16 option) (s : 'symbol)
(__camlp4_0 : Gram.Token.t) (_loc : Loc.t) ->
match __camlp4_0 with
| UIDENT "LIST1" ->
@@ -10400,7 +11250,6 @@ module G =
let text = slist _loc true sep s
in
{
-
used = used;
text = text;
styp = styp;
@@ -10429,10 +11278,10 @@ module G =
(__camlp4_0 : Gram.Token.t)
(_loc : Loc.t) ->
match __camlp4_0 with
- | UIDENT "SEP" -> (t : 'e__13)
+ | UIDENT "SEP" -> (t : 'e__15)
| _ -> assert false))) ]) ],
(Gram.Action.mk
- (fun (sep : 'e__13 option) (s : 'symbol)
+ (fun (sep : 'e__15 option) (s : 'symbol)
(__camlp4_0 : Gram.Token.t) (_loc : Loc.t) ->
match __camlp4_0 with
| UIDENT "LIST0" ->
@@ -10447,7 +11296,6 @@ module G =
let text = slist _loc false sep s
in
{
-
used = used;
text = text;
styp = styp;
@@ -10482,13 +11330,12 @@ module G =
| UIDENT "LEVEL" ->
(let s =
Gram.Token.extract_string s
- in s : 'e__16)
+ in s : 'e__18)
| _ -> assert false))) ]) ],
(Gram.Action.mk
- (fun (lev : 'e__16 option) (n : 'name)
+ (fun (lev : 'e__18 option) (n : 'name)
(_loc : Loc.t) ->
({
-
used = [ n.tvar ];
text = TXnterm (_loc, n, lev);
styp = STquo (_loc, n.tvar);
@@ -10520,10 +11367,10 @@ module G =
| UIDENT "LEVEL" ->
(let s =
Gram.Token.extract_string s
- in s : 'e__15)
+ in s : 'e__17)
| _ -> assert false))) ]) ],
(Gram.Action.mk
- (fun (lev : 'e__15 option) (il : 'qualid) _
+ (fun (lev : 'e__17 option) (il : 'qualid) _
(i : Gram.Token.t) (_loc : Loc.t) ->
(let i = Gram.Token.extract_string i in
let n =
@@ -10532,7 +11379,6 @@ module G =
il))
in
{
-
used = [ n.tvar ];
text = TXnterm (_loc, n, lev);
styp = STquo (_loc, n.tvar);
@@ -10547,7 +11393,6 @@ module G =
(let s = Gram.Token.extract_string s
in
{
-
used = [];
text = TXkwd (_loc, s);
styp = STtok _loc;
@@ -10602,7 +11447,6 @@ module G =
Ast.PaTup (_loc, Ast.PaAny _loc))
in
{
-
used = [];
text = text;
styp = STtok _loc;
@@ -10660,7 +11504,6 @@ module G =
let t = new_type_var ()
in
{
-
used = used_of_rule_list rl;
text =
TXrules (_loc, srules _loc t rl "");
@@ -10679,7 +11522,6 @@ module G =
match __camlp4_0 with
| UIDENT "NEXT" ->
({
-
used = [];
text = TXnext _loc;
styp = STself (_loc, "NEXT");
@@ -10697,7 +11539,6 @@ module G =
match __camlp4_0 with
| UIDENT "SELF" ->
({
-
used = [];
text = TXself _loc;
styp = STself (_loc, "SELF");
@@ -10820,7 +11661,7 @@ module G =
(fun (__camlp4_0 : Gram.Token.t)
(_loc : Loc.t) ->
match __camlp4_0 with
- | UIDENT "SLIST1" -> (true : 'e__17)
+ | UIDENT "SLIST1" -> (true : 'e__19)
| _ -> assert false)));
([ Gram.Stoken
(((function
@@ -10831,7 +11672,7 @@ module G =
(fun (__camlp4_0 : Gram.Token.t)
(_loc : Loc.t) ->
match __camlp4_0 with
- | UIDENT "SLIST0" -> (false : 'e__17)
+ | UIDENT "SLIST0" -> (false : 'e__19)
| _ -> assert false))) ];
Gram.Sself;
Gram.Sopt
@@ -10849,11 +11690,11 @@ module G =
(__camlp4_0 : Gram.Token.t)
(_loc : Loc.t) ->
match __camlp4_0 with
- | UIDENT "SEP" -> (t : 'e__18)
+ | UIDENT "SEP" -> (t : 'e__20)
| _ -> assert false))) ]) ],
(Gram.Action.mk
- (fun (sep : 'e__18 option) (s : 'symbol)
- (min : 'e__17) (_loc : Loc.t) ->
+ (fun (sep : 'e__20 option) (s : 'symbol)
+ (min : 'e__19) (_loc : Loc.t) ->
(sslist _loc min sep s : 'symbol)))) ]) ]))
())
let sfold _loc n foldfun f e s =
@@ -10879,7 +11720,6 @@ module G =
styp)
in
{
-
used = s.used;
text = TXmeta (_loc, n, [ s.text ], e, t);
styp = styp;
@@ -10908,7 +11748,6 @@ module G =
styp)
in
{
-
used = s.used @ sep.used;
text = TXmeta (_loc, n, [ s.text; sep.text ], e, t);
styp = styp;
@@ -11072,12 +11911,14 @@ module M =
(* Authors:
* - Daniel de Rauglaudre: initial version
* - Nicolas Pouillard: refactoring
+ * - Aleksey Nogin: extra features and bug fixes.
+ * - Christopher Conway: extra feature (-D<uident>=)
*)
module Id =
struct
let name = "Camlp4MacroParser"
let version =
- "$Id: Camlp4MacroParser.ml,v 1.1 2007/02/07 10:09:22 ertai Exp $"
+ "$Id: Camlp4MacroParser.ml,v 1.1.4.5 2007/04/26 19:51:49 pouillar Exp $"
end
(*
Added statements:
@@ -11087,16 +11928,22 @@ Added statements:
DEFINE <uident>
DEFINE <uident> = <expression>
DEFINE <uident> (<parameters>) = <expression>
- IFDEF <uident> THEN <structure_items> (END | ENDIF)
- IFDEF <uident> THEN <structure_items> ELSE <structure_items> (END | ENDIF)
- IFNDEF <uident> THEN <structure_items> (END | ENDIF)
- IFNDEF <uident> THEN <structure_items> ELSE <structure_items> (END | ENDIF)
+ IFDEF <uident> THEN <structure_items> [ ELSE <structure_items> ] (END | ENDIF)
+ IFNDEF <uident> THEN <structure_items> [ ELSE <structure_items> ] (END | ENDIF)
+ INCLUDE <string>
+
+ At toplevel (signature item):
+
+ DEFINE <uident>
+ IFDEF <uident> THEN <signature_items> [ ELSE <signature_items> ] (END | ENDIF)
+ IFNDEF <uident> THEN <signature_items> [ ELSE <signature_items> ] (END | ENDIF)
INCLUDE <string>
In expressions:
- IFDEF <uident> THEN <expression> ELSE <expression> (END | ENDIF)
- IFNDEF <uident> THEN <expression> ELSE <expression> (END | ENDIF)
+ IFDEF <uident> THEN <expression> [ ELSE <expression> ] (END | ENDIF)
+ IFNDEF <uident> THEN <expression> [ ELSE <expression> ] (END | ENDIF)
+ DEFINE <lident> = <expression> IN <expression>
__FILE__
__LOCATION__
@@ -11107,7 +11954,7 @@ Added statements:
As Camlp4 options:
- -D<uident> define <uident>
+ -D<uident> or -D<uident>=expr define <uident> with optional value <expr>
-U<uident> undefine it
-I<dir> add <dir> to the search path for INCLUDE'd files
@@ -11116,7 +11963,13 @@ Added statements:
the macro cannot be used as a pattern, there is an error message if
it is used in a pattern.
+ You can also define a local macro in an expression usigng the DEFINE ... IN form.
+ Note that local macros have lowercase names and can not take parameters.
+ If a macro is defined to = NOTHING, and then used as an argument to a function,
+ this will be equivalent to function taking one less argument. Similarly,
+ passing NOTHING as an argument to a macro is equivalent to "erasing" the
+ corresponding parameter from the macro body.
The toplevel statement INCLUDE <string> can be used to include a
file containing macro definitions and also any other toplevel items.
@@ -11134,7 +11987,9 @@ Added statements:
include Syntax
type 'a item_or_def =
| SdStr of 'a | SdDef of string * ((string list) * Ast.expr) option
- | SdUnd of string | SdITE of string * 'a * 'a | SdInc of string
+ | 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
@@ -11142,17 +11997,6 @@ Added statements:
| [] -> []
let defined = ref []
let is_defined i = List.mem_assoc i !defined
- class reloc _loc =
- object inherit Ast.map as super method _Loc_t = fun _ -> _loc end
- class subst _loc env =
- object inherit reloc _loc as super
- method expr =
- function
- | (Ast.ExId (_, (Ast.IdLid (_, x))) |
- Ast.ExId (_, (Ast.IdUid (_, x)))
- as e) -> (try List.assoc x env with | Not_found -> e)
- | e -> super#expr e
- end
let bad_patt _loc =
Loc.raise _loc
(Failure
@@ -11161,6 +12005,7 @@ Added statements:
let rec loop =
function
| Ast.ExApp (_, e1, e2) -> Ast.PaApp (_loc, loop e1, loop e2)
+ | Ast.ExNil _ -> Ast.PaNil _loc
| Ast.ExId (_, (Ast.IdLid (_, x))) ->
(try List.assoc x env
with | Not_found -> Ast.PaId (_loc, Ast.IdLid (_loc, x)))
@@ -11174,13 +12019,33 @@ Added statements:
| Ast.ExRec (_, bi, (Ast.ExNil _)) ->
let rec substbi =
(function
- | Ast.BiSem (_, b1, b2) ->
+ | Ast.RbSem (_, b1, b2) ->
Ast.PaSem (_loc, substbi b1, substbi b2)
- | Ast.BiEq (_, p, e) -> Ast.PaEq (_loc, p, loop e)
+ | Ast.RbEq (_, i, e) -> Ast.PaEq (_loc, i, loop e)
| _ -> bad_patt _loc)
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
+ class subst _loc env =
+ object inherit reloc _loc as super
+ method expr =
+ function
+ | (Ast.ExId (_, (Ast.IdLid (_, x))) |
+ Ast.ExId (_, (Ast.IdUid (_, 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))) |
+ Ast.PaId (_, (Ast.IdUid (_, x)))
+ as p) ->
+ (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
@@ -11332,6 +12197,14 @@ Added statements:
| None -> ());
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.ExApp (_,
+ (Ast.ExApp (_, (Ast.ExId (_, (Ast.IdLid (_, "=")))),
+ (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. *)
@@ -11355,21 +12228,74 @@ Added statements:
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
+ | SdDef (x, eo) -> (define eo x; nil)
+ | SdUnd x -> (undef x; nil)
+ | SdITE (i, l1, l2) ->
+ execute_macro_list nil cons (if is_defined i then l1 else l2)
+ | SdLazy l -> Lazy.force l
+ and execute_macro_list nil cons =
+ function
+ | [] -> nil
+ | 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)
and _ = (str_item : 'str_item Gram.Entry.t)
and _ = (patt : 'patt Gram.Entry.t) in
let grammar_entry_create = Gram.Entry.mk in
- let endif : 'endif Gram.Entry.t = grammar_entry_create "endif"
+ let macro_def : 'macro_def Gram.Entry.t =
+ grammar_entry_create "macro_def"
and uident : 'uident Gram.Entry.t = grammar_entry_create "uident"
and opt_macro_value : 'opt_macro_value Gram.Entry.t =
grammar_entry_create "opt_macro_value"
+ and endif : 'endif Gram.Entry.t = grammar_entry_create "endif"
+ and sglist : 'sglist Gram.Entry.t = grammar_entry_create "sglist"
+ and smlist : 'smlist Gram.Entry.t = grammar_entry_create "smlist"
+ and else_expr : 'else_expr Gram.Entry.t =
+ grammar_entry_create "else_expr"
+ and else_macro_def_sig : 'else_macro_def_sig Gram.Entry.t =
+ grammar_entry_create "else_macro_def_sig"
+ and else_macro_def : 'else_macro_def Gram.Entry.t =
+ grammar_entry_create "else_macro_def"
+ and macro_def_sig : 'macro_def_sig Gram.Entry.t =
+ grammar_entry_create "macro_def_sig"
in
(Gram.extend (str_item : 'str_item Gram.Entry.t)
((fun () ->
((Some Camlp4.Sig.Grammar.First),
[ (None, None,
+ [ ([ Gram.Snterm
+ (Gram.Entry.obj
+ (macro_def : 'macro_def Gram.Entry.t)) ],
+ (Gram.Action.mk
+ (fun (x : 'macro_def) (_loc : Loc.t) ->
+ (execute_macro (Ast.StNil _loc)
+ (fun a b -> Ast.StSem (_loc, a, b)) x :
+ 'str_item)))) ]) ]))
+ ());
+ Gram.extend (sig_item : 'sig_item Gram.Entry.t)
+ ((fun () ->
+ ((Some Camlp4.Sig.Grammar.First),
+ [ (None, None,
+ [ ([ Gram.Snterm
+ (Gram.Entry.obj
+ (macro_def_sig :
+ 'macro_def_sig Gram.Entry.t)) ],
+ (Gram.Action.mk
+ (fun (x : 'macro_def_sig) (_loc : Loc.t) ->
+ (execute_macro (Ast.SgNil _loc)
+ (fun a b -> Ast.SgSem (_loc, a, b)) x :
+ 'sig_item)))) ]) ]))
+ ());
+ Gram.extend (macro_def : 'macro_def Gram.Entry.t)
+ ((fun () ->
+ (None,
+ [ (None, None,
[ ([ Gram.Skeyword "INCLUDE";
Gram.Stoken
(((function | STRING ((_)) -> true | _ -> false),
@@ -11377,103 +12303,228 @@ Added statements:
(Gram.Action.mk
(fun (fname : Gram.Token.t) _ (_loc : Loc.t) ->
(let fname = Gram.Token.extract_string fname
- in parse_include_file str_items fname :
- 'str_item))));
+ in
+ SdLazy
+ (lazy
+ (parse_include_file str_items fname)) :
+ 'macro_def))));
([ Gram.Skeyword "IFNDEF";
Gram.Snterm
(Gram.Entry.obj (uident : 'uident Gram.Entry.t));
Gram.Skeyword "THEN";
Gram.Snterm
- (Gram.Entry.obj
- (str_items : 'str_items Gram.Entry.t));
- Gram.Skeyword "ELSE";
+ (Gram.Entry.obj (smlist : 'smlist Gram.Entry.t));
Gram.Snterm
(Gram.Entry.obj
- (str_items : 'str_items Gram.Entry.t));
- Gram.Snterm
- (Gram.Entry.obj (endif : 'endif Gram.Entry.t)) ],
+ (else_macro_def :
+ 'else_macro_def Gram.Entry.t)) ],
(Gram.Action.mk
- (fun _ (st2 : 'str_items) _ (st1 : 'str_items) _
+ (fun (st1 : 'else_macro_def) (st2 : 'smlist) _
(i : 'uident) _ (_loc : Loc.t) ->
- (if is_defined i then st2 else st1 :
- 'str_item))));
- ([ Gram.Skeyword "IFNDEF";
+ (SdITE (i, st1, st2) : 'macro_def))));
+ ([ Gram.Skeyword "IFDEF";
Gram.Snterm
(Gram.Entry.obj (uident : 'uident Gram.Entry.t));
Gram.Skeyword "THEN";
Gram.Snterm
+ (Gram.Entry.obj (smlist : 'smlist Gram.Entry.t));
+ Gram.Snterm
(Gram.Entry.obj
- (str_items : 'str_items Gram.Entry.t));
+ (else_macro_def :
+ 'else_macro_def Gram.Entry.t)) ],
+ (Gram.Action.mk
+ (fun (st2 : 'else_macro_def) (st1 : 'smlist) _
+ (i : 'uident) _ (_loc : Loc.t) ->
+ (SdITE (i, st1, st2) : 'macro_def))));
+ ([ Gram.Skeyword "UNDEF";
Gram.Snterm
- (Gram.Entry.obj (endif : 'endif Gram.Entry.t)) ],
+ (Gram.Entry.obj (uident : 'uident Gram.Entry.t)) ],
+ (Gram.Action.mk
+ (fun (i : 'uident) _ (_loc : Loc.t) ->
+ (SdUnd i : 'macro_def))));
+ ([ Gram.Skeyword "DEFINE";
+ Gram.Snterm
+ (Gram.Entry.obj (uident : 'uident Gram.Entry.t));
+ Gram.Snterm
+ (Gram.Entry.obj
+ (opt_macro_value :
+ 'opt_macro_value Gram.Entry.t)) ],
(Gram.Action.mk
- (fun _ (st : 'str_items) _ (i : 'uident) _
+ (fun (def : 'opt_macro_value) (i : 'uident) _
(_loc : Loc.t) ->
- (if is_defined i then Ast.StNil _loc else st :
- 'str_item))));
- ([ Gram.Skeyword "IFDEF";
+ (SdDef (i, def) : 'macro_def)))) ]) ]))
+ ());
+ Gram.extend (macro_def_sig : 'macro_def_sig Gram.Entry.t)
+ ((fun () ->
+ (None,
+ [ (None, None,
+ [ ([ Gram.Skeyword "INCLUDE";
+ Gram.Stoken
+ (((function | STRING ((_)) -> true | _ -> false),
+ "STRING _")) ],
+ (Gram.Action.mk
+ (fun (fname : Gram.Token.t) _ (_loc : Loc.t) ->
+ (let fname = Gram.Token.extract_string fname
+ in
+ SdLazy
+ (lazy
+ (parse_include_file sig_items fname)) :
+ 'macro_def_sig))));
+ ([ Gram.Skeyword "IFNDEF";
Gram.Snterm
(Gram.Entry.obj (uident : 'uident Gram.Entry.t));
Gram.Skeyword "THEN";
Gram.Snterm
- (Gram.Entry.obj
- (str_items : 'str_items Gram.Entry.t));
- Gram.Skeyword "ELSE";
+ (Gram.Entry.obj (sglist : 'sglist Gram.Entry.t));
Gram.Snterm
(Gram.Entry.obj
- (str_items : 'str_items Gram.Entry.t));
- Gram.Snterm
- (Gram.Entry.obj (endif : 'endif Gram.Entry.t)) ],
+ (else_macro_def_sig :
+ 'else_macro_def_sig Gram.Entry.t)) ],
(Gram.Action.mk
- (fun _ (st2 : 'str_items) _ (st1 : 'str_items) _
- (i : 'uident) _ (_loc : Loc.t) ->
- (if is_defined i then st1 else st2 :
- 'str_item))));
+ (fun (sg1 : 'else_macro_def_sig) (sg2 : 'sglist)
+ _ (i : 'uident) _ (_loc : Loc.t) ->
+ (SdITE (i, sg1, sg2) : 'macro_def_sig))));
([ Gram.Skeyword "IFDEF";
Gram.Snterm
(Gram.Entry.obj (uident : 'uident Gram.Entry.t));
Gram.Skeyword "THEN";
Gram.Snterm
- (Gram.Entry.obj
- (str_items : 'str_items Gram.Entry.t));
+ (Gram.Entry.obj (sglist : 'sglist Gram.Entry.t));
Gram.Snterm
- (Gram.Entry.obj (endif : 'endif Gram.Entry.t)) ],
+ (Gram.Entry.obj
+ (else_macro_def_sig :
+ 'else_macro_def_sig Gram.Entry.t)) ],
(Gram.Action.mk
- (fun _ (st : 'str_items) _ (i : 'uident) _
- (_loc : Loc.t) ->
- (if is_defined i then st else Ast.StNil _loc :
- 'str_item))));
+ (fun (sg2 : 'else_macro_def_sig) (sg1 : 'sglist)
+ _ (i : 'uident) _ (_loc : 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) ->
- ((undef i; Ast.StNil _loc) : 'str_item))));
+ (SdUnd i : 'macro_def_sig))));
([ Gram.Skeyword "DEFINE";
Gram.Snterm
- (Gram.Entry.obj (uident : 'uident Gram.Entry.t));
+ (Gram.Entry.obj (uident : 'uident Gram.Entry.t)) ],
+ (Gram.Action.mk
+ (fun (i : 'uident) _ (_loc : Loc.t) ->
+ (SdDef (i, None) : 'macro_def_sig)))) ]) ]))
+ ());
+ Gram.extend (else_macro_def : 'else_macro_def Gram.Entry.t)
+ ((fun () ->
+ (None,
+ [ (None, None,
+ [ ([ Gram.Snterm
+ (Gram.Entry.obj (endif : 'endif Gram.Entry.t)) ],
+ (Gram.Action.mk
+ (fun _ (_loc : Loc.t) -> ([] : 'else_macro_def))));
+ ([ Gram.Skeyword "ELSE";
Gram.Snterm
- (Gram.Entry.obj
- (opt_macro_value :
- 'opt_macro_value Gram.Entry.t)) ],
+ (Gram.Entry.obj (smlist : 'smlist Gram.Entry.t));
+ Gram.Snterm
+ (Gram.Entry.obj (endif : 'endif Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (def : 'opt_macro_value) (i : 'uident) _
- (_loc : Loc.t) ->
- ((define def i; Ast.StNil _loc) : 'str_item)))) ]) ]))
+ (fun _ (st : 'smlist) _ (_loc : Loc.t) ->
+ (st : 'else_macro_def)))) ]) ]))
());
- Gram.extend (sig_item : 'sig_item Gram.Entry.t)
+ Gram.extend
+ (else_macro_def_sig : 'else_macro_def_sig Gram.Entry.t)
((fun () ->
- ((Some Camlp4.Sig.Grammar.First),
+ (None,
[ (None, None,
- [ ([ Gram.Skeyword "INCLUDE";
- Gram.Stoken
- (((function | STRING ((_)) -> true | _ -> false),
- "STRING _")) ],
+ [ ([ Gram.Snterm
+ (Gram.Entry.obj (endif : 'endif Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (fname : Gram.Token.t) _ (_loc : Loc.t) ->
- (let fname = Gram.Token.extract_string fname
- in parse_include_file sig_items fname :
- 'sig_item)))) ]) ]))
+ (fun _ (_loc : Loc.t) ->
+ ([] : 'else_macro_def_sig))));
+ ([ Gram.Skeyword "ELSE";
+ Gram.Snterm
+ (Gram.Entry.obj (sglist : 'sglist Gram.Entry.t));
+ Gram.Snterm
+ (Gram.Entry.obj (endif : 'endif Gram.Entry.t)) ],
+ (Gram.Action.mk
+ (fun _ (st : 'sglist) _ (_loc : Loc.t) ->
+ (st : 'else_macro_def_sig)))) ]) ]))
+ ());
+ Gram.extend (else_expr : 'else_expr Gram.Entry.t)
+ ((fun () ->
+ (None,
+ [ (None, None,
+ [ ([ Gram.Snterm
+ (Gram.Entry.obj (endif : 'endif Gram.Entry.t)) ],
+ (Gram.Action.mk
+ (fun _ (_loc : Loc.t) ->
+ (Ast.ExId (_loc, Ast.IdUid (_loc, "()")) :
+ 'else_expr))));
+ ([ Gram.Skeyword "ELSE";
+ Gram.Snterm
+ (Gram.Entry.obj (expr : 'expr Gram.Entry.t));
+ Gram.Snterm
+ (Gram.Entry.obj (endif : 'endif Gram.Entry.t)) ],
+ (Gram.Action.mk
+ (fun _ (e : 'expr) _ (_loc : Loc.t) ->
+ (e : 'else_expr)))) ]) ]))
+ ());
+ Gram.extend (smlist : 'smlist Gram.Entry.t)
+ ((fun () ->
+ (None,
+ [ (None, None,
+ [ ([ Gram.Slist1
+ (Gram.srules smlist
+ [ ([ Gram.Snterm
+ (Gram.Entry.obj
+ (str_item :
+ 'str_item Gram.Entry.t));
+ Gram.Snterm
+ (Gram.Entry.obj
+ (semi : 'semi Gram.Entry.t)) ],
+ (Gram.Action.mk
+ (fun _ (si : 'str_item) (_loc : Loc.t)
+ -> (SdStr si : 'e__21))));
+ ([ Gram.Snterm
+ (Gram.Entry.obj
+ (macro_def :
+ 'macro_def Gram.Entry.t));
+ Gram.Snterm
+ (Gram.Entry.obj
+ (semi : 'semi Gram.Entry.t)) ],
+ (Gram.Action.mk
+ (fun _ (d : 'macro_def) (_loc : Loc.t)
+ -> (d : 'e__21)))) ]) ],
+ (Gram.Action.mk
+ (fun (sml : 'e__21 list) (_loc : Loc.t) ->
+ (sml : 'smlist)))) ]) ]))
+ ());
+ Gram.extend (sglist : 'sglist Gram.Entry.t)
+ ((fun () ->
+ (None,
+ [ (None, None,
+ [ ([ Gram.Slist1
+ (Gram.srules sglist
+ [ ([ Gram.Snterm
+ (Gram.Entry.obj
+ (sig_item :
+ 'sig_item Gram.Entry.t));
+ Gram.Snterm
+ (Gram.Entry.obj
+ (semi : 'semi Gram.Entry.t)) ],
+ (Gram.Action.mk
+ (fun _ (si : 'sig_item) (_loc : Loc.t)
+ -> (SdStr si : 'e__22))));
+ ([ Gram.Snterm
+ (Gram.Entry.obj
+ (macro_def_sig :
+ 'macro_def_sig Gram.Entry.t));
+ Gram.Snterm
+ (Gram.Entry.obj
+ (semi : 'semi Gram.Entry.t)) ],
+ (Gram.Action.mk
+ (fun _ (d : 'macro_def_sig)
+ (_loc : Loc.t) -> (d : 'e__22)))) ]) ],
+ (Gram.Action.mk
+ (fun (sgl : 'e__22 list) (_loc : Loc.t) ->
+ (sgl : 'sglist)))) ]) ]))
());
Gram.extend (endif : 'endif Gram.Entry.t)
((fun () ->
@@ -11512,13 +12563,13 @@ Added statements:
->
(let x =
Gram.Token.extract_string x
- in x : 'e__19)))) ],
+ in x : 'e__23)))) ],
Gram.Skeyword ",");
Gram.Skeyword ")"; Gram.Skeyword "=";
Gram.Snterm
(Gram.Entry.obj (expr : 'expr Gram.Entry.t)) ],
(Gram.Action.mk
- (fun (e : 'expr) _ _ (pl : 'e__19 list) _
+ (fun (e : 'expr) _ _ (pl : 'e__23 list) _
(_loc : Loc.t) ->
(Some ((pl, e)) : 'opt_macro_value)))) ]) ]))
());
@@ -11526,26 +12577,38 @@ Added statements:
((fun () ->
((Some (Camlp4.Sig.Grammar.Level "top")),
[ (None, None,
- [ ([ Gram.Skeyword "IFNDEF";
+ [ ([ Gram.Skeyword "DEFINE";
+ Gram.Stoken
+ (((function | LIDENT ((_)) -> true | _ -> false),
+ "LIDENT _"));
+ Gram.Skeyword "="; Gram.Sself;
+ Gram.Skeyword "IN"; Gram.Sself ],
+ (Gram.Action.mk
+ (fun (body : 'expr) _ (def : 'expr) _
+ (i : Gram.Token.t) _ (_loc : Loc.t) ->
+ (let i = Gram.Token.extract_string i
+ in (new subst _loc [ (i, def) ])#expr body :
+ 'expr))));
+ ([ Gram.Skeyword "IFNDEF";
Gram.Snterm
(Gram.Entry.obj (uident : 'uident Gram.Entry.t));
Gram.Skeyword "THEN"; Gram.Sself;
- Gram.Skeyword "ELSE"; Gram.Sself;
Gram.Snterm
- (Gram.Entry.obj (endif : 'endif Gram.Entry.t)) ],
+ (Gram.Entry.obj
+ (else_expr : 'else_expr Gram.Entry.t)) ],
(Gram.Action.mk
- (fun _ (e2 : 'expr) _ (e1 : 'expr) _
+ (fun (e2 : 'else_expr) (e1 : 'expr) _
(i : 'uident) _ (_loc : Loc.t) ->
(if is_defined i then e2 else e1 : 'expr))));
([ Gram.Skeyword "IFDEF";
Gram.Snterm
(Gram.Entry.obj (uident : 'uident Gram.Entry.t));
Gram.Skeyword "THEN"; Gram.Sself;
- Gram.Skeyword "ELSE"; Gram.Sself;
Gram.Snterm
- (Gram.Entry.obj (endif : 'endif Gram.Entry.t)) ],
+ (Gram.Entry.obj
+ (else_expr : 'else_expr Gram.Entry.t)) ],
(Gram.Action.mk
- (fun _ (e2 : 'expr) _ (e1 : 'expr) _
+ (fun (e2 : 'else_expr) (e1 : 'expr) _
(i : 'uident) _ (_loc : Loc.t) ->
(if is_defined i then e1 else e2 : 'expr)))) ]) ]))
());
@@ -11658,7 +12721,7 @@ Added statements:
'uident)))) ]) ]))
()))
let _ =
- Options.add "-D" (Arg.String (define None))
+ Options.add "-D" (Arg.String parse_def)
"<string> Define for IFDEF instruction."
let _ =
Options.add "-U" (Arg.String undef)
@@ -11668,6 +12731,22 @@ Added statements:
"<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.ExFun (_,
+ (Ast.McArr (_, (Ast.PaId (_, (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
@@ -11849,6 +12928,345 @@ module D =
end
let _ = let module M = Register.OCamlSyntaxExtension(Id)(Make) in ()
end
+module L =
+ struct
+ open Camlp4
+ (* -*- camlp4r -*- *)
+ (****************************************************************************)
+ (* *)
+ (* Objective Caml *)
+ (* *)
+ (* 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 GNU Library General Public License, with the special *)
+ (* exception on linking described in LICENSE at the top of the Objective *)
+ (* Caml source tree. *)
+ (* *)
+ (****************************************************************************)
+ (* Authors:
+ * - Nao Hirokawa: initial version
+ * - 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
+ 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"
+ (fun strm ->
+ let rec skip_patt n =
+ match stream_peek_nth n strm with
+ | Some (KEYWORD "<-") -> n
+ | Some (KEYWORD ("[" | "[<")) ->
+ skip_patt ((ignore_upto "]" (n + 1)) + 1)
+ | Some (KEYWORD "(") ->
+ skip_patt ((ignore_upto ")" (n + 1)) + 1)
+ | Some (KEYWORD "{") ->
+ skip_patt ((ignore_upto "}" (n + 1)) + 1)
+ | Some (KEYWORD ("as" | "::" | ";" | "," | "_")) |
+ Some (LIDENT _ | UIDENT _) -> skip_patt (n + 1)
+ | Some _ | None -> raise Stream.Failure
+ and ignore_upto end_kwd n =
+ match stream_peek_nth n strm with
+ | Some (KEYWORD prm) when prm = end_kwd -> n
+ | Some (KEYWORD ("[" | "[<")) ->
+ ignore_upto end_kwd ((ignore_upto "]" (n + 1)) + 1)
+ | Some (KEYWORD "(") ->
+ ignore_upto end_kwd ((ignore_upto ")" (n + 1)) + 1)
+ | Some (KEYWORD "{") ->
+ ignore_upto end_kwd ((ignore_upto "}" (n + 1)) + 1)
+ | 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 (_, (Ast.IdLid (_, y)))) when x = y -> l
+ | _ ->
+ if Ast.is_irrefut_patt p
+ then
+ Ast.ExApp (_loc,
+ Ast.ExApp (_loc,
+ Ast.ExId (_loc,
+ Ast.IdAcc (_loc, Ast.IdUid (_loc, "List"),
+ Ast.IdLid (_loc, "map"))),
+ Ast.ExFun (_loc, Ast.McArr (_loc, p, Ast.ExNil _loc, e))),
+ l)
+ else
+ Ast.ExApp (_loc,
+ Ast.ExApp (_loc,
+ Ast.ExApp (_loc,
+ Ast.ExId (_loc,
+ Ast.IdAcc (_loc, Ast.IdUid (_loc, "List"),
+ Ast.IdLid (_loc, "fold_right"))),
+ Ast.ExFun (_loc,
+ Ast.McOr (_loc,
+ Ast.McArr (_loc, p,
+ Ast.ExId (_loc, Ast.IdUid (_loc, "True")),
+ Ast.ExApp (_loc,
+ Ast.ExFun (_loc,
+ Ast.McArr (_loc,
+ Ast.PaId (_loc, Ast.IdLid (_loc, "x")),
+ Ast.ExNil _loc,
+ Ast.ExFun (_loc,
+ Ast.McArr (_loc,
+ Ast.PaId (_loc, Ast.IdLid (_loc, "xs")),
+ Ast.ExNil _loc,
+ Ast.ExApp (_loc,
+ Ast.ExApp (_loc,
+ Ast.ExId (_loc,
+ Ast.IdUid (_loc, "::")),
+ Ast.ExId (_loc,
+ Ast.IdLid (_loc, "x"))),
+ Ast.ExId (_loc,
+ Ast.IdLid (_loc, "xs"))))))),
+ e)),
+ Ast.McArr (_loc, Ast.PaAny _loc, Ast.ExNil _loc,
+ Ast.ExFun (_loc,
+ Ast.McArr (_loc,
+ Ast.PaId (_loc, Ast.IdLid (_loc, "l")),
+ Ast.ExNil _loc,
+ 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.ExApp (_loc,
+ Ast.ExApp (_loc,
+ Ast.ExId (_loc,
+ Ast.IdAcc (_loc, Ast.IdUid (_loc, "List"),
+ Ast.IdLid (_loc, "filter"))),
+ Ast.ExFun (_loc, Ast.McArr (_loc, p, Ast.ExNil _loc, b))),
+ l)
+ else
+ Ast.ExApp (_loc,
+ Ast.ExApp (_loc,
+ Ast.ExId (_loc,
+ Ast.IdAcc (_loc, Ast.IdUid (_loc, "List"),
+ Ast.IdLid (_loc, "filter"))),
+ Ast.ExFun (_loc,
+ Ast.McOr (_loc,
+ Ast.McArr (_loc, p,
+ Ast.ExId (_loc, Ast.IdUid (_loc, "True")), b),
+ 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)) :: `cond b :: items ->
+ compr _loc e ((`gen ((p, (filter _loc p b l)))) :: items)
+ | `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.Snterm
+ (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 "[";
+ Gram.Snterm
+ (Gram.Entry.obj
+ (sem_expr_for_list : 'sem_expr_for_list Gram.Entry.t));
+ Gram.Skeyword "::";
+ Gram.Snterm (Gram.Entry.obj (expr : 'expr Gram.Entry.t));
+ 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 _ =
+ (comprehension_or_sem_expr_for_list :
+ 'comprehension_or_sem_expr_for_list Gram.Entry.t) in
+ let grammar_entry_create = Gram.Entry.mk in
+ let item : 'item Gram.Entry.t = grammar_entry_create "item"
+ in
+ (Gram.extend (expr : 'expr Gram.Entry.t)
+ ((fun () ->
+ ((Some (Camlp4.Sig.Grammar.Level "simple")),
+ [ (None, None,
+ [ ([ Gram.Skeyword "[";
+ Gram.Snterm
+ (Gram.Entry.obj
+ (comprehension_or_sem_expr_for_list :
+ 'comprehension_or_sem_expr_for_list Gram.
+ Entry.t));
+ Gram.Skeyword "]" ],
+ (Gram.Action.mk
+ (fun _ (e : 'comprehension_or_sem_expr_for_list)
+ _ (_loc : Loc.t) -> (e : 'expr)))) ]) ]))
+ ());
+ Gram.extend
+ (comprehension_or_sem_expr_for_list :
+ 'comprehension_or_sem_expr_for_list Gram.Entry.t)
+ ((fun () ->
+ (None,
+ [ (None, None,
+ [ ([ Gram.Snterml
+ (Gram.Entry.obj (expr : 'expr Gram.Entry.t),
+ "top") ],
+ (Gram.Action.mk
+ (fun (e : 'expr) (_loc : Loc.t) ->
+ (Ast.ExApp (_loc,
+ Ast.ExApp (_loc,
+ Ast.ExId (_loc, Ast.IdUid (_loc, "::")),
+ e),
+ Ast.ExId (_loc, Ast.IdUid (_loc, "[]"))) :
+ 'comprehension_or_sem_expr_for_list))));
+ ([ Gram.Snterml
+ (Gram.Entry.obj (expr : 'expr Gram.Entry.t),
+ "top");
+ Gram.Skeyword "|";
+ Gram.Slist1sep
+ (Gram.Snterm
+ (Gram.Entry.obj (item : 'item Gram.Entry.t)),
+ Gram.Skeyword ";") ],
+ (Gram.Action.mk
+ (fun (l : 'item list) _ (e : 'expr)
+ (_loc : Loc.t) ->
+ (compr _loc e l :
+ 'comprehension_or_sem_expr_for_list))));
+ ([ Gram.Snterml
+ (Gram.Entry.obj (expr : 'expr Gram.Entry.t),
+ "top");
+ Gram.Skeyword ";" ],
+ (Gram.Action.mk
+ (fun _ (e : 'expr) (_loc : Loc.t) ->
+ (Ast.ExApp (_loc,
+ Ast.ExApp (_loc,
+ Ast.ExId (_loc, Ast.IdUid (_loc, "::")),
+ e),
+ Ast.ExId (_loc, Ast.IdUid (_loc, "[]"))) :
+ 'comprehension_or_sem_expr_for_list))));
+ ([ Gram.Snterml
+ (Gram.Entry.obj (expr : 'expr Gram.Entry.t),
+ "top");
+ Gram.Skeyword ";";
+ Gram.Snterm
+ (Gram.Entry.obj
+ (sem_expr_for_list :
+ 'sem_expr_for_list Gram.Entry.t)) ],
+ (Gram.Action.mk
+ (fun (mk : 'sem_expr_for_list) _ (e : 'expr)
+ (_loc : Loc.t) ->
+ (Ast.ExApp (_loc,
+ Ast.ExApp (_loc,
+ Ast.ExId (_loc, Ast.IdUid (_loc, "::")),
+ e),
+ mk
+ (Ast.ExId (_loc, Ast.IdUid (_loc, "[]")))) :
+ 'comprehension_or_sem_expr_for_list)))) ]) ]))
+ ());
+ Gram.extend (item : 'item Gram.Entry.t)
+ ((fun () ->
+ (None,
+ [ (None, None,
+ [ ([ Gram.Snterml
+ (Gram.Entry.obj (expr : 'expr Gram.Entry.t),
+ "top") ],
+ (Gram.Action.mk
+ (fun (e : 'expr) (_loc : Loc.t) ->
+ (`cond e : 'item))));
+ ([ Gram.Snterm
+ (Gram.Entry.obj
+ (test_patt_lessminus :
+ 'test_patt_lessminus Gram.Entry.t));
+ Gram.Snterm
+ (Gram.Entry.obj (patt : 'patt Gram.Entry.t));
+ Gram.Skeyword "<-";
+ Gram.Snterml
+ (Gram.Entry.obj (expr : 'expr Gram.Entry.t),
+ "top") ],
+ (Gram.Action.mk
+ (fun (e : 'expr) _ (p : 'patt) _ (_loc : Loc.t)
+ -> (`gen ((p, e)) : 'item)))) ]) ]))
+ ()))
+ let _ =
+ if is_revised
+ then
+ (let _ = (expr : 'expr Gram.Entry.t)
+ and _ =
+ (comprehension_or_sem_expr_for_list :
+ 'comprehension_or_sem_expr_for_list Gram.Entry.t)
+ in
+ Gram.extend
+ (comprehension_or_sem_expr_for_list :
+ 'comprehension_or_sem_expr_for_list Gram.Entry.t)
+ ((fun () ->
+ (None,
+ [ (None, None,
+ [ ([ Gram.Snterml
+ (Gram.Entry.obj (expr : 'expr Gram.Entry.t),
+ "top");
+ Gram.Skeyword "::";
+ Gram.Snterm
+ (Gram.Entry.obj (expr : 'expr Gram.Entry.t)) ],
+ (Gram.Action.mk
+ (fun (last : 'expr) _ (e : 'expr)
+ (_loc : Loc.t) ->
+ (Ast.ExApp (_loc,
+ Ast.ExApp (_loc,
+ Ast.ExId (_loc,
+ Ast.IdUid (_loc, "::")),
+ e),
+ last) :
+ 'comprehension_or_sem_expr_for_list))));
+ ([ Gram.Snterml
+ (Gram.Entry.obj (expr : 'expr Gram.Entry.t),
+ "top");
+ Gram.Skeyword ";";
+ Gram.Snterm
+ (Gram.Entry.obj
+ (sem_expr_for_list :
+ 'sem_expr_for_list Gram.Entry.t));
+ Gram.Skeyword "::";
+ Gram.Snterm
+ (Gram.Entry.obj (expr : 'expr Gram.Entry.t)) ],
+ (Gram.Action.mk
+ (fun (last : 'expr) _
+ (mk : 'sem_expr_for_list) _ (e : 'expr)
+ (_loc : Loc.t) ->
+ (Ast.ExApp (_loc,
+ Ast.ExApp (_loc,
+ Ast.ExId (_loc,
+ Ast.IdUid (_loc, "::")),
+ e),
+ mk last) :
+ 'comprehension_or_sem_expr_for_list)))) ]) ]))
+ ()))
+ else ()
+ end
+ let _ = let module M = Register.OCamlSyntaxExtension(Id)(Make) in ()
+ end
module P =
struct
(****************************************************************************)
@@ -11889,7 +13307,7 @@ module B =
* - Daniel de Rauglaudre: initial version
* - Nicolas Pouillard: refactoring
*)
- (* $Id: Camlp4Bin.ml,v 1.13 2007/02/07 10:09:21 ertai Exp $ *)
+ (* $Id: Camlp4Bin.ml,v 1.14.2.3 2007/03/30 15:50:12 pouillar Exp $ *)
open Camlp4
open PreCast.Syntax
open PreCast
@@ -11897,7 +13315,7 @@ module B =
module CleanAst = Camlp4.Struct.CleanAst.Make(Ast)
module SSet = Set.Make(String)
let pa_r = "Camlp4OCamlRevisedParser"
- (* value pa_rr = "Camlp4OCamlrrParser"; *)
+ let pa_rr = "Camlp4OCamlReloadedParser"
let pa_o = "Camlp4OCamlParser"
let pa_rp = "Camlp4OCamlRevisedParserParser"
let pa_op = "Camlp4OCamlParserParser"
@@ -11907,8 +13325,10 @@ module B =
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", 42, 24)))
+ 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 =
@@ -11921,7 +13341,9 @@ module B =
let load =
List.iter
(fun n ->
- if SSet.mem n !loaded_modules
+ if
+ (SSet.mem n !loaded_modules) ||
+ (List.mem n !Register.loaded_modules)
then ()
else
(add_to_loaded_modules n;
@@ -11932,10 +13354,13 @@ module B =
("pa_r.cmo" | "r" | "ocamlr" | "ocamlrevised" |
"camlp4ocamlrevisedparser.cmo"))
-> load [ pa_r ]
- | (* | ("Parsers"|"", "rr" | "OCamlrr") -> load [pa_r; pa_rr] *)
- (("Parsers" | ""),
- ("pa_o.cmo" | "o" | "ocaml" | "camlp4ocamlparser.cmo"))
- -> load [ pa_r; pa_o ]
+ | (("Parsers" | ""),
+ ("rr" | "reloaded" | "ocamlreloaded" |
+ "camlp4ocamlreloadedparser.cmo"))
+ -> load [ pa_rr ]
+ | (("Parsers" | ""),
+ ("pa_o.cmo" | "o" | "ocaml" | "camlp4ocamlparser.cmo")) ->
+ load [ pa_r; pa_o ]
| (("Parsers" | ""),
("pa_rp.cmo" | "rp" | "rparser" |
"camlp4ocamlrevisedparserparser.cmo"))
@@ -11946,23 +13371,26 @@ module B =
| (("Parsers" | ""),
("pa_extend.cmo" | "pa_extend_m.cmo" | "g" | "grammar" |
"camlp4grammarparser.cmo"))
- -> load [ pa_r; pa_g ]
+ -> load [ pa_g ]
| (("Parsers" | ""),
("pa_macro.cmo" | "m" | "macro" | "camlp4macroparser.cmo")) ->
- load [ pa_r; pa_m ]
+ load [ pa_m ]
| (("Parsers" | ""), ("q" | "camlp4quotationexpander.cmo")) ->
- load [ pa_r; pa_qb; pa_q ]
+ load [ pa_qb; pa_q ]
| (("Parsers" | ""),
- ("q_MLast.cmo" | "rq" |
+ ("q_mlast.cmo" | "rq" |
"camlp4ocamlrevisedquotationexpander.cmo"))
- -> load [ pa_r; pa_qb; pa_rq ]
+ -> load [ pa_qb; pa_rq ]
| (("Parsers" | ""),
("oq" | "camlp4ocamloriginalquotationexpander.cmo")) ->
load [ pa_r; pa_o; pa_qb; pa_oq ]
| (("Parsers" | ""), "rf") ->
- load [ pa_r; pa_rp; pa_qb; pa_q; pa_g; pa_m ]
+ load [ pa_r; pa_rp; pa_qb; pa_q; pa_g; pa_l; pa_m ]
| (("Parsers" | ""), "of") ->
- load [ pa_r; pa_o; pa_rp; pa_op; pa_qb; pa_rq; pa_g; pa_m ]
+ load
+ [ pa_r; pa_o; pa_rp; pa_op; pa_qb; pa_rq; pa_g; pa_l; pa_m ]
+ | (("Parsers" | ""), ("comp" | "camlp4listcomprehension.cmo")) ->
+ load [ pa_l ]
| (("Filters" | ""), ("lift" | "camlp4astlifter.cmo")) ->
load [ "Camlp4AstLifter" ]
| (("Filters" | ""), ("exn" | "camlp4exceptiontracer.cmo")) ->
@@ -11984,11 +13412,9 @@ module B =
| (("Printers" | ""),
("pr_r.cmo" | "r" | "ocamlr" | "camlp4ocamlrevisedprinter.cmo"))
-> Register.enable_ocamlr_printer ()
- | (* | ("Printers"|"", "rr" | "OCamlrr" | "Camlp4Printers/OCamlrr.cmo") -> *)
- (* Register.enable_ocamlrr_printer () *)
- (("Printers" | ""),
- ("pr_o.cmo" | "o" | "ocaml" | "camlp4ocamlprinter.cmo"))
- -> Register.enable_ocaml_printer ()
+ | (("Printers" | ""),
+ ("pr_o.cmo" | "o" | "ocaml" | "camlp4ocamlprinter.cmo")) ->
+ Register.enable_ocaml_printer ()
| (("Printers" | ""),
("pr_dump.cmo" | "p" | "dumpocaml" | "camlp4ocamlastdumper.cmo"))
-> Register.enable_dump_ocaml_ast_printer ()
@@ -12019,7 +13445,7 @@ module B =
| None -> None) in
let loc = Loc.mk name
in
- (Warning.current := print_warning;
+ (current_warning := 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
@@ -12040,14 +13466,13 @@ module B =
function
| Ast.StDir (loc, n, (Ast.ExStr (_, s))) -> Some ((loc, n, s))
| _ -> None
- open Register
let process_intf dyn_loader name =
process dyn_loader name CurrentParser.parse_interf CurrentPrinter.
- print_interf new CleanAst.clean_ast#sig_item AstFilters.
+ 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.
+ 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)
diff --git a/camlp4/boot/camlp4boot.ml4 b/camlp4/boot/camlp4boot.ml4
index 582ce9c27..4c4c46d14 100644
--- a/camlp4/boot/camlp4boot.ml4
+++ b/camlp4/boot/camlp4boot.ml4
@@ -5,5 +5,6 @@ module Rp = struct INCLUDE "camlp4/Camlp4Parsers/Camlp4OCamlRevisedParserParser.
module G = struct INCLUDE "camlp4/Camlp4Parsers/Camlp4GrammarParser.ml"; end;
module M = struct INCLUDE "camlp4/Camlp4Parsers/Camlp4MacroParser.ml"; end;
module D = struct INCLUDE "camlp4/Camlp4Parsers/Camlp4DebugParser.ml"; end;
+module L = struct INCLUDE "camlp4/Camlp4Parsers/Camlp4ListComprehension.ml"; end;
module P = struct INCLUDE "camlp4/Camlp4Printers/Camlp4OCamlAstDumper.ml"; end;
module B = struct INCLUDE "camlp4/Camlp4Bin.ml"; end;
diff --git a/camlp4/camlp4fulllib.mllib b/camlp4/camlp4fulllib.mllib
new file mode 100644
index 000000000..311d478b4
--- /dev/null
+++ b/camlp4/camlp4fulllib.mllib
@@ -0,0 +1,42 @@
+Camlp4
+Linenum
+Misc
+Warnings
+Location
+Config
+Camlp4_config
+Myocamlbuild_config
+Longident
+
+Camlp4Parsers/Camlp4AstLoader
+Camlp4Parsers/Camlp4DebugParser
+Camlp4Parsers/Camlp4GrammarParser
+Camlp4Parsers/Camlp4ListComprehension
+Camlp4Parsers/Camlp4MacroParser
+Camlp4Parsers/Camlp4OCamlOriginalQuotationExpander
+Camlp4Parsers/Camlp4OCamlParser
+Camlp4Parsers/Camlp4OCamlParserParser
+Camlp4Parsers/Camlp4OCamlRevisedParser
+Camlp4Parsers/Camlp4OCamlRevisedParserParser
+Camlp4Parsers/Camlp4OCamlRevisedQuotationExpander
+Camlp4Parsers/Camlp4QuotationCommon
+Camlp4Parsers/Camlp4QuotationExpander
+
+Camlp4Printers/Camlp4AstDumper
+Camlp4Printers/Camlp4AutoPrinter
+Camlp4Printers/Camlp4NullDumper
+Camlp4Printers/Camlp4OCamlAstDumper
+Camlp4Printers/Camlp4OCamlPrinter
+Camlp4Printers/Camlp4OCamlRevisedPrinter
+
+Camlp4Filters/Camlp4AstLifter
+Camlp4Filters/Camlp4ExceptionTracer
+Camlp4Filters/Camlp4FoldGenerator
+Camlp4Filters/Camlp4LocationStripper
+Camlp4Filters/Camlp4MapGenerator
+Camlp4Filters/Camlp4MetaGenerator
+Camlp4Filters/Camlp4Profiler
+Camlp4Filters/Camlp4Tracer
+Camlp4Filters/Camlp4TrashRemover
+
+Camlp4Top
diff --git a/camlp4/examples/_tags b/camlp4/examples/_tags
new file mode 100644
index 000000000..18742e404
--- /dev/null
+++ b/camlp4/examples/_tags
@@ -0,0 +1,8 @@
+"apply_operator.ml" or "type_quotation.ml": 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
+"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
diff --git a/camlp4/examples/apply_operator.ml b/camlp4/examples/apply_operator.ml
new file mode 100644
index 000000000..2d4d2cb09
--- /dev/null
+++ b/camlp4/examples/apply_operator.ml
@@ -0,0 +1,6 @@
+open Camlp4.PreCast;
+AstFilters.register_str_item_filter
+ (Ast.map_expr
+ (fun
+ [ <:expr@loc< \& $e1$ $e2$ >> -> <:expr@loc< $e1$ $e2$ >>
+ | e -> e ]))#str_item;
diff --git a/camlp4/examples/apply_operator_test.ml b/camlp4/examples/apply_operator_test.ml
new file mode 100644
index 000000000..6644b943b
--- /dev/null
+++ b/camlp4/examples/apply_operator_test.ml
@@ -0,0 +1 @@
+f& g& h x
diff --git a/camlp4/examples/lambda_quot.ml b/camlp4/examples/lambda_quot.ml
new file mode 100644
index 000000000..654511af2
--- /dev/null
+++ b/camlp4/examples/lambda_quot.ml
@@ -0,0 +1,38 @@
+open Camlp4.PreCast;
+module CamlSyntax = Camlp4OCamlParser.Make (Camlp4OCamlRevisedParser.Make Syntax);
+
+value expr_of_string = CamlSyntax.Gram.parse_string CamlSyntax.expr_eoi;
+
+module LambdaGram = MakeGram Lexer;
+
+value term = LambdaGram.Entry.mk "term";
+value term_eoi = LambdaGram.Entry.mk "lambda term quotation";
+
+Camlp4_config.antiquotations.val := 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;
+
+value 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.val := "lam";
diff --git a/camlp4/examples/lambda_test.ml b/camlp4/examples/lambda_test.ml
new file mode 100644
index 000000000..746aea445
--- /dev/null
+++ b/camlp4/examples/lambda_test.ml
@@ -0,0 +1,13 @@
+let id = << fun x -> x >>
+(* Imported and traduced from CCT *)
+let zero = << fun s -> fun z -> z >>
+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 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 >>
+let times = << fun n -> fun m -> $rec_nat$ n (fun n -> fun p -> $plus$ m p) $zero$ >>
+let fact = << fun n -> $rec_nat$ n (fun n -> fun p -> $times$ ($succ$ n) p) $one$ >>
+
diff --git a/camlp4/examples/macros.ml b/camlp4/examples/macros.ml
new file mode 100644
index 000000000..fe7b7392e
--- /dev/null
+++ b/camlp4/examples/macros.ml
@@ -0,0 +1,67 @@
+open Camlp4.PreCast;;
+let foldr_funs = ref [];;
+let foldl_funs = ref [];;
+AstFilters.register_str_item_filter begin
+ Ast.map_expr begin function
+ | <:expr@loc< def_foldr $lid:name$ $e$ >> ->
+ foldr_funs := (name, e) :: !foldr_funs; <:expr@loc<()>>
+ | <:expr@loc< def_foldl $lid:name$ $e$ >> ->
+ foldl_funs := (name, e) :: !foldl_funs; <:expr@loc<()>>
+ | e -> e
+ end
+end#str_item;;
+AstFilters.register_str_item_filter begin
+ Ast.map_expr begin function
+ | <:expr@loc< $lid:name$($tup:e$) >> when List.mem_assoc name !foldl_funs ->
+ let op = List.assoc name !foldl_funs in
+ let rec foldl =
+ function
+ | [] -> assert false
+ | [x] -> x
+ | x :: xs -> <:expr@loc< $op$ $foldl xs$ $x$ >>
+ in foldl (List.rev (Ast.list_of_expr e []))
+ | <:expr@loc< $lid:name$($tup:e$) >> when List.mem_assoc name !foldr_funs ->
+ let op = List.assoc name !foldr_funs in
+ let rec foldr =
+ function
+ | [] -> assert false
+ | [x] -> x
+ | x :: xs -> <:expr@loc< $op$ $x$ $foldr xs$ >>
+ in foldr (Ast.list_of_expr e [])
+ | e -> e
+ end
+end#str_item;;
+(*
+
+AstFilters.register_str_item_filter begin
+ Ast.map_expr begin function
+ | <:expr@loc< foldl($lid:op$, $e$) >> ->
+ let rec foldl =
+ function
+ | [] -> assert false
+ | [x] -> x
+ | x :: xs -> <:expr@loc< $lid:op$ $foldl xs$ $x$ >>
+ in foldl (List.rev (Ast.list_of_expr e []))
+ | <:expr@loc< foldr($lid:op$, $e$) >> ->
+ let rec foldr =
+ function
+ | [] -> assert false
+ | [x] -> x
+ | x :: xs -> <:expr@loc< $lid:op$ $x$ $foldr xs$ >>
+ in foldr (Ast.list_of_expr e [])
+ | e -> e
+ end
+end#str_item;;
+
+AstFilters.register_str_item_filter begin
+ Ast.map_expr begin function
+ | <:expr@loc< \!+ ($tup:e$) >> ->
+ begin match Ast.list_of_expr e [] with
+ | [] | [_] -> assert false
+ | x :: xs -> List.fold_left (fun acc x -> <:expr@loc< $acc$ + $x$ >>) x xs
+ end
+ | <:expr< \!+ $e$ >> -> e
+ | e -> e
+ end
+end#str_item;;
+*)
diff --git a/camlp4/examples/parse_files.ml b/camlp4/examples/parse_files.ml
new file mode 100644
index 000000000..3e7e30fbe
--- /dev/null
+++ b/camlp4/examples/parse_files.ml
@@ -0,0 +1,31 @@
+open Camlp4.PreCast;;
+
+module CamlGram = MakeGram(Lexer);;
+
+module Caml =
+ Camlp4.Printers.OCaml.Make
+ (Camlp4OCamlParser.Make
+ (Camlp4OCamlRevisedParser.Make
+ (Camlp4.OCamlInitSyntax.Make(Ast)(Gram)(Quotation))));;
+
+let parse f =
+ let ic = open_in f in
+ let strm = Stream.of_channel ic in
+ let res = Caml.parse_implem (Loc.mk f) strm in
+ close_in ic; res;;
+
+let ghost = Loc.ghost;;
+
+let main () =
+ let a = parse "apply_operator_test.ml" in
+ let b = parse "global_handler_test.ml" in
+ Caml.print_implem
+ <:str_item@ghost<
+ module Apply_operator_test = struct $a$ end;;
+ module Global_handler_test = struct $b$ end >>
+;;
+
+try main ()
+with e ->
+ Format.eprintf "error: %a@." Camlp4.ErrorHandler.print e;
+ exit 1;;
diff --git a/camlp4/examples/test_macros.ml b/camlp4/examples/test_macros.ml
new file mode 100644
index 000000000..1e1b172b5
--- /dev/null
+++ b/camlp4/examples/test_macros.ml
@@ -0,0 +1,15 @@
+(* DEFINE F(x, y, z) = x + y * z;; *)
+(* F(F(1, 2, 3), 4, 5);; *)
+
+(* !+ (1, 2, 3, 4);; *)
+
+(* foldl(( + ), 1, 2, 3, 4);; *)
+(* foldr(cons, 1, 2, 3, []);; *)
+
+let cons x xs = x :: xs;;
+
+def_foldl ( !+ ) ( + );;
+def_foldr ( !:: ) cons;;
+
+!+ (1, 2, 3, 4);;
+!:: (1, 2, 3, []);;
diff --git a/camlp4/examples/test_type_quotation.ml b/camlp4/examples/test_type_quotation.ml
new file mode 100644
index 000000000..772dfcfca
--- /dev/null
+++ b/camlp4/examples/test_type_quotation.ml
@@ -0,0 +1,3 @@
+type t1 = <:power< 6 | int >>
+type t2 = <:power< 3 | int -> int >> -> int
+type t3 = <:power< 3 | int -> <:power< 2 | int >> >> -> int
diff --git a/camlp4/examples/type_quotation.ml b/camlp4/examples/type_quotation.ml
new file mode 100644
index 000000000..5dae046fd
--- /dev/null
+++ b/camlp4/examples/type_quotation.ml
@@ -0,0 +1,18 @@
+open Camlp4.PreCast;
+
+value rec mk_tuple _loc t n =
+ if n <= 1 then t else <:ctyp< $t$ * $mk_tuple _loc t (n - 1)$ >>;
+
+value ctyp_eoi = Gram.Entry.mk "ctyp eoi";
+
+EXTEND Gram
+ ctyp_eoi: [[ t = Syntax.ctyp; `EOI -> t ]];
+END;
+
+value exp _loc _ s =
+ Scanf.sscanf s " %d | %[^!]" begin fun n s ->
+ let t = Syntax.Gram.parse_string ctyp_eoi _loc(* not accurate *) s in
+ <:ctyp< $tup:mk_tuple _loc t n$ >>
+ end;
+
+Quotation.add "power" Quotation.DynAst.ctyp_tag exp;
diff --git a/camlp4/test/fixtures/macrotest.ml b/camlp4/test/fixtures/macrotest.ml
index 555457349..023a5b426 100644
--- a/camlp4/test/fixtures/macrotest.ml
+++ b/camlp4/test/fixtures/macrotest.ml
@@ -51,5 +51,20 @@ value f =
print_int (A * a_should_be_present + 5)
ENDIF;
+IFDEF A THEN
+ DEFINE Z = "ok";
+ELSE
+ DEFINE Z = "ko";
+ENDIF;
+
+Z;
+
+IFDEF DNE THEN
+ DEFINE Z = "ko2";
+ELSE
+ DEFINE Z = "ok2";
+ENDIF;
+
+Z;
pouet;
diff --git a/config/Makefile.msvc b/config/Makefile.msvc
index 24ed4a3da..6825586d8 100644
--- a/config/Makefile.msvc
+++ b/config/Makefile.msvc
@@ -92,17 +92,21 @@ NATIVECCLIBS=advapi32.lib
### How to invoke the C preprocessor
CPP=cl /nologo /EP
-### How to merge a .manifest (if any) in a .exe or .dll
-MERGEMANIFEST=test ! -f $(1).manifest || mt -nologo -outputresource:$(1) -manifest $(1).manifest && rm -f $(1).manifest
-#ml let mergemanifest out = Printf.sprintf "test ! -f %s.manifest || mt -nologo -outputresource:%s -manifest %s.manifest && rm -f %s.manifest" out out out out;;
+### How to merge a .manifest (if any) in a .exe
+MERGEMANIFESTEXE=test ! -f $(1).manifest || mt -nologo -outputresource:$(1) -manifest $(1).manifest && rm -f $(1).manifest
+#ml let mergemanifestexe out = Printf.sprintf "test ! -f %s.manifest || mt -nologo -outputresource:%s -manifest %s.manifest && rm -f %s.manifest" out out out out;;
### How to build an EXE
-MKEXE=$(BYTECC) /Fe$(1) $(2) && ($(MERGEMANIFEST))
-#ml let mkexe out files opts = Printf.sprintf "%s /Fe%s %s %s && (%s)" bytecc out opts files (mergemanifest out);;
+MKEXE=$(BYTECC) /Fe$(1) $(2) && ($(MERGEMANIFESTEXE))
+#ml let mkexe out files opts = Printf.sprintf "%s /Fe%s %s %s && (%s)" bytecc out opts files (mergemanifestexe out);;
+
+### How to merge a .manifest (if any) in a .dll
+MERGEMANIFESTDLL=test ! -f $(1).manifest || mt -nologo -outputresource:"$(1);\#2" -manifest $(1).manifest && rm -f $(1).manifest
+#ml let mergemanifestdll out = Printf.sprintf "test ! -f %s.manifest || mt -nologo -outputresource:\"%s;\\#2\" -manifest %s.manifest && rm -f %s.manifest" out out out out;;
### How to build a DLL
-MKDLL=link /nologo /dll /out:$(1) /implib:$(2) $(3) && ($(MERGEMANIFEST))
-#ml let mkdll out implib files opts = Printf.sprintf "link /nologo /dll /out:%s /implib:%s %s %s && (%s)" out implib opts files (mergemanifest out);;
+MKDLL=link /nologo /dll /out:$(1) /implib:$(2) $(3) && ($(MERGEMANIFESTDLL))
+#ml let mkdll out implib files opts = Printf.sprintf "link /nologo /dll /out:%s /implib:%s %s %s && (%s)" out implib opts files (mergemanifestdll out);;
### How to build a static library
MKLIB=link /lib /nologo /out:$(1) $(2)
diff --git a/configure b/configure
index 518ed08c6..77810bb1f 100755
--- a/configure
+++ b/configure
@@ -488,7 +488,7 @@ mksharedlibrpath=''
if test $withsharedlibs = "yes"; then
case "$host" in
- *-*-linux-gnu|*-*-linux|*-*-freebsd[3-9]*|*-*-openbsd[3-9]*|*-*-netbsd[3-9]*|*-*-gnu*)
+ *-*-linux-gnu|*-*-linux|*-*-freebsd[3-9]*|*-*-openbsd*|*-*-netbsd*|*-*-gnu*)
sharedcccompopts="-fPIC"
mksharedlib="$bytecc -shared -o"
bytecclinkopts="$bytecclinkopts -Wl,-E"
@@ -1066,10 +1066,14 @@ systhread_support=false
if test "$pthread_wanted" = "yes"; then
case "$host" in
- *-*-solaris*) pthread_link="-lpthread -lposix4";;
- *-*-freebsd*) pthread_link="-pthread";;
- *-*-openbsd*) pthread_link="-pthread";;
- *) pthread_link="-lpthread";;
+ *-*-solaris*) pthread_link="-lpthread -lposix4"
+ pthread_caml_link="-cclib -lpthread -cclib -lposix4";;
+ *-*-freebsd*) pthread_link="-pthread"
+ pthread_caml_link="-cclib -pthread";;
+ *-*-openbsd*) pthread_link="-pthread"
+ pthread_caml_link="-cclib -pthread";;
+ *) pthread_link="-lpthread"
+ pthread_caml_link="-cclib -lpthread";;
esac
if ./hasgot -i pthread.h $pthread_link pthread_self; then
echo "POSIX threads library supported."
@@ -1098,7 +1102,7 @@ if test "$pthread_wanted" = "yes"; then
else
pthread_link=""
fi
-echo "PTHREAD_LINK=$pthread_link" >> Makefile
+echo "PTHREAD_LINK=$pthread_caml_link" >> Makefile
# Determine if the bytecode thread library is supported
diff --git a/man/ocaml.m b/man/ocaml.m
index 7f7e5a644..47c263a7f 100644
--- a/man/ocaml.m
+++ b/man/ocaml.m
@@ -25,7 +25,7 @@ The
command is the toplevel system for Objective Caml,
that permits interactive use of the Objective Caml system through a
read-eval-print loop. In this mode, the system repeatedly reads Caml
-phrases from the input, then typechecks, compile and evaluate
+phrases from the input, then typechecks, compiles and evaluates
them, then prints the inferred type and result value, if any. The
system prints a # (sharp) prompt before reading each phrase.
diff --git a/myocamlbuild.ml b/myocamlbuild.ml
index a9e14aa30..0e522f0e2 100644
--- a/myocamlbuild.ml
+++ b/myocamlbuild.ml
@@ -110,21 +110,24 @@ let threads_dir = if_partial_dir "otherlibs/threads";;
let systhreads_dir = if_partial_dir "otherlibs/systhreads";;
let dynlink_dir = if_partial_dir "otherlibs/dynlink";;
let str_dir = if_partial_dir "otherlibs/str";;
-let stdlib_dir = if_partial_dir "stdlib";;
let toplevel_dir = if_partial_dir "toplevel";;
-let ocamlc_solver () =
- if Pathname.exists "ocamlc.opt" && Pathname.exists (stdlib_dir/"stdlib.cmxa") then
- S[A"./ocamlc.opt"; A"-nostdlib"]
- else if Pathname.exists "ocamlc" && Pathname.exists (stdlib_dir/"stdlib.cma") then
- S[ocamlrun; A"./ocamlc"; A"-nostdlib"]
- else boot_ocamlc;;
+let ocamlc_solver =
+ let native_deps = ["ocamlc.opt"; "stdlib/stdlib.cmxa";
+ "stdlib/std_exit.cmx"; "stdlib/std_exit"-.-C.o] in
+ let byte_deps = ["ocamlc"; "stdlib/stdlib.cma"; "stdlib/std_exit.cmo"] in
+ fun () ->
+ if List.for_all Pathname.exists native_deps then
+ S[A"./ocamlc.opt"; A"-nostdlib"]
+ else if List.for_all Pathname.exists byte_deps then
+ S[ocamlrun; A"./ocamlc"; A"-nostdlib"]
+ else boot_ocamlc;;
Command.setup_virtual_command_solver "OCAMLC" ocamlc_solver;;
Command.setup_virtual_command_solver "OCAMLCWIN" (convert_for_windows_shell ocamlc_solver);;
let ocamlopt_solver () =
- S[if Pathname.exists "ocamlopt.opt" && Pathname.exists (stdlib_dir/"stdlib.cmxa")
+ S[if Pathname.exists "ocamlopt.opt" && Pathname.exists ("stdlib/stdlib.cmxa")
then A"./ocamlopt.opt"
else S[ocamlrun; A"./ocamlopt"];
A"-nostdlib"];;
@@ -207,13 +210,15 @@ use_lib "otherlibs/dynlink/extract_crc" "otherlibs/dynlink/dynlink";;
hide_package_contents "otherlibs/dynlink/dynlinkaux";;
flag ["ocaml"; "link"; "file:driver/main.native"; "native"] begin
- S[A("asmrun/meta"-.-C.o); A("asmrun/dynlink"-.-C.o);
- A"-ccopt"; A C.bytecclinkopts; A"-cclib"; A C.bytecclibs]
+ S[A"-ccopt"; A C.bytecclinkopts; A"-cclib"; A C.bytecclibs]
end;;
-flag ["ocaml"; "link"] (S[A"-I"; P stdlib_dir]);;
-flag ["ocaml"; "compile"; "include_stdlib"] (S[A"-I"; P stdlib_dir]);;
-flag ["ocaml"; "compile"; "include_threads_stdlib"] (S[A"-I"; P threads_dir; A"-I"; P stdlib_dir]);;
+dep ["ocaml"; "link"; "file:driver/main.native"; "native"]
+ ["asmrun/meta"-.-C.o; "asmrun/dynlink"-.-C.o];;
+
+dep ["ocaml"; "compile"; "native"] ["stdlib/libasmrun"-.-C.a];;
+
+flag ["ocaml"; "link"] (S[A"-I"; P "stdlib"]);;
flag ["ocaml"; "compile"; "include_unix"] (S[A"-I"; P unix_dir]);;
flag ["ocaml"; "compile"; "include_str"] (S[A"-I"; P str_dir]);;
flag ["ocaml"; "compile"; "include_dynlink"] (S[A"-I"; P dynlink_dir]);;
@@ -233,6 +238,7 @@ let setup_arch arch =
let camlp4_arch =
dir "" [
+ dir "stdlib" [];
dir "utils" [];
dir "parsing" [];
dir "camlp4" [
@@ -249,26 +255,36 @@ let camlp4_arch =
setup_arch camlp4_arch;;
-Pathname.define_context "utils" [Pathname.current_dir_name];;
-Pathname.define_context "camlp4" ["camlp4/build"; "utils"];;
-Pathname.define_context "camlp4/boot" ["camlp4/build"; "utils"; "parsing"; "camlp4"];;
-Pathname.define_context "camlp4/Camlp4Parsers" ["camlp4"; "camlp4/build"];;
-Pathname.define_context "camlp4/Camlp4Printers" ["camlp4"; "camlp4/build"];;
-Pathname.define_context "camlp4/Camlp4Filters" ["camlp4"; "camlp4/build"];;
-Pathname.define_context "camlp4/Camlp4Top" ["typing"];;
-Pathname.define_context "typing" ["typing"; "parsing"; "utils"];;
-Pathname.define_context "ocamldoc" ["typing"; "parsing"; "utils"; "tools"; "bytecomp"];;
-Pathname.define_context "bytecomp" ["bytecomp"; "parsing"; "typing"; "utils"];;
-Pathname.define_context "tools" ["tools"; (* "toplevel"; *) "parsing"; "utils"; "driver"; "bytecomp"; "asmcomp"; "typing"];;
-Pathname.define_context "toplevel" ["toplevel"; "parsing"; "typing"; "bytecomp"; "utils"; "driver"];;
-Pathname.define_context "driver" ["driver"; "asmcomp"; "bytecomp"; "typing"; "utils"; "parsing"];;
-Pathname.define_context "debugger" ["bytecomp"; "utils"; "typing"; "parsing"; "toplevel"];;
-Pathname.define_context "otherlibs/dynlink" ["otherlibs/dynlink"; "bytecomp"; "utils"; "typing"; "parsing"];;
-Pathname.define_context "asmcomp" ["asmcomp"; "bytecomp"; "parsing"; "typing"; "utils"];;
+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 "typing" ["typing"; "parsing"; "utils"; "stdlib"];;
+Pathname.define_context "ocamldoc" ["typing"; "parsing"; "utils"; "tools"; "bytecomp"; "stdlib"];;
+Pathname.define_context "bytecomp" ["bytecomp"; "parsing"; "typing"; "utils"; "stdlib"];;
+Pathname.define_context "tools" ["tools"; (* "toplevel"; *) "parsing"; "utils"; "driver"; "bytecomp"; "asmcomp"; "typing"; "stdlib"];;
+Pathname.define_context "toplevel" ["toplevel"; "parsing"; "typing"; "bytecomp"; "utils"; "driver"; "stdlib"];;
+Pathname.define_context "driver" ["driver"; "asmcomp"; "bytecomp"; "typing"; "utils"; "parsing"; "stdlib"];;
+Pathname.define_context "debugger" ["bytecomp"; "utils"; "typing"; "parsing"; "toplevel"; "stdlib"];;
+Pathname.define_context "otherlibs/dynlink" ["otherlibs/dynlink"; "bytecomp"; "utils"; "typing"; "parsing"; "stdlib"];;
+Pathname.define_context "asmcomp" ["asmcomp"; "bytecomp"; "parsing"; "typing"; "utils"; "stdlib"];;
+Pathname.define_context "ocamlbuild" ["ocamlbuild"; "stdlib"; "."];;
+Pathname.define_context "lex" ["lex"; "stdlib"];;
+
+List.iter (fun x -> let x = "otherlibs"/x in Pathname.define_context x [x; "stdlib"])
+ ["bigarray"; "dbm"; "graph"; "num"; "str"; "systhreads"; "unix"; "win32graph"; "win32unix"];;
(* The bootstrap standard library *)
copy_rule "The bootstrap standard library" "stdlib/%" "boot/%";;
+(* About the standard library *)
+copy_rule "stdlib asmrun" ("asmrun/%"-.-C.a) ("stdlib/%"-.-C.a);;
+copy_rule "stdlib byterun" ("byterun/%"-.-C.a) ("stdlib/%"-.-C.a);;
+
(* The thread specific standard library *)
copy_rule "The thread specific standard library (mllib)" ~insert:`bottom "stdlib/%.mllib" "otherlibs/threads/%.mllib";;
copy_rule "The thread specific standard library (cmo)" ~insert:`bottom "stdlib/%.cmo" "otherlibs/threads/%.cmo";;
@@ -316,6 +332,52 @@ copy_rule' "otherlibs/dynlink/extract_crc.byte" "otherlibs/dynlink/extract_crc";
copy_rule' ~insert:`bottom "%" "%.exe";;
+ocaml_lib "stdlib/stdlib";;
+
+let stdlib_mllib_contents =
+ lazy (string_list_of_file "stdlib/stdlib.mllib");;
+
+let import_stdlib_contents build exts =
+ let l =
+ List.fold_right begin fun x ->
+ List.fold_right begin fun ext acc ->
+ ["stdlib"/(String.uncapitalize x)-.-ext] :: acc
+ end exts
+ end !*stdlib_mllib_contents []
+ in
+ let res = build l in
+ List.iter Outcome.ignore_good res
+;;
+
+rule "byte stdlib in partial mode"
+ ~prod:"byte_stdlib_partial_mode"
+ ~deps:["stdlib/stdlib.mllib"; "stdlib/stdlib.cma";
+ "stdlib/std_exit.cmo"; "stdlib/libcamlrun"-.-C.a;
+ "stdlib/camlheader"; "stdlib/camlheader_ur"]
+ begin fun env build ->
+ let (_ : Command.t) =
+ Ocamlbuild_pack.Ocaml_compiler.byte_library_link_mllib
+ "stdlib/stdlib.mllib" "stdlib/stdlib.cma" env build
+ in
+ import_stdlib_contents build ["cmi"];
+ touch "byte_stdlib_partial_mode"
+ end;;
+
+rule "native stdlib in partial mode"
+ ~prod:"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/camlheader"; "stdlib/camlheader_ur"]
+ begin fun env build ->
+ let (_ : Command.t) =
+ Ocamlbuild_pack.Ocaml_compiler.native_library_link_mllib
+ "stdlib/stdlib.mllib" "stdlib/stdlib.cmxa" env build
+ in
+ import_stdlib_contents build ["cmi"];
+ touch "native_stdlib_partial_mode"
+ end;;
+
rule "C files"
~prod:("%"-.-C.o)
~dep:"%.c"
@@ -378,7 +440,7 @@ rule "Standard library manual"
begin fun _ _ ->
Seq[Cmd(S[A"mkdir"; A"-p"; P"ocamldoc/stdlib_man"]);
Cmd(S[ocamldoc; A"-man"; A"-d"; P"ocamldoc/stdlib_man";
- A"-I"; P"stdlib"; A"-I"; P"otherlibs/unix"; A"-I"; P"otherlibs/num";
+ A"-I"; P "stdlib"; A"-I"; P"otherlibs/unix"; A"-I"; P"otherlibs/num";
A"-t"; A"Ocaml library"; A"-man-mini"; atomize stdlib_mlis])]
end;;
@@ -464,7 +526,7 @@ rule "libthreadsnat.a"
(* See remark above: force static linking of libthreadsnat.a *)
flag ["ocaml"; "link"; "library"; "otherlibs_systhreads"; "native"] begin
- S[A"-cclib"; syscamllib "threadsnat"; (* A"-cclib"; syscamllib "unix"; seems to be useless and can be dangerous during bootstrap *) A"-cclib"; A C.pthread_link]
+ S[A"-cclib"; syscamllib "threadsnat"; (* A"-cclib"; syscamllib "unix"; seems to be useless and can be dangerous during bootstrap *) Sh C.pthread_link]
end;
end;;
@@ -518,8 +580,11 @@ rule "stdlib/sys.ml"
~prod:"stdlib/sys.ml"
~deps:["stdlib/sys.mlp"; "VERSION"]
begin fun _ _ ->
+ let version = with_input_file "VERSION" input_line in
Seq [rm_f "stdlib/sys.ml";
- Cmd (Sh"sed -e\"s|%%VERSION%%|`head -1 VERSION`|\" stdlib/sys.mlp >stdlib/sys.ml");
+ Cmd (S[A"sed"; A"-e";
+ A(sprintf "s,%%%%VERSION%%%%,%s," version);
+ Sh"<"; P"stdlib/sys.mlp"; Sh">"; Px"stdlib/sys.ml"]);
chmod (A"-w") "stdlib/sys.ml"]
end;;
@@ -583,14 +648,8 @@ rule "bytecomp/runtimedef.ml"
~prod:"bytecomp/runtimedef.ml"
~deps:["byterun/primitives"; "byterun/fail.h"]
begin fun _ _ ->
- Cmd(Sh"(echo 'let builtin_exceptions = [|'; \
- sed -n -e 's|.*/\\* \\(\"[A-Za-z_]*\"\\) \\*/$| \\1;|p' byterun/fail.h | \
- sed -e '$s/;$//'; \
- echo '|]'; \
- echo 'let builtin_primitives = [|'; \
- sed -e 's/.*/ \"&\";/' -e '$s/;$//' byterun/primitives; \
- echo '|]') > bytecomp/runtimedef.ml")
- end;;
+ Cmd(S[A"../build/mkruntimedef.sh";Sh">"; Px"bytecomp/runtimedef.ml"])
+ end;;
(* Choose the right machine-dependent files *)
@@ -767,7 +826,7 @@ dep ["ocaml"; "compile"; "file:camlp4/Camlp4/Sig.ml"]
mk_camlp4_bin "camlp4" [];;
mk_camlp4 "camlp4boot" ~unix:false
- [pa_r; pa_qc; pa_q; pa_rp; pa_g; pa_macro; pa_debug] [pr_dump] [top_rprint];;
+ [pa_r; pa_qc; pa_q; pa_rp; pa_g; pa_macro; pa_debug; pa_l] [pr_dump] [top_rprint];;
mk_camlp4 "camlp4r"
[pa_r; pa_rp] [pr_a] [top_rprint];;
mk_camlp4 "camlp4rf"
@@ -784,24 +843,25 @@ mk_camlp4 "camlp4orf"
(* Labltk *)
-Pathname.define_context "otherlibs/labltk/compiler" ["otherlibs/labltk/compiler"; "otherlibs/labltk/support"];;
-Pathname.define_context "otherlibs/labltk/labltk" ["otherlibs/labltk/labltk"; "otherlibs/labltk/support"];;
-Pathname.define_context "otherlibs/labltk/camltk" ["otherlibs/labltk/camltk"; "otherlibs/labltk/support"];;
+Pathname.define_context "otherlibs/labltk/support" ["otherlibs/labltk/support"; "stdlib"];;
+Pathname.define_context "otherlibs/labltk/compiler" ["otherlibs/labltk/compiler"; "otherlibs/labltk/support"; "stdlib"];;
+Pathname.define_context "otherlibs/labltk/labltk" ["otherlibs/labltk/labltk"; "otherlibs/labltk/support"; "stdlib"];;
+Pathname.define_context "otherlibs/labltk/camltk" ["otherlibs/labltk/camltk"; "otherlibs/labltk/support"; "stdlib"];;
Pathname.define_context "otherlibs/labltk/lib"
- ["otherlibs/labltk/labltk"; "otherlibs/labltk/camltk"; "otherlibs/labltk/support"];;
+ ["otherlibs/labltk/labltk"; "otherlibs/labltk/camltk"; "otherlibs/labltk/support"; "stdlib"];;
Pathname.define_context "otherlibs/labltk/jpf"
- ["otherlibs/labltk/jpf"; "otherlibs/labltk/labltk"; "otherlibs/labltk/support"];;
+ ["otherlibs/labltk/jpf"; "otherlibs/labltk/labltk"; "otherlibs/labltk/support"; "stdlib"];;
Pathname.define_context "otherlibs/labltk/frx"
- ["otherlibs/labltk/frx"; "otherlibs/labltk/camltk"; "otherlibs/labltk/support"];;
+ ["otherlibs/labltk/frx"; "otherlibs/labltk/camltk"; "otherlibs/labltk/support"; "stdlib"];;
Pathname.define_context "otherlibs/labltk/tkanim"
- ["otherlibs/labltk/tkanim"; "otherlibs/labltk/camltk"; "otherlibs/labltk/support"];;
+ ["otherlibs/labltk/tkanim"; "otherlibs/labltk/camltk"; "otherlibs/labltk/support"; "stdlib"];;
Pathname.define_context "otherlibs/labltk/browser"
- ["otherlibs/labltk/browser"; "otherlibs/labltk/labltk"; "otherlibs/labltk/support"; "parsing"; "utils"; "typing"];;
+ ["otherlibs/labltk/browser"; "otherlibs/labltk/labltk"; "otherlibs/labltk/support"; "parsing"; "utils"; "typing"; "stdlib"];;
file_rule "otherlibs/labltk/compiler/copyright"
~dep:"otherlibs/labltk/compiler/copyright"
~prod:"otherlibs/labltk/compiler/copyright.ml"
- ~cache:(fun _ -> "0.1")
+ ~cache:(fun _ _ -> "0.1")
begin fun _ oc ->
Printf.fprintf oc "let copyright = \"%a\";;\n\
let write ~w = w copyright;;"
@@ -970,13 +1030,13 @@ rule "labltktop"
A"-I"; P"otherlibs/labltk/support"; A"-I"; P"toplevel"; P"toplevellib.cma";
A"-I"; P"otherlibs/labltk/labltk"; A"-I"; P"otherlibs/labltk/camltk";
A"-I"; P"otherlibs/labltk/lib"; P"labltk.cma"; A"-I"; P unix_dir; P"unix.cma";
- A"-I"; P"otherlibs/str"; A"-I"; P"stdlib"; P"str.cma"; P"topstart.cmo"])
+ A"-I"; P"otherlibs/str"; A"-I"; P "stdlib"; P"str.cma"; P"topstart.cmo"])
end;;
let labltk_installdir = C.libdir/"labltk" in
file_rule "labltk"
~prod:"otherlibs/labltk/lib/labltk"
- ~cache:(fun _ -> labltk_installdir)
+ ~cache:(fun _ _ -> labltk_installdir)
begin fun _ oc ->
Printf.fprintf oc
"#!/bin/sh\n\
diff --git a/ocamlbuild/ChangeLog b/ocamlbuild/ChangeLog
index 9fb7d0670..a844e38b8 100644
--- a/ocamlbuild/ChangeLog
+++ b/ocamlbuild/ChangeLog
@@ -1,3 +1,148 @@
+2007-03-22 Nicolas Pouillard <nicolas.pouillard@gmail.com>
+
+ Allow to receive the build function in {custom,file}_rule.
+
+ * rule.ml,
+ * rule.mli,
+ * signatures.mli: Ditto.
+ * ocaml_specific.ml: Update.
+
+ * command.ml,
+ * command.mli: Add a function to get string and tags.
+
+ * ocamldep.ml,
+ * ocamldep.mli: Make tag based dependencies.
+
+ * ocaml_compiler.ml: Do the pack as one command to be sure running the
+ remove.
+
+ * test/test8/myocamlbuild.ml,
+ * test/good-output: Update.
+
+2007-03-21 Nicolas Pouillard <nicolas.pouillard@gmail.com>
+
+ Fix the previous fix.
+
+ * ocaml_compiler.ml: Remove the empty file.
+ * test/good-output: Update.
+
+2007-03-21 Nicolas Pouillard <nicolas.pouillard@gmail.com>
+
+ [native pack] use touch instead of mv and cmp.
+
+ * ocaml_compiler.ml: This version is will force ocamlopt to do the
+ right thing.
+ * test/good-output: Update.
+
+2007-03-20 Nicolas Pouillard <nicolas.pouillard@gmail.com>
+
+ Two bugs, two fixes.
+
+ * ocaml_tools.ml: Add pp flags to interface inference.
+ * ocaml_specific.ml: Add a rule for packing with a cmi that already
+ exists.
+ * test/good-output: Update.
+ * Makefile: Change the default location.
+
+2007-03-13 Nicolas Pouillard <nicolas.pouillard@gmail.com>
+
+ Fix a bug in expand_module.
+
+ * ocaml_utils.ml: Handle correctly pathnames instead of just basenames.
+
+2007-03-13 Nicolas Pouillard <nicolas.pouillard@gmail.com>
+
+ Use sys_file_exists instead of Sys.file_exists.
+
+ * my_unix.ml: Since Sys.file_exists don't treat well captial letters.
+ * my_std.ml: Fix a bug.
+ * pathname.ml: Here is a an exception to the previous rule so, put a
+ comment.
+
+2007-03-11 Nicolas Pouillard <nicolas.pouillard@gmail.com>
+
+ Fix the List.union order.
+
+ * my_std.ml: Fix and improve List.union.
+ * pathname.ml: Use it and fix merge_include_dirs.
+ * test/good-output: Update since the union order was wrong.
+
+2007-03-11 Nicolas Pouillard <nicolas.pouillard@gmail.com>
+
+ Re fix menhir and include dirs.
+
+ * ocaml_tools.ml: Specifiy ocamlc and -I with --ocamlc.
+
+2007-03-11 Nicolas Pouillard <nicolas.pouillard@gmail.com>
+
+ Fix a bug: Add include directories to menhir.
+
+ * ocaml_tools.ml: Ditto.
+ * my_std.ml,
+ * signatures.mli: Specification typo.
+
+2007-03-07 Nicolas Pouillard <nicolas.pouillard@gmail.com>
+
+ Handle specially archives files during an import.
+
+ * shell.ml: Ditto.
+
+2007-03-07 Nicolas Pouillard <nicolas.pouillard@gmail.com>
+
+ Use cp -p in copy_rule, and fix some typos in the manual.
+
+ * manual/manual.tex: Typos.
+ * rule.ml,
+ * rule.mli: Add cp_p and use it for copy_rule.
+
+2007-03-05 Nicolas Pouillard <nicolas.pouillard@gmail.com>
+
+ Relaxe executor on exception condition.
+
+ Patch from Berke.
+ * executor.ml: Ignore Not_found and exceptional conditions.
+ * TODO: Add an entry (needs to better understand POSIX).
+
+2007-03-04 Nicolas Pouillard <nicolas.pouillard@gmail.com>
+
+ Split where in bindir and libdir.
+
+ * ocamlbuild_where.mli: Ditto.
+ * ocaml_specific.ml: Update.
+ * options.ml: Use bindir.
+ * plugin.ml: Update.
+ * start.sh: Update.
+
+2007-03-04 Nicolas Pouillard <nicolas.pouillard@gmail.com>
+
+ Virtual solvers for ocaml tools.
+
+ * options.ml: Setup virtual command solver for commands like ocamlc,
+ ocamlopt... This allow to have full pathname but let also failback to
+ classic search path.
+ * ocaml_compiler.ml: Add a tag to differentiate dependencies at link
+ time.
+ * ocamlbuild-presentation.rslide: Add an item as suggested by a friend.
+
+2007-03-02 Nicolas Pouillard <nicolas.pouillard@gmail.com>
+
+ Same thing for the second link function.
+
+ * ocaml_compiler.ml: Ignore stdlib.
+
+2007-03-02 Nicolas Pouillard <nicolas.pouillard@gmail.com>
+
+ Move the stdlib hack.
+
+ * ocaml_compiler.ml: Should works better.
+
+2007-03-02 Nicolas Pouillard <nicolas.pouillard@gmail.com>
+
+ Little fix about library linking.
+
+ * ocaml_utils.ml: Avoid linking twice in some cases.
+ * ocaml_compiler.ml: Handle specially the OCaml stdlib.
+
2007-03-01 Nicolas Pouillard <nicolas.pouillard@gmail.com>
Remove a rec.
diff --git a/ocamlbuild/Makefile b/ocamlbuild/Makefile
index 01fd55a7f..e2cb570b6 100644
--- a/ocamlbuild/Makefile
+++ b/ocamlbuild/Makefile
@@ -1,7 +1,7 @@
.PHONY: all byte native profile debug ppcache doc
ifndef INSTALL_PREFIX
-INSTALL_PREFIX := /usr/local
+INSTALL_PREFIX := $(PWD)/_install
endif
ifndef INSTALL_LIB
@@ -25,7 +25,7 @@ OCAMLBUILD_OPTIONS := $(OCAMLBUILD_OPTIONS) $(O)
endif
ifeq ($(wildcard ./boot/oc*build),./boot/ocamlbuild)
-OCAMLBUILD=INSTALL_LIB=$(INSTALL_LIB) $(OCAMLBUILDCMD) -build-dir $(BUILDDIR) -no-links $(OCAMLBUILD_OPTIONS)
+OCAMLBUILD=INSTALL_LIB=$(INSTALL_LIB) INSTALL_BIN=$(INSTALL_BIN) $(OCAMLBUILDCMD) -build-dir $(BUILDDIR) -no-links $(OCAMLBUILD_OPTIONS)
LIBS=ocamlbuildlib ocamlbuildlightlib
PROGRAMS=ocamlbuild ocamlbuildlight
BYTE=$(LIBS:=.cma) $(PROGRAMS:=.byte)
@@ -46,6 +46,7 @@ doc:
ln -sf $(BUILDDIR)/ocamlbuild.docdir doc
else
all byte native: ocamlbuild.byte.start
+ mkdir -p boot
cp ocamlbuild.byte.start boot/ocamlbuild
$(MAKE) $(MFLAGS) $(MAKECMDGOALS)
cp $(BUILDDIR)/ocamlbuild.native boot/ocamlbuild
diff --git a/ocamlbuild/TODO b/ocamlbuild/TODO
index 65f270f5e..3b634f6b5 100644
--- a/ocamlbuild/TODO
+++ b/ocamlbuild/TODO
@@ -1,4 +1,5 @@
To do:
+* Executor: exceptional conditions and Not_found
* Fix report
* Design a nice, friendly, future-proof plugin (myocamlbuild) API
* Ocamlbuild should keep track of files removed from the source directory, e.g.,
diff --git a/ocamlbuild/command.ml b/ocamlbuild/command.ml
index 593b1f8d0..61c305d40 100644
--- a/ocamlbuild/command.ml
+++ b/ocamlbuild/command.ml
@@ -151,12 +151,16 @@ let rec string_of_command_spec_with_calls call_with_tags call_with_target resolv
let string_of_command_spec x = string_of_command_spec_with_calls ignore ignore false x
-let string_print_of_command_spec spec =
+let string_target_and_tags_of_command_spec spec =
let rtags = ref Tags.empty in
let rtarget = ref "" in
let s = string_of_command_spec_with_calls ((:=) rtags) ((:=) rtarget) true spec in
let target = if !rtarget = "" then s else !rtarget in
- (s, (fun quiet pretend () -> if not quiet then Log.event ~pretend s target !rtags))
+ s, target, !rtags
+
+let string_print_of_command_spec spec =
+ 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))
(* ***)
let rec print f =
diff --git a/ocamlbuild/command.mli b/ocamlbuild/command.mli
index 5ad5302dd..de4537aad 100644
--- a/ocamlbuild/command.mli
+++ b/ocamlbuild/command.mli
@@ -19,6 +19,8 @@ include Signatures.COMMAND with type tags = Tags.t
(** {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
diff --git a/ocamlbuild/examples/example_with_C/_tags b/ocamlbuild/examples/example_with_C/_tags
new file mode 100644
index 000000000..769cb463b
--- /dev/null
+++ b/ocamlbuild/examples/example_with_C/_tags
@@ -0,0 +1 @@
+<*caml.o>: output_obj
diff --git a/ocamlbuild/examples/example_with_C/fib.ml b/ocamlbuild/examples/example_with_C/fib.ml
new file mode 100644
index 000000000..ef6dbd438
--- /dev/null
+++ b/ocamlbuild/examples/example_with_C/fib.ml
@@ -0,0 +1,5 @@
+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
diff --git a/ocamlbuild/examples/example_with_C/fibwrap.c b/ocamlbuild/examples/example_with_C/fibwrap.c
new file mode 100644
index 000000000..cc2104b67
--- /dev/null
+++ b/ocamlbuild/examples/example_with_C/fibwrap.c
@@ -0,0 +1,7 @@
+ /* -*- 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)));
+}
diff --git a/ocamlbuild/examples/example_with_C/main.c b/ocamlbuild/examples/example_with_C/main.c
new file mode 100644
index 000000000..c7f6bb5d2
--- /dev/null
+++ b/ocamlbuild/examples/example_with_C/main.c
@@ -0,0 +1,10 @@
+ /* -*- 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;
+}
diff --git a/ocamlbuild/examples/example_with_C/myocamlbuild.ml b/ocamlbuild/examples/example_with_C/myocamlbuild.ml
new file mode 100644
index 000000000..f53df7e10
--- /dev/null
+++ b/ocamlbuild/examples/example_with_C/myocamlbuild.ml
@@ -0,0 +1,35 @@
+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
+
diff --git a/ocamlbuild/examples/example_with_C/x.ml b/ocamlbuild/examples/example_with_C/x.ml
new file mode 100644
index 000000000..7fecab12d
--- /dev/null
+++ b/ocamlbuild/examples/example_with_C/x.ml
@@ -0,0 +1 @@
+let x = 42
diff --git a/ocamlbuild/executor.ml b/ocamlbuild/executor.ml
index 1890c98f5..300e1a6ae 100644
--- a/ocamlbuild/executor.ml
+++ b/ocamlbuild/executor.ml
@@ -304,18 +304,22 @@ let execute
begin fun (fdlist, hook) ->
List.iter
begin fun fd ->
- let job = FDM.find fd !outputs in
- ticker ();
- hook fd job
+ 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
+ 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
diff --git a/ocamlbuild/main.ml b/ocamlbuild/main.ml
index 967c7c373..07f493b06 100644
--- a/ocamlbuild/main.ml
+++ b/ocamlbuild/main.ml
@@ -134,6 +134,8 @@ let proceed () =
dprintf 3 "include directories are:@ %a" print_string_list !Options.include_dirs;
Options.entry := Some entry;
+ List.iter Configuration.parse_string !Options.tag_lines;
+
Hooks.call_hook Hooks.Before_rules;
Ocaml_specific.init ();
Hooks.call_hook Hooks.After_rules;
diff --git a/ocamlbuild/manual/manual.tex b/ocamlbuild/manual/manual.tex
index 99b76d7eb..6cb325364 100644
--- a/ocamlbuild/manual/manual.tex
+++ b/ocamlbuild/manual/manual.tex
@@ -73,7 +73,7 @@ projects need features not available in that module -- you may then use
functions or values directly from the core \ocb modules. We ask you to report
such usage to the authors so that we may make the necessary changes to the API;
you may also want to isolate calls to the non-API parts of the \ocb library
-from the rest of your plugin to to be able to keep the later when incompatible
+from the rest of your plugin to be able to keep the later when incompatible
changes arise.
The way that \ocb handles the command-line options, the \tags file,
@@ -174,9 +174,9 @@ total 208
You can execute your code the old-fashioned way (\texttt{./hello.native}).
You may also type
\begin{verbatim}
-ocamlbuild main.native -- Caesar
+ocamlbuild hello.native -- Caesar
\end{verbatim}
-and it will compile and then run \texttt{main.native} with the arguments following \texttt{-{}-},
+and it will compile and then run \texttt{hello.native} with the arguments following \texttt{-{}-},
which should display:
\begin{verbatim}
% ocamlbuild hello.native -- Caesar
@@ -257,14 +257,14 @@ let _ =
Printf.printf "My name is %s\n" Sys.argv.(0)
;;
\end{verbatim}
-Then the module \texttt{Main} depends on the module \texttt{Greet} and \ocb can
+Then the module \texttt{Hello} depends on the module \texttt{Greet} and \ocb can
figure this out for himself -- we still only have to invoke \texttt{\ocb
-main.native}. Needless to say, this works for any number of modules.
+hello.native}. Needless to say, this works for any number of modules.
%***)
%(*** Native and byte code
\subsection{Native and byte-code}
If we want to compile byte-code instead of native, we just a target name of
-\texttt{main.byte} instead of \texttt{main.native}, i.e., we type
+\texttt{hello.byte} instead of \texttt{hello.native}, i.e., we type
\texttt{\ocb hello.byte}.
%***)
%(*** Compile flags
@@ -536,7 +536,8 @@ There are then two cases. If no other modules named \texttt{Bar} or
\texttt{Baz} exist elsewhere in the project, then you are done. Just use
\texttt{Foo}, \texttt{Foo.Bar} and \texttt{Foo.Baz} in your code.
Otherwise, you will need to use the plugin mechanism and define the mutual
-visibility of the subdirectories using the XXX function.
+visibility of the subdirectories using the \texttt{Pathname.define\_context}
+function.
%***)
%(*** Grouping targets
\subsection{Grouping targets with \texttt{.itarget}}
diff --git a/ocamlbuild/my_std.ml b/ocamlbuild/my_std.ml
index 6a0351608..9d74a189c 100644
--- a/ocamlbuild/my_std.ml
+++ b/ocamlbuild/my_std.ml
@@ -109,15 +109,16 @@ module List = struct
| None -> acc
end xs []
+ let rec rev_append_uniq acc =
+ function
+ | [] -> acc
+ | x :: xs ->
+ if mem x acc then rev_append_uniq acc xs
+ else rev_append_uniq (x :: acc) xs
+
let union a b =
- let rec self a b =
- if a = [] then b else
- match b with
- | [] -> a
- | x :: xs ->
- if mem x a then self a xs
- else self (x :: a) xs
- in rev (self (rev a) b)
+ rev (rev_append_uniq (rev_append_uniq [] a) b)
+
end
module String = struct
@@ -169,7 +170,7 @@ module String = struct
end
in loop 0; text
- (*** is_prefix : is v a prefix of u ? *)
+ (*** is_prefix : is u a prefix of v ? *)
let is_prefix u v =
let m = String.length u
and n = String.length v
@@ -215,10 +216,12 @@ let sys_readdir, reset_readdir_cache, reset_readdir_cache_for =
let sys_file_exists x =
let dirname = Filename.dirname x in
let basename = Filename.basename x in
- if basename = Filename.current_dir_name then true else
match sys_readdir dirname with
| Outcome.Bad _ -> false
- | Outcome.Good a -> try Array.iter (fun x -> if x = basename then raise Exit) a; false with Exit -> true
+ | Outcome.Good a ->
+ if basename = Filename.current_dir_name then true else
+ try Array.iter (fun x -> if x = basename then raise Exit) a; false
+ with Exit -> true
let sys_command =
match Sys.os_type with
diff --git a/ocamlbuild/my_unix.ml b/ocamlbuild/my_unix.ml
index 0c8d4e9c6..b914bbb94 100644
--- a/ocamlbuild/my_unix.ml
+++ b/ocamlbuild/my_unix.ml
@@ -51,7 +51,7 @@ let is_degraded = true
let stat f =
{ stat_key = f;
stat_file_kind =
- if Sys.file_exists f then
+ if sys_file_exists f then
if Sys.is_directory f then
FK_dir
else
diff --git a/ocamlbuild/my_unix_with_unix.ml b/ocamlbuild/my_unix_with_unix.ml
index 1c0dd1e6f..2bca1f9d5 100644
--- a/ocamlbuild/my_unix_with_unix.ml
+++ b/ocamlbuild/my_unix_with_unix.ml
@@ -57,9 +57,7 @@ let run_and_open s kont =
with e -> (close (); raise e)
let stdout_isatty () =
- (* 3.10
- Unix.isatty Unix.stdout *)
- true
+ Unix.isatty Unix.stdout
let setup () =
implem.is_degraded <- false;
diff --git a/ocamlbuild/ocaml_compiler.ml b/ocamlbuild/ocaml_compiler.ml
index cf17c45d2..e875d9bc0 100644
--- a/ocamlbuild/ocaml_compiler.ml
+++ b/ocamlbuild/ocaml_compiler.ml
@@ -78,11 +78,16 @@ let ocamlopt_link_prog = ocamlopt_link N
let ocamlopt_p tags deps out =
let dirnames = List.union [] (List.map Pathname.dirname deps) in
let include_flags = List.fold_right ocaml_add_include_flag dirnames [] in
- let cmi = cmi_of out and cmitmp = Pathname.update_extensions "cmitmp" out in
- Seq[mv cmi cmitmp;
- Cmd (S [!Options.ocamlopt; A"-pack"; forpack_flags out tags; T tags; S include_flags;
- atomize_paths deps; flags_of_pathname out; (* FIXME: P (cmi_of out);*) A"-o"; Px out]);
- cmp cmitmp cmi]
+ let mli = Pathname.update_extensions "mli" out in
+ let cmd =
+ S [!Options.ocamlopt; A"-pack"; forpack_flags out tags; T tags;
+ S include_flags; atomize_paths deps; flags_of_pathname out;
+ A"-o"; Px out] in
+ if (*FIXME true ||*) Pathname.exists mli then Cmd cmd
+ else
+ let rm = S[A"rm"; A"-f"; P mli] in
+ Cmd(S[A"touch"; P mli; Sh" ; if "; cmd; Sh" ; then "; rm; Sh" ; else ";
+ rm; Sh" ; exit 1; fi"])
let native_lib_linker tags =
if Tags.mem "ocamlmklib" tags then
@@ -175,7 +180,7 @@ let caml_transitive_closure = Ocaml_dependencies.caml_transitive_closure
let link_gen cmX_ext cma_ext a_ext extensions linker tagger cmX out env build =
let cmX = env cmX and out = env out in
let tags = tagger (tags_of_pathname out) in
- let dyndeps = Rule.build_deps_of_tags build tags in
+ let dyndeps = Rule.build_deps_of_tags build (tags++"link_with") in
let cmi = Pathname.update_extensions "cmi" cmX in
prepare_link cmX cmi extensions build;
let libs = prepare_libs cma_ext a_ext out build in
@@ -185,9 +190,15 @@ let link_gen cmX_ext cma_ext a_ext extensions linker tagger cmX out env build =
~caml_obj_ext:cmX_ext ~caml_lib_ext:cma_ext
~used_libraries:libs ~hidden_packages (cmX :: dyndeps) in
let deps = (List.filter (fun l -> not (List.mem l deps)) libs) @ deps in
+
+ (* Hack to avoid linking twice with the standard library. *)
+ let stdlib = "stdlib/stdlib"-.-cma_ext in
+ let is_not_stdlib x = x <> stdlib in
+ let deps = List.filter is_not_stdlib deps in
+
if deps = [] then failwith "Link list cannot be empty";
let () = dprintf 6 "link: %a -o %a" print_string_list deps Pathname.print out in
- linker tags deps out
+ linker (tags++"dont_link_with") deps out
let byte_link_gen = link_gen "cmo" "cma" "cma" ["cmo"; "cmi"]
@@ -258,6 +269,12 @@ let link_units table extensions cmX_ext cma_ext a_ext linker tagger contents_lis
let full_contents = libs @ module_paths in
let deps = List.filter (fun x -> List.mem x full_contents) deps in
let deps = (List.filter (fun l -> not (List.mem l deps)) libs) @ deps in
+
+ (* Hack to avoid linking twice with the standard library. *)
+ let stdlib = "stdlib/stdlib"-.-cma_ext in
+ let is_not_stdlib x = x <> stdlib in
+ let deps = List.filter is_not_stdlib deps in
+
linker tags deps cmX
let link_modules = link_units library_index
diff --git a/ocamlbuild/ocaml_specific.ml b/ocamlbuild/ocaml_specific.ml
index 7c4c91b18..973f610d6 100644
--- a/ocamlbuild/ocaml_specific.ml
+++ b/ocamlbuild/ocaml_specific.ml
@@ -79,6 +79,12 @@ rule "ocaml: mlpack & d.cmo* -> d.cmo & cmi"
~deps:["%.mlpack"; "%.cmi"]
(Ocaml_compiler.byte_debug_pack_mlpack "%.mlpack" "%.d.cmo");;
+rule "ocaml: mlpack & cmo* & cmi -> cmo"
+ ~tags:["ocaml"; "byte"]
+ ~prod:"%.cmo"
+ ~deps:["%.mli"; "%.cmi"; "%.mlpack"]
+ (Ocaml_compiler.byte_pack_mlpack "%.mlpack" "%.cmo");;
+
rule "ocaml: mlpack & cmo* -> cmo & cmi"
~tags:["ocaml"; "byte"]
~prods:["%.cmo"; "%.cmi"]
@@ -308,6 +314,7 @@ flag ["ocaml"; "link"] begin
end;;
flag ["ocaml"; "ocamlyacc"] (atomize !Options.ocaml_yaccflags);;
+flag ["ocaml"; "menhir"] (atomize !Options.ocaml_yaccflags);;
flag ["ocaml"; "ocamllex"] (atomize !Options.ocaml_lexflags);;
@@ -326,6 +333,14 @@ let camlp4_flags camlp4s =
camlp4_flags ["camlp4o"; "camlp4r"; "camlp4of"; "camlp4rf"; "camlp4orf"];;
+let camlp4_flags' camlp4s =
+ List.iter begin fun (camlp4, flags) ->
+ flag ["ocaml"; "pp"; camlp4] flags
+ end camlp4s;;
+
+camlp4_flags' ["camlp4orr", S[A"camlp4of"; A"-parser"; A"reloaded"];
+ "camlp4rrr", S[A"camlp4rf"; A"-parser"; A"reloaded"]];;
+
ocaml_lib ~extern:true ~native:false "dynlink";;
ocaml_lib ~extern:true "unix";;
ocaml_lib ~extern:true "str";;
@@ -333,11 +348,18 @@ ocaml_lib ~extern:true "bigarray";;
ocaml_lib ~extern:true "nums";;
ocaml_lib ~extern:true "dbm";;
ocaml_lib ~extern:true "graphics";;
+ocaml_lib ~extern:true ~tag_name:"use_toplevel" "toplevellib";;
ocaml_lib ~extern:true ~dir:"+labltk" "labltk";;
+ocaml_lib ~extern:true ~dir:"+ocamldoc" "ocamldoc";;
+ocaml_lib ~extern:true ~dir:"+ocamlbuild" ~tag_name:"use_ocamlbuild" "ocamlbuildlib";;
+
ocaml_lib ~extern:true ~dir:"+camlp4" ~tag_name:"use_camlp4" "camlp4lib";;
ocaml_lib ~extern:true ~dir:"+camlp4" ~tag_name:"use_old_camlp4" "camlp4";;
-ocaml_lib ~extern:true ~dir:"+ocamldoc" "ocamldoc";;
-ocaml_lib ~extern:true ~dir:"+ocamlbuild" "ocamlbuild";;
+ocaml_lib ~extern:true ~dir:"+camlp4" ~tag_name:"use_camlp4_full" "camlp4fulllib";;
+flag ["ocaml"; "compile"; "use_camlp4_full"]
+ (S[A"-I"; A"+camlp4/Camlp4Parsers";
+ A"-I"; A"+camlp4/Camlp4Printers";
+ A"-I"; A"+camlp4/Camlp4Filters"]);;
flag ["ocaml"; "debug"; "compile"; "byte"] (A "-g");;
flag ["ocaml"; "debug"; "link"; "byte"; "program"] (A "-g");;
@@ -345,8 +367,11 @@ flag ["ocaml"; "debug"; "pack"; "byte"] (A "-g");;
flag ["ocaml"; "debug"; "compile"; "native"] (A "-g");;
flag ["ocaml"; "debug"; "link"; "native"; "program"] (A "-g");;
flag ["ocaml"; "debug"; "pack"; "native"] (A "-g");;
+flag ["ocaml"; "link"; "native"; "output_obj"] (A"-output-obj");;
+flag ["ocaml"; "link"; "byte"; "output_obj"] (A"-output-obj");;
flag ["ocaml"; "dtypes"; "compile"] (A "-dtypes");;
flag ["ocaml"; "rectypes"; "compile"] (A "-rectypes");;
+flag ["ocaml"; "rectypes"; "infer_interface"] (A "-rectypes");;
flag ["ocaml"; "linkall"; "link"] (A "-linkall");;
flag ["ocaml"; "link"; "profile"; "native"] (A "-p");;
flag ["ocaml"; "link"; "program"; "custom"; "byte"] (A "-custom");;
@@ -382,11 +407,13 @@ flag ["ocaml"; "doc"; "docfile"; "extension:texi"] (A"-texi");;
(** 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"
~prod:"%ocamlbuild_where.ml"
- ~cache:(fun _ -> !*install_lib)
+ ~cache:(fun _ _ -> Printf.sprintf "lib:%S, bin:%S" !*install_lib !*install_bin)
begin fun _ oc ->
- Printf.fprintf oc "let where = ref %S;;\n" !*install_lib
+ Printf.fprintf oc "let bindir = ref %S;;\n" !*install_bin;
+ Printf.fprintf oc "let libdir = ref %S;;\n" !*install_lib
end;;
ocaml_lib "ocamlbuildlib";;
ocaml_lib "ocamlbuildlightlib";;
diff --git a/ocamlbuild/ocaml_tools.ml b/ocamlbuild/ocaml_tools.ml
index 365d3de4d..2a17b128d 100644
--- a/ocamlbuild/ocaml_tools.ml
+++ b/ocamlbuild/ocaml_tools.ml
@@ -20,7 +20,8 @@ open Ocaml_utils
let ocamlyacc mly env _build =
let mly = env mly in
- Cmd(S[!Options.ocamlyacc; T(tags_of_pathname mly++"ocaml"++"parser"++"ocamlyacc");
+ let ocamlyacc = if !Options.ocamlyacc = N then V"OCAMLYACC" else !Options.ocamlyacc in
+ Cmd(S[ocamlyacc; T(tags_of_pathname mly++"ocaml"++"parser"++"ocamlyacc");
flags_of_pathname mly; Px mly])
let ocamllex mll env _build =
@@ -30,14 +31,18 @@ let ocamllex mll env _build =
let infer_interface ml mli env build =
let ml = env ml and mli = env mli in
+ let tags = tags_of_pathname ml++"ocaml" in
Ocaml_compiler.prepare_compile build ml;
- Cmd(S[!Options.ocamlc; ocaml_include_flags ml; A"-i";
- T(tags_of_pathname ml++"ocaml"++"infer_interface"); P ml; Sh">"; Px mli])
+ Cmd(S[!Options.ocamlc; ocaml_ppflags tags; ocaml_include_flags ml; A"-i";
+ T(tags++"infer_interface"); P ml; Sh">"; Px mli])
let menhir mly env build =
let mly = env mly in
+ let menhir = if !Options.ocamlyacc = N then V"MENHIR" else !Options.ocamlyacc in
Ocaml_compiler.prepare_compile build mly;
- Cmd(S[!Options.ocamlyacc; T(tags_of_pathname mly++"ocaml"++"parser"++"menhir");
+ Cmd(S[menhir;
+ A"--ocamlc"; Quote(S[!Options.ocamlc; ocaml_include_flags mly]);
+ T(tags_of_pathname mly++"ocaml"++"parser"++"menhir");
A"--infer"; flags_of_pathname mly; Px mly])
let ocamldoc_c tags arg odoc =
diff --git a/ocamlbuild/ocaml_utils.ml b/ocamlbuild/ocaml_utils.ml
index 6eaff007b..3174819cf 100644
--- a/ocamlbuild/ocaml_utils.ml
+++ b/ocamlbuild/ocaml_utils.ml
@@ -52,11 +52,14 @@ let module_importance modpath x =
else if ignore_stdlib x then `just_try else `mandatory
let expand_module include_dirs module_name exts =
+ let dirname = Pathname.dirname module_name in
+ let basename = Pathname.basename module_name in
+ let module_name_cap = dirname/(String.capitalize basename) in
+ let module_name_uncap = dirname/(String.uncapitalize basename) in
List.fold_right begin fun include_dir ->
List.fold_right begin fun ext acc ->
- let module_name_ext = module_name-.-ext in
- include_dir/(String.uncapitalize module_name_ext) ::
- include_dir/(String.capitalize module_name_ext) :: acc
+ include_dir/(module_name_uncap-.-ext) ::
+ include_dir/(module_name_cap-.-ext) :: acc
end exts
end include_dirs []
@@ -96,10 +99,15 @@ let ocaml_lib ?(extern=false) ?(byte=true) ?(native=true) ?dir ?tag_name libpath
| None -> "use_" ^ Pathname.basename libpath
in
Hashtbl.replace info_libraries tag_name (libpath, extern);
- if byte then
- flag ["ocaml"; tag_name; "link"; "byte"] (add_dir (A (libpath^".cma")));
- if native then
- flag ["ocaml"; tag_name; "link"; "native"] (add_dir (A (libpath^".cmxa")));
+ if extern then begin
+ if byte then
+ flag ["ocaml"; tag_name; "link"; "byte"] (add_dir (A (libpath^".cma")));
+ if native then
+ flag ["ocaml"; tag_name; "link"; "native"] (add_dir (A (libpath^".cmxa")));
+ end else begin
+ if not byte && not native then
+ invalid_arg "ocaml_lib: ~byte:false or ~native:false only works with ~extern:true";
+ end;
match dir with
| None -> ()
| Some dir -> flag ["ocaml"; tag_name; "compile"] (S[A"-I"; P dir])
diff --git a/ocamlbuild/ocamlbuild-presentation.rslide b/ocamlbuild/ocamlbuild-presentation.rslide
index 547cd6874..4dc529f8d 100644
--- a/ocamlbuild/ocamlbuild-presentation.rslide
+++ b/ocamlbuild/ocamlbuild-presentation.rslide
@@ -66,6 +66,7 @@ slide "What does ocamlbuild provide?" do
* Supports multiple build directories
* Automatic and safe cleaning
* A source directory uncluttered by object files
+ * A portable tool shipped with OCaml
end
overlay 2 do
* Saves time and money!
diff --git a/ocamlbuild/ocamlbuild_where.mli b/ocamlbuild/ocamlbuild_where.mli
index ba8b3a720..157536f77 100644
--- a/ocamlbuild/ocamlbuild_where.mli
+++ b/ocamlbuild/ocamlbuild_where.mli
@@ -10,5 +10,8 @@
(***********************************************************************)
(* $Id$ *)
+
(* Original author: Nicolas Pouillard *)
-val where : string ref
+
+val bindir : string ref
+val libdir : string ref
diff --git a/ocamlbuild/ocamldep.ml b/ocamlbuild/ocamldep.ml
index 86d420dc1..bbabc5e85 100644
--- a/ocamlbuild/ocamldep.ml
+++ b/ocamlbuild/ocamldep.ml
@@ -27,13 +27,14 @@ let ocamldep_command arg =
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
- Cmd (S [!Options.ocamlyacc; T tags; A"--raw-depend";
- A"--ocamldep"; Quote (ocamldep_command arg);
- P arg; Sh ">"; Px out])
+ S [menhir; T tags; A"--raw-depend";
+ A"--ocamldep"; Quote (ocamldep_command arg);
+ P arg; Sh ">"; Px out]
let ocamldep_command arg out =
- Cmd (S[ocamldep_command arg; P arg; Sh ">"; Px out])
+ S[ocamldep_command arg; P arg; Sh ">"; Px out]
let module_dependencies = Hashtbl.create 103
let module_dependencies_of module_path =
@@ -49,11 +50,16 @@ let register_module_dependencies module_path deps =
let depends name ?tags ~prod ~dep ?insert ?(ocamldep_command=ocamldep_command) () =
Rule.custom_rule name ?tags ~prod ~dep ?insert
- ~cache:(fun env -> Command.to_string (ocamldep_command (env dep) (env prod)))
+ ~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 = ocamldep_command arg out 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))
diff --git a/ocamlbuild/ocamldep.mli b/ocamlbuild/ocamldep.mli
index 05fce25ad..c0796c67c 100644
--- a/ocamlbuild/ocamldep.mli
+++ b/ocamlbuild/ocamldep.mli
@@ -12,8 +12,8 @@
(* $Id$ *)
(* Original author: Nicolas Pouillard *)
exception Error of string
-val ocamldep_command : Pathname.t -> Pathname.t -> Command.t
-val menhir_ocamldep_command : Pathname.t -> Pathname.t -> Command.t
+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 :
@@ -22,5 +22,5 @@ val depends :
prod:string ->
dep:string ->
?insert:[`top | `before of string | `after of string | `bottom] ->
- ?ocamldep_command:(Pathname.t -> Pathname.t -> Command.t) ->
+ ?ocamldep_command:(Pathname.t -> Pathname.t -> Command.spec) ->
unit -> unit
diff --git a/ocamlbuild/options.ml b/ocamlbuild/options.ml
index c7395e335..ed42a6a14 100644
--- a/ocamlbuild/options.ml
+++ b/ocamlbuild/options.ml
@@ -37,14 +37,40 @@ let make_links = ref true
let nostdlib = ref false
let use_menhir = ref false
let catch_errors = ref true
-let ocamlc = ref (A"ocamlc.opt")
-let ocamlopt = ref (A"ocamlopt.opt")
-let ocamldep = ref (A"ocamldep.opt")
-let ocamldoc = ref (A"ocamldoc.opt")
-let ocamlyacc = ref (A"ocamlyacc")
-let ocamllex = ref (A"ocamllex")
-let ocamlmklib = ref (A"ocamlmklib")
-let ocamlmktop = ref (A"ocamlmktop")
+
+let mk_virtual_solvers =
+ let dir = Ocamlbuild_where.bindir in
+ List.iter begin fun cmd ->
+ let opt = cmd ^ ".opt" in
+ let a_opt = A opt in
+ let a_cmd = A cmd in
+ let search_in_path = memo Command.search_in_path in
+ let solver () =
+ if sys_file_exists !dir then
+ let long = filename_concat !dir cmd in
+ let long_opt = long ^ ".opt" in
+ if sys_file_exists long_opt then A long_opt
+ else if sys_file_exists long then A long
+ else try let _ = search_in_path opt in a_opt
+ with Not_found -> a_cmd
+ else
+ try let _ = search_in_path opt in a_opt
+ with Not_found -> a_cmd
+ in Command.setup_virtual_command_solver (String.uppercase cmd) solver
+ end
+
+let () =
+ mk_virtual_solvers
+ ["ocamlc"; "ocamlopt"; "ocamldep"; "ocamldoc";
+ "ocamlyacc"; "menhir"; "ocamllex"; "ocamlmklib"; "ocamlmktop"]
+let ocamlc = ref (V"OCAMLC")
+let ocamlopt = ref (V"OCAMLOPT")
+let ocamldep = ref (V"OCAMLDEP")
+let ocamldoc = ref (V"OCAMLDOC")
+let ocamlyacc = ref N
+let ocamllex = ref (V"OCAMLLEX")
+let ocamlmklib = ref (V"OCAMLMKLIB")
+let ocamlmktop = ref (V"OCAMLMKTOP")
let ocamlrun = ref N
let program_to_execute = ref false
let must_clean = ref false
@@ -63,6 +89,7 @@ let ocaml_lexflags_internal = ref []
let program_args_internal = ref []
let ignore_list_internal = ref []
let tags_internal = ref [["quiet"]]
+let tag_lines_internal = ref []
let show_tags_internal = ref []
let my_include_dirs = ref [[Filename.current_dir_name]]
@@ -124,6 +151,7 @@ let spec =
"-pp", String (add_to ocaml_ppflags_internal), "<flag,...> (idem)";
"-tag", String (add_to' tags_internal), "<tag> Add to default tags";
"-tags", String (add_to tags_internal), "<tag,...> (idem)";
+ "-tag-line", String (add_to' tag_lines_internal), "<tag> Use this line of tags (as in _tags)";
"-show-tags", String (add_to' show_tags_internal), "<path> Show tags that applies on that pathname";
"-ignore", String (add_to ignore_list_internal), "<module,...> Don't try to build these modules";
@@ -139,14 +167,14 @@ let spec =
"-no-sanitize", Clear sanitize, " Do not generate sanitization script";
"-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", Unit(fun () -> use_menhir := true; ocamlyacc := A"menhir"),
- " Use menhir instead of ocamlyacc";
+ "-use-menhir", Set use_menhir, " Use menhir instead of ocamlyacc";
"-j", Set_int Command.jobs, "<N> Allow N jobs at once (0 for unlimited)";
"-build-dir", Set_string build_dir, "<path> Set build directory";
- "-install-dir", Set_string Ocamlbuild_where.where, "<path> Set the install directory";
- "-where", Unit (fun () -> print_endline !Ocamlbuild_where.where; raise Exit_OK), " Display the install directory";
+ "-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";
"-ocamlc", set_cmd ocamlc, "<command> Set the OCaml bytecode compiler";
"-ocamlopt", set_cmd ocamlopt, "<command> Set the OCaml native compiler";
@@ -173,6 +201,7 @@ let ocaml_lexflags = ref []
let program_args = ref []
let ignore_list = ref []
let tags = ref []
+let tag_lines = ref []
let show_tags = ref []
let init () =
@@ -191,6 +220,7 @@ let init () =
reorder ocaml_lexflags ocaml_lexflags_internal;
reorder program_args program_args_internal;
reorder tags tags_internal;
+ reorder tag_lines tag_lines_internal;
reorder ignore_list ignore_list_internal;
reorder show_tags show_tags_internal;
diff --git a/ocamlbuild/pathname.ml b/ocamlbuild/pathname.ml
index 24793ddfb..f2c2d85a2 100644
--- a/ocamlbuild/pathname.ml
+++ b/ocamlbuild/pathname.ml
@@ -103,6 +103,7 @@ let clean_up_links entry =
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
@@ -145,25 +146,6 @@ let root = mk "__root__"
let context_table = Hashtbl.create 107
-let merge_include_dirs a b =
- let rec aux a b =
- match a, b with
- | [], _ -> b
- | _, [] -> a
- | _, x::xs ->
- if List.mem x a then aux a xs
- else aux (x :: a) xs
- in List.rev (aux (List.rev a) b)
-
-let define_context dir context =
- let dir = if dir = "" then current_dir_name else dir in
- try
- let context = merge_include_dirs context (Hashtbl.find context_table dir) in
- Hashtbl.replace context_table dir context
- with Not_found ->
- let context = merge_include_dirs context (!Options.include_dirs) in
- Hashtbl.add context_table dir context
-
let rec include_dirs_of dir =
try Hashtbl.find context_table dir
with Not_found -> dir :: List.filter (fun dir' -> dir <> dir') !Options.include_dirs
@@ -175,6 +157,10 @@ let include_dirs_of s =
in res
*)
+let define_context dir context =
+ 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
diff --git a/ocamlbuild/plugin.ml b/ocamlbuild/plugin.ml
index 88516d517..bc10a3e21 100644
--- a/ocamlbuild/plugin.ml
+++ b/ocamlbuild/plugin.ml
@@ -76,7 +76,7 @@ module Make(U:sig end) =
in
let ocamlbuildlib = ocamlbuildlib-.-cma in
let ocamlbuild = ocamlbuild-.-cmo in
- let dir = !Ocamlbuild_where.where 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);
let dir = if Pathname.is_implicit dir then Pathname.pwd/dir else dir in
diff --git a/ocamlbuild/rule.ml b/ocamlbuild/rule.ml
index e8fc50dc9..e14083cbe 100644
--- a/ocamlbuild/rule.ml
+++ b/ocamlbuild/rule.ml
@@ -97,9 +97,10 @@ let exists2 find p rs =
let all_deps_of_tags = ref []
let cons deps acc =
- List.fold_left begin fun acc dep ->
- if List.mem dep acc then acc else dep :: acc
- end acc deps
+ List.rev&
+ List.fold_left begin fun acc dep ->
+ if List.mem dep acc then acc else dep :: acc
+ end acc deps
let deps_of_tags tags =
List.fold_left begin fun acc (xtags, xdeps) ->
@@ -270,21 +271,22 @@ let rule name ?(tags=[]) ?(prods=[]) ?(deps=[]) ?prod ?dep ?(insert = `bottom) c
code = code }
let file_rule name ?tags ~prod ?deps ?dep ?insert ~cache action =
- rule name ?tags ~prod ?dep ?deps ?insert begin fun env _ ->
- raise (Code_digest (cache env, (fun cached ->
+ 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 _ ->
- raise (Code_digest (cache env, fun cached -> action env ~cached))
+ 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 cp src dest = Cmd (S [A"cp"; P src; Px dest])
+ let cp_p src dest = Cmd (S [A"cp"; A"-p"; 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])
@@ -296,5 +298,5 @@ open Common_commands
let copy_rule name ?insert src dest =
rule name ?insert ~prod:dest ~dep:src
- (fun env _ -> cp (env src) (env dest))
+ (fun env _ -> cp_p (env src) (env dest))
diff --git a/ocamlbuild/rule.mli b/ocamlbuild/rule.mli
index 87206bf92..95ac6d374 100644
--- a/ocamlbuild/rule.mli
+++ b/ocamlbuild/rule.mli
@@ -40,7 +40,7 @@ val file_rule : string ->
?deps:string list ->
?dep:string ->
?insert:[`top | `before of string | `after of string | `bottom] ->
- cache:(env -> string) ->
+ cache:(env -> builder -> string) ->
(env -> out_channel -> unit) -> unit
val custom_rule : string ->
@@ -50,7 +50,7 @@ val custom_rule : string ->
?deps:string list ->
?dep:string ->
?insert:[`top | `before of string | `after of string | `bottom] ->
- cache:(env -> string) ->
+ cache:(env -> builder -> string) ->
(env -> cached:bool -> unit) -> unit
(** [copy_rule name ?insert source destination] *)
@@ -64,6 +64,7 @@ val dep : string list -> string list -> unit
module Common_commands : sig
val mv : Pathname.t -> Pathname.t -> Command.t
val cp : Pathname.t -> Pathname.t -> Command.t
+ val cp_p : Pathname.t -> Pathname.t -> Command.t
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
diff --git a/ocamlbuild/shell.ml b/ocamlbuild/shell.ml
index 9c056ff39..73deaf4bc 100644
--- a/ocamlbuild/shell.ml
+++ b/ocamlbuild/shell.ml
@@ -27,11 +27,12 @@ let quote_filename_if_needed s =
let chdir dir =
reset_filesys_cache ();
Sys.chdir dir
-let run args =
+let run args target =
reset_readdir_cache ();
let cmd = String.concat " " (List.map quote_filename_if_needed args) in
if !*My_unix.is_degraded || Sys.os_type = "Win32" then
begin
+ Log.event cmd target Tags.empty;
let st = sys_command cmd in
if st <> 0 then
failwith (Printf.sprintf "Error during command `%s'.\nExit code %d.\n" cmd st)
@@ -49,23 +50,32 @@ let rm_f x =
let mkdir dir =
reset_filesys_cache_for_file dir;
(*Sys.mkdir dir (* MISSING in ocaml *) *)
- run ["mkdir"; dir]
+ run ["mkdir"; dir] dir
let try_mkdir dir = if not (sys_file_exists dir) then mkdir dir
let rec mkdir_p dir =
if sys_file_exists dir then ()
else (mkdir_p (Filename.dirname dir); mkdir dir)
-let cp = copy_file (* Décret du 2007-02-01 *)
-(*
- let cp src dest =
+
+let cp_pf src dest =
reset_filesys_cache_for_file dest;
- run["cp";"-pf";src;dest]*)
+ run["cp";"-pf";src;dest] dest
+
+(* L'Arrêté du 2007-03-07 prend en consideration
+ differement les archives. Pour les autres fichiers
+ le décret du 2007-02-01 est toujours valable :-) *)
+let cp src dst =
+ if Filename.check_suffix src ".a"
+ && Filename.check_suffix dst ".a"
+ then cp_pf src dst
+ else copy_file src dst
+
let readlink = My_unix.readlink
let is_link = My_unix.is_link
let rm_rf x =
reset_filesys_cache ();
- run["rm";"-Rf";x]
+ run["rm";"-Rf";x] x
let mv src dest =
reset_filesys_cache_for_file src;
reset_filesys_cache_for_file dest;
- run["mv"; src; dest]
+ run["mv"; src; dest] dest
(*Sys.rename src dest*)
diff --git a/ocamlbuild/signatures.mli b/ocamlbuild/signatures.mli
index 59a2e72ca..0cc06cbbe 100644
--- a/ocamlbuild/signatures.mli
+++ b/ocamlbuild/signatures.mli
@@ -64,7 +64,7 @@ module type STRING = sig
val eq_sub_strings : string -> int -> string -> int -> int -> bool
- (** [is_prefix u v] is v a prefix of u ? *)
+ (** [is_prefix u v] is u a prefix of v ? *)
val is_prefix : string -> string -> bool
(** [is_suffix u v] : is v a suffix of u ? *)
val is_suffix : string -> string -> bool
@@ -372,6 +372,7 @@ module type OPTIONS = sig
val program_args : string list ref
val ignore_list : string list ref
val tags : string list ref
+ val tag_lines : string list ref
val show_tags : string list ref
val ext_obj : string ref
@@ -452,7 +453,7 @@ module type PLUGIN = sig
?deps:string list ->
?dep:string ->
?insert:[`top | `before of string | `after of string | `bottom] ->
- cache:(env -> string) ->
+ cache:(env -> builder -> string) ->
(env -> out_channel -> unit) -> unit
val custom_rule : string ->
@@ -462,7 +463,7 @@ module type PLUGIN = sig
?deps:string list ->
?dep:string ->
?insert:[`top | `before of string | `after of string | `bottom] ->
- cache:(env -> string) ->
+ cache:(env -> builder -> string) ->
(env -> cached:bool -> unit) -> unit
(** [copy_rule name ?insert source destination] *)
diff --git a/ocamlbuild/start.sh b/ocamlbuild/start.sh
index e75fa1f50..d2525717f 100755
--- a/ocamlbuild/start.sh
+++ b/ocamlbuild/start.sh
@@ -5,7 +5,7 @@ rm -rf _start
mkdir _start
cp *.ml* _start
cd _start
-echo "let where = ref \"<start>\";;" > ocamlbuild_where.ml
+echo "let bindir = ref \"<start>\";; let libdir = bindir;;" > ocamlbuild_where.ml
ocamlc -c std_signatures.mli
ocamlc -c signatures.mli
ocamlc -c tags.mli
diff --git a/ocamlbuild/test/good-output b/ocamlbuild/test/good-output
index 6d1054880..553e4ef4f 100644
--- a/ocamlbuild/test/good-output
+++ b/ocamlbuild/test/good-output
@@ -12,26 +12,26 @@
+ cp vivi1.ml vivi.ml
+ ../../_build/ocamlbuild.native toto.byte toto.native -no-skip -classic-display -- -help
ocamldep.opt -modules toto.ml > toto.ml.depends
-ocamldep.opt -modules tutu.mli > tutu.mli.depends
-ocamldep.opt -modules titi.ml > titi.ml.depends
ocamldep.opt -modules tata.mli > tata.mli.depends
-ocamlc.opt -c -o tutu.cmi tutu.mli
-ocamlc.opt -c -o titi.cmo titi.ml
+ocamldep.opt -modules titi.ml > titi.ml.depends
+ocamldep.opt -modules tutu.mli > tutu.mli.depends
ocamlc.opt -c -o tata.cmi tata.mli
+ocamlc.opt -c -o titi.cmo titi.ml
+ocamlc.opt -c -o tutu.cmi tutu.mli
ocamlc.opt -c -o toto.cmo toto.ml
+ocamldep.opt -modules tata.ml > tata.ml.depends
ocamldep.opt -modules tutu.ml > tutu.ml.depends
-ocamldep.opt -pp camlp4o -modules vivi.ml > vivi.ml.depends
ocamldep.opt -modules tyty.mli > tyty.mli.depends
-ocamlc.opt -c -pp camlp4o -o vivi.cmo vivi.ml
+ocamldep.opt -pp camlp4o -modules vivi.ml > vivi.ml.depends
ocamlc.opt -c -o tyty.cmi tyty.mli
-ocamldep.opt -modules tata.ml > tata.ml.depends
-ocamlc.opt -c -o tutu.cmo tutu.ml
+ocamlc.opt -c -pp camlp4o -o vivi.cmo vivi.ml
ocamlc.opt -c -o tata.cmo tata.ml
+ocamlc.opt -c -o tutu.cmo tutu.ml
ocamlc.opt tata.cmo titi.cmo vivi.cmo tutu.cmo toto.cmo -o toto.byte
ocamlopt.opt -c -pp camlp4o -o vivi.cmx vivi.ml
-ocamlopt.opt -c -o tutu.cmx tutu.ml
-ocamlopt.opt -c -o titi.cmx titi.ml
ocamlopt.opt -c -o tata.cmx tata.ml
+ocamlopt.opt -c -o titi.cmx titi.ml
+ocamlopt.opt -c -o tutu.cmx tutu.ml
ocamlopt.opt -c -o toto.cmx toto.ml
ocamlopt.opt tata.cmx titi.cmx vivi.cmx tutu.cmx toto.cmx -o toto.native
Warning: Using -- only run the last target
@@ -40,26 +40,26 @@ Tutu.tutu => 1
Tata.tata => "TATA2"
+ ../../_build/ocamlbuild.native toto.byte toto.native -no-skip -classic-display -verbose 0 -nothing-should-be-rebuilt -- -help
[cache hit] ocamldep.opt -modules toto.ml > toto.ml.depends
-[cache hit] ocamldep.opt -modules tutu.mli > tutu.mli.depends
-[cache hit] ocamlc.opt -c -o tutu.cmi tutu.mli
-[cache hit] ocamldep.opt -modules titi.ml > titi.ml.depends
-[cache hit] ocamlc.opt -c -o titi.cmo titi.ml
[cache hit] ocamldep.opt -modules tata.mli > tata.mli.depends
[cache hit] ocamlc.opt -c -o tata.cmi tata.mli
+[cache hit] ocamldep.opt -modules titi.ml > titi.ml.depends
+[cache hit] ocamlc.opt -c -o titi.cmo titi.ml
+[cache hit] ocamldep.opt -modules tutu.mli > tutu.mli.depends
+[cache hit] ocamlc.opt -c -o tutu.cmi tutu.mli
[cache hit] ocamlc.opt -c -o toto.cmo toto.ml
+[cache hit] ocamldep.opt -modules tata.ml > tata.ml.depends
+[cache hit] ocamlc.opt -c -o tata.cmo tata.ml
[cache hit] ocamldep.opt -modules tutu.ml > tutu.ml.depends
-[cache hit] ocamldep.opt -pp camlp4o -modules vivi.ml > vivi.ml.depends
-[cache hit] ocamlc.opt -c -pp camlp4o -o vivi.cmo vivi.ml
[cache hit] ocamldep.opt -modules tyty.mli > tyty.mli.depends
[cache hit] ocamlc.opt -c -o tyty.cmi tyty.mli
+[cache hit] ocamldep.opt -pp camlp4o -modules vivi.ml > vivi.ml.depends
+[cache hit] ocamlc.opt -c -pp camlp4o -o vivi.cmo vivi.ml
[cache hit] ocamlc.opt -c -o tutu.cmo tutu.ml
-[cache hit] ocamldep.opt -modules tata.ml > tata.ml.depends
-[cache hit] ocamlc.opt -c -o tata.cmo tata.ml
[cache hit] ocamlc.opt tata.cmo titi.cmo vivi.cmo tutu.cmo toto.cmo -o toto.byte
+[cache hit] ocamlopt.opt -c -o tata.cmx tata.ml
+[cache hit] ocamlopt.opt -c -o titi.cmx titi.ml
[cache hit] ocamlopt.opt -c -pp camlp4o -o vivi.cmx vivi.ml
[cache hit] ocamlopt.opt -c -o tutu.cmx tutu.ml
-[cache hit] ocamlopt.opt -c -o titi.cmx titi.ml
-[cache hit] ocamlopt.opt -c -o tata.cmx tata.ml
[cache hit] ocamlopt.opt -c -o toto.cmx toto.ml
[cache hit] ocamlopt.opt tata.cmx titi.cmx vivi.cmx tutu.cmx toto.cmx -o toto.native
Warning: Using -- only run the last target
@@ -79,26 +79,26 @@ Tutu.tutu => 1
Tata.tata => "TATA2"
+ ../../_build/ocamlbuild.native toto.byte toto.native -no-skip -classic-display -verbose 0 -nothing-should-be-rebuilt -- -help
[cache hit] ocamldep.opt -modules toto.ml > toto.ml.depends
-[cache hit] ocamldep.opt -modules tutu.mli > tutu.mli.depends
-[cache hit] ocamlc.opt -c -o tutu.cmi tutu.mli
-[cache hit] ocamldep.opt -modules titi.ml > titi.ml.depends
-[cache hit] ocamlc.opt -c -o titi.cmo titi.ml
[cache hit] ocamldep.opt -modules tata.mli > tata.mli.depends
[cache hit] ocamlc.opt -c -o tata.cmi tata.mli
+[cache hit] ocamldep.opt -modules titi.ml > titi.ml.depends
+[cache hit] ocamlc.opt -c -o titi.cmo titi.ml
+[cache hit] ocamldep.opt -modules tutu.mli > tutu.mli.depends
+[cache hit] ocamlc.opt -c -o tutu.cmi tutu.mli
[cache hit] ocamlc.opt -c -o toto.cmo toto.ml
+[cache hit] ocamldep.opt -modules tata.ml > tata.ml.depends
+[cache hit] ocamlc.opt -c -o tata.cmo tata.ml
[cache hit] ocamldep.opt -modules tutu.ml > tutu.ml.depends
-[cache hit] ocamldep.opt -pp camlp4o -modules vivi.ml > vivi.ml.depends
-[cache hit] ocamlc.opt -c -pp camlp4o -o vivi.cmo vivi.ml
[cache hit] ocamldep.opt -modules tyty.mli > tyty.mli.depends
[cache hit] ocamlc.opt -c -o tyty.cmi tyty.mli
+[cache hit] ocamldep.opt -pp camlp4o -modules vivi.ml > vivi.ml.depends
+[cache hit] ocamlc.opt -c -pp camlp4o -o vivi.cmo vivi.ml
[cache hit] ocamlc.opt -c -o tutu.cmo tutu.ml
-[cache hit] ocamldep.opt -modules tata.ml > tata.ml.depends
-[cache hit] ocamlc.opt -c -o tata.cmo tata.ml
[cache hit] ocamlc.opt tata.cmo titi.cmo vivi.cmo tutu.cmo toto.cmo -o toto.byte
+[cache hit] ocamlopt.opt -c -o tata.cmx tata.ml
+[cache hit] ocamlopt.opt -c -o titi.cmx titi.ml
[cache hit] ocamlopt.opt -c -pp camlp4o -o vivi.cmx vivi.ml
[cache hit] ocamlopt.opt -c -o tutu.cmx tutu.ml
-[cache hit] ocamlopt.opt -c -o titi.cmx titi.ml
-[cache hit] ocamlopt.opt -c -o tata.cmx tata.ml
[cache hit] ocamlopt.opt -c -o toto.cmx toto.ml
[cache hit] ocamlopt.opt tata.cmx titi.cmx vivi.cmx tutu.cmx toto.cmx -o toto.native
Warning: Using -- only run the last target
@@ -121,26 +121,26 @@ Tutu.tutu => 2
Tata.tata => "TATA2"
+ ../../_build/ocamlbuild.native toto.byte toto.native -no-skip -classic-display -verbose 0 -nothing-should-be-rebuilt -- -help
[cache hit] ocamldep.opt -modules toto.ml > toto.ml.depends
-[cache hit] ocamldep.opt -modules tutu.mli > tutu.mli.depends
-[cache hit] ocamlc.opt -c -o tutu.cmi tutu.mli
-[cache hit] ocamldep.opt -modules titi.ml > titi.ml.depends
-[cache hit] ocamlc.opt -c -o titi.cmo titi.ml
[cache hit] ocamldep.opt -modules tata.mli > tata.mli.depends
[cache hit] ocamlc.opt -c -o tata.cmi tata.mli
+[cache hit] ocamldep.opt -modules titi.ml > titi.ml.depends
+[cache hit] ocamlc.opt -c -o titi.cmo titi.ml
+[cache hit] ocamldep.opt -modules tutu.mli > tutu.mli.depends
+[cache hit] ocamlc.opt -c -o tutu.cmi tutu.mli
[cache hit] ocamlc.opt -c -o toto.cmo toto.ml
+[cache hit] ocamldep.opt -modules tata.ml > tata.ml.depends
+[cache hit] ocamlc.opt -c -o tata.cmo tata.ml
[cache hit] ocamldep.opt -modules tutu.ml > tutu.ml.depends
-[cache hit] ocamldep.opt -pp camlp4o -modules vivi.ml > vivi.ml.depends
-[cache hit] ocamlc.opt -c -pp camlp4o -o vivi.cmo vivi.ml
[cache hit] ocamldep.opt -modules tyty.mli > tyty.mli.depends
[cache hit] ocamlc.opt -c -o tyty.cmi tyty.mli
+[cache hit] ocamldep.opt -pp camlp4o -modules vivi.ml > vivi.ml.depends
+[cache hit] ocamlc.opt -c -pp camlp4o -o vivi.cmo vivi.ml
[cache hit] ocamlc.opt -c -o tutu.cmo tutu.ml
-[cache hit] ocamldep.opt -modules tata.ml > tata.ml.depends
-[cache hit] ocamlc.opt -c -o tata.cmo tata.ml
[cache hit] ocamlc.opt tata.cmo titi.cmo vivi.cmo tutu.cmo toto.cmo -o toto.byte
+[cache hit] ocamlopt.opt -c -o tata.cmx tata.ml
+[cache hit] ocamlopt.opt -c -o titi.cmx titi.ml
[cache hit] ocamlopt.opt -c -pp camlp4o -o vivi.cmx vivi.ml
[cache hit] ocamlopt.opt -c -o tutu.cmx tutu.ml
-[cache hit] ocamlopt.opt -c -o titi.cmx titi.ml
-[cache hit] ocamlopt.opt -c -o tata.cmx tata.ml
[cache hit] ocamlopt.opt -c -o toto.cmx toto.ml
[cache hit] ocamlopt.opt tata.cmx titi.cmx vivi.cmx tutu.cmx toto.cmx -o toto.native
Warning: Using -- only run the last target
@@ -159,9 +159,9 @@ Tata.tata => "TATA2"
+ BUILD2=../../_build/ocamlbuild.native a.byte a.native proj.docdir/index.html -no-skip -classic-display -verbose 0 -nothing-should-be-rebuilt
+ rm -rf _build
+ ../../_build/ocamlbuild.native a.byte a.native proj.docdir/index.html -no-skip -classic-display
-ocamldep.opt -modules a.ml > a.ml.depends
ocamldep.opt -modules a.mli > a.mli.depends
ocamlc.opt -c -o a.cmi a.mli
+ocamldep.opt -modules a.ml > a.ml.depends
ocamldep.opt -modules b.mli > b.mli.depends
ocamlc.opt -c -o b.cmi b.mli
ocamlc.opt -c -o a.cmo a.ml
@@ -201,9 +201,9 @@ rm -rf proj.docdir
mkdir -p proj.docdir
ocamldoc.opt -load a.odoc -load b.odoc -load c.odoc -load d.odoc -load e.odoc -load f.odoc -html -d proj.docdir
+ ../../_build/ocamlbuild.native a.byte a.native proj.docdir/index.html -no-skip -classic-display -verbose 0 -nothing-should-be-rebuilt
-[cache hit] ocamldep.opt -modules a.ml > a.ml.depends
[cache hit] ocamldep.opt -modules a.mli > a.mli.depends
[cache hit] ocamlc.opt -c -o a.cmi a.mli
+[cache hit] ocamldep.opt -modules a.ml > a.ml.depends
[cache hit] ocamldep.opt -modules b.mli > b.mli.depends
[cache hit] ocamlc.opt -c -o b.cmi b.mli
[cache hit] ocamlc.opt -c -o a.cmo a.ml
@@ -254,9 +254,9 @@ ocamldoc.opt -load a.odoc -load b.odoc -load c.odoc -load d.odoc -load e.odoc -l
+ BUILD2=../../_build/ocamlbuild.native -I a -I b aa.byte aa.native -no-skip -classic-display -verbose 0 -nothing-should-be-rebuilt
+ rm -rf _build
+ ../../_build/ocamlbuild.native -I a -I b aa.byte aa.native -no-skip -classic-display
-ocamldep.opt -modules a/aa.ml > a/aa.ml.depends
ocamldep.opt -modules a/aa.mli > a/aa.mli.depends
ocamlc.opt -c -I a -I b -o a/aa.cmi a/aa.mli
+ocamldep.opt -modules a/aa.ml > a/aa.ml.depends
ocamldep.opt -modules b/bb.ml > b/bb.ml.depends
ocamlc.opt -c -I b -I a -o b/bb.cmo b/bb.ml
ocamlc.opt -c -I a -I b -o a/aa.cmo a/aa.ml
@@ -265,9 +265,9 @@ ocamlopt.opt -c -I b -I a -o b/bb.cmx b/bb.ml
ocamlopt.opt -c -I a -I b -o a/aa.cmx a/aa.ml
ocamlopt.opt str.cmxa b/bb.cmx a/aa.cmx -o a/aa.native
+ ../../_build/ocamlbuild.native -I a -I b aa.byte aa.native -no-skip -classic-display -verbose 0 -nothing-should-be-rebuilt
-[cache hit] ocamldep.opt -modules a/aa.ml > a/aa.ml.depends
[cache hit] ocamldep.opt -modules a/aa.mli > a/aa.mli.depends
[cache hit] ocamlc.opt -c -I a -I b -o a/aa.cmi a/aa.mli
+[cache hit] ocamldep.opt -modules a/aa.ml > a/aa.ml.depends
[cache hit] ocamldep.opt -modules b/bb.ml > b/bb.ml.depends
[cache hit] ocamlc.opt -c -I b -I a -o b/bb.cmo b/bb.ml
[cache hit] ocamlc.opt -c -I a -I b -o a/aa.cmo a/aa.ml
@@ -288,9 +288,9 @@ ocamlopt.opt str.cmxa b/bb.cmx a/aa.cmx -o a/aa.native
+ rm -rf _build
+ ../../_build/ocamlbuild.native d.byte d.native -no-skip -classic-display
ocamldep.opt -modules d.ml > d.ml.depends
-ocamldep.opt -modules a.ml > a.ml.depends
ocamldep.opt -modules a.mli > a.mli.depends
ocamlc.opt -c -o a.cmi a.mli
+ocamldep.opt -modules a.ml > a.ml.depends
ocamldep.opt -modules stack.ml > stack.ml.depends
ocamlc.opt -c -o stack.cmo stack.ml
ocamldep.opt -modules b.ml > b.ml.depends
@@ -302,16 +302,14 @@ ocamlc.opt stack.cmo c.cmo d.cmo -o d.byte
ocamlopt.opt -c -o stack.cmx stack.ml
ocamlopt.opt -c -for-pack C -o a.cmx a.ml
ocamlopt.opt -c -for-pack C -o b.cmx b.ml
-mv c.cmi c.cmitmp
-ocamlopt.opt -pack a.cmx b.cmx -o c.cmx
-cmp c.cmitmp c.cmi
+touch c.mli ; if ocamlopt.opt -pack a.cmx b.cmx -o c.cmx ; then rm -f c.mli ; else rm -f c.mli ; exit 1; fi
ocamlopt.opt -c -o d.cmx d.ml
ocamlopt.opt stack.cmx c.cmx d.cmx -o d.native
+ ../../_build/ocamlbuild.native d.byte d.native -no-skip -classic-display -verbose 0 -nothing-should-be-rebuilt
[cache hit] ocamldep.opt -modules d.ml > d.ml.depends
-[cache hit] ocamldep.opt -modules a.ml > a.ml.depends
[cache hit] ocamldep.opt -modules a.mli > a.mli.depends
[cache hit] ocamlc.opt -c -o a.cmi a.mli
+[cache hit] ocamldep.opt -modules a.ml > a.ml.depends
[cache hit] ocamldep.opt -modules stack.ml > stack.ml.depends
[cache hit] ocamlc.opt -c -o stack.cmo stack.ml
[cache hit] ocamlc.opt -c -o a.cmo a.ml
@@ -323,9 +321,7 @@ ocamlopt.opt stack.cmx c.cmx d.cmx -o d.native
[cache hit] ocamlopt.opt -c -o stack.cmx stack.ml
[cache hit] ocamlopt.opt -c -for-pack C -o a.cmx a.ml
[cache hit] ocamlopt.opt -c -for-pack C -o b.cmx b.ml
-[cache hit] mv c.cmi c.cmitmp
-[cache hit] ocamlopt.opt -pack a.cmx b.cmx -o c.cmx
-[cache hit] cmp c.cmitmp c.cmi
+[cache hit] touch c.mli ; if ocamlopt.opt -pack a.cmx b.cmx -o c.cmx ; then rm -f c.mli ; else rm -f c.mli ; exit 1; fi
[cache hit] ocamlopt.opt -c -o d.cmx d.ml
[cache hit] ocamlopt.opt stack.cmx c.cmx d.cmx -o d.native
_____ _ __
@@ -342,38 +338,38 @@ ocamlopt.opt stack.cmx c.cmx d.cmx -o d.native
+ cp b.mli.v1 b.mli
+ cp d.mli.v1 d.mli
+ ../../_build/ocamlbuild.native -no-skip main.byte -classic-display
-ocamldep.opt -modules main.ml > main.ml.depends
ocamldep.opt -modules main.mli > main.mli.depends
ocamlc.opt -c -o main.cmi main.mli
-ocamldep.opt -modules d.mli > d.mli.depends
+ocamldep.opt -modules main.ml > main.ml.depends
ocamldep.opt -modules a.mli > a.mli.depends
-ocamlc.opt -c -o d.cmi d.mli
+ocamldep.opt -modules d.mli > d.mli.depends
ocamlc.opt -c -o a.cmi a.mli
+ocamlc.opt -c -o d.cmi d.mli
ocamlc.opt -c -o main.cmo main.ml
-ocamldep.opt -modules d.ml > d.ml.depends
ocamldep.opt -modules a.ml > a.ml.depends
ocamldep.opt -modules b.mli > b.mli.depends
ocamlc.opt -c -o b.cmi b.mli
-ocamlc.opt -c -o d.cmo d.ml
+ocamldep.opt -modules d.ml > d.ml.depends
ocamlc.opt -c -o a.cmo a.ml
+ocamlc.opt -c -o d.cmo d.ml
ocamldep.opt -modules b.ml > b.ml.depends
ocamlc.opt -c -o b.cmo b.ml
ocamlc.opt d.cmo b.cmo a.cmo main.cmo -o main.byte
+ ../../_build/ocamlbuild.native -no-skip main.byte -classic-display -verbose 0 -nothing-should-be-rebuilt
-[cache hit] ocamldep.opt -modules main.ml > main.ml.depends
[cache hit] ocamldep.opt -modules main.mli > main.mli.depends
[cache hit] ocamlc.opt -c -o main.cmi main.mli
-[cache hit] ocamldep.opt -modules d.mli > d.mli.depends
-[cache hit] ocamlc.opt -c -o d.cmi d.mli
+[cache hit] ocamldep.opt -modules main.ml > main.ml.depends
[cache hit] ocamldep.opt -modules a.mli > a.mli.depends
[cache hit] ocamlc.opt -c -o a.cmi a.mli
+[cache hit] ocamldep.opt -modules d.mli > d.mli.depends
+[cache hit] ocamlc.opt -c -o d.cmi d.mli
[cache hit] ocamlc.opt -c -o main.cmo main.ml
-[cache hit] ocamldep.opt -modules d.ml > d.ml.depends
-[cache hit] ocamlc.opt -c -o d.cmo d.ml
[cache hit] ocamldep.opt -modules a.ml > a.ml.depends
[cache hit] ocamldep.opt -modules b.mli > b.mli.depends
[cache hit] ocamlc.opt -c -o b.cmi b.mli
[cache hit] ocamlc.opt -c -o a.cmo a.ml
+[cache hit] ocamldep.opt -modules d.ml > d.ml.depends
+[cache hit] ocamlc.opt -c -o d.cmo d.ml
[cache hit] ocamldep.opt -modules b.ml > b.ml.depends
[cache hit] ocamlc.opt -c -o b.cmo b.ml
[cache hit] ocamlc.opt d.cmo b.cmo a.cmo main.cmo -o main.byte
@@ -396,20 +392,20 @@ ocamlc.opt -c -o d.cmo d.ml
ocamlc.opt -c -o b.cmo b.ml
ocamlc.opt d.cmo b.cmo a.cmo main.cmo -o main.byte
+ ../../_build/ocamlbuild.native -no-skip main.byte -classic-display -verbose 0 -nothing-should-be-rebuilt
-[cache hit] ocamldep.opt -modules main.ml > main.ml.depends
[cache hit] ocamldep.opt -modules main.mli > main.mli.depends
[cache hit] ocamlc.opt -c -o main.cmi main.mli
-[cache hit] ocamldep.opt -modules d.mli > d.mli.depends
-[cache hit] ocamlc.opt -c -o d.cmi d.mli
+[cache hit] ocamldep.opt -modules main.ml > main.ml.depends
[cache hit] ocamldep.opt -modules a.mli > a.mli.depends
[cache hit] ocamlc.opt -c -o a.cmi a.mli
+[cache hit] ocamldep.opt -modules d.mli > d.mli.depends
+[cache hit] ocamlc.opt -c -o d.cmi d.mli
[cache hit] ocamlc.opt -c -o main.cmo main.ml
-[cache hit] ocamldep.opt -modules d.ml > d.ml.depends
-[cache hit] ocamlc.opt -c -o d.cmo d.ml
[cache hit] ocamldep.opt -modules a.ml > a.ml.depends
[cache hit] ocamldep.opt -modules b.mli > b.mli.depends
[cache hit] ocamlc.opt -c -o b.cmi b.mli
[cache hit] ocamlc.opt -c -o a.cmo a.ml
+[cache hit] ocamldep.opt -modules d.ml > d.ml.depends
+[cache hit] ocamlc.opt -c -o d.cmo d.ml
[cache hit] ocamldep.opt -modules b.ml > b.ml.depends
[cache hit] ocamlc.opt -c -o b.cmo b.ml
[cache hit] ocamlc.opt d.cmo b.cmo a.cmo main.cmo -o main.byte
@@ -421,22 +417,23 @@ PASS
| | __/\__ \ |_ / /
|_|\___||___/\__/_/
++ svn=svk
+ CMDOPTS=
+ BUILD=../../_build/ocamlbuild.native bbcc.cma main.byte bbcc.cmxa main.native -no-skip -classic-display
+ BUILD1=../../_build/ocamlbuild.native bbcc.cma main.byte bbcc.cmxa main.native -no-skip -classic-display
+ BUILD2=../../_build/ocamlbuild.native bbcc.cma main.byte bbcc.cmxa main.native -no-skip -classic-display -verbose 0 -nothing-should-be-rebuilt
+ rm -rf _build
-+ svn revert bb.ml
++ svk revert bb.ml
+ ../../_build/ocamlbuild.native bbcc.cma main.byte bbcc.cmxa main.native -no-skip -classic-display
-ocamlopt.opt -I /Users/ertai/wext/ocamlbuild/trunk2/_install/lib/ocamlbuild unix.cmxa /Users/ertai/wext/ocamlbuild/trunk2/_install/lib/ocamlbuild/ocamlbuildlib.cmxa myocamlbuild.ml /Users/ertai/wext/ocamlbuild/trunk2/_install/lib/ocamlbuild/ocamlbuild.cmx -o myocamlbuild
-ocamldep.opt -modules bb.ml > bb.ml.depends
+ocamlopt.opt -I /Users/ertai/w/inria/ocaml/ocaml-cvs-ocamlbuild/ocamlbuild/_install/lib/ocamlbuild unix.cmxa /Users/ertai/w/inria/ocaml/ocaml-cvs-ocamlbuild/ocamlbuild/_install/lib/ocamlbuild/ocamlbuildlib.cmxa myocamlbuild.ml /Users/ertai/w/inria/ocaml/ocaml-cvs-ocamlbuild/ocamlbuild/_install/lib/ocamlbuild/ocamlbuild.cmx -o myocamlbuild
ocamldep.opt -modules bb.mli > bb.mli.depends
ocamlc.opt -c -o bb.cmi bb.mli
+ocamldep.opt -modules bb.ml > bb.ml.depends
ocamldep.opt -modules cc.ml > cc.ml.depends
-ocamldep.opt -modules c2.mli > c2.mli.depends
ocamldep.opt -modules aa.ml > aa.ml.depends
-ocamlc.opt -c -o c2.cmi c2.mli
+ocamldep.opt -modules c2.mli > c2.mli.depends
ocamlc.opt -c -o aa.cmo aa.ml
+ocamlc.opt -c -o c2.cmi c2.mli
ocamlc.opt -c -o bb.cmo bb.ml
ocamlc.opt -c -o cc.cmo cc.ml
ocamlc.opt -a bb.cmo cc.cmo -o bbcc.cma
@@ -450,23 +447,23 @@ ocamldep.opt -modules c2.ml > c2.ml.depends
ocamlc.opt -c -o c2.cmo c2.ml
ocamlc.opt aa.cmo c2.cmo bbcc.cma c3.cmo main.cmo cool_plugin.cmo -o main.byte
ocamlopt.opt -c -o bb.cmx bb.ml
-ocamlopt.opt -c -o c2.cmx c2.ml
ocamlopt.opt -c -o aa.cmx aa.ml
+ocamlopt.opt -c -o c2.cmx c2.ml
ocamlopt.opt -c -o cc.cmx cc.ml
ocamlopt.opt -a bb.cmx cc.cmx -o bbcc.cmxa
ocamlopt.opt -c -o c3.cmx c3.ml
ocamlopt.opt -c -o main.cmx main.ml
ocamlopt.opt aa.cmx c2.cmx bbcc.cmxa c3.cmx main.cmx -o main.native
+ ../../_build/ocamlbuild.native bbcc.cma main.byte bbcc.cmxa main.native -no-skip -classic-display -verbose 0 -nothing-should-be-rebuilt
-[cache hit] ocamldep.opt -modules bb.ml > bb.ml.depends
[cache hit] ocamldep.opt -modules bb.mli > bb.mli.depends
[cache hit] ocamlc.opt -c -o bb.cmi bb.mli
+[cache hit] ocamldep.opt -modules bb.ml > bb.ml.depends
[cache hit] ocamlc.opt -c -o bb.cmo bb.ml
[cache hit] ocamldep.opt -modules cc.ml > cc.ml.depends
-[cache hit] ocamldep.opt -modules c2.mli > c2.mli.depends
-[cache hit] ocamlc.opt -c -o c2.cmi c2.mli
[cache hit] ocamldep.opt -modules aa.ml > aa.ml.depends
[cache hit] ocamlc.opt -c -o aa.cmo aa.ml
+[cache hit] ocamldep.opt -modules c2.mli > c2.mli.depends
+[cache hit] ocamlc.opt -c -o c2.cmi c2.mli
[cache hit] ocamlc.opt -c -o cc.cmo cc.ml
[cache hit] ocamlc.opt -a bb.cmo cc.cmo -o bbcc.cma
[cache hit] ocamldep.opt -modules main.ml > main.ml.depends
@@ -479,8 +476,8 @@ ocamlopt.opt aa.cmx c2.cmx bbcc.cmxa c3.cmx main.cmx -o main.native
[cache hit] ocamlc.opt -c -o c2.cmo c2.ml
[cache hit] ocamlc.opt aa.cmo c2.cmo bbcc.cma c3.cmo main.cmo cool_plugin.cmo -o main.byte
[cache hit] ocamlopt.opt -c -o bb.cmx bb.ml
-[cache hit] ocamlopt.opt -c -o c2.cmx c2.ml
[cache hit] ocamlopt.opt -c -o aa.cmx aa.ml
+[cache hit] ocamlopt.opt -c -o c2.cmx c2.ml
[cache hit] ocamlopt.opt -c -o cc.cmx cc.ml
[cache hit] ocamlopt.opt -a bb.cmx cc.cmx -o bbcc.cmxa
[cache hit] ocamlopt.opt -c -o c3.cmx c3.ml
@@ -488,14 +485,14 @@ ocamlopt.opt aa.cmx c2.cmx bbcc.cmxa c3.cmx main.cmx -o main.native
[cache hit] ocamlopt.opt aa.cmx c2.cmx bbcc.cmxa c3.cmx main.cmx -o main.native
+ cp bb2.ml bb.ml
+ ../../_build/ocamlbuild.native bbcc.cma main.byte bbcc.cmxa main.native -no-skip -classic-display -verbose 0
-ocamldep.opt -modules bb.ml > bb.ml.depends
[cache hit] ocamldep.opt -modules bb.mli > bb.mli.depends
[cache hit] ocamlc.opt -c -o bb.cmi bb.mli
+ocamldep.opt -modules bb.ml > bb.ml.depends
[cache hit] ocamldep.opt -modules cc.ml > cc.ml.depends
-[cache hit] ocamldep.opt -modules c2.mli > c2.mli.depends
-[cache hit] ocamlc.opt -c -o c2.cmi c2.mli
[cache hit] ocamldep.opt -modules aa.ml > aa.ml.depends
[cache hit] ocamlc.opt -c -o aa.cmo aa.ml
+[cache hit] ocamldep.opt -modules c2.mli > c2.mli.depends
+[cache hit] ocamlc.opt -c -o c2.cmi c2.mli
[cache hit] ocamlc.opt -c -o cc.cmo cc.ml
ocamlc.opt -c -o bb.cmo bb.ml
ocamlc.opt -a bb.cmo cc.cmo -o bbcc.cma
@@ -508,24 +505,24 @@ ocamlc.opt -a bb.cmo cc.cmo -o bbcc.cma
[cache hit] ocamldep.opt -modules c2.ml > c2.ml.depends
[cache hit] ocamlc.opt -c -o c2.cmo c2.ml
ocamlc.opt aa.cmo c2.cmo bbcc.cma c3.cmo main.cmo cool_plugin.cmo -o main.byte
-[cache hit] ocamlopt.opt -c -o c2.cmx c2.ml
-ocamlopt.opt -c -o bb.cmx bb.ml
[cache hit] ocamlopt.opt -c -o aa.cmx aa.ml
+ocamlopt.opt -c -o bb.cmx bb.ml
+[cache hit] ocamlopt.opt -c -o c2.cmx c2.ml
ocamlopt.opt -c -o cc.cmx cc.ml
ocamlopt.opt -a bb.cmx cc.cmx -o bbcc.cmxa
ocamlopt.opt -c -o c3.cmx c3.ml
ocamlopt.opt -c -o main.cmx main.ml
ocamlopt.opt aa.cmx c2.cmx bbcc.cmxa c3.cmx main.cmx -o main.native
+ ../../_build/ocamlbuild.native bbcc.cma main.byte bbcc.cmxa main.native -no-skip -classic-display -verbose 0 -nothing-should-be-rebuilt
-[cache hit] ocamldep.opt -modules bb.ml > bb.ml.depends
[cache hit] ocamldep.opt -modules bb.mli > bb.mli.depends
[cache hit] ocamlc.opt -c -o bb.cmi bb.mli
+[cache hit] ocamldep.opt -modules bb.ml > bb.ml.depends
[cache hit] ocamlc.opt -c -o bb.cmo bb.ml
[cache hit] ocamldep.opt -modules cc.ml > cc.ml.depends
-[cache hit] ocamldep.opt -modules c2.mli > c2.mli.depends
-[cache hit] ocamlc.opt -c -o c2.cmi c2.mli
[cache hit] ocamldep.opt -modules aa.ml > aa.ml.depends
[cache hit] ocamlc.opt -c -o aa.cmo aa.ml
+[cache hit] ocamldep.opt -modules c2.mli > c2.mli.depends
+[cache hit] ocamlc.opt -c -o c2.cmi c2.mli
[cache hit] ocamlc.opt -c -o cc.cmo cc.ml
[cache hit] ocamlc.opt -a bb.cmo cc.cmo -o bbcc.cma
[cache hit] ocamldep.opt -modules main.ml > main.ml.depends
@@ -538,8 +535,8 @@ ocamlopt.opt aa.cmx c2.cmx bbcc.cmxa c3.cmx main.cmx -o main.native
[cache hit] ocamlc.opt -c -o c2.cmo c2.ml
[cache hit] ocamlc.opt aa.cmo c2.cmo bbcc.cma c3.cmo main.cmo cool_plugin.cmo -o main.byte
[cache hit] ocamlopt.opt -c -o bb.cmx bb.ml
-[cache hit] ocamlopt.opt -c -o c2.cmx c2.ml
[cache hit] ocamlopt.opt -c -o aa.cmx aa.ml
+[cache hit] ocamlopt.opt -c -o c2.cmx c2.ml
[cache hit] ocamlopt.opt -c -o cc.cmx cc.ml
[cache hit] ocamlopt.opt -a bb.cmx cc.cmx -o bbcc.cmxa
[cache hit] ocamlopt.opt -c -o c3.cmx c3.ml
@@ -547,14 +544,14 @@ ocamlopt.opt aa.cmx c2.cmx bbcc.cmxa c3.cmx main.cmx -o main.native
[cache hit] ocamlopt.opt aa.cmx c2.cmx bbcc.cmxa c3.cmx main.cmx -o main.native
+ cp bb3.ml bb.ml
+ ../../_build/ocamlbuild.native bbcc.cma main.byte bbcc.cmxa main.native -no-skip -classic-display -verbose 0
-ocamldep.opt -modules bb.ml > bb.ml.depends
[cache hit] ocamldep.opt -modules bb.mli > bb.mli.depends
[cache hit] ocamlc.opt -c -o bb.cmi bb.mli
+ocamldep.opt -modules bb.ml > bb.ml.depends
[cache hit] ocamldep.opt -modules cc.ml > cc.ml.depends
-[cache hit] ocamldep.opt -modules c2.mli > c2.mli.depends
-[cache hit] ocamlc.opt -c -o c2.cmi c2.mli
[cache hit] ocamldep.opt -modules aa.ml > aa.ml.depends
[cache hit] ocamlc.opt -c -o aa.cmo aa.ml
+[cache hit] ocamldep.opt -modules c2.mli > c2.mli.depends
+[cache hit] ocamlc.opt -c -o c2.cmi c2.mli
[cache hit] ocamlc.opt -c -o cc.cmo cc.ml
ocamlc.opt -c -o bb.cmo bb.ml
ocamlc.opt -a bb.cmo cc.cmo -o bbcc.cma
@@ -567,24 +564,24 @@ ocamlc.opt -a bb.cmo cc.cmo -o bbcc.cma
[cache hit] ocamldep.opt -modules c2.ml > c2.ml.depends
[cache hit] ocamlc.opt -c -o c2.cmo c2.ml
ocamlc.opt aa.cmo c2.cmo bbcc.cma c3.cmo main.cmo cool_plugin.cmo -o main.byte
-[cache hit] ocamlopt.opt -c -o c2.cmx c2.ml
-ocamlopt.opt -c -o bb.cmx bb.ml
[cache hit] ocamlopt.opt -c -o aa.cmx aa.ml
+ocamlopt.opt -c -o bb.cmx bb.ml
+[cache hit] ocamlopt.opt -c -o c2.cmx c2.ml
[cache hit] ocamlopt.opt -c -o cc.cmx cc.ml
ocamlopt.opt -a bb.cmx cc.cmx -o bbcc.cmxa
[cache hit] ocamlopt.opt -c -o c3.cmx c3.ml
[cache hit] ocamlopt.opt -c -o main.cmx main.ml
ocamlopt.opt aa.cmx c2.cmx bbcc.cmxa c3.cmx main.cmx -o main.native
+ ../../_build/ocamlbuild.native bbcc.cma main.byte bbcc.cmxa main.native -no-skip -classic-display -verbose 0 -nothing-should-be-rebuilt
-[cache hit] ocamldep.opt -modules bb.ml > bb.ml.depends
[cache hit] ocamldep.opt -modules bb.mli > bb.mli.depends
[cache hit] ocamlc.opt -c -o bb.cmi bb.mli
+[cache hit] ocamldep.opt -modules bb.ml > bb.ml.depends
[cache hit] ocamlc.opt -c -o bb.cmo bb.ml
[cache hit] ocamldep.opt -modules cc.ml > cc.ml.depends
-[cache hit] ocamldep.opt -modules c2.mli > c2.mli.depends
-[cache hit] ocamlc.opt -c -o c2.cmi c2.mli
[cache hit] ocamldep.opt -modules aa.ml > aa.ml.depends
[cache hit] ocamlc.opt -c -o aa.cmo aa.ml
+[cache hit] ocamldep.opt -modules c2.mli > c2.mli.depends
+[cache hit] ocamlc.opt -c -o c2.cmi c2.mli
[cache hit] ocamlc.opt -c -o cc.cmo cc.ml
[cache hit] ocamlc.opt -a bb.cmo cc.cmo -o bbcc.cma
[cache hit] ocamldep.opt -modules main.ml > main.ml.depends
@@ -597,15 +594,15 @@ ocamlopt.opt aa.cmx c2.cmx bbcc.cmxa c3.cmx main.cmx -o main.native
[cache hit] ocamlc.opt -c -o c2.cmo c2.ml
[cache hit] ocamlc.opt aa.cmo c2.cmo bbcc.cma c3.cmo main.cmo cool_plugin.cmo -o main.byte
[cache hit] ocamlopt.opt -c -o bb.cmx bb.ml
-[cache hit] ocamlopt.opt -c -o c2.cmx c2.ml
[cache hit] ocamlopt.opt -c -o aa.cmx aa.ml
+[cache hit] ocamlopt.opt -c -o c2.cmx c2.ml
[cache hit] ocamlopt.opt -c -o cc.cmx cc.ml
[cache hit] ocamlopt.opt -a bb.cmx cc.cmx -o bbcc.cmxa
[cache hit] ocamlopt.opt -c -o c3.cmx c3.ml
[cache hit] ocamlopt.opt -c -o main.cmx main.ml
[cache hit] ocamlopt.opt aa.cmx c2.cmx bbcc.cmxa c3.cmx main.cmx -o main.native
-+ svn revert bb.ml
-Reverted 'bb.ml'
++ svk revert bb.ml
+Reverted bb.ml
_____ _ ___
|_ _|__ ___| |_( _ )
| |/ _ \/ __| __/ _ \
@@ -618,7 +615,7 @@ Reverted 'bb.ml'
+ BUILD2=../../_build/ocamlbuild.native a.byte a.native -no-skip -classic-display -verbose 0 -nothing-should-be-rebuilt
+ rm -rf _build
+ ../../_build/ocamlbuild.native a.byte a.native -no-skip -classic-display
-ocamlopt.opt -I /Users/ertai/wext/ocamlbuild/trunk2/_install/lib/ocamlbuild unix.cmxa /Users/ertai/wext/ocamlbuild/trunk2/_install/lib/ocamlbuild/ocamlbuildlib.cmxa myocamlbuild.ml /Users/ertai/wext/ocamlbuild/trunk2/_install/lib/ocamlbuild/ocamlbuild.cmx -o myocamlbuild
+ocamlopt.opt -I /Users/ertai/w/inria/ocaml/ocaml-cvs-ocamlbuild/ocamlbuild/_install/lib/ocamlbuild unix.cmxa /Users/ertai/w/inria/ocaml/ocaml-cvs-ocamlbuild/ocamlbuild/_install/lib/ocamlbuild/ocamlbuildlib.cmxa myocamlbuild.ml /Users/ertai/w/inria/ocaml/ocaml-cvs-ocamlbuild/ocamlbuild/_install/lib/ocamlbuild/ocamlbuild.cmx -o myocamlbuild
ocamldep.opt -modules a.ml > a.ml.depends
ocamldep.opt -modules myconfig.ml > myconfig.ml.depends
ocamlc.opt -c -o myconfig.cmo myconfig.ml
diff --git a/ocamlbuild/test/test7/test.sh b/ocamlbuild/test/test7/test.sh
index 0ccb69d98..3e539a4f6 100755
--- a/ocamlbuild/test/test7/test.sh
+++ b/ocamlbuild/test/test7/test.sh
@@ -2,12 +2,13 @@
cd `dirname $0`
set -e
set -x
+svn=svk
CMDOPTS="" # -- command args
BUILD="../../_build/ocamlbuild.native bbcc.cma main.byte bbcc.cmxa main.native -no-skip -classic-display $@"
BUILD1="$BUILD $CMDARGS"
BUILD2="$BUILD -verbose 0 -nothing-should-be-rebuilt $CMDARGS"
rm -rf _build
-svn revert bb.ml
+$svn revert bb.ml
$BUILD1
$BUILD2
cp bb2.ml bb.ml
@@ -16,4 +17,4 @@ $BUILD2
cp bb3.ml bb.ml
$BUILD1 -verbose 0
$BUILD2
-svn revert bb.ml
+$svn revert bb.ml
diff --git a/ocamlbuild/test/test8/myocamlbuild.ml b/ocamlbuild/test/test8/myocamlbuild.ml
index 4a8ae9d68..2aeb988f2 100644
--- a/ocamlbuild/test/test8/myocamlbuild.ml
+++ b/ocamlbuild/test/test8/myocamlbuild.ml
@@ -3,7 +3,7 @@ open Ocamlbuild_plugin;;
let version = "0.1";;
file_rule "myconfig.ml"
~prod:"myconfig.ml"
- ~cache:(fun _ -> version)
+ ~cache:(fun _ _ -> version)
begin fun _ oc ->
Printf.fprintf oc "let version = %S;;\n%!" version
end;;
diff --git a/ocamldoc/odoc_args.ml b/ocamldoc/odoc_args.ml
index f266e99f5..a1c009623 100644
--- a/ocamldoc/odoc_args.ml
+++ b/ocamldoc/odoc_args.ml
@@ -221,6 +221,7 @@ let options = ref [
"-rectypes", Arg.Set recursive_types, M.rectypes ;
"-nolabels", Arg.Unit (fun () -> classic := true), M.nolabels ;
"-warn-error", Arg.Set Odoc_global.warn_error, M.werr ;
+ "-hide-warnings", Arg.Clear Odoc_config.print_warnings, M.hide_warnings ;
"-o", Arg.String (fun s -> out_file := s), M.out_file ;
"-d", Arg.String (fun s -> target_dir := s), M.target_dir ;
"-sort", Arg.Unit (fun () -> sort_modules := true), M.sort_modules ;
diff --git a/ocamldoc/odoc_config.ml b/ocamldoc/odoc_config.ml
index ced04ae2e..71769534d 100644
--- a/ocamldoc/odoc_config.ml
+++ b/ocamldoc/odoc_config.ml
@@ -11,6 +11,8 @@
(* $Id$ *)
-let custom_generators_path =
- Filename.concat Config.standard_library
+let custom_generators_path =
+ Filename.concat Config.standard_library
(Filename.concat "ocamldoc" "custom")
+
+let print_warnings = ref true
diff --git a/ocamldoc/odoc_config.mli b/ocamldoc/odoc_config.mli
index 622d8d3e1..fb356084b 100644
--- a/ocamldoc/odoc_config.mli
+++ b/ocamldoc/odoc_config.mli
@@ -15,3 +15,6 @@
(** Default path to search for custom generators and to install them. *)
val custom_generators_path : string
+
+(** A flag to indicate whether to print ocamldoc warnings or not. *)
+val print_warnings : bool ref
diff --git a/ocamldoc/odoc_info.ml b/ocamldoc/odoc_info.ml
index d7454c1aa..a39e4ad6c 100644
--- a/ocamldoc/odoc_info.ml
+++ b/ocamldoc/odoc_info.ml
@@ -175,6 +175,7 @@ let verbose s =
()
let warning s = Odoc_messages.pwarning s
+let print_warnings = Odoc_config.print_warnings
let errors = Odoc_global.errors
diff --git a/ocamldoc/odoc_info.mli b/ocamldoc/odoc_info.mli
index 3fa8ea822..613d066f8 100644
--- a/ocamldoc/odoc_info.mli
+++ b/ocamldoc/odoc_info.mli
@@ -711,6 +711,9 @@ val verbose : string -> unit
error counter is incremented. *)
val warning : string -> unit
+(** A flag to indicate whether ocamldoc warnings must be printed or not. *)
+val print_warnings : bool ref
+
(** Increment this counter when an error is encountered.
The ocamldoc tool will print the number of errors
encountered exit with code 1 if this number is greater
diff --git a/ocamldoc/odoc_messages.ml b/ocamldoc/odoc_messages.ml
index 033673b57..7bd32d330 100644
--- a/ocamldoc/odoc_messages.ml
+++ b/ocamldoc/odoc_messages.ml
@@ -45,6 +45,7 @@ let add_load_dir = "<dir>\tAdd the given directory to the search path for custom
let load_file = "<file.cm[o|a]>\n\t\tLoad file defining a new documentation generator\n\t\t"^bytecode_only
let nolabels = "\tIgnore non-optional labels in types"
let werr = "\tTreat ocamldoc warnings as errors"
+let hide_warnings = "\n\t\tdo not print ocamldoc warnings"
let target_dir = "<dir>\tGenerate files in directory <dir>, rather than in current\n"^
"\t\tdirectory (for man and HTML generators)"
let dump = "<file>\tDump collected information into <file>"
@@ -211,7 +212,7 @@ let merge_options =
let warning = "Warning"
let pwarning s =
- prerr_endline (warning^": "^s);
+ if !Odoc_config.print_warnings then prerr_endline (warning^": "^s);
if !Odoc_global.warn_error then incr Odoc_global.errors
let bad_magic_number =
diff --git a/otherlibs/labltk/support/Makefile b/otherlibs/labltk/support/Makefile
index 1fb848bc2..3e315bfc3 100644
--- a/otherlibs/labltk/support/Makefile
+++ b/otherlibs/labltk/support/Makefile
@@ -34,9 +34,9 @@ install: lib$(LIBNAME).a $(PUB)
installopt: opt
@if test -d $(INSTALLDIR); then : ; else mkdir $(INSTALLDIR); fi
cp $(PUBMLI:.mli=.cmx) $(INSTALLDIR)
- if test -f tkthread.o; then \
- cp tkthread.o $(INSTALLDIR); \
- chmod 644 $(INSTALLDIR)/tkthread.o; \
+ if test -f tkthread.cmx; then \
+ cp tkthread.cmx tkthread.o $(INSTALLDIR); \
+ chmod 644 $(INSTALLDIR)/tkthread.cmx $(INSTALLDIR)/tkthread.o; \
fi
clean :
diff --git a/otherlibs/labltk/support/tkthread.ml b/otherlibs/labltk/support/tkthread.ml
index 0336afe3c..04dcc74c5 100644
--- a/otherlibs/labltk/support/tkthread.ml
+++ b/otherlibs/labltk/support/tkthread.ml
@@ -26,7 +26,7 @@ let cannot_sync () =
| Some id -> Thread.id (Thread.self ()) = id
let gui_safe () =
- not (Sys.os_type = "Win32") || !loop_id = Some(Thread.id (Thread.self ()))
+ !loop_id = Some(Thread.id (Thread.self ()))
let has_jobs () = not (with_jobs Queue.is_empty)
let n_jobs () = with_jobs Queue.length
@@ -52,9 +52,9 @@ let rec job_timer () =
let thread_main () =
try
+ loop_id := Some (Thread.id (Thread.self ()));
ignore (Protocol.openTk());
job_timer();
- loop_id := Some (Thread.id (Thread.self ()));
Protocol.mainLoop();
loop_id := None;
with exn ->
diff --git a/otherlibs/labltk/support/tkthread.mli b/otherlibs/labltk/support/tkthread.mli
index ae031e3a4..88883a5db 100644
--- a/otherlibs/labltk/support/tkthread.mli
+++ b/otherlibs/labltk/support/tkthread.mli
@@ -14,7 +14,8 @@
(* $Id$ *)
-(* Basic functions *)
+(* 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
@@ -24,8 +25,8 @@ val thread_main : unit -> unit
val top : Widget.toplevel Widget.widget
(* Jobs are needed for Windows, as you cannot do GUI work from
- another thread.
- Even under Unix some calls need to come from the main thread.
+ another thread. This is apparently true on OSX/Aqua too.
+ And even using X11 some calls need to come from the main thread.
The basic idea is to either use async (if you don't need a result)
or sync whenever you call a Tk related function from another thread
(for instance with the threaded toplevel).
@@ -36,6 +37,7 @@ val top : Widget.toplevel Widget.widget
val async : ('a -> unit) -> 'a -> unit
(** Add a synchronous job (to do in the main thread) *)
val sync : ('a -> 'b) -> 'a -> 'b
-(** Whether it is safe to call most Tk functions directly from
- the current thread *)
+(** 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
diff --git a/otherlibs/num/.depend b/otherlibs/num/.depend
index 54fca363c..6fa1caf7b 100644
--- a/otherlibs/num/.depend
+++ b/otherlibs/num/.depend
@@ -1,5 +1,5 @@
bng.o: bng.c bng.h ../../byterun/config.h ../../byterun/../config/m.h \
- ../../byterun/../config/s.h ../../byterun/compatibility.h bng_ppc.c \
+ ../../byterun/../config/s.h ../../byterun/compatibility.h bng_ia32.c \
bng_digit.c
bng_alpha.o: bng_alpha.c
bng_amd64.o: bng_amd64.c
diff --git a/otherlibs/systhreads/Makefile b/otherlibs/systhreads/Makefile
index 52186d6e5..83c40a669 100644
--- a/otherlibs/systhreads/Makefile
+++ b/otherlibs/systhreads/Makefile
@@ -50,12 +50,12 @@ posix_n.o: posix.c
threads.cma: $(THREAD_OBJS)
$(MKLIB) -ocamlc '$(CAMLC)' -o threads $(THREAD_OBJS) \
- -cclib -lunix -cclib "$(PTHREAD_LINK)"
+ -cclib -lunix $(PTHREAD_LINK)
# See remark above: force static linking of libthreadsnat.a
threads.cmxa: $(THREAD_OBJS:.cmo=.cmx)
$(CAMLOPT) -a -o threads.cmxa $(THREAD_OBJS:.cmo=.cmx) \
- -cclib -lthreadsnat -cclib -lunix -cclib "$(PTHREAD_LINK)"
+ -cclib -lthreadsnat -cclib -lunix $(PTHREAD_LINK)
$(THREAD_OBJS:.cmo=.cmx): ../../ocamlopt
diff --git a/parsing/printast.ml b/parsing/printast.ml
index 5a001f3ae..005a757f0 100644
--- a/parsing/printast.ml
+++ b/parsing/printast.ml
@@ -89,7 +89,14 @@ let line i f s (*...*) =
fprintf f s (*...*)
;;
-let list i f ppf l = List.iter (f i ppf) l;;
+let list i f ppf l =
+ match l with
+ | [] -> line i ppf "[]\n";
+ | h::t ->
+ line i ppf "[\n";
+ List.iter (f (i+1) ppf) l;
+ line i ppf "]\n";
+;;
let option i f ppf x =
match x with
@@ -361,9 +368,11 @@ and class_type_field i ppf x =
| Pctf_virt (s, pf, ct, loc) ->
line i ppf
"Pctf_virt \"%s\" %a %a\n" s fmt_private_flag pf fmt_location loc;
+ core_type (i+1) ppf ct;
| Pctf_meth (s, pf, ct, loc) ->
line i ppf
"Pctf_meth \"%s\" %a %a\n" s fmt_private_flag pf fmt_location loc;
+ core_type (i+1) ppf ct;
| Pctf_cstr (ct1, ct2, loc) ->
line i ppf "Pctf_cstr %a\n" fmt_location loc;
core_type i ppf ct1;
@@ -619,11 +628,11 @@ and core_type_x_core_type_x_location i ppf (ct1, ct2, l) =
core_type (i+1) ppf ct2;
and string_x_core_type_list_x_location i ppf (s, l, loc) =
- string i ppf s;
+ line i ppf "\"%s\" %a\n" s fmt_location loc;
list (i+1) core_type ppf l;
and string_x_mutable_flag_x_core_type_x_location i ppf (s, mf, ct, loc) =
- line i ppf "\"%s\" %a\n" s fmt_mutable_flag mf;
+ line i ppf "\"%s\" %a %a\n" s fmt_mutable_flag mf fmt_location loc;
core_type (i+1) ppf ct;
and string_list_x_location i ppf (l, loc) =
diff --git a/stdlib/scanf.mli b/stdlib/scanf.mli
index 24b93977e..0d558da7c 100644
--- a/stdlib/scanf.mli
+++ b/stdlib/scanf.mli
@@ -18,7 +18,7 @@
(** {6 Functional input with format strings.} *)
(** The formatted input functions provided by module [Scanf] are functionals
- that apply the values they read in the input to their function argument.
+ that apply their function argument to the values they read in the input.
The specification of the values to read is simply given by a format string
(the same format strings as those used to print material using module
{!Printf} or module {!Format}).
@@ -31,7 +31,7 @@
[f i]; thus, if we enter [41] at the keyboard, [scanf "%d" f] evaluates to
[42].
- This module provides general formatted input functions that reads from any
+ This module provides general formatted input functions that read from any
kind of input, including strings, files, or anything that can return
characters. The more general source of characters is named a [scanbuf], and
it is the first argument of scanning functions.
@@ -61,16 +61,16 @@ type scanbuf;;
current state of the scan, plus a function to get the next char from the
input, and a token buffer to store the string matched so far.
- Note: a scan may often require to examine one character in advance;
- when this ``lookahead'' character does not belong to the token read,
- it is stored back in the scanning buffer and becomes the next
- character read. *)
+ Note: a scan may often require to examine one character in advance;
+ when this ``lookahead'' character does not belong to the token read,
+ it is stored back in the scanning buffer and becomes the next
+ character read. *)
val stdib : scanbuf;;
(** The scanning buffer reading from [stdin].
[stdib] is equivalent to [Scanning.from_channel stdin].
- Note: when input is read interactively from [stdin], the carriage return
+ Note: when input is read interactively from [stdin], the newline character
that triggers the evaluation is incorporated in the input; thus, scanning
specifications must properly skip this character (simply add a ['\n']
as the last character of the format string). *)
@@ -152,7 +152,7 @@ val bscanf : Scanning.scanbuf -> ('a, 'b, 'c, 'd) scanner;;
(** [bscanf ib fmt r1 ... rN f] reads arguments for the function [f] from the
scanning buffer [ib] according to the format string [fmt], and applies [f]
to these values.
- This application of [f] is the result of the whole construct.
+ The result of this call to [f] is returned as the result of [bscanf].
For instance, if [f] is the function [fun s i -> i + 1], then
[Scanf.sscanf "x = 1" "%s = %i" f] returns [2].
@@ -169,7 +169,7 @@ val bscanf : Scanning.scanbuf -> ('a, 'b, 'c, 'd) scanner;;
Among plain characters the space character (ASCII code 32) has a
special meaning: it matches ``whitespace'', that is any number of tab,
- space, newline and carriage return characters. Hence, a space in the format
+ space, line feed and carriage return characters. Hence, a space in the format
matches any amount of whitespace in the input.
Conversion specifications consist in the [%] character, followed by
@@ -216,7 +216,7 @@ val bscanf : Scanning.scanbuf -> ('a, 'b, 'c, 'd) scanner;;
- [\[ range \]]: reads characters that matches one of the characters
mentioned in the range of characters [range] (or not mentioned in
it, if the range starts with [^]). Reads a [string] that can be
- empty, if no character in the input matches the range. The set of
+ empty, if the next input character does not match the range. The set of
characters from [c1] to [c2] (inclusively) is denoted by [c1-c2].
Hence, [%\[0-9\]] returns a string representing a decimal number
or an empty string if no decimal digit is found; similarly,
@@ -246,18 +246,18 @@ val bscanf : Scanning.scanbuf -> ('a, 'b, 'c, 'd) scanner;;
- [!]: matches the end of input condition.
- [%]: matches one [%] character in the input.
- Following the [%] character introducing a conversion, there may be
+ Following the [%] character that introduces a conversion, there may be
the special flag [_]: the conversion that follows occurs as usual,
but the resulting value is discarded.
For instance, if [f] is the function [fun i -> i + 1], then
[Scanf.sscanf "x = 1" "%_s = %i" f] returns [2].
- The field widths are composed of an optional integer literal
+ The field width is composed of an optional integer literal
indicating the maximal width of the token to read.
For instance, [%6d] reads an integer, having at most 6 decimal digits;
[%4f] reads a float with at most 4 characters; and [%8\[\\000-\\255\]]
returns the next 8 characters (or all the characters still available,
- if less than 8 characters are available in the input).
+ if fewer than 8 characters are available in the input).
Scanning indications appear just after the string conversions [%s]
and [%\[ range \]] to delimit the end of the token. A scanning
@@ -266,7 +266,7 @@ val bscanf : Scanning.scanbuf -> ('a, 'b, 'c, 'd) scanner;;
just before the next matching [c] (which is skipped). If no [c]
character is encountered, the string token spreads as much as
possible. For instance, ["%s@\t"] reads a string up to the next
- tabulation character or to the end of input. If a scanning
+ tab character or to the end of input. If a scanning
indication [\@c] does not follow a string conversion, it is treated
as a plain [c] character.
@@ -310,8 +310,8 @@ val fscanf : in_channel -> ('a, 'b, 'c, 'd) scanner;;
Warning: since all formatted input functions operate from a scanning
buffer, be aware that each [fscanf] invocation must allocate a new
- fresh scanning buffer (unless careful use of partial evaluation in
- the program). Hence, there are chances that some characters seem
+ fresh scanning buffer (unless you make careful use of partial
+ application). Hence, there are chances that some characters seem
to be skipped (in fact they are pending in the previously used
scanning buffer). This happens in particular when calling [fscanf] again
after a scan involving a format that necessitated some look ahead
@@ -322,7 +322,7 @@ val fscanf : in_channel -> ('a, 'b, 'c, 'd) scanner;;
to allocate the scanning buffer reading from file [f].
This method is not only clearer it is also faster, since scanning
- buffers to files are optimized for fast bufferized reading. *)
+ buffers to files are optimized for fast buffered reading. *)
val sscanf : string -> ('a, 'b, 'c, 'd) scanner;;
(** Same as {!Scanf.bscanf}, but reads from the given string. *)
@@ -336,8 +336,8 @@ val kscanf :
('a, 'b, 'c, 'd) scanner;;
(** Same as {!Scanf.bscanf}, but takes an additional function argument
[ef] that is called in case of error: if the scanning process or
- some conversion fails, the scanning function aborts and applies the
- error handling function [ef] to the scanning buffer and the
+ some conversion fails, the scanning function aborts and calls the
+ error handling function [ef] with the scanning buffer and the
exception that aborted the scanning process. *)
(** {6 Reading format strings} *)
@@ -348,8 +348,8 @@ val bscanf_format :
(** [bscanf_format ib fmt f] reads a format string token from the scannning
buffer [ib], according to the given format string [fmt], and applies [f] to
the resulting format string value.
- Raises [Scan_failure] if the format string value read has not the same type
- as [fmt]. *)
+ Raise [Scan_failure] if the format string value read doesn't have the
+ same type as [fmt]. *)
val sscanf_format :
string -> ('a, 'b, 'c, 'd, 'e, 'f) format6 ->
@@ -361,5 +361,5 @@ val format_from_string :
('a, 'b, 'c, 'd, 'e, 'f) format6 -> ('a, 'b, 'c, 'd, 'e, 'f) format6;;
(** [format_from_string s fmt] converts a string argument to a format string,
according to the given format string [fmt].
- Raises [Scan_failure] if [s], considered as a format string, has not the same
- type as [fmt]. *)
+ Raise [Scan_failure] if [s], considered as a format string, doesn't
+ have the same type as [fmt]. *)
diff --git a/typing/ctype.ml b/typing/ctype.ml
index 878882501..cf9b1b3b8 100644
--- a/typing/ctype.ml
+++ b/typing/ctype.ml
@@ -427,15 +427,11 @@ let rec closed_type ty =
let closed_parameterized_type params ty =
List.iter mark_type params;
- try
- closed_type ty;
- List.iter unmark_type params;
- unmark_type ty;
- true
- with Non_closed _ ->
- List.iter unmark_type params;
- unmark_type ty;
- false
+ let ok =
+ try closed_type ty; true with Non_closed _ -> false in
+ List.iter unmark_type params;
+ unmark_type ty;
+ ok
let closed_type_decl decl =
try
diff --git a/typing/oprint.ml b/typing/oprint.ml
index e37230bf9..139daadc2 100644
--- a/typing/oprint.ml
+++ b/typing/oprint.ml
@@ -391,20 +391,20 @@ and print_out_type_decl kwd ppf (name, args, ty, priv, constraints) =
| _ -> ty
in
let print_private ppf = function
- Asttypes.Private -> fprintf ppf "private "
+ Asttypes.Private -> fprintf ppf " private"
| Asttypes.Public -> () in
let rec print_out_tkind ppf = function
| Otyp_abstract -> ()
| Otyp_record lbls ->
- fprintf ppf " = %a{%a@;<1 -2>}"
+ fprintf ppf " =%a {%a@;<1 -2>}"
print_private priv
(print_list_init print_out_label (fun ppf -> fprintf ppf "@ ")) lbls
| Otyp_sum constrs ->
- fprintf ppf " =@;<1 2>%a%a"
+ fprintf ppf " =%a@;<1 2>%a"
print_private priv
(print_list print_out_constr (fun ppf -> fprintf ppf "@ | ")) constrs
| ty ->
- fprintf ppf " =@;<1 2>%a%a"
+ fprintf ppf " =%a@;<1 2>%a"
print_private priv
!out_type ty
in
diff --git a/typing/typecore.ml b/typing/typecore.ml
index 232bf2286..7939fe69c 100644
--- a/typing/typecore.ml
+++ b/typing/typecore.ml
@@ -1832,10 +1832,16 @@ and type_expect ?in_function env sexp ty_expected =
raise(Error(loc,
Too_many_arguments (in_function <> None, ty_fun)))
in
- if is_optional l then begin
- try unify env ty_arg (type_option(newvar()))
- with Unify _ -> assert false
- end;
+ let ty_arg =
+ if is_optional l then
+ let tv = newvar() in
+ begin
+ try unify env ty_arg (type_option tv)
+ with Unify _ -> assert false
+ end;
+ type_option tv
+ else ty_arg
+ in
let cases, partial =
type_cases ~in_function:(loc,ty_fun) env ty_arg ty_res
(Some sexp.pexp_loc) caselist in
diff --git a/typing/typedecl.ml b/typing/typedecl.ml
index b9442e425..f0ce9836c 100644
--- a/typing/typedecl.ml
+++ b/typing/typedecl.ml
@@ -369,6 +369,7 @@ let check_recursion env loc path decl to_check =
Ctype.correct_abbrev env path decl.type_params body
with Ctype.Recursive_abbrev ->
raise(Error(loc, Recursive_abbrev (Path.name path)))
+ | Ctype.Unify trace -> raise(Error(loc, Type_clash trace))
end;
(* Check that recursion is regular *)
if decl.type_params = [] then () else
@@ -849,7 +850,9 @@ let report_error ppf = function
let ty = Ctype.repr ty in
let explain tl typ kwd lab =
let ti = List.find (fun ti -> Ctype.deep_occur ty (typ ti)) tl in
- Printtyp.reset_and_mark_loops_list [typ ti;ty];
+ let ty0 = (* Hack to force aliasing when needed *)
+ Btype.newgenty (Tobject(ty, ref None)) in
+ Printtyp.reset_and_mark_loops_list [typ ti; ty0];
fprintf ppf
".@.@[<hov2>In %s@ %s%a@;<1 -2>the variable %a is unbound@]"
kwd (lab ti) Printtyp.type_expr (typ ti) Printtyp.type_expr ty
diff --git a/typing/typemod.ml b/typing/typemod.ml
index 9989a257d..2bbe203ae 100644
--- a/typing/typemod.ml
+++ b/typing/typemod.ml
@@ -795,31 +795,37 @@ and simplify_signature sg =
let type_implementation sourcefile outputprefix modulename initial_env ast =
Typecore.reset_delayed_checks ();
- let (str, sg, finalenv) = type_structure initial_env ast Location.none in
+ let (str, sg, finalenv) =
+ Misc.try_finally (fun () -> type_structure initial_env ast Location.none)
+ (fun () -> Stypes.dump (outputprefix ^ ".annot"))
+ in
+ let simple_sg = simplify_signature sg in
Typecore.force_delayed_checks ();
if !Clflags.print_types then begin
- fprintf std_formatter "%a@." Printtyp.signature (simplify_signature sg);
- (str, Tcoerce_none)
+ fprintf std_formatter "%a@." Printtyp.signature simple_sg;
+ (str, Tcoerce_none) (* result is ignored by Compile.implementation *)
end else begin
- let coercion =
- let sourceintf =
- Misc.chop_extension_if_any sourcefile ^ !Config.interface_suffix in
- if Sys.file_exists sourceintf then begin
- let intf_file =
- try
- find_in_path_uncap !Config.load_path (modulename ^ ".cmi")
- with Not_found ->
- raise(Error(Location.none, Interface_not_compiled sourceintf)) in
- let dclsig = Env.read_signature modulename intf_file in
- Includemod.compunit sourcefile sg intf_file dclsig
- end else begin
- check_nongen_schemes finalenv str;
- normalize_signature finalenv sg;
- if not !Clflags.dont_write_files then
- Env.save_signature sg modulename (outputprefix ^ ".cmi");
- Tcoerce_none
- end in
- (str, coercion)
+ let sourceintf =
+ Misc.chop_extension_if_any sourcefile ^ !Config.interface_suffix in
+ if Sys.file_exists sourceintf then begin
+ let intf_file =
+ try
+ find_in_path_uncap !Config.load_path (modulename ^ ".cmi")
+ with Not_found ->
+ raise(Error(Location.none, Interface_not_compiled sourceintf)) in
+ let dclsig = Env.read_signature modulename intf_file in
+ let coercion = Includemod.compunit sourcefile sg intf_file dclsig in
+ (str, coercion)
+ end else begin
+ check_nongen_schemes finalenv str;
+ normalize_signature finalenv sg;
+ let coercion =
+ Includemod.compunit sourcefile sg
+ "(inferred signature)" simple_sg in
+ if not !Clflags.dont_write_files then
+ Env.save_signature simple_sg modulename (outputprefix ^ ".cmi");
+ (str, coercion)
+ end
end
(* "Packaging" of several compilation units into one unit
diff --git a/typing/typetexp.ml b/typing/typetexp.ml
index 5171adf1b..4f615abbd 100644
--- a/typing/typetexp.ml
+++ b/typing/typetexp.ml
@@ -221,9 +221,8 @@ let rec transl_type env policy styp =
row_fixed = false; row_more = newvar () } in
let static = Btype.static_row row in
let row =
- if static then row else
- { row with row_more =
- if policy = Univars then new_pre_univar () else newvar () }
+ if static || policy <> Univars then row
+ else { row with row_more = new_pre_univar () }
in
newty (Tvariant row)
| Tobject (fi, _) ->
@@ -272,8 +271,9 @@ let rec transl_type env policy styp =
try
let f' = List.assoc l fields in
let ty = mkfield l f and ty' = mkfield l f' in
- if equal env false [ty] [ty'] then fields
- else raise(Error(loc, Constructor_mismatch (ty,ty')))
+ if equal env false [ty] [ty'] then fields else
+ try unify env ty ty'; fields
+ with Unify trace -> raise(Error(loc, Constructor_mismatch (ty,ty')))
with Not_found ->
(l, f) :: fields
in
@@ -352,13 +352,9 @@ let rec transl_type env policy styp =
row_fixed = false; row_name = !name } in
let static = Btype.static_row row in
let row =
- if static then row else
- { row with row_more =
- if policy = Univars then new_pre_univar () else
- if policy = Fixed && not static then
- raise(Error(styp.ptyp_loc, Unbound_type_variable "[..]"))
- else row.row_more
- } in
+ if static || policy <> Univars then row
+ else { row with row_more = new_pre_univar () }
+ in
newty (Tvariant row)
| Ptyp_poly(vars, st) ->
begin_def();
diff --git a/win32caml/inria.h b/win32caml/inria.h
index 13949d52d..8b0ad2262 100644
--- a/win32caml/inria.h
+++ b/win32caml/inria.h
@@ -63,6 +63,14 @@
#include "editbuffer.h"
#include "history.h"
+#if _MSC_VER <= 1200
+#define GetWindowLongPtr GetWindowLong
+#define SetWindowLongPtr SetWindowLong
+#define DWLP_USER DWL_USER
+#define GWLP_WNDPROC GWL_WNDPROC
+#define LONG_PTR DWORD
+#endif
+
// In this structure should go eventually all global variables scattered
// through the program.
typedef struct _programParams {