summaryrefslogtreecommitdiff
path: root/devel
diff options
context:
space:
mode:
authorwiz <wiz@pkgsrc.org>2010-12-17 09:40:14 +0000
committerwiz <wiz@pkgsrc.org>2010-12-17 09:40:14 +0000
commit1141cc77e05002c221307d1e7b2a04e35eb15608 (patch)
tree0963af90080ddaef79b101940dfa3412d3bbc7cc /devel
parentc12342c40733fb2abe4a29d9308f31f77568a417 (diff)
downloadpkgsrc-1141cc77e05002c221307d1e7b2a04e35eb15608.tar.gz
Update to 0.9.8.6rc1 and add lots of upstream SVN patches to make
it build again. Changes: This is a major feature enhancement and bugfix release * Added keyword and optional function arguments. The syntax of a keyword parameter/argument is "identifier = expr". Function Application ------------------------------------------- f(a) f(1) f(~a, b) f(~a = 10, 11) Required keyword argument f(?a, b) f(~a = 10, 12) Optional keyword argument f(12) -- defaults to empty f(?a = 1, b) f(~a = 10, 11) Optional keyword argument with default value f(~a = 1, b) f(11) -- ~a is same as ?a if there is a default value f(?a = 10, 11) -- Arguments can use ?, but it means the same thing Keyword arguments and normal arguments are processed independently. Normal arguments have to appear in the same order as in the parameter list, but keyword arguments can go anywhere. This also adds the function notation. fun(x, y) => add($x, $y) foreach(x => ..., a b c) println($x) where the "..." essentially means "parse as if the indented block below was actually an expression in here" Old-style foreach generate a warning. * Added "program" syntax. This provides a more standard programming language, where strings must be explicit, and variables represent applications. The outer syntax is normal; the program syntax is an ast to ast translation. The translation is turned on with the command ".LANGUAGE: program", which is scoped like "export". Here is an example: #!/usr/bin/env osh .LANGUAGE: program f(x) = return x + 1 println(f(f(1))) The normal $-style expressions are always allowed, but in program-syntax mode, identifiers stand for variables, function application is the f(e1, ..., e2) form, and there are the standard infix operators. To switch back to the default syntax, use .LANGUAGE: make Note, shell commands and rules never use program syntax, except within function arguments. This is not heavily tested. * Added support for partial and curried function applications. Normal funcation application still require using the correct number of arguments (as relaxed by the introduction of optional arguments), but apply function can be used to create curried and partial applications. f(x,y) = return $(add $x, $y) g = $(apply $f, 2) # Partial applications must use apply println($(g 3)) # 5 ff(x) = gg(y) = return $(add $x, $y) println($(apply $(ff), 3, 5)) # Prints 8, also need to use apply here apply can also take keyword arguments. * A high-quality C parser was added to OMake — see lib/parse/C/Parse.om * Added a LaTeX parser and spellchecker - see lib/parse/LaTeX/README.txt * New functions added: localtime, gmtime, mktime, normalize-tm, utimes, digest-string, url-escaped, find-all, addprefixes * New object added: Tm * About 10 Bugs fixed * [Experimental] Object methods can now export their fields back into the parent object. For example, Z. = x = 1 f() = x = 2 export Z.f() echo $(Z.x) # Prints "2" This works with arbitrary levels of nesting.
Diffstat (limited to 'devel')
-rw-r--r--devel/omake/Makefile8
-rw-r--r--devel/omake/PLIST8
-rw-r--r--devel/omake/distinfo32
-rw-r--r--devel/omake/patches/patch-aa26
-rw-r--r--devel/omake/patches/patch-ac25
-rw-r--r--devel/omake/patches/patch-ad17
-rw-r--r--devel/omake/patches/patch-ae177
-rw-r--r--devel/omake/patches/patch-af127
-rw-r--r--devel/omake/patches/patch-ag45
-rw-r--r--devel/omake/patches/patch-ah15
-rw-r--r--devel/omake/patches/patch-ai24
-rw-r--r--devel/omake/patches/patch-aj15
-rw-r--r--devel/omake/patches/patch-ak90
-rw-r--r--devel/omake/patches/patch-al96
-rw-r--r--devel/omake/patches/patch-am18
-rw-r--r--devel/omake/patches/patch-an33
-rw-r--r--devel/omake/patches/patch-ao35
-rw-r--r--devel/omake/patches/patch-ap117
-rw-r--r--devel/omake/patches/patch-aq58
-rw-r--r--devel/omake/patches/patch-ar125
-rw-r--r--devel/omake/patches/patch-as127
-rw-r--r--devel/omake/patches/patch-at364
-rw-r--r--devel/omake/patches/patch-au24
-rw-r--r--devel/omake/patches/patch-av20
-rw-r--r--devel/omake/patches/patch-aw343
-rw-r--r--devel/omake/patches/patch-ax366
26 files changed, 2311 insertions, 24 deletions
diff --git a/devel/omake/Makefile b/devel/omake/Makefile
index 1c044450192..6fa84a89377 100644
--- a/devel/omake/Makefile
+++ b/devel/omake/Makefile
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.1.1.1 2010/05/29 10:43:14 obache Exp $
+# $NetBSD: Makefile,v 1.2 2010/12/17 09:40:14 wiz Exp $
#
-DISTNAME= omake-${VERSION}-3
-PKGNAME= omake-${VERSION}
+DISTNAME= omake-${VERSION}-0.rc1
+PKGNAME= omake-${VERSION}.0rc1
CATEGORIES= devel
MASTER_SITES= http://omake.metaprl.org/downloads/
@@ -19,7 +19,7 @@ WRKSRC= ${WRKDIR}/omake-${VERSION}
MAKE_ENV+= INSTALL_ROOT=${DESTDIR}
-VERSION= 0.9.8.5
+VERSION= 0.9.8.6
.include "../../lang/ocaml/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
diff --git a/devel/omake/PLIST b/devel/omake/PLIST
index 90eec6973ba..a4b7e52000e 100644
--- a/devel/omake/PLIST
+++ b/devel/omake/PLIST
@@ -1,6 +1,5 @@
-@comment $NetBSD: PLIST,v 1.1.1.1 2010/05/29 10:43:14 obache Exp $
+@comment $NetBSD: PLIST,v 1.2 2010/12/17 09:40:14 wiz Exp $
bin/cvs_realclean
-bin/ocamldep-omake
bin/omake
bin/osh
lib/omake/OMakefile.default
@@ -21,3 +20,8 @@ lib/omake/configure/readline.om
lib/omake/configure/snprintf.om
lib/omake/parse/C/Lex.om
lib/omake/parse/C/Parse.om
+lib/omake/parse/LaTeX/Lex.om
+lib/omake/parse/LaTeX/Macros.om
+lib/omake/parse/LaTeX/Parse.om
+lib/omake/parse/LaTeX/Spell.om
+lib/omake/web/simple-xml.om
diff --git a/devel/omake/distinfo b/devel/omake/distinfo
index d9b8022822d..331a71a7514 100644
--- a/devel/omake/distinfo
+++ b/devel/omake/distinfo
@@ -1,7 +1,29 @@
-$NetBSD: distinfo,v 1.1.1.1 2010/05/29 10:43:14 obache Exp $
+$NetBSD: distinfo,v 1.2 2010/12/17 09:40:14 wiz Exp $
-SHA1 (omake-0.9.8.5-3.tar.gz) = e78c9d8858749f5e234cba303637980e24085cbc
-RMD160 (omake-0.9.8.5-3.tar.gz) = 2364e29a7cc9bd6aaf837818bbe0a64ef4afce14
-Size (omake-0.9.8.5-3.tar.gz) = 3321245 bytes
-SHA1 (patch-aa) = b8138151041b1c99ddc752361f99c1822d88ef07
+SHA1 (omake-0.9.8.6-0.rc1.tar.gz) = f714fa992bf391b8bac49a488bc654128962d1cc
+RMD160 (omake-0.9.8.6-0.rc1.tar.gz) = b7ceebea6f4c40460625e2e9528257e200676bca
+Size (omake-0.9.8.6-0.rc1.tar.gz) = 3254283 bytes
+SHA1 (patch-aa) = 1cc195874da3db9f909993818b347211c9f3ff77
SHA1 (patch-ab) = 449aae3ff362efbc50f188cba8a76a13334eb964
+SHA1 (patch-ac) = 21f4d1b8d822cebbd19ab2226193f137d66dfd7e
+SHA1 (patch-ad) = d522e9cd5fbbf74c876314afecbfecc85434210c
+SHA1 (patch-ae) = 2b0a400b4da3e557d6a14eab9fa76913059c084a
+SHA1 (patch-af) = 24731dd649379f22de0fd34d46d68e7acf6c8a61
+SHA1 (patch-ag) = e7c9e2e0826dc2ca69df4830f449a4d0946fd278
+SHA1 (patch-ah) = 35ffade097aa37b37be1e73b3f1521d57b9d1880
+SHA1 (patch-ai) = ea06c43ea427508f6eef0e0ade9b569977bd7ac1
+SHA1 (patch-aj) = 9c33be37c2dff423890b132984414c1fd1da457f
+SHA1 (patch-ak) = 20af5574290a4ee1dd98bcaff63ed7d93945029e
+SHA1 (patch-al) = 86b3e0bb348ad6d5813df20bad5ec8e0c77e372b
+SHA1 (patch-am) = 15f572056b66dc565cba65da04899909be784bf8
+SHA1 (patch-an) = 493e5e9bb25371b066aafe8aac70defee13370b7
+SHA1 (patch-ao) = 5f70ae344d3d0d822ed5a6ed21c75c33b2b10d0d
+SHA1 (patch-ap) = 93db626ca9bee439d513014c9aa23212d3e42a70
+SHA1 (patch-aq) = 9531c72e6d6c417b10059dabbf37b8e3a1324b02
+SHA1 (patch-ar) = 936c185d4a290ae2acb0b6f6788cef9996d2e197
+SHA1 (patch-as) = fa7a7720867a5e5b53df8c3d80f35d0aa27b5b80
+SHA1 (patch-at) = cb81d50d1a85dac9cb0fa81046b8a7b255387a4c
+SHA1 (patch-au) = efb7a298c259e645d2031fee5b016a47389621dd
+SHA1 (patch-av) = 10edbea63bca8788f922c9debb2ebc50655760a5
+SHA1 (patch-aw) = 4999a863230373cca75a6e5cbc4203430823468d
+SHA1 (patch-ax) = 0a91c5d1a561b319885e848def2a3c54d52751d7
diff --git a/devel/omake/patches/patch-aa b/devel/omake/patches/patch-aa
index c2e3051e1ba..efa7f22778b 100644
--- a/devel/omake/patches/patch-aa
+++ b/devel/omake/patches/patch-aa
@@ -1,15 +1,15 @@
-$NetBSD: patch-aa,v 1.1.1.1 2010/05/29 10:43:14 obache Exp $
+$NetBSD: patch-aa,v 1.2 2010/12/17 09:40:14 wiz Exp $
-http://svn.metaprl.org/viewvc/mojave?view=rev&revision=12923
+From upstream SVN.
---- src/exec/omake_exec.ml.orig 2006-12-08 22:52:01.000000000 +0000
-+++ src/exec/omake_exec.ml
-@@ -46,8 +46,6 @@ open Omake_exec_notify
- open Omake_options
- open Omake_command_type
-
--external sync : unit -> unit = "caml_sync"
--
- module Exec =
- struct
- (*
+--- OMakefile.orig 2010-10-27 00:42:37.000000000 +0000
++++ OMakefile
+@@ -57,7 +57,7 @@ if $(not $(defined CAMLLIB))
+ #
+ # OCaml options
+ #
+-OCAMLFLAGS[] += -w Ae$(if $(OCAML_ACCEPTS_Z_WARNING), z)
++OCAMLFLAGS[] += -w Ae$(if $(OCAML_ACCEPTS_Z_WARNING), z-9-29)
+ if $(THREADS_ENABLED)
+ OCAMLFLAGS += -thread
+ export
diff --git a/devel/omake/patches/patch-ac b/devel/omake/patches/patch-ac
new file mode 100644
index 00000000000..4db285efa7a
--- /dev/null
+++ b/devel/omake/patches/patch-ac
@@ -0,0 +1,25 @@
+$NetBSD: patch-ac,v 1.1 2010/12/17 09:40:14 wiz Exp $
+
+From upstream SVN.
+
+--- src/build/omake_rule.ml.orig 2010-10-07 19:59:08.000000000 +0000
++++ src/build/omake_rule.ml
+@@ -768,7 +768,7 @@ let lazy_command venv pos command =
+ let fv = free_vars_exp_list el in
+ CommandSection (eval_string_exp venv pos s, fv, el)
+ | ShellExp (loc, s) ->
+- CommandValue (loc, ValStringExp (venv_get_env venv, s))
++ CommandValue (loc, venv_get_env venv, s)
+ | _ ->
+ let fv = free_vars_exp command in
+ CommandSection (ValData "eval", fv, [command])
+@@ -1121,7 +1121,8 @@ and eval_rule venv loc target sources sl
+ let commands = ([], CommandEval e) :: commands in
+ let fv = free_vars_union fv fv' in
+ commands, fv
+- | CommandValue (loc, v) ->
++ | CommandValue (loc, env, s) ->
++ let v = ValStringExp (env, s) in
+ let commands =
+ try
+ let flags, pipe = pipe_of_value venv find_alias options pos loc v in
diff --git a/devel/omake/patches/patch-ad b/devel/omake/patches/patch-ad
new file mode 100644
index 00000000000..6b6b21a60d8
--- /dev/null
+++ b/devel/omake/patches/patch-ad
@@ -0,0 +1,17 @@
+$NetBSD: patch-ad,v 1.1 2010/12/17 09:40:14 wiz Exp $
+
+From upstream SVN.
+
+--- src/builtin/omake_builtin_target.ml.orig 2008-01-15 19:57:00.000000000 +0000
++++ src/builtin/omake_builtin_target.ml
+@@ -221,8 +221,8 @@ let split_command venv (values1, lines1)
+ match line with
+ CommandSection (_, _, e) ->
+ ValBody (e, ExportNone)
+- | CommandValue (_, v) ->
+- v
++ | CommandValue (_, exp, v) ->
++ ValStringExp(exp,v)
+ in
+ v :: lines) lines1 lines2
+ in
diff --git a/devel/omake/patches/patch-ae b/devel/omake/patches/patch-ae
new file mode 100644
index 00000000000..eba1eb6ce78
--- /dev/null
+++ b/devel/omake/patches/patch-ae
@@ -0,0 +1,177 @@
+$NetBSD: patch-ae,v 1.1 2010/12/17 09:40:14 wiz Exp $
+
+From upstream SVN.
+
+--- src/clib/omake_shell_sys.c.orig 2007-12-01 21:32:13.000000000 +0000
++++ src/clib/omake_shell_sys.c
+@@ -551,7 +551,7 @@ value omake_shell_sys_suspend(value v_pg
+ fflush(stderr);
+ #endif
+ if(process_group_map(suspend_process, Int_val(v_pgrp)) < 0)
+- failwith("omake_shell_sys_suspend");
++ caml_failwith("omake_shell_sys_suspend");
+ CAMLreturn(Val_unit);
+ }
+
+@@ -563,7 +563,7 @@ value omake_shell_sys_resume(value v_pgr
+ fflush(stderr);
+ #endif
+ if(process_group_map(resume_process, Int_val(v_pgrp)) < 0)
+- failwith("omake_shell_sys_resume");
++ caml_failwith("omake_shell_sys_resume");
+ CAMLreturn(Val_unit);
+ }
+
+@@ -575,7 +575,7 @@ value omake_shell_sys_kill(value v_pgrp)
+ fflush(stderr);
+ #endif
+ if(process_group_map(kill_process, Int_val(v_pgrp)) < 0)
+- failwith("omake_shell_sys_kill");
++ caml_failwith("omake_shell_sys_kill");
+ CAMLreturn(Val_unit);
+ }
+
+@@ -600,14 +600,14 @@ value omake_shell_sys_create_thread_pid(
+ /* Allocate the process data */
+ processp = (Process *) malloc(sizeof(Process));
+ if(processp == 0)
+- failwith("omake_shell_sys_create_thread_pid: out of memory");
++ caml_failwith("omake_shell_sys_create_thread_pid: out of memory");
+ memset(processp, 0, sizeof(Process));
+
+ /* Create an event for waiting on the thread */
+ event = CreateEvent(NULL, FALSE, FALSE, NULL);
+ if(event == NULL) {
+ free(processp);
+- failwith("omake_shell_sys_create_thread_pid: can't create event");
++ caml_failwith("omake_shell_sys_create_thread_pid: can't create event");
+ }
+
+ pgrp = Int_val(v_pgrp);
+@@ -645,7 +645,7 @@ value omake_shell_sys_init_thread_pid(va
+ break;
+ }
+ if(processp == 0)
+- raise_not_found();
++ caml_raise_not_found();
+
+ /* Process has terminated */
+ processp->thread = GetCurrentThreadId();
+@@ -679,7 +679,7 @@ value omake_shell_sys_release_thread_pid
+ break;
+ }
+ if(processp == 0)
+- raise_not_found();
++ caml_raise_not_found();
+
+ /* Process has terminated */
+ processp->changed = 1;
+@@ -771,7 +771,7 @@ value omake_shell_sys_wait(value v_pgrp,
+ goto done;
+ else {
+ if(ncount == MAXIMUM_WAIT_OBJECTS)
+- invalid_argument("omake_shell_sys_wait: too many processes");
++ caml_invalid_argument("omake_shell_sys_wait: too many processes");
+ processes[ncount] = processp->pid;
+ handles[ncount] = processp->handle;
+ ncount++;
+@@ -787,11 +787,11 @@ value omake_shell_sys_wait(value v_pgrp,
+ /* Wait for an event */
+ while(1) {
+ /* Perform the wait */
+- enter_blocking_section();
++ caml_enter_blocking_section();
+ index = WaitForMultipleObjects(ncount, handles, FALSE, timeout);
+ if(index == WAIT_FAILED)
+ code = GetLastError();
+- leave_blocking_section();
++ caml_leave_blocking_section();
+
+ /* See if something has changed */
+ if(index == WAIT_OBJECT_0) {
+@@ -810,7 +810,7 @@ value omake_shell_sys_wait(value v_pgrp,
+ else if(index >= WAIT_ABANDONED_0 + 1 && index < WAIT_ABANDONED_0 + ncount)
+ index -= WAIT_ABANDONED_0;
+ else
+- raise_not_found();
++ caml_raise_not_found();
+
+ /* Adjust process */
+ pid = processes[index];
+@@ -863,7 +863,7 @@ value omake_shell_sys_wait(value v_pgrp,
+ break;
+ case STATUS_RUNNING:
+ default:
+- invalid_argument("wait_process: process is running");
++ caml_invalid_argument("wait_process: process is running");
+ break;
+ }
+
+@@ -908,7 +908,7 @@ value omake_shell_sys_create_process(val
+ strp = String_val(Field(v_envp, i));
+ length = strlen(strp);
+ if(index + length + 2 > SIZEOF_ENVIRONMENT)
+- failwith("omake_shell_sys_create_process: environment is too big");
++ caml_failwith("omake_shell_sys_create_process: environment is too big");
+ strcpy(env + index, strp);
+ index += length + 1;
+ }
+@@ -919,7 +919,7 @@ value omake_shell_sys_create_process(val
+ v_argvp = Field(v_info, CREATE_PROCESS_ARGV);
+ count = Wosize_val(v_argvp);
+ if(count == 0)
+- invalid_argument("omake_shell_sys_create_process: command line is empty");
++ caml_invalid_argument("omake_shell_sys_create_process: command line is empty");
+ index = 0;
+ for(i = 0; i != count; i++) {
+ /* Win32 doesn't deal well when the command name differs from the executable */
+@@ -930,7 +930,7 @@ value omake_shell_sys_create_process(val
+ length = strlen(argp);
+ white = string_escape_length(argp);
+ if(index + length + white + 4 >= SIZEOF_COMMAND)
+- failwith("omake_shell_sys_create_process: command line is too long");
++ caml_failwith("omake_shell_sys_create_process: command line is too long");
+ if(index)
+ argv[index++] = ' ';
+ if(white)
+@@ -1019,13 +1019,13 @@ value omake_shell_sys_create_process(val
+ if ((bufLen < 1) || (bufLen > 1024)) {
+ if (lpMsgBuf != NULL)
+ LocalFree( lpMsgBuf );
+- failwith("omake_shell_sys_create_process: process creation failed");
++ caml_failwith("omake_shell_sys_create_process: process creation failed");
+ } else {
+ char err[2048];
+ sprintf(err, "omake_shell_sys_create_process: process creation failed: %s", (char *)lpMsgBuf);
+ if (lpMsgBuf != NULL)
+ LocalFree( lpMsgBuf );
+- failwith(err);
++ caml_failwith(err);
+ }
+ }
+ CloseHandle(process.hThread);
+@@ -1034,7 +1034,7 @@ value omake_shell_sys_create_process(val
+ processp = (Process *) malloc(sizeof(Process));
+ if(processp == 0) {
+ CloseHandle(process.hProcess);
+- failwith("omake_shell_sys_create_process: out of memory");
++ caml_failwith("omake_shell_sys_create_process: out of memory");
+ }
+ memset(processp, 0, sizeof(Process));
+ processp->pid = pid;
+@@ -1129,13 +1129,13 @@ value omake_shell_sys_init(value v_unit)
+ /* Allocate a struct for the current process */
+ processp = (Process *) malloc(sizeof(Process));
+ if(processp == 0)
+- failwith("Omake_shell_csys.create_state: out of memory");
++ caml_failwith("Omake_shell_csys.create_state: out of memory");
+ memset(processp, 0, sizeof(Process));
+
+ /* Allocate the state */
+ state = (ShellState *) malloc(sizeof(ShellState));
+ if(state == 0)
+- failwith("Omake_shell_csys.create_state: out of memory");
++ caml_failwith("Omake_shell_csys.create_state: out of memory");
+ memset(state, 0, sizeof(ShellState));
+ state->pid_counter = INIT_PID;
+ state->changed = CreateEvent(NULL, FALSE, FALSE, NULL);
diff --git a/devel/omake/patches/patch-af b/devel/omake/patches/patch-af
new file mode 100644
index 00000000000..145d12b04c4
--- /dev/null
+++ b/devel/omake/patches/patch-af
@@ -0,0 +1,127 @@
+$NetBSD: patch-af,v 1.1 2010/12/17 09:40:14 wiz Exp $
+
+From upstream SVN.
+
+--- src/clib/readline.c.orig 2007-05-15 19:03:03.000000000 +0000
++++ src/clib/readline.c
+@@ -134,7 +134,7 @@ static char **readline_completion(char *
+ CAMLreturnT(char **, 0);
+
+ /* The callback returns an array of strings */
+- request = copy_string(text);
++ request = caml_copy_string(text);
+ response = caml_callback(*callbackp, request);
+
+ /* Copy the array of strings */
+@@ -726,9 +726,9 @@ static ProcessCode processor(ReadLine *r
+
+ /* Input loop */
+ while(1) {
+- enter_blocking_section();
++ caml_enter_blocking_section();
+ status = ReadConsoleInput(readp->console_in, input, INPUT_COUNT, &count);
+- leave_blocking_section();
++ caml_leave_blocking_section();
+ if(status == 0) {
+ print_error("ReadConsoleInput");
+ return CODE_EOF;
+@@ -766,11 +766,11 @@ static void readline_cooked(ReadLine *re
+ {
+ char *s;
+
+- enter_blocking_section();
++ caml_enter_blocking_section();
+ s = fgets(readp->current.buffer, LINE_MAX, stdin);
+- leave_blocking_section();
++ caml_leave_blocking_section();
+ if(s == 0)
+- raise_end_of_file();
++ caml_raise_end_of_file();
+ readp->current.length = strlen(readp->current.buffer);
+ }
+
+@@ -1053,7 +1053,7 @@ value omake_readline(value v_prompt)
+
+ /* Copy it to a string */
+ linep = &readp->current;
+- v_str = alloc_string(linep->length);
++ v_str = caml_alloc_string(linep->length);
+ memcpy(String_val(v_str), linep->buffer, linep->length);
+
+ /* Reset the current buffer */
+@@ -1105,7 +1105,7 @@ value omake_readline_init(value v_unit)
+ c_stdin = GetStdHandle(STD_INPUT_HANDLE);
+ c_stdout = GetStdHandle(STD_OUTPUT_HANDLE);
+ if(c_stdin == INVALID_HANDLE_VALUE || c_stdout == INVALID_HANDLE_VALUE)
+- failwith("omake_readline_init: no standard channels");
++ caml_failwith("omake_readline_init: no standard channels");
+
+ /* Check if it is a console */
+ is_console = 1;
+@@ -1179,18 +1179,18 @@ static ReadLine *AllocReadLine(int is_co
+ /* Allocate */
+ readp = (ReadLine *) malloc(sizeof(ReadLine));
+ if(readp == NULL)
+- failwith("AllocReadLine: out of memory");
++ caml_failwith("AllocReadLine: out of memory");
+ memset(readp, 0, sizeof(ReadLine));
+
+ /* Initialize */
+ readp->buffer = malloc(LINE_MAX);
+ if (readp->buffer == NULL)
+- failwith("AllocReadLine: out of memory");
++ caml_failwith("AllocReadLine: out of memory");
+ readp->buffer_size = LINE_MAX;
+
+ readp->prompt = malloc(MAX_PROMPT_LENGTH);
+ if (readp->prompt == NULL)
+- failwith("AllocReadLine: out of memory");
++ caml_failwith("AllocReadLine: out of memory");
+ readp->prompt_size = MAX_PROMPT_LENGTH;
+
+ readp->console_in = console_in;
+@@ -1262,7 +1262,7 @@ static void readline_raw(ReadLine *readp
+ if(length >= readp->buffer_size) {
+ char *new_buffer = malloc(length + 1);
+ if(new_buffer == NULL)
+- failwith("readline_raw: out of memory");
++ caml_failwith("readline_raw: out of memory");
+ free(readp->buffer);
+ readp->buffer = new_buffer;
+ readp->buffer_size = length + 1;
+@@ -1307,7 +1307,7 @@ static void do_readline(ReadLine *readp,
+ readp->prompt = malloc(new_size);
+ if (readp->prompt == NULL) {
+ readp->prompt = old_prompt;
+- failwith("do_readline: out of memory");
++ caml_failwith("do_readline: out of memory");
+ } else {
+ memcpy(readp->prompt, old_prompt, i);
+ free(old_prompt);
+@@ -1545,7 +1545,7 @@ value omake_readline(value v_prompt)
+ do_readline(readp, String_val(v_prompt));
+
+ /* Copy it to the buffer */
+- v_str = alloc_string(readp->length);
++ v_str = caml_alloc_string(readp->length);
+ memcpy(String_val(v_str), readp->buffer, readp->length);
+
+ /* Reset the current buffer */
+@@ -1609,7 +1609,7 @@ value omake_rl_prompt_wrappers(value v_u
+ CAMLlocal2(s1, s2);
+ s1 = caml_copy_string(begin);
+ s2 = caml_copy_string(end);
+- buf = alloc_tuple(2);
++ buf = caml_alloc_tuple(2);
+ Field(buf, 0) = s1;
+ Field(buf, 1) = s2;
+ }
+@@ -1617,7 +1617,7 @@ value omake_rl_prompt_wrappers(value v_u
+ {
+ CAMLlocal1(emptystr);
+ emptystr = caml_copy_string("");
+- buf = alloc_tuple(2);
++ buf = caml_alloc_tuple(2);
+ Field(buf, 0) = emptystr;
+ Field(buf, 1) = emptystr;
+ }
diff --git a/devel/omake/patches/patch-ag b/devel/omake/patches/patch-ag
new file mode 100644
index 00000000000..e1fdcbac863
--- /dev/null
+++ b/devel/omake/patches/patch-ag
@@ -0,0 +1,45 @@
+$NetBSD: patch-ag,v 1.1 2010/12/17 09:40:14 wiz Exp $
+
+From upstream SVN.
+
+--- src/env/omake_env.ml.orig 2008-01-15 19:57:00.000000000 +0000
++++ src/env/omake_env.ml
+@@ -404,8 +404,8 @@ let rec pp_print_command buf command =
+ match command with
+ CommandSection (arg, fv, e) ->
+ fprintf buf "@[<hv 3>section %a@ %a@]" pp_print_value arg pp_print_exp_list e
+- | CommandValue (_, v) ->
+- pp_print_value buf v
++ | CommandValue (_, _, v) ->
++ pp_print_string_exp buf v
+
+ and pp_print_commands buf commands =
+ List.iter (fun command -> fprintf buf "@ %a" pp_print_command command) commands
+@@ -1928,6 +1928,14 @@ let venv_save_explicit_rules venv loc er
+ let venv_add_wild_match venv v =
+ venv_add_var venv wild_var v
+
++let command_add_wild venv wild command =
++ match command with
++ CommandSection _ ->
++ command
++ | CommandValue(loc, env, s) ->
++ let env = venv_get_env (venv_add_wild_match (venv_with_env venv env) wild) in
++ CommandValue(loc, env, s)
++
+ (*
+ * This is the standard way to add results of a pattern match.
+ *)
+@@ -2699,8 +2707,10 @@ let venv_find_implicit_rules_inner venv
+ let scanner_args = List.map (subst_source venv target_dir subst) irule.irule_scanners in
+ let scanners = node_set_of_list scanner_args in
+ let core = wild_core subst in
+- let venv = venv_add_wild_match venv (ValData core) in
+- let commands = make_command_info venv source_args irule.irule_values irule.irule_body in
++ let core_val = ValData core in
++ let venv = venv_add_wild_match venv core_val in
++ let commands = List.map (command_add_wild venv core_val) irule.irule_body in
++ let commands = make_command_info venv source_args irule.irule_values commands in
+ let effects =
+ List.fold_left (fun effects pattern ->
+ let effect = wild_subst_in subst pattern in
diff --git a/devel/omake/patches/patch-ah b/devel/omake/patches/patch-ah
new file mode 100644
index 00000000000..29382a32bc8
--- /dev/null
+++ b/devel/omake/patches/patch-ah
@@ -0,0 +1,15 @@
+$NetBSD: patch-ah,v 1.1 2010/12/17 09:40:14 wiz Exp $
+
+From upstream SVN.
+
+--- src/ir/omake_value_type.ml.orig 2010-10-07 19:59:08.000000000 +0000
++++ src/ir/omake_value_type.ml
+@@ -162,7 +162,7 @@ type path =
+ *)
+ type command =
+ CommandSection of value * free_vars * exp list (* Name of the section, its free variables, and the expression *)
+- | CommandValue of loc * value
++ | CommandValue of loc * env * string_exp
+
+ (*
+ * Kinds of rules.
diff --git a/devel/omake/patches/patch-ai b/devel/omake/patches/patch-ai
new file mode 100644
index 00000000000..8b30bdce76d
--- /dev/null
+++ b/devel/omake/patches/patch-ai
@@ -0,0 +1,24 @@
+$NetBSD: patch-ai,v 1.1 2010/12/17 09:40:14 wiz Exp $
+
+From upstream SVN.
+
+--- src/libmojave-external/cutil/lm_channel.c.orig 2006-07-15 17:23:37.000000000 +0000
++++ src/libmojave-external/cutil/lm_channel.c
+@@ -57,7 +57,7 @@ value omake_shell_peek_pipe(value v_fd)
+ &total, // Total number of bytes available
+ NULL); // Number of bytes in the next message
+ if(status == 0)
+- failwith("Not a pipe");
++ caml_failwith("Not a pipe");
+ return total ? Val_int(1) : Val_int(0);
+ }
+
+@@ -83,7 +83,7 @@ value omake_shell_pipe_kind(value v_fd)
+
+ value omake_shell_peek_pipe(value v_fd)
+ {
+- failwith("omake_shell_peek_pipe: not available on Unix systems");
++ caml_failwith("omake_shell_peek_pipe: not available on Unix systems");
+ return Val_unit;
+ }
+
diff --git a/devel/omake/patches/patch-aj b/devel/omake/patches/patch-aj
new file mode 100644
index 00000000000..9cc2ede9bdc
--- /dev/null
+++ b/devel/omake/patches/patch-aj
@@ -0,0 +1,15 @@
+$NetBSD: patch-aj,v 1.1 2010/12/17 09:40:14 wiz Exp $
+
+From upstream SVN.
+
+--- src/libmojave-external/cutil/lm_ctype.c.orig 2006-12-01 21:13:14.000000000 +0000
++++ src/libmojave-external/cutil/lm_ctype.c
+@@ -59,7 +59,7 @@ static value get_chars(int (*f)(int))
+ if(f(i))
+ *p++ = (char) i;
+ }
+- s = alloc_string(p - buf);
++ s = caml_alloc_string(p - buf);
+ memcpy(String_val(s), buf, p - buf);
+ return s;
+ }
diff --git a/devel/omake/patches/patch-ak b/devel/omake/patches/patch-ak
new file mode 100644
index 00000000000..4eeb50142d9
--- /dev/null
+++ b/devel/omake/patches/patch-ak
@@ -0,0 +1,90 @@
+$NetBSD: patch-ak,v 1.1 2010/12/17 09:40:14 wiz Exp $
+
+From upstream SVN.
+
+--- src/libmojave-external/cutil/lm_notify.c.orig 2007-07-27 17:58:13.000000000 +0000
++++ src/libmojave-external/cutil/lm_notify.c
+@@ -74,13 +74,13 @@ typedef struct {
+
+ #define CheckCode(fmt, expr) \
+ do { \
+- enter_blocking_section(); \
++ caml_enter_blocking_section(); \
+ code = expr; \
+- leave_blocking_section(); \
++ caml_leave_blocking_section(); \
+ if(code < 0) { \
+ char buffer[256]; \
+ ErrFmt(buffer, fmt); \
+- failwith(buffer); \
++ caml_failwith(buffer); \
+ } \
+ } while(0)
+
+@@ -145,11 +145,11 @@ value om_notify_open(value v_unit)
+ FAMInfo *info;
+ int code;
+
+- v = alloc_custom(&fam_connection_ops, sizeof(FAMInfo), 0, 1);
++ v = caml_alloc_custom(&fam_connection_ops, sizeof(FAMInfo), 0, 1);
+ info = FAMInfo_val(v);
+ fc = malloc(sizeof(FAMConnection));
+ if(fc == 0)
+- invalid_argument("om_notify_open: out of memory");
++ caml_invalid_argument("om_notify_open: out of memory");
+ info->fc = fc;
+ CheckCode("om_notify_open", FAMOpen(fc));
+ #ifdef HAVE_FAMNOEXISTS
+@@ -180,7 +180,7 @@ value om_notify_fd(value v_fc)
+ fc = FAMConnection_val(v_fc);
+ return Val_int(fc->id);
+ #else /* FAM_PSEUDO && !FAM_INOTIFY */
+- failwith("No file descriptors in pseudo-FAM");
++ caml_failwith("No file descriptors in pseudo-FAM");
+ return Val_unit;
+ #endif /* FAM_INOTIFY */
+ #else /* FAM_PSEUDO */
+@@ -209,7 +209,7 @@ value om_notify_monitor_directory(value
+ #ifdef WIN32
+ CheckCode("om_notify_monitor_directory", FAMMonitorDirectoryTree(fc, name, &request, 0));
+ #else /* WIN32 */
+- failwith("om_notify_monitor_directory: recursive monitoring is not allowed");
++ caml_failwith("om_notify_monitor_directory: recursive monitoring is not allowed");
+ #endif /* !WIN32 */
+ }
+ else
+@@ -294,13 +294,13 @@ value om_notify_next_event(value v_fc)
+ CheckCode("om_notify_next_event", FAMNextEvent(fc, &event));
+ code = event.code;
+ if(code < 1 || code > 10)
+- failwith("om_notify_next_event: code out of bounds");
++ caml_failwith("om_notify_next_event: code out of bounds");
+
+ /* Allocate the string name */
+- v_name = copy_string(event.filename);
++ v_name = caml_copy_string(event.filename);
+
+ /* Allocate the tuple */
+- v_tuple = alloc_tuple(3);
++ v_tuple = caml_alloc_tuple(3);
+ Field(v_tuple, 0) = Val_int(event.fr.reqnum);
+ Field(v_tuple, 1) = v_name;
+ Field(v_tuple, 2) = Val_int(code - 1);
+@@ -330,7 +330,7 @@ value om_notify_open(value v_unit)
+ */
+ value om_notify_fd(value v_fc)
+ {
+- invalid_argument("FAM not enabled");
++ caml_invalid_argument("FAM not enabled");
+ return Val_unit;
+ }
+
+@@ -389,7 +389,7 @@ value om_notify_pending(value v_fc)
+ */
+ value om_notify_next_event(value v_fc)
+ {
+- invalid_argument("FAM not enabled");
++ caml_invalid_argument("FAM not enabled");
+ return Val_unit;
+ }
+
diff --git a/devel/omake/patches/patch-al b/devel/omake/patches/patch-al
new file mode 100644
index 00000000000..429c61f21ff
--- /dev/null
+++ b/devel/omake/patches/patch-al
@@ -0,0 +1,96 @@
+$NetBSD: patch-al,v 1.1 2010/12/17 09:40:14 wiz Exp $
+
+From upstream SVN.
+
+--- src/libmojave-external/cutil/lm_printf.c.orig 2009-02-06 16:41:21.000000000 +0000
++++ src/libmojave-external/cutil/lm_printf.c
+@@ -61,12 +61,12 @@ value ml_print_char(value v_fmt, value v
+ char c = (char) Int_val(v_char);
+ #ifdef HAVE_SNPRINTF
+ if(snprintf(buffer, sizeof(buffer), fmt, c) < 0)
+- failwith("ml_print_char");
++ caml_failwith("ml_print_char");
+ #else
+ if(sprintf(buffer, fmt, c) < 0)
+- failwith("ml_print_char");
++ caml_failwith("ml_print_char");
+ #endif
+- return copy_string(buffer);
++ return caml_copy_string(buffer);
+ }
+
+ /*
+@@ -79,12 +79,12 @@ value ml_print_int(value v_fmt, value v_
+ int i = Int_val(v_int);
+ #ifdef HAVE_SNPRINTF
+ if(snprintf(buffer, sizeof(buffer), fmt, i) < 0)
+- failwith("ml_print_int");
++ caml_failwith("ml_print_int");
+ #else
+ if(sprintf(buffer, fmt, i) < 0)
+- failwith("ml_print_int");
++ caml_failwith("ml_print_int");
+ #endif
+- return copy_string(buffer);
++ return caml_copy_string(buffer);
+ }
+
+
+@@ -98,12 +98,12 @@ value ml_print_float(value v_fmt, value
+ double x = Double_val(v_float);
+ #ifdef HAVE_SNPRINTF
+ if(snprintf(buffer, sizeof(buffer), fmt, x) < 0)
+- failwith("ml_print_float");
++ caml_failwith("ml_print_float");
+ #else
+ if(sprintf(buffer, fmt, x) < 0)
+- failwith("ml_print_float");
++ caml_failwith("ml_print_float");
+ #endif
+- return copy_string(buffer);
++ return caml_copy_string(buffer);
+ }
+
+ /*
+@@ -132,7 +132,7 @@ value ml_print_string(value v_fmt, value
+ size = len * 2;
+ bufp = malloc(size);
+ if(bufp == 0)
+- failwith("ml_print_string");
++ caml_failwith("ml_print_string");
+ }
+
+ #ifdef HAVE_SNPRINTF
+@@ -143,9 +143,9 @@ value ml_print_string(value v_fmt, value
+ if(code < 0) {
+ if(bufp != buffer)
+ free(bufp);
+- failwith("ml_print_string");
++ caml_failwith("ml_print_string");
+ }
+- v_result = copy_string(bufp);
++ v_result = caml_copy_string(bufp);
+ if(bufp != buffer)
+ free(bufp);
+ return v_result;
+@@ -180,7 +180,7 @@ value ml_print_string2(value v_width, va
+ size = len * 2;
+ bufp = malloc(size);
+ if(bufp == 0)
+- failwith("ml_print_string");
++ caml_failwith("ml_print_string");
+ }
+
+ #ifdef HAVE_SNPRINTF
+@@ -191,9 +191,9 @@ value ml_print_string2(value v_width, va
+ if(code < 0) {
+ if(bufp != buffer)
+ free(bufp);
+- failwith("ml_print_string");
++ caml_failwith("ml_print_string");
+ }
+- v_result = copy_string(bufp);
++ v_result = caml_copy_string(bufp);
+ if(bufp != buffer)
+ free(bufp);
+ return v_result;
diff --git a/devel/omake/patches/patch-am b/devel/omake/patches/patch-am
new file mode 100644
index 00000000000..2445dfb497c
--- /dev/null
+++ b/devel/omake/patches/patch-am
@@ -0,0 +1,18 @@
+$NetBSD: patch-am,v 1.1 2010/12/17 09:40:14 wiz Exp $
+
+From upstream SVN.
+
+--- src/libmojave-external/cutil/lm_terminfo.c.orig 2007-05-15 19:03:32.000000000 +0000
++++ src/libmojave-external/cutil/lm_terminfo.c
+@@ -75,9 +75,9 @@ value caml_tgetstr(value id) {
+
+ /* Note that tigetstr will return either 0 or -1 on error. */
+ if(termdata == NULL || termdata == (char *)(-1)) {
+- result = copy_string("");
++ result = caml_copy_string("");
+ } else {
+- result = copy_string(termdata);
++ result = caml_copy_string(termdata);
+ /* apparently we're not supposed to free termdata here */
+ /* TEMP: I cannot find specs on this! */
+ //free(termdata);
diff --git a/devel/omake/patches/patch-an b/devel/omake/patches/patch-an
new file mode 100644
index 00000000000..8a943f9f849
--- /dev/null
+++ b/devel/omake/patches/patch-an
@@ -0,0 +1,33 @@
+$NetBSD: patch-an,v 1.1 2010/12/17 09:40:14 wiz Exp $
+
+From upstream SVN.
+
+--- src/libmojave-external/cutil/lm_termsize.c.orig 2008-03-19 00:44:12.000000000 +0000
++++ src/libmojave-external/cutil/lm_termsize.c
+@@ -45,7 +45,7 @@ value caml_term_size(value arg)
+ CAMLlocal1(buf);
+
+ /* Return a pair of numbers */
+- buf = alloc_small(2, 0);
++ buf = caml_alloc_small(2, 0);
+
+ /* Get the terminal size, return None on failure */
+ #ifdef WIN32
+@@ -53,7 +53,7 @@ value caml_term_size(value arg)
+ HANDLE fd = *(HANDLE *)Data_custom_val(arg);
+ CONSOLE_SCREEN_BUFFER_INFO ConsoleInfo;
+ if (! GetConsoleScreenBufferInfo(fd, &ConsoleInfo))
+- failwith("lm_termsize.c: caml_term_size: GetConsoleScreenBufferInfo failed");
++ caml_failwith("lm_termsize.c: caml_term_size: GetConsoleScreenBufferInfo failed");
+
+ Field(buf, 0) = Val_int(ConsoleInfo.dwSize.Y);
+ Field(buf, 1) = Val_int(ConsoleInfo.dwSize.X);
+@@ -65,7 +65,7 @@ value caml_term_size(value arg)
+ struct winsize ws;
+
+ if(ioctl(fd, TIOCGWINSZ, &ws) < 0)
+- failwith("lm_termsize.c: caml_term_size: not a terminal");
++ caml_failwith("lm_termsize.c: caml_term_size: not a terminal");
+
+ /* Return the pair of numbers */
+ Field(buf, 0) = Val_int(ws.ws_row);
diff --git a/devel/omake/patches/patch-ao b/devel/omake/patches/patch-ao
new file mode 100644
index 00000000000..471021b5f18
--- /dev/null
+++ b/devel/omake/patches/patch-ao
@@ -0,0 +1,35 @@
+$NetBSD: patch-ao,v 1.1 2010/12/17 09:40:14 wiz Exp $
+
+From upstream SVN.
+
+--- src/libmojave-external/cutil/lm_uname_ext.c.orig 2006-12-08 19:21:40.000000000 +0000
++++ src/libmojave-external/cutil/lm_uname_ext.c
+@@ -147,21 +147,21 @@ value lm_uname(value x)
+
+ /* Get sysinfo */
+ if(uname(&name) < 0)
+- failwith("uname");
++ caml_failwith("uname");
+
+ /* Copy data */
+- result = alloc_tuple(5);
++ result = caml_alloc_tuple(5);
+ Field(result, 0) = Val_unit;
+ Field(result, 1) = Val_unit;
+ Field(result, 2) = Val_unit;
+ Field(result, 3) = Val_unit;
+ Field(result, 4) = Val_unit;
+
+- Field(result, 0) = copy_string(name.sysname);
+- Field(result, 1) = copy_string(name.nodename);
+- Field(result, 2) = copy_string(name.release);
+- Field(result, 3) = copy_string(name.version);
+- Field(result, 4) = copy_string(name.machine);
++ Field(result, 0) = caml_copy_string(name.sysname);
++ Field(result, 1) = caml_copy_string(name.nodename);
++ Field(result, 2) = caml_copy_string(name.release);
++ Field(result, 3) = caml_copy_string(name.version);
++ Field(result, 4) = caml_copy_string(name.machine);
+
+ /* Return it */
+ CAMLreturn(result);
diff --git a/devel/omake/patches/patch-ap b/devel/omake/patches/patch-ap
new file mode 100644
index 00000000000..39bf8fff734
--- /dev/null
+++ b/devel/omake/patches/patch-ap
@@ -0,0 +1,117 @@
+$NetBSD: patch-ap,v 1.1 2010/12/17 09:40:14 wiz Exp $
+
+From upstream SVN.
+
+--- src/libmojave-external/cutil/lm_unix_cutil.c.orig 2007-07-18 17:42:32.000000000 +0000
++++ src/libmojave-external/cutil/lm_unix_cutil.c
+@@ -87,9 +87,9 @@ value home_win32(value v_unit)
+ TCHAR path[MAX_PATH];
+
+ if(SUCCEEDED(CompatSHGetFolderPath(NULL, CSIDL_LOCAL_APPDATA | CSIDL_FLAG_CREATE, NULL, 0, path)))
+- CAMLreturn(copy_string(path));
++ CAMLreturn(caml_copy_string(path));
+
+- failwith("home_win32");
++ caml_failwith("home_win32");
+ return Val_unit;
+ }
+
+@@ -138,7 +138,7 @@ value lockf_win32(value v_fd, value v_ki
+ flags = LOCKFILE_FAIL_IMMEDIATELY;
+ break;
+ default:
+- invalid_argument("lockf_win32");
++ caml_invalid_argument("lockf_win32");
+ break;
+ }
+
+@@ -147,11 +147,11 @@ value lockf_win32(value v_fd, value v_ki
+ overlapped.Offset = pos;
+
+ /* Perform the lock */
+- enter_blocking_section();
++ caml_enter_blocking_section();
+ code = LockFileEx(fd, flags, 0, len, 0, &overlapped);
+ if(code == 0)
+ error = GetLastError();
+- leave_blocking_section();
++ caml_leave_blocking_section();
+
+ /* Fail if the lock was not successful */
+ if(code == 0) {
+@@ -165,14 +165,14 @@ value lockf_win32(value v_fd, value v_ki
+ * XXX: HACK: this exception is being caught
+ * Do not change the string w/o changing the wrapper code.
+ */
+- failwith("lockf_win32: already locked");
++ caml_failwith("lockf_win32: already locked");
+ break;
+ case ERROR_POSSIBLE_DEADLOCK:
+ /*
+ * XXX: HACK: this exception is being caught
+ * Do not change the string w/o changing the wrapper code.
+ */
+- failwith("lockf_win32: possible deadlock");
++ caml_failwith("lockf_win32: possible deadlock");
+ break;
+ default:
+ FormatMessage(
+@@ -187,7 +187,7 @@ value lockf_win32(value v_fd, value v_ki
+ sprintf(szBuf, "lockf_win32 failed with error %d: %s", error, lpMsgBuf);
+ LocalFree(lpMsgBuf);
+
+- failwith(szBuf);
++ caml_failwith(szBuf);
+ break;
+ }
+ }
+@@ -289,7 +289,7 @@ value caml_registry_find(value v_hkey, v
+ #endif
+
+ /* Got the value */
+- return copy_string(buffer);
++ return caml_copy_string(buffer);
+ }
+
+ #else /* WIN32 */
+@@ -381,9 +381,9 @@ value lm_flock(value v_fd, value v_op)
+ op = Int_val(v_op);
+ #if defined(FLOCK_ENABLED)
+ cmd = flock_of_flock[op];
+- enter_blocking_section();
++ caml_enter_blocking_section();
+ code = flock(fd, cmd);
+- leave_blocking_section();
++ caml_leave_blocking_section();
+ #elif defined(FCNTL_ENABLED)
+ {
+ struct flock info;
+@@ -392,9 +392,9 @@ value lm_flock(value v_fd, value v_op)
+ info.l_whence = SEEK_SET;
+ info.l_start = 0;
+ info.l_len = FLOCK_LEN;
+- enter_blocking_section();
++ caml_enter_blocking_section();
+ code = fcntl(fd, cmd, &info);
+- leave_blocking_section();
++ caml_leave_blocking_section();
+ }
+ #elif defined(LOCKF_ENABLED)
+ cmd = lockf_of_flock[op];
+@@ -457,12 +457,12 @@ value lm_getpwents(value v_unit)
+ Store_field(entry, 2, Val_int(entryp->pw_uid));
+ Store_field(entry, 3, Val_int(entryp->pw_gid));
+ #ifdef __BEOS__
+- Store_field(entry, 4, copy_string(""));
++ Store_field(entry, 4, caml_copy_string(""));
+ #else
+- Store_field(entry, 4, copy_string(entryp->pw_gecos));
++ Store_field(entry, 4, caml_copy_string(entryp->pw_gecos));
+ #endif
+- Store_field(entry, 5, copy_string(entryp->pw_dir));
+- Store_field(entry, 6, copy_string(entryp->pw_shell));
++ Store_field(entry, 5, caml_copy_string(entryp->pw_dir));
++ Store_field(entry, 6, caml_copy_string(entryp->pw_shell));
+ cons = caml_alloc_tuple(2);
+ Store_field(cons, 0, entry);
+ Store_field(cons, 1, users);
diff --git a/devel/omake/patches/patch-aq b/devel/omake/patches/patch-aq
new file mode 100644
index 00000000000..06fd0aa71f8
--- /dev/null
+++ b/devel/omake/patches/patch-aq
@@ -0,0 +1,58 @@
+$NetBSD: patch-aq,v 1.1 2010/12/17 09:40:14 wiz Exp $
+
+From upstream SVN.
+
+--- src/libmojave-external/stdlib/lm_debug.ml.orig 2006-08-03 22:51:52.000000000 +0000
++++ src/libmojave-external/stdlib/lm_debug.ml
+@@ -173,11 +173,10 @@ let create_debug
+ *)
+ let load_debug name =
+ let rec search = function
+- { info_name = name'; info_flag = flag } :: t ->
+- if name' = name then
+- flag
+- else
+- search t
++ info :: _ when info.info_name = name ->
++ info.info_flag
++ | _ :: t ->
++ search t
+ | [] ->
+ raise (Failure (sprintf "Lm_debug.load_debug: variable '%s' has not been created" name))
+ in
+@@ -189,11 +188,10 @@ let load_debug name =
+ let set_debug name flag =
+ let rec search = function
+ h :: t ->
+- let { info_name = name'; info_flag = flag' } = h in
+- if name' = name then
+- flag' := flag
+- else
+- search t
++ if h.info_name = name then
++ h.info_flag := flag
++ else
++ search t
+ | [] ->
+ (*
+ (* Try a C function *)
+@@ -227,9 +225,8 @@ let get_debug name =
+ let rec search = function
+ h :: t ->
+ if h.info_name = name then
+- let { info_info = description; info_flag = flag } = h in
+ let description =
+- match description with
++ match h.info_info with
+ Some desc ->
+ desc
+ | None ->
+@@ -237,7 +234,7 @@ let get_debug name =
+ in
+ { debug_name = name;
+ debug_description = description;
+- debug_value = !flag
++ debug_value = !(h.info_flag)
+ }
+ else
+ search t
diff --git a/devel/omake/patches/patch-ar b/devel/omake/patches/patch-ar
new file mode 100644
index 00000000000..724c55d42d5
--- /dev/null
+++ b/devel/omake/patches/patch-ar
@@ -0,0 +1,125 @@
+$NetBSD: patch-ar,v 1.1 2010/12/17 09:40:14 wiz Exp $
+
+From upstream SVN.
+
+--- src/libmojave-external/stdlib/lm_string_util.ml.orig 2008-06-28 01:21:34.000000000 +0000
++++ src/libmojave-external/stdlib/lm_string_util.ml
+@@ -613,18 +613,13 @@ let tokens_create wrap group =
+ * Get the tokens list.
+ *)
+ let tokens_flush info =
+- let { tokens_group = group;
+- tokens_list = tokens;
+- tokens_prefix = prefix
+- } = info
+- in
+ let tokens =
+- match prefix with
++ match info.tokens_prefix with
+ NoPrefix ->
+- tokens
++ info.tokens_list
+ | WordPrefix prefix
+ | QuotePrefix (_, prefix) ->
+- group prefix :: tokens
++ info.tokens_group prefix :: info.tokens_list
+ in
+ List.rev tokens
+
+@@ -632,38 +627,29 @@ let tokens_flush info =
+ * End the current word.
+ *)
+ let tokens_break info =
+- let { tokens_group = group;
+- tokens_list = tokens;
+- tokens_prefix = prefix
+- } = info
+- in
+- match prefix with
+- NoPrefix ->
+- info
+- | WordPrefix prefix
+- | QuotePrefix (_, prefix) ->
+- { info with tokens_list = group prefix :: tokens;
+- tokens_prefix = NoPrefix
+- }
++ match info.tokens_prefix with
++ NoPrefix ->
++ info
++ | WordPrefix prefix
++ | QuotePrefix (_, prefix) ->
++ { info with tokens_list = info.tokens_group prefix :: info.tokens_list;
++ tokens_prefix = NoPrefix
++ }
+
+ (*
+ * Add a value directly.
+ * This also performs a break.
+ *)
+ let tokens_atomic info x =
+- let { tokens_group = group;
+- tokens_list = tokens;
+- tokens_prefix = prefix
+- } = info
+- in
+- match prefix with
++ let tokens = info.tokens_list in
++ match info.tokens_prefix with
+ NoPrefix ->
+ { info with tokens_list = x :: tokens;
+ tokens_prefix = NoPrefix
+ }
+ | WordPrefix prefix
+ | QuotePrefix (_, prefix) ->
+- { info with tokens_list = x :: group prefix :: tokens;
++ { info with tokens_list = x :: info.tokens_group prefix :: tokens;
+ tokens_prefix = NoPrefix
+ }
+
+@@ -758,11 +744,8 @@ let tokens_string info s =
+ if len = 0 then
+ info
+ else
+- let { tokens_list = tokens;
+- tokens_prefix = prefix
+- } = info
+- in
+- match prefix with
++ let tokens = info.tokens_list in
++ match info.tokens_prefix with
+ NoPrefix ->
+ scan_white tokens 0
+ | WordPrefix prefix ->
+@@ -809,13 +792,11 @@ let buffer_get_token lexer s i len =
+ BufChar
+
+ let tokens_lex info s =
+- let { tokens_lexer = lexer;
+- tokens_wrap_string = wrap_string;
+- tokens_wrap_data = wrap_data;
+- tokens_wrap_token = wrap_token;
+- tokens_group = group
+- } = info
+- in
++ let lexer = info.tokens_lexer in
++ let wrap_string = info.tokens_wrap_string in
++ let wrap_data = info.tokens_wrap_data in
++ let wrap_token = info.tokens_wrap_token in
++ let group = info.tokens_group in
+ let len = String.length s in
+
+ (* Don't add empty strings *)
+@@ -902,11 +883,8 @@ let tokens_lex info s =
+ if len = 0 then
+ info
+ else
+- let { tokens_list = tokens;
+- tokens_prefix = prefix
+- } = info
+- in
+- match prefix with
++ let tokens = info.tokens_list in
++ match info.tokens_prefix with
+ NoPrefix ->
+ scan_white tokens 0
+ | WordPrefix prefix ->
diff --git a/devel/omake/patches/patch-as b/devel/omake/patches/patch-as
new file mode 100644
index 00000000000..e34ea14d2bd
--- /dev/null
+++ b/devel/omake/patches/patch-as
@@ -0,0 +1,127 @@
+$NetBSD: patch-as,v 1.1 2010/12/17 09:40:14 wiz Exp $
+
+From upstream SVN.
+
+--- src/libmojave-external/unix/lm_notify.ml.orig 2007-07-19 21:06:05.000000000 +0000
++++ src/libmojave-external/unix/lm_notify.ml
+@@ -153,10 +153,8 @@ let is_path_prefix (root1, path1) (root2
+ let is_monitored_name requests name =
+ let new_path = path_of_name name in
+ IntTable.exists (fun _ job ->
+- let { job_path = path;
+- job_recursive = recursive
+- } = job
+- in
++ let path = job.job_path in
++ let recursive = job.job_recursive in
+ new_path = path || (recursive && is_path_prefix path new_path)) requests
+
+ (************************************************************************
+@@ -215,18 +213,16 @@ let close notify =
+ (*
+ * Get the file descriptor.
+ *)
+-let file_descr { notify_fd = fd } =
+- fd
++let file_descr notify =
++ notify.notify_fd
+
+ (*
+ * Monitoring.
+ *)
+ let monitor notify dir recursive =
+- let { notify_info = info;
+- notify_dirs = dirs;
+- notify_requests = requests
+- } = notify
+- in
++ let info = notify.notify_info in
++ let dirs = notify.notify_dirs in
++ let requests = notify.notify_requests in
+ let name = name_of_dir dir in
+ if not (is_monitored_name requests name) then begin
+ if !debug_notify then
+@@ -250,11 +246,9 @@ let monitor notify dir recursive =
+ * Suspend notifications.
+ *)
+ let suspend notify dir =
+- let { notify_info = info;
+- notify_dirs = dirs;
+- notify_requests = requests
+- } = notify
+- in
++ let info = notify.notify_info in
++ let dirs = notify.notify_dirs in
++ let requests = notify.notify_requests in
+ let dir = name_of_dir dir in
+ let request =
+ try StringTable.find dirs dir with
+@@ -269,10 +263,8 @@ let suspend notify dir =
+ end
+
+ let suspend_all notify =
+- let { notify_info = info;
+- notify_requests = requests
+- } = notify
+- in
++ let info = notify.notify_info in
++ let requests = notify.notify_requests in
+ IntTable.iter (fun _ job ->
+ if job.job_running then
+ begin
+@@ -281,11 +273,9 @@ let suspend_all notify =
+ end) requests
+
+ let resume notify dir =
+- let { notify_info = info;
+- notify_dirs = dirs;
+- notify_requests = requests
+- } = notify
+- in
++ let info = notify.notify_info in
++ let dirs = notify.notify_dirs in
++ let requests = notify.notify_requests in
+ let dir = name_of_dir dir in
+ let request =
+ try StringTable.find dirs dir with
+@@ -300,10 +290,8 @@ let resume notify dir =
+ end
+
+ let resume_all notify =
+- let { notify_info = info;
+- notify_requests = requests
+- } = notify
+- in
++ let info = notify.notify_info in
++ let requests = notify.notify_requests in
+ IntTable.iter (fun _ job ->
+ if not job.job_running then
+ begin
+@@ -315,11 +303,9 @@ let resume_all notify =
+ * Cancel a request.
+ *)
+ let cancel notify dir =
+- let { notify_info = info;
+- notify_dirs = dirs;
+- notify_requests = requests
+- } = notify
+- in
++ let info = notify.notify_info in
++ let dirs = notify.notify_dirs in
++ let requests = notify.notify_requests in
+ let dir = name_of_dir dir in
+ let request =
+ try StringTable.find dirs dir with
+@@ -332,10 +318,8 @@ let cancel notify dir =
+ notify.notify_requests <- IntTable.remove requests request
+
+ let cancel_all notify =
+- let { notify_info = info;
+- notify_requests = requests
+- } = notify
+- in
++ let info = notify.notify_info in
++ let requests = notify.notify_requests in
+ IntTable.iter (fun request _ -> notify_cancel info request) requests;
+ notify.notify_dirs <- StringTable.empty;
+ notify.notify_requests <- IntTable.empty
diff --git a/devel/omake/patches/patch-at b/devel/omake/patches/patch-at
new file mode 100644
index 00000000000..743c5a3bb23
--- /dev/null
+++ b/devel/omake/patches/patch-at
@@ -0,0 +1,364 @@
+$NetBSD: patch-at,v 1.1 2010/12/17 09:40:14 wiz Exp $
+
+From upstream SVN.
+
+--- src/libmojave-external/util/lm_channel.ml.orig 2007-07-16 21:10:43.000000000 +0000
++++ src/libmojave-external/util/lm_channel.ml
+@@ -337,12 +337,10 @@ let of_string s =
+ of_string string_sym 1 0 (String.copy s)
+
+ let info channel =
+- let { channel_id = id;
+- channel_kind = kind;
+- channel_mode = mode;
+- channel_binary = binary
+- } = channel
+- in
++ let id = channel.channel_id in
++ let kind = channel.channel_kind in
++ let mode = channel.channel_mode in
++ let binary = channel.channel_binary in
+ id, kind, mode, binary
+
+ let name channel =
+@@ -468,13 +466,11 @@ let squash_text buffer off amount =
+ * Get the line/char for a particular point in the input buffer.
+ *)
+ let line_of_index info buffer index =
+- let { start_line = start_line;
+- start_char = start_char;
+- middle_index = middle_index;
+- middle_line = middle_line;
+- middle_char = middle_char
+- } = info
+- in
++ let start_line = info.start_line in
++ let start_char = info.start_char in
++ let middle_index = info.middle_index in
++ let middle_line = info.middle_line in
++ let middle_char = info.middle_char in
+ let rec search line char i =
+ if i = index then
+ begin
+@@ -509,12 +505,10 @@ let reset_input_buffer info =
+ info.lex_index <- 0
+
+ let shift_input_buffer info =
+- let { in_buffer = in_buffer;
+- in_index = in_index;
+- lex_index = lex_index;
+- in_max = in_max
+- } = info
+- in
++ let in_buffer = info.in_buffer in
++ let in_index = info.in_index in
++ let lex_index = info.lex_index in
++ let in_max = info.in_max in
+ let line, char = line_of_index info in_buffer in_index in
+ String.blit in_buffer in_index in_buffer 0 (in_max - in_index);
+ info.start_line <- line;
+@@ -562,10 +556,8 @@ let reset_output_buffer info =
+ * flushing.
+ *)
+ let expand_output info =
+- let { out_buffer = buffer;
+- out_max = max
+- } = info
+- in
++ let buffer = info.out_buffer in
++ let max = info.out_max in
+ if max = String.length buffer then begin
+ let buffer2 = String.create (max * 2) in
+ String.blit buffer 0 buffer2 0 max;
+@@ -575,10 +567,8 @@ let expand_output info =
+ end
+
+ let to_string info =
+- let { out_buffer = buffer;
+- out_max = max
+- } = info
+- in
++ let buffer = info.out_buffer in
++ let max = info.out_max in
+ String.sub buffer 0 max
+
+ (************************************************************************
+@@ -614,12 +604,10 @@ let setup_write_buffer info =
+ *)
+ let flush_output_once info =
+ setup_write_buffer info;
+- let { write_index = off;
+- write_max = max;
+- write_buffer = buf;
+- write_fun = write
+- } = info
+- in
++ let off = info.write_index in
++ let max = info.write_max in
++ let buf = info.write_buffer in
++ let write = info.write_fun in
+ let count = write buf off (max - off) in
+ let off' = off + count in
+ if off' = max then
+@@ -632,17 +620,13 @@ let flush_output_once info =
+ *)
+ let flush_aux info =
+ setup_write_buffer info;
+- let { write_buffer = buf;
+- write_fun = writer
+- } = info
+- in
++ let buf = info.write_buffer in
++ let writer = info.write_fun in
+
+ (* Now write the data directly *)
+ let rec write () =
+- let { write_index = index;
+- write_max = max
+- } = info
+- in
++ let index = info.write_index in
++ let max = info.write_max in
+ let len = max - index in
+ if len <> 0 then
+ let count = writer buf index len in
+@@ -701,10 +685,8 @@ let close info =
+ * Print a byte.
+ *)
+ let rec output_char info c =
+- let { out_max = max;
+- out_buffer = buffer
+- } = info
+- in
++ let max = info.out_max in
++ let buffer = info.out_buffer in
+ flush_input info;
+ if max = String.length buffer then
+ begin
+@@ -724,10 +706,8 @@ let output_byte info c =
+ * Write a substring.
+ *)
+ let rec output_buffer info buf off len =
+- let { out_max = max;
+- out_buffer = buffer
+- } = info
+- in
++ let max = info.out_max in
++ let buffer = info.out_buffer in
+ let avail = String.length buffer - max in
+ flush_input info;
+ if len <> 0 then
+@@ -758,21 +738,17 @@ let write info buf off len =
+ * Check if there is input already in the buffer.
+ *)
+ let poll info =
+- let { in_index = index;
+- in_max = max
+- } = info
+- in
++ let index = info.in_index in
++ let max = info.in_max in
+ index <> max
+
+ (*
+ * Get data when the buffer is empty.
+ *)
+ let fillbuf info =
+- let { channel_binary = binary;
+- in_buffer = buf;
+- read_fun = reader
+- } = info
+- in
++ let binary = info.channel_binary in
++ let buf = info.in_buffer in
++ let reader = info.read_fun in
+ let count = reader buf 0 buf_size in
+ let count =
+ if count = 0 then
+@@ -797,11 +773,9 @@ let fillbuf info =
+ * Get a single char.
+ *)
+ let rec input_char info =
+- let { in_index = index;
+- in_max = max;
+- in_buffer = buf;
+- } = info
+- in
++ let index = info.in_index in
++ let max = info.in_max in
++ let buf = info.in_buffer in
+ flush_output info;
+ if index = max then
+ begin
+@@ -823,11 +797,9 @@ let input_byte info =
+ * Read data into a buffer.
+ *)
+ let rec input_buffer info s off len =
+- let { in_index = index;
+- in_max = max;
+- in_buffer = buf
+- } = info
+- in
++ let index = info.in_index in
++ let max = info.in_max in
++ let buf = info.in_buffer in
+ let avail = max - index in
+ flush_output info;
+ if len <> 0 then
+@@ -884,12 +856,10 @@ let input_entire_line info =
+ * Read allows for partial reading.
+ *)
+ let read info s off len =
+- let { in_index = index;
+- in_max = max;
+- in_buffer = buf;
+- read_fun = reader
+- } = info
+- in
++ let index = info.in_index in
++ let max = info.in_max in
++ let buf = info.in_buffer in
++ let reader = info.read_fun in
+ let avail = max - index in
+ flush_output info;
+ if avail = 0 then
+@@ -925,13 +895,11 @@ let seek info pos whence =
+ * Get the current location.
+ *)
+ let loc info =
+- let { out_max = out_max;
+- in_index = in_index;
+- in_buffer = in_buffer;
+- out_buffer = out_buffer;
+- channel_file = file
+- } = info
+- in
++ let out_max = info.out_max in
++ let in_index = info.in_index in
++ let in_buffer = info.in_buffer in
++ let out_buffer = info.out_buffer in
++ let file = info.channel_file in
+ let line, char =
+ if out_max <> 0 then
+ line_of_index info out_buffer out_max
+@@ -1132,10 +1100,8 @@ struct
+ * Start lex mode.
+ *)
+ let lex_start channel =
+- let { in_index = index;
+- in_buffer = buffer
+- } = channel
+- in
++ let index = channel.in_index in
++ let buffer = channel.in_buffer in
+ let prev =
+ if index = 0 then
+ bof
+@@ -1149,10 +1115,8 @@ struct
+ * Restart at a previous position.
+ *)
+ let lex_restart channel pos =
+- let { in_max = max;
+- in_index = index
+- } = channel
+- in
++ let max = channel.in_max in
++ let index = channel.in_index in
+ assert (pos >= 0 && pos <= max - index);
+ channel.lex_index <- index + pos
+
+@@ -1168,20 +1132,16 @@ struct
+ * Get the string matched by the lexer.
+ *)
+ let lex_string channel pos =
+- let { in_index = start;
+- in_buffer = buffer
+- } = channel
+- in
++ let start = channel.in_index in
++ let buffer = channel.in_buffer in
+ String.sub buffer start pos
+
+ (*
+ * Get the string matched by the lexer.
+ *)
+ let lex_substring channel off len =
+- let { in_index = start;
+- in_buffer = buffer
+- } = channel
+- in
++ let start = channel.in_index in
++ let buffer = channel.in_buffer in
+ String.sub buffer (start + off) len
+
+ (*
+@@ -1189,13 +1149,11 @@ struct
+ * We can't discard any of the existing data.
+ *)
+ let rec lex_fill channel =
+- let { in_max = max;
+- in_buffer = buffer;
+- in_index = start;
+- read_fun = reader;
+- channel_binary = binary
+- } = channel
+- in
++ let max = channel.in_max in
++ let buffer = channel.in_buffer in
++ let start = channel.in_index in
++ let reader = channel.read_fun in
++ let binary = channel.channel_binary in
+ let len = String.length buffer in
+ let amount = len - max in
+ (* If we have space, fill it *)
+@@ -1245,11 +1203,9 @@ struct
+ * Get the next character in lex mode.
+ *)
+ let lex_next channel =
+- let { in_max = max;
+- in_buffer = buffer;
+- lex_index = index
+- } = channel
+- in
++ let max = channel.in_max in
++ let buffer = channel.in_buffer in
++ let index = channel.lex_index in
+ if index = max then
+ lex_fill channel
+ else
+@@ -1267,14 +1223,12 @@ struct
+ * Get the location of the buffer.
+ *)
+ let lex_loc channel off =
+- let { start_line = line;
+- start_char = char;
+- channel_file = file;
+- lex_index = index;
+- in_buffer = buffer;
+- in_max = max
+- } = channel
+- in
++ let line = channel.start_line in
++ let char = channel.start_char in
++ let file = channel.channel_file in
++ let index = channel.lex_index in
++ let buffer = channel.in_buffer in
++ let max = channel.in_max in
+ let line1, char1 =
+ if index > max then
+ line, char
+@@ -1293,11 +1247,9 @@ struct
+ * Add any remaining buffered text to a buffer.
+ *)
+ let lex_buffer channel buf =
+- let { in_max = max;
+- in_buffer = buffer;
+- in_index = start
+- } = channel
+- in
++ let max = channel.in_max in
++ let buffer = channel.in_buffer in
++ let start = channel.in_index in
+ Buffer.add_substring buf buffer start (max - start);
+ channel.in_index <- max
+ end
diff --git a/devel/omake/patches/patch-au b/devel/omake/patches/patch-au
new file mode 100644
index 00000000000..4c543208410
--- /dev/null
+++ b/devel/omake/patches/patch-au
@@ -0,0 +1,24 @@
+$NetBSD: patch-au,v 1.1 2010/12/17 09:40:14 wiz Exp $
+
+From upstream SVN.
+
+--- src/libmojave-external/util/lm_filename_util.ml.orig 2007-01-29 20:14:42.000000000 +0000
++++ src/libmojave-external/util/lm_filename_util.ml
+@@ -48,12 +48,11 @@ let groups =
+ let unix_is_executable s =
+ let flag =
+ try
+- let { Unix.LargeFile.st_kind = kind;
+- Unix.LargeFile.st_perm = perm;
+- Unix.LargeFile.st_uid = uid;
+- Unix.LargeFile.st_gid = gid
+- } = Unix.LargeFile.stat s
+- in
++ let st = Unix.LargeFile.stat s in
++ let kind = st.Unix.LargeFile.st_kind in
++ let perm = st.Unix.LargeFile.st_perm in
++ let uid = st.Unix.LargeFile.st_uid in
++ let gid = st.Unix.LargeFile.st_gid in
+ (kind = Unix.S_REG)
+ && ((perm land 0o001) <> 0
+ || (List.mem gid groups && (perm land 0o010) <> 0)
diff --git a/devel/omake/patches/patch-av b/devel/omake/patches/patch-av
new file mode 100644
index 00000000000..41721d5cf5e
--- /dev/null
+++ b/devel/omake/patches/patch-av
@@ -0,0 +1,20 @@
+$NetBSD: patch-av,v 1.1 2010/12/17 09:40:14 wiz Exp $
+
+From upstream SVN.
+
+--- src/libmojave-external/util/lm_glob.ml.orig 2007-09-04 16:12:33.000000000 +0000
++++ src/libmojave-external/util/lm_glob.ml
+@@ -157,11 +157,8 @@ let home_dir =
+ let getusers () =
+ let users = Lm_unix_util.getpwents () in
+ List.map (fun entry ->
+- let { Unix.pw_name = name;
+- Unix.pw_dir = dir
+- } = entry
+- in
+- tilde_insert dir name;
++ let name = entry.Unix.pw_name in
++ tilde_insert entry.Unix.pw_dir name;
+ name) users
+
+ (************************************************************************
diff --git a/devel/omake/patches/patch-aw b/devel/omake/patches/patch-aw
new file mode 100644
index 00000000000..c77511cc851
--- /dev/null
+++ b/devel/omake/patches/patch-aw
@@ -0,0 +1,343 @@
+$NetBSD: patch-aw,v 1.1 2010/12/17 09:40:14 wiz Exp $
+
+From upstream SVN.
+
+--- src/libmojave-external/util/lm_lexer.ml.orig 2007-01-25 18:31:18.000000000 +0000
++++ src/libmojave-external/util/lm_lexer.ml
+@@ -1325,10 +1325,8 @@ struct
+ * Expressions.
+ *)
+ let pp_print_exp buf exp =
+- let { exp_clauses = clauses;
+- exp_id = id
+- } = exp
+- in
++ let clauses = exp.exp_clauses in
++ let id = exp.exp_id in
+ fprintf buf "Id: %d" id;
+ List.iter (fun (action, id, regex) ->
+ fprintf buf "@ @[<hv 3>Clause:@ id = %d@ action = %a@ @[<hv 3>regex =@ %a@]@]" (**)
+@@ -1370,10 +1368,8 @@ struct
+ let add_clause_exp exp action s =
+ let regex = regex_of_string s in
+ let arity = regex_arg_count 0 regex in
+- let { exp_clauses = clauses;
+- exp_id = id
+- } = exp
+- in
++ let clauses = exp.exp_clauses in
++ let id = exp.exp_id in
+ let exp =
+ { exp_clauses = (action, id, regex) :: clauses;
+ exp_id = succ id
+@@ -1395,11 +1391,9 @@ struct
+ * Take the union of two expression lists.
+ *)
+ let union_exp exp1 exp2 =
+- let { exp_clauses = clauses1;
+- exp_id = id1
+- } = exp1
+- in
+- let { exp_clauses = clauses2 } = exp2 in
++ let clauses1 = exp1.exp_clauses in
++ let id1 = exp1.exp_id in
++ let clauses2 = exp2.exp_clauses in
+ let actions =
+ List.fold_left (fun actions (action, _, _) ->
+ ActionSet.add actions action) ActionSet.empty clauses1
+@@ -1474,20 +1468,16 @@ struct
+ counter min final max start
+
+ let pp_print_nfa_state buf nfa_state =
+- let { nfa_state_index = index;
+- nfa_state_action = action
+- } = nfa_state
+- in
++ let index = nfa_state.nfa_state_index in
++ let action = nfa_state.nfa_state_action in
+ fprintf buf "@[<hv 3>NFA state %d:@ action %a@]" index pp_print_nfa_action action
+
+ let pp_print_nfa buf nfa =
+- let { nfa_hash = hash;
+- nfa_start = start;
+- nfa_search_start = search;
+- nfa_search_states = search_states;
+- nfa_table = table
+- } = nfa
+- in
++ let hash = nfa.nfa_hash in
++ let start = nfa.nfa_start in
++ let search = nfa.nfa_search_start in
++ let search_states = nfa.nfa_search_states in
++ let table = nfa.nfa_table in
+ fprintf buf "@[<hv 3>NFA:@ start = %a@ search = %a@ @[<b 3>search-states =%a@]" (**)
+ (pp_print_nfa_id hash) start
+ (pp_print_nfa_id hash) search
+@@ -1500,7 +1490,7 @@ struct
+ * Construct a new state.
+ *)
+ let nfa_state accum action =
+- let { nfa_index = index } = accum in
++ let index = accum.nfa_index in
+ let state =
+ { nfa_state_index = index;
+ nfa_state_action = action
+@@ -1582,7 +1572,7 @@ struct
+ in
+ accum, info, start, start1 :: final1 :: states
+ | RegexInterval (regex, min, max) ->
+- let { nfa_counter = counter } = accum in
++ let counter = accum.nfa_counter in
+ let accum, start1 = nfa_state accum NfaActionNone in
+ let accum, final1 =
+ nfa_state accum (NfaActionIncrCounter (counter, min, final.nfa_state_index, max, start1.nfa_state_index))
+@@ -1605,11 +1595,11 @@ struct
+
+ (* Arguments *)
+ | RegexArg regex ->
+- let { nfa_arg_index = argindex } = accum in
++ let argindex = accum.nfa_arg_index in
+ let accum, final1 = nfa_state accum (NfaActionArgStop (argindex, final.nfa_state_index)) in
+ let accum, start1 = nfa_state accum NfaActionNone in
+ let start = set_action start (NfaActionArgStart (argindex, start1.nfa_state_index)) in
+- let { nfa_arg_number = argnumber } = info in
++ let argnumber = info.nfa_arg_number in
+ let accum = { accum with nfa_arg_index = succ argindex } in
+ let info = { info with nfa_arg_number = succ argnumber } in
+ let accum, info, start1, states =
+@@ -1783,10 +1773,8 @@ struct
+ fprintf buf "search-stop at %d" off
+
+ let pp_print_dfa_actions nfa_hash buf action =
+- let { dfa_action_final = final;
+- dfa_action_actions = actions
+- } = action
+- in
++ let final = action.dfa_action_final in
++ let actions = action.dfa_action_actions in
+ let () =
+ fprintf buf "@[<hv 3>(action"
+ in
+@@ -1798,20 +1786,16 @@ struct
+ ()
+ in
+ NfaStateTable.iter (fun dst action ->
+- let { dfa_action_src = src;
+- dfa_action_args = args
+- } = action
+- in
++ let src = action.dfa_action_src in
++ let args = action.dfa_action_args in
+ fprintf buf "@ @[<hv 3>(%a -> %a" (pp_print_nfa_id nfa_hash) src (pp_print_nfa_id nfa_hash) dst;
+ List.iter (fun action -> fprintf buf "@ %a" pp_print_dfa_arg_action action) args;
+ fprintf buf ")@]") actions;
+ fprintf buf ")@]"
+
+ let pp_print_pre_actions buf action =
+- let { pre_action_final = final;
+- pre_action_args = args
+- } = action
+- in
++ let final = action.pre_action_final in
++ let args = action.pre_action_args in
+ let () =
+ fprintf buf "@[<hv 3>(pre-action@ "
+ in
+@@ -1897,10 +1881,10 @@ struct
+ * DFA actions.
+ *)
+ let dfa_action_is_empty action =
+- match action with
+- { dfa_action_final = None; dfa_action_actions = actions } ->
+- NfaStateTable.is_empty actions
+- | { dfa_action_final = Some _ } ->
++ match action.dfa_action_final with
++ None ->
++ NfaStateTable.is_empty action.dfa_action_actions
++ | Some _ ->
+ false
+
+ (*
+@@ -1920,21 +1904,15 @@ struct
+ ArgTable.add args ArgSearch pos
+
+ let dfa_eval_action dfa info action =
+- let { dfa_channel = channel;
+- dfa_args = args_table
+- } = info
+- in
+- let { dfa_action_final = final;
+- dfa_action_actions = actions
+- } = action
+- in
++ let channel = info.dfa_channel in
++ let args_table = info.dfa_args in
++ let final = action.dfa_action_final in
++ let actions = action.dfa_action_actions in
+ let pos = Input.lex_pos channel in
+ let args_table =
+ NfaStateTable.map (fun action ->
+- let { dfa_action_src = src;
+- dfa_action_args = actions
+- } = action
+- in
++ let src = action.dfa_action_src in
++ let actions = action.dfa_action_args in
+ let args =
+ try NfaStateTable.find args_table src with
+ Not_found ->
+@@ -2140,10 +2118,8 @@ struct
+ * the DFA state.
+ *)
+ let close_state dfa table nids c =
+- let { dfa_search_states = search_states;
+- dfa_nfa_hash = nfa_hash
+- } = dfa
+- in
++ let search_states = dfa.dfa_search_states in
++ let nfa_hash = dfa.dfa_nfa_hash in
+ let final, actions =
+ List.fold_left (fun final_actions nid ->
+ let frontier =
+@@ -2152,10 +2128,8 @@ struct
+ if !debug_lexgen then
+ eprintf "@[<v 3>Frontier:@ %a@]@." (pp_print_frontier nfa_hash) frontier;
+ NfaStateTable.fold (fun (final', actions) id action ->
+- let { pre_action_final = final;
+- pre_action_args = args
+- } = action
+- in
++ let final = action.pre_action_final in
++ let args = action.pre_action_args in
+ let final =
+ match final', final with
+ Some (clause_id', _nid'), Some clause_id ->
+@@ -2264,11 +2238,9 @@ struct
+ extend_args ("" :: args) (succ len1) len2
+
+ let dfa_args dfa_info lexeme =
+- let { dfa_start_pos = start;
+- dfa_stop_pos = stop;
+- dfa_stop_args = args
+- } = dfa_info
+- in
++ let start = dfa_info.dfa_start_pos in
++ let stop = dfa_info.dfa_stop_pos in
++ let args = dfa_info.dfa_stop_args in
+
+ (* Get the pairs of argument info *)
+ let info, start_pos =
+@@ -2326,11 +2298,9 @@ struct
+ * Add a state to the DFA. It is initially empty.
+ *)
+ let dfa_find_state dfa nids =
+- let { dfa_map = map;
+- dfa_length = dfa_id;
+- dfa_states = states
+- } = dfa
+- in
++ let map = dfa.dfa_map in
++ let dfa_id = dfa.dfa_length in
++ let states = dfa.dfa_states in
+ try DfaStateTable.find map nids with
+ Not_found ->
+ (* Make a new state *)
+@@ -2362,14 +2332,10 @@ struct
+ * an entry in the transition table yet.
+ *)
+ let create_entry dfa dfa_state c =
+- let { dfa_dfa_hash = dfa_hash;
+- dfa_table = table
+- } = dfa
+- in
+- let { dfa_state_set = nids;
+- dfa_state_delta = delta
+- } = dfa_state
+- in
++ let dfa_hash = dfa.dfa_dfa_hash in
++ let table = dfa.dfa_table in
++ let nids = dfa_state.dfa_state_set in
++ let delta = dfa_state.dfa_state_delta in
+ let frontier, actions = close_next_state dfa table (DfaState.get dfa_hash nids) c in
+ if frontier = [] && dfa_action_is_empty actions then
+ dfa_state.dfa_state_delta <- TransTable.add delta c DfaNoTransition
+@@ -2437,10 +2403,8 @@ struct
+ let () = loop dfa_state c in
+
+ (* Now figure out what happened *)
+- let { dfa_stop_clause = clause;
+- dfa_stop_pos = stop;
+- } = dfa_info
+- in
++ let clause = dfa_info.dfa_stop_clause in
++ let stop = dfa_info.dfa_stop_pos in
+ (*
+ * If we did not get a match, return the channel to
+ * the starting position, and raise an exception.
+@@ -2489,10 +2453,8 @@ struct
+ let () = loop dfa_state c in
+
+ (* Now figure out what happened *)
+- let { dfa_stop_clause = clause;
+- dfa_stop_pos = stop;
+- } = dfa_info
+- in
++ let clause = dfa_info.dfa_stop_clause in
++ let stop = dfa_info.dfa_stop_pos in
+ (*
+ * If we did not get a match, return the channel to
+ * the starting position, and raise an exception.
+@@ -2551,10 +2513,8 @@ struct
+ let () = loop dfa_state c in
+
+ (* Now figure out what happened *)
+- let { dfa_stop_clause = clause;
+- dfa_stop_pos = stop;
+- } = dfa_info
+- in
++ let clause = dfa_info.dfa_stop_clause in
++ let stop = dfa_info.dfa_stop_pos in
+ (*
+ * If we did not get a match, return all the text to
+ * the end of the channel.
+@@ -2610,14 +2570,12 @@ struct
+ if !debug_lexgen || !debug_lex then
+ eprintf "%a@." pp_print_nfa nfa
+ in
+- let { nfa_hash = nfa_hash;
+- nfa_table = nfa_table;
+- nfa_start = nfa_start;
+- nfa_actions = actions;
+- nfa_search_start = nfa_search_start;
+- nfa_search_states = nfa_search_states
+- } = nfa
+- in
++ let nfa_hash = nfa.nfa_hash in
++ let nfa_table = nfa.nfa_table in
++ let nfa_start = nfa.nfa_start in
++ let actions = nfa.nfa_actions in
++ let nfa_search_start = nfa.nfa_search_start in
++ let nfa_search_states = nfa.nfa_search_states in
+ let dfa_hash = DfaState.create_state () in
+ let nfa_start = DfaState.create dfa_hash [nfa_start] in
+ let start =
+@@ -2673,8 +2631,8 @@ struct
+ * then we have seen all the rest of the clauses too.
+ *)
+ let union info1 info2 =
+- let { lex_exp = exp1 } = info1 in
+- let { lex_exp = exp2 } = info2 in
++ let exp1 = info1.lex_exp in
++ let exp2 = info2.lex_exp in
+ (* Catch degenerate cases first *)
+ match exp1.exp_clauses, exp2.exp_clauses with
+ [], _ -> info2
+@@ -2711,7 +2669,7 @@ struct
+ ignore (dfa_of_info info)
+
+ let pp_print_lexer buf info =
+- let { lex_exp = exp } = info in
++ let exp = info.lex_exp in
+ let dfa = dfa_of_info info in
+ fprintf buf "@[<v 0>@[<hv 3>Lexer:@ %a@]" pp_print_exp exp;
+ fprintf buf "@ @[<hv 3>NFA:";
diff --git a/devel/omake/patches/patch-ax b/devel/omake/patches/patch-ax
new file mode 100644
index 00000000000..94dae3eb8f8
--- /dev/null
+++ b/devel/omake/patches/patch-ax
@@ -0,0 +1,366 @@
+$NetBSD: patch-ax,v 1.1 2010/12/17 09:40:14 wiz Exp $
+
+From upstream SVN.
+
+--- src/libmojave-external/util/lm_parser.ml.orig 2007-01-25 18:31:18.000000000 +0000
++++ src/libmojave-external/util/lm_parser.ml
+@@ -282,15 +282,11 @@ struct
+ let debug = "ProdItem"
+
+ let hash item =
+- let { prod_item_name = name;
+- prod_item_left = left;
+- prod_item_right = right;
+- prod_item_action = action
+- } = item
+- in
++ let name = item.prod_item_name in
++ let action = item.prod_item_action in
+ let hash = hash_combine (IVar.hash name) (IAction.hash action) in
+- let hash = ivar_list_hash hash left in
+- let hash = ivar_list_hash hash right in
++ let hash = ivar_list_hash hash item.prod_item_left in
++ let hash = ivar_list_hash hash item.prod_item_right in
+ hash
+
+ let compare item1 item2 =
+@@ -657,18 +653,12 @@ struct
+ fprintf buf "@ %a: %a" (pp_print_ivar info) v (pp_print_pda_action info) action) actions
+
+ let pp_print_prod_item_core info buf item =
+- let { prod_item_action = action;
+- prod_item_name = name;
+- prod_item_left = left;
+- prod_item_right = right
+- } = item
+- in
+ let hash = info.info_hash in
+ fprintf buf "%a ::=%a .%a (%a)" (**)
+- (pp_print_ivar hash) name
+- (pp_print_ivars hash) (List.rev left)
+- (pp_print_ivars hash) right
+- (pp_print_iaction hash) action
++ (pp_print_ivar hash) item.prod_item_name
++ (pp_print_ivars hash) (List.rev item.prod_item_left)
++ (pp_print_ivars hash) item.prod_item_right
++ (pp_print_iaction hash) item.prod_item_action
+
+ let pp_print_prod_item info buf item =
+ pp_print_prod_item_core info buf (ProdItem.get info.info_hash.hash_prod_item_state item)
+@@ -678,40 +668,27 @@ struct
+ fprintf buf "@ %a" (pp_print_prod_item info) item) items
+
+ let pp_print_state info buf state =
+- let { info_state_items = items } = State.get info.info_hash.hash_state_state state in
++ let items = (State.get info.info_hash.hash_state_state state).info_state_items in
+ eprintf "@[<v 3>State %d" (State.hash state);
+ pp_print_prod_item_set info buf items;
+ eprintf "@]"
+
+ let pp_print_info_item info buf info_item =
+- let { info_hash = hash;
+- info_hash_state_item = hash_state_item
+- } = info
+- in
+- let { info_item_index = index;
+- info_item_entries = entries
+- } = info_item
+- in
+- fprintf buf "@[<v 3>State %d:" index;
++ let hash = info.info_hash in
++ let hash_state_item = info.info_hash_state_item in
++ fprintf buf "@[<v 3>State %d:" info_item.info_item_index;
+ Array.iter (fun entry ->
+- let { prop_state_item = state_item;
+- prop_vars = lookahead
+- } = entry
+- in
++ let state_item = entry.prop_state_item in
++ let lookahead = entry.prop_vars in
+ let _, prod_item = StateItem.get hash_state_item state_item in
+- fprintf buf "@ @[<hv 3>%a@ @[<b 2>#%a@]@]" (pp_print_prod_item info) prod_item (pp_print_ivar_set hash) lookahead) entries;
++ fprintf buf "@ @[<hv 3>%a@ @[<b 2>#%a@]@]" (pp_print_prod_item info) prod_item (pp_print_ivar_set hash) lookahead) info_item.info_item_entries;
+ fprintf buf "@]"
+
+ let pp_print_info buf info =
+- let { info_grammar = gram;
+- info_nullable = nullable;
+- info_first = first;
+- info_hash = hash
+- } = info
+- in
+- fprintf buf "@[<v 0>%a" pp_print_grammar gram;
+- fprintf buf "@ @[<b 3>Nullable:%a@]" (pp_print_ivar_set hash) nullable;
+- fprintf buf "@ @[<v 3>First:%a@]" (pp_print_ivar_table hash) first;
++ let hash = info.info_hash in
++ fprintf buf "@[<v 0>%a" pp_print_grammar info.info_grammar;
++ fprintf buf "@ @[<b 3>Nullable:%a@]" (pp_print_ivar_set hash) info.info_nullable;
++ fprintf buf "@ @[<v 3>First:%a@]" (pp_print_ivar_table hash) info.info_first;
+ fprintf buf "@]"
+
+ let pp_print_lookahead hash buf look =
+@@ -917,16 +894,11 @@ struct
+ let changed, prods =
+ VarMTable.fold_all (fun (changed, prods) _ prodlist ->
+ List.fold_left (fun (changed, prods) prod ->
+- let { prod_action = action;
+- prod_name = name;
+- prod_prec = pre
+- } = prod
+- in
+- if ActionSet.mem actions action then
+- changed, prods
+- else
+- let prod = { prod with prod_prec = PrecTable.find prec_translate pre } in
+- true, VarMTable.add prods name prod) (changed, prods) prodlist) (false, prod1) prod2
++ if ActionSet.mem actions prod.prod_action then
++ changed, prods
++ else
++ let prod = { prod with prod_prec = PrecTable.find prec_translate prod.prod_prec } in
++ true, VarMTable.add prods prod.prod_name prod) (changed, prods) prodlist) (false, prod1) prod2
+ in
+
+ (* Union of the start symbols *)
+@@ -1012,12 +984,10 @@ struct
+ let step first prods =
+ IVarTable.fold (fun (first, changed) _ prods ->
+ List.fold_left (fun (first, changed) prod ->
+- let { prod_item_name = x;
+- prod_item_right = rhs
+- } = ProdItem.get prod_state prod
+- in
++ let prod_item = ProdItem.get prod_state prod in
++ let x = prod_item.prod_item_name in
+ let set = IVarTable.find first x in
+- let set' = first_rhs nullable first set rhs in
++ let set' = first_rhs nullable first set prod_item.prod_item_right in
+ let set, changed =
+ if changed || IVarSet.cardinal set' <> IVarSet.cardinal set then
+ set', true
+@@ -1059,10 +1029,8 @@ struct
+ * Get the set of first symbols that can begin a list.
+ *)
+ let lookahead info rhs =
+- let { info_first = first;
+- info_nullable = nullable
+- } = info
+- in
++ let first = info.info_first in
++ let nullable = info.info_nullable in
+ let rec search set rhs =
+ match rhs with
+ v :: rhs ->
+@@ -1274,14 +1242,10 @@ struct
+ let hash = info.info_hash.hash_prod_item_state in
+ ProdItemSet.fold (fun delta prod_item ->
+ let core = ProdItem.get hash prod_item in
+- let { prod_item_left = left;
+- prod_item_right = right
+- } = core
+- in
+- match right with
++ match core.prod_item_right with
+ v :: right ->
+ let core =
+- { core with prod_item_left = v :: left;
++ { core with prod_item_left = v :: core.prod_item_left;
+ prod_item_right = right
+ }
+ in
+@@ -1517,11 +1481,7 @@ struct
+ let goto_table = StateTable.find shift_table state in
+ let prod_item_hash = info.info_hash.hash_prod_item_state in
+ let prod_item_core = ProdItem.get prod_item_hash prod_item in
+- let { prod_item_left = left;
+- prod_item_right = right
+- } = prod_item_core
+- in
+- match right with
++ match prod_item_core.prod_item_right with
+ v :: right ->
+ (* If v is a nonterminal, then also propagate to initial items *)
+ let prop_items =
+@@ -1534,7 +1494,7 @@ struct
+ (* Propagate directly to the next state *)
+ let next_state = IVarTable.find goto_table v in
+ let next_item_core =
+- { prod_item_core with prod_item_left = v :: left;
++ { prod_item_core with prod_item_left = v :: prod_item_core.prod_item_left;
+ prod_item_right = right
+ }
+ in
+@@ -1833,8 +1793,8 @@ struct
+ item :: items ->
+ let core = ProdItem.get hash item in
+ let empty_flag =
+- match core with
+- { prod_item_left = []; prod_item_right = [] } ->
++ match core.prod_item_left, core.prod_item_right with
++ [], [] ->
+ true
+ | _ ->
+ false
+@@ -1865,14 +1825,12 @@ struct
+ look)
+
+ let reduce_actions info empties prop_table =
+- let { info_head_lookahead = look_table } = info in
++ let look_table = info.info_head_lookahead in
+ let hash = info.info_hash.hash_prod_item_state in
+ let hash_state_item = info.info_hash_state_item in
+ Array.fold_left (fun actions entry ->
+- let { prop_state_item = state_item;
+- prop_vars = look3
+- } = entry
+- in
++ let state_item = entry.prop_state_item in
++ let look3 = entry.prop_vars in
+ let state, item = StateItem.get hash_state_item state_item in
+ let core = ProdItem.get hash item in
+ match core.prod_item_right with
+@@ -1902,8 +1860,8 @@ struct
+ * Error messages.
+ *)
+ let shift_reduce_conflict info state v shift_state reduce_item =
+- let { info_hash = hash } = info in
+- let { hash_prod_item_state = hash_prod_item } = hash in
++ let hash = info.info_hash in
++ let hash_prod_item = hash.hash_prod_item_state in
+ let pp_print_ivar = pp_print_ivar hash in
+ let pp_print_iaction = pp_print_iaction hash in
+ let reduce_core = ProdItem.get hash_prod_item reduce_item in
+@@ -1917,8 +1875,8 @@ struct
+ raise (Invalid_argument "Lm_parser.shift_reduce_conflict\n\tset MP_DEBUG=parse_conflict_is_warning to ignore this error")
+
+ let reduce_reduce_conflict info state v reduce_item action =
+- let { info_hash = hash } = info in
+- let { hash_prod_item_state = hash_prod_item } = hash in
++ let hash = info.info_hash in
++ let hash_prod_item = hash.hash_prod_item_state in
+ let pp_print_ivar = pp_print_ivar hash in
+ let pp_print_iaction = pp_print_iaction hash in
+ let reduce_core = ProdItem.get hash_prod_item reduce_item in
+@@ -1936,24 +1894,18 @@ struct
+ * This is finally the stage where we check for conflicts.
+ *)
+ let process_reduce_actions info reduce_actions action_table =
+- let { info_grammar = gram;
+- info_prec = var_prec_table;
+- info_hash = { hash_prod_item_state = hash_prod_item }
+- } = info
+- in
+- let { gram_prec_table = prec_table } = gram in
++ let gram = info.info_grammar in
++ let var_prec_table = info.info_prec in
++ let hash_prod_item = info.info_hash.hash_prod_item_state in
++ let prec_table = gram.gram_prec_table in
+ let state_item_hash = info.info_hash_state_item in
+ StateItemTable.fold (fun action_table state_item look ->
+ let look = lookahead_set look in
+ let state, item = StateItem.get state_item_hash state_item in
+- let { prod_item_name = name;
+- prod_item_action = action;
+- prod_item_left = left;
+- prod_item_prec = prec_name
+- } = ProdItem.get hash_prod_item item
+- in
++ let prod_item = ProdItem.get hash_prod_item item in
++ let prec_name = prod_item.prod_item_prec in
+ let assoc = Precedence.assoc prec_table prec_name in
+- let reduce = ReduceAction (action, name, List.length left) in
++ let reduce = ReduceAction (prod_item.prod_item_action, prod_item.prod_item_name, List.length prod_item.prod_item_left) in
+ let actions = StateTable.find action_table state in
+ let actions =
+ IVarSet.fold (fun actions v ->
+@@ -2006,7 +1958,8 @@ struct
+ { prod_item_right = [];
+ prod_item_action = action;
+ prod_item_name = name;
+- prod_item_left = left
++ prod_item_left = left;
++ prod_item_prec = _
+ } ->
+ let state_item = StateItem.create info.info_hash_state_item (state, item) in
+ let lookahead = prop_table.(StateItem.hash state_item).prop_vars in
+@@ -2027,18 +1980,14 @@ struct
+ * Flatten a production state to a pda description.
+ *)
+ let pda_info_of_items info prop_table state items =
+- let { info_first = first;
+- info_hash_state_item = hash_state_item;
+- info_hash = { hash_prod_item_state = hash_prod_item }
+- } = info
+- in
++ let first = info.info_first in
++ let hash_state_item = info.info_hash_state_item in
++ let hash_prod_item = info.info_hash.hash_prod_item_state in
+ let items, next =
+ ProdItemSet.fold (fun (items, next) prod_item ->
+ let core = ProdItem.get hash_prod_item prod_item in
+- let { prod_item_left = left;
+- prod_item_right = right
+- } = core
+- in
++ let left = core.prod_item_left in
++ let right = core.prod_item_right in
+ let item =
+ { pda_item_left = left;
+ pda_item_right = right
+@@ -2094,7 +2043,7 @@ struct
+ (* Build the PDA states *)
+ let table =
+ State.map_array (fun state core ->
+- let { info_state_items = items } = core in
++ let items = core.info_state_items in
+ { pda_delta = pda_delta (StateTable.find trans_table state);
+ pda_reduce = reduce_early info prop_table state items;
+ pda_info = pda_info_of_items info prop_table state items
+@@ -2155,7 +2104,7 @@ struct
+ * Exceptions.
+ *)
+ let parse_error loc hash run _stack state (v : ivar) =
+- let { pda_info = { pda_items = items; pda_next = next } } = run.run_states.(state) in
++ let { pda_items = items; pda_next = next } = run.run_states.(state).pda_info in
+ let pp_print_ivar = pp_print_ivar hash in
+ let buf = stdstr in
+ fprintf buf "@[<v 0>Syntax error on token %a" pp_print_ivar v;
+@@ -2188,7 +2137,7 @@ struct
+
+ let pda_loop hash run arg start =
+ let rec pda_lookahead arg stack state tok =
+- let { pda_delta = delta } = run.run_states.(state) in
++ let delta = run.run_states.(state).pda_delta in
+ let v, loc, x = tok in
+ match
+ (try IVarTable.find delta v with
+@@ -2323,24 +2272,24 @@ struct
+ let prec_max = Precedence.prec_max
+
+ let add_assoc info pre assoc =
+- let { parse_grammar = gram } = info in
+- let { gram_prec_table = prec_table } = gram in
++ let gram = info.parse_grammar in
++ let prec_table = gram.gram_prec_table in
+ let prec_table = Precedence.add_assoc prec_table pre assoc in
+ let gram = { gram with gram_prec_table = prec_table } in
+ let info = { parse_grammar = gram; parse_pda = None } in
+ info
+
+ let create_prec_lt info pre assoc =
+- let { parse_grammar = gram } = info in
+- let { gram_prec_table = prec_table } = gram in
++ let gram = info.parse_grammar in
++ let prec_table = gram.gram_prec_table in
+ let prec_table, pre = Precedence.create_prec_lt prec_table pre assoc in
+ let gram = { gram with gram_prec_table = prec_table } in
+ let info = { parse_grammar = gram; parse_pda = None } in
+ info, pre
+
+ let create_prec_gt info pre assoc =
+- let { parse_grammar = gram } = info in
+- let { gram_prec_table = prec_table } = gram in
++ let gram = info.parse_grammar in
++ let prec_table = gram.gram_prec_table in
+ let prec_table, pre = Precedence.create_prec_gt prec_table pre assoc in
+ let gram = { gram with gram_prec_table = prec_table } in
+ let info = { parse_grammar = gram; parse_pda = None } in