caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] fixing swig
@ 2010-12-29  0:22 Joel Reymont
  2010-12-29 21:43 ` Hezekiah M. Carty
  0 siblings, 1 reply; 5+ messages in thread
From: Joel Reymont @ 2010-12-29  0:22 UTC (permalink / raw)
  To: caml-list

Here's what happens when building OCaml examples in the latest SWIG:

---
ocamlc -I ` camlp4 -where` -pp "camlp4o pa_extend.cmo q_MLast.cmo" -c swigp4.ml
File "swig.ml", line 159, characters 54-57:
Warning 20: this argument will not be used by the function.
File "swigp4.ml", line 26, characters 2-6:
Parse error: Deprecated syntax, the grammar module is expected
File "swigp4.ml", line 1, characters 0-1:
Error: Preprocessor error
make[1]: *** [ocaml_static_cpp] Error 2
---

The following code from swigp4.ml needs to be fixed but I don't know enough Camlp4 to do it :-(.

If a kind soul can lend me a hand with this then I can try to incorporate the changes back into SWIG.

	Thanks in advance, Joel

--- swigp4.ml ---

open Pcaml ;;

let lap x y = x :: y
let c_ify e loc = 	  
  match e with
      <:expr< $int:_$ >> -> <:expr< (C_int $e$) >>
    | <:expr< $str:_$ >> -> <:expr< (C_string $e$) >>
    | <:expr< $chr:_$ >> -> <:expr< (C_char $e$) >>
    | <:expr< $flo:_$ >> -> <:expr< (C_double $e$) >>
    | <:expr< True    >> -> <:expr< (C_bool $e$) >>
    | <:expr< False   >> -> <:expr< (C_bool $e$) >>
    | _ -> <:expr< $e$ >>
let mk_list args loc f =
  let rec mk_list_inner args loc f =
    match args with
	[] -> <:expr< [] >>
      | x :: xs ->
	  (let loc = MLast.loc_of_expr x in
	     <:expr< [ ($f x loc$) ] @ ($mk_list_inner xs loc f$) >>) in
    match args with
	[] -> <:expr< (Obj.magic C_void) >>
      | [ a ] -> <:expr< (Obj.magic $f a loc$) >>
      | _ -> <:expr< (Obj.magic (C_list ($mk_list_inner args loc f$))) >>

EXTEND
  expr:
  [ [ e1 = expr ; "'" ; "[" ; e2 = expr ; "]" ->
	<:expr< (invoke $e1$) "[]" (C_list [ $c_ify e2 loc$ ]) >>
    | e1 = expr ; "->" ; l = LIDENT ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" ->
	<:expr< (invoke $e1$) $str:l$ ($mk_list args loc c_ify$) >>
    | e1 = expr ; "->" ; u = UIDENT ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" ->
	<:expr< (invoke $e1$) $str:u$ ($mk_list args loc c_ify$) >>
    | e1 = expr ; "->" ; s = expr LEVEL "simple" ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" ->
	<:expr< (invoke $e1$) $s$ ($mk_list args loc c_ify$) >>
    | e1 = expr ; "'" ; "." ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" ->
	<:expr< (invoke $e1$) "()" ($mk_list args loc c_ify$) >>
    | e1 = expr ; "'" ; "->" ; l = LIDENT ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" ->
	<:expr< (invoke ((invoke $e1$) "->" C_void)) $str:l$ ($mk_list args loc c_ify$) >>
    | e1 = expr ; "'" ; "->" ; u = UIDENT ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" ->
	<:expr< (invoke ((invoke $e1$) "->" C_void)) $str:u$ ($mk_list args loc c_ify$) >>
    | e1 = expr ; "'" ; "->" ; s = expr LEVEL "simple" ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" ->
	<:expr< (invoke ((invoke $e1$) "->" C_void)) $s$ ($mk_list args loc c_ify$) >>
    | e1 = expr ; "'" ; "++" ->
	<:expr< (invoke $e1$) "++" C_void >>
    | e1 = expr ; "'" ; "--" ->
	<:expr< (invoke $e1$) "--" C_void >>
    | e1 = expr ; "'" ; "-" ; e2 = expr ->
	<:expr< (invoke $e1$) "-" (C_list [ $c_ify e2 loc$ ]) >>
    | e1 = expr ; "'" ; "+" ; e2 = expr -> <:expr< (invoke $e1$) "+" (C_list [ $c_ify e2 loc$ ])  >> 
    | e1 = expr ; "'" ; "*" ; e2 = expr -> <:expr< (invoke $e1$) "*" (C_list [ $c_ify e2 loc$ ])  >> 
    | "'" ; "&" ; e1 = expr -> 
	<:expr< (invoke $e1$) "&" C_void >> 
    | "'" ; "!" ; e1 = expr ->
	<:expr< (invoke $e1$) "!" C_void >>
    | "'" ; "~" ; e1 = expr ->
	<:expr< (invoke $e1$) "~" C_void >>
    | e1 = expr ; "'" ; "/" ; e2 = expr ->
	<:expr< (invoke $e1$) "/" (C_list [ $c_ify e2 loc$ ]) >>
    | e1 = expr ; "'" ; "%" ; e2 = expr ->
	<:expr< (invoke $e1$) "%" (C_list [ $c_ify e2 loc$ ]) >>
    | e1 = expr ; "'" ; "lsl" ; e2 = expr ->
	<:expr< (invoke $e1$) ("<" ^ "<") (C_list [ $c_ify e2 loc$ ]) >>
    | e1 = expr ; "'" ; "lsr" ; e2 = expr ->
	<:expr< (invoke $e1$) (">" ^ ">") (C_list [ $c_ify e2 loc$ ]) >>
    | e1 = expr ; "'" ; "<" ; e2 = expr ->
	<:expr< (invoke $e1$) "<" (C_list [ $c_ify e2 loc$ ]) >>
    | e1 = expr ; "'" ; "<=" ; e2 = expr ->
	<:expr< (invoke $e1$) "<=" (C_list [ $c_ify e2 loc$ ]) >>
    | e1 = expr ; "'" ; ">" ; e2 = expr ->
	<:expr< (invoke $e1$) ">" (C_list [ $c_ify e2 loc$ ]) >>
    | e1 = expr ; "'" ; ">=" ; e2 = expr ->
	<:expr< (invoke $e1$) ">=" (C_list [ $c_ify e2 loc$ ]) >>
    | e1 = expr ; "'" ; "==" ; e2 = expr ->
	<:expr< (invoke $e1$) "==" (C_list [ $c_ify e2 loc$ ]) >>
    | e1 = expr ; "'" ; "!=" ; e2 = expr ->
	<:expr< (invoke $e1$) "!=" (C_list [ $c_ify e2 loc$ ]) >>
    | e1 = expr ; "'" ; "&" ; e2 = expr ->
	<:expr< (invoke $e1$) "&" (C_list [ $c_ify e2 loc$ ]) >>
    | e1 = expr ; "'" ; "^" ; e2 = expr ->
	<:expr< (invoke $e1$) "^" (C_list [ $c_ify e2 loc$ ]) >>
    | e1 = expr ; "'" ; "|" ; e2 = expr ->
	<:expr< (invoke $e1$) "|" (C_list [ $c_ify e2 loc$ ]) >>
    | e1 = expr ; "'" ; "&&" ; e2 = expr ->
	<:expr< (invoke $e1$) "&&" (C_list [ $c_ify e2 loc$ ]) >>
    | e1 = expr ; "'" ; "||" ; e2 = expr ->
	<:expr< (invoke $e1$) "||" (C_list [ $c_ify e2 loc$ ]) >>
    | e1 = expr ; "'" ; "=" ; e2 = expr ->
	<:expr< (invoke $e1$) "=" (C_list [ $c_ify e2 loc$ ]) >>
    | e1 = expr ; "'" ; "+=" ; e2 = expr ->
	<:expr< (invoke $e1$) "+=" (C_list [ $c_ify e2 loc$ ]) >>
    | e1 = expr ; "'" ; "-=" ; e2 = expr ->
	<:expr< (invoke $e1$) "-=" (C_list [ $c_ify e2 loc$ ]) >>
    | e1 = expr ; "'" ; "*=" ; e2 = expr ->
	<:expr< (invoke $e1$) "*=" (C_list [ $c_ify e2 loc$ ]) >>
    | e1 = expr ; "'" ; "/=" ; e2 = expr ->
	<:expr< (invoke $e1$) "/=" (C_list [ $c_ify e2 loc$ ]) >>
    | e1 = expr ; "'" ; "%=" ; e2 = expr ->
	<:expr< (invoke $e1$) "%=" (C_list [ $c_ify e2 loc$ ]) >>
    | e1 = expr ; "'" ; "lsl" ; "=" ; e2 = expr ->
	<:expr< (invoke $e1$) ("<" ^ "<=") (C_list [ $c_ify e2 loc$ ]) >>
    | e1 = expr ; "'" ; "lsr" ; "=" ; e2 = expr ->
	<:expr< (invoke $e1$) (">" ^ ">=") (C_list [ $c_ify e2 loc$ ]) >>
    | e1 = expr ; "'" ; "&=" ; e2 = expr ->
	<:expr< (invoke $e1$) "&=" (C_list [ $c_ify e2 loc$ ]) >>
    | e1 = expr ; "'" ; "^=" ; e2 = expr ->
	<:expr< (invoke $e1$) "^=" (C_list [ $c_ify e2 loc$ ]) >> 
    | e1 = expr ; "'" ; "|=" ; e2 = expr ->
	<:expr< (invoke $e1$) "|=" (C_list [ $c_ify e2 loc$ ]) >>
    | "'" ; e = expr -> c_ify e loc
    | c = expr ; "as" ; id = LIDENT -> <:expr< $lid:"get_" ^ id$ $c$ >>
    | c = expr ; "to" ; id = LIDENT -> <:expr< $uid:"C_" ^ id$ $c$ >>
    | "`" ; "`" ; l = LIDENT -> <:expr< C_enum `$lid:l$ >>
    | "`" ; "`" ; u = UIDENT -> <:expr< C_enum `$uid:u$ >>
    | f = expr ; "'" ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" -> 
	<:expr< $f$ ($mk_list args loc c_ify$) >>
    ] ] ;
END ;;
      

---
http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont







^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] fixing swig
  2010-12-29  0:22 [Caml-list] fixing swig Joel Reymont
@ 2010-12-29 21:43 ` Hezekiah M. Carty
  2010-12-29 21:47   ` Joel Reymont
                     ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Hezekiah M. Carty @ 2010-12-29 21:43 UTC (permalink / raw)
  To: Joel Reymont; +Cc: caml-list

On Tue, Dec 28, 2010 at 7:22 PM, Joel Reymont <joelr1@gmail.com> wrote:
> Here's what happens when building OCaml examples in the latest SWIG:
>
> ---
> ocamlc -I ` camlp4 -where` -pp "camlp4o pa_extend.cmo q_MLast.cmo" -c swigp4.ml
> File "swig.ml", line 159, characters 54-57:
> Warning 20: this argument will not be used by the function.
> File "swigp4.ml", line 26, characters 2-6:
> Parse error: Deprecated syntax, the grammar module is expected
> File "swigp4.ml", line 1, characters 0-1:
> Error: Preprocessor error
> make[1]: *** [ocaml_static_cpp] Error 2
> ---
>
> The following code from swigp4.ml needs to be fixed but I don't know enough Camlp4 to do it :-(.
>
> If a kind soul can lend me a hand with this then I can try to incorporate the changes back into SWIG.
>
>        Thanks in advance, Joel
>
> --- swigp4.ml ---
>
> open Pcaml ;;
>

I don't have much experience hacking around with camlp4, so this is
partial speculation.

It looks like swig may be using old camlp4 (now camlp5)
libraries/syntax.  As a work-around, you could try dropping in camlp5
in place of camlp4.

Good luck,

Hez


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] fixing swig
  2010-12-29 21:43 ` Hezekiah M. Carty
@ 2010-12-29 21:47   ` Joel Reymont
  2010-12-29 23:29   ` Joel Reymont
  2011-01-02 19:31   ` Joel Reymont
  2 siblings, 0 replies; 5+ messages in thread
From: Joel Reymont @ 2010-12-29 21:47 UTC (permalink / raw)
  To: Hezekiah M. Carty; +Cc: caml-list


On Dec 29, 2010, at 9:43 PM, Hezekiah M. Carty wrote:

> It looks like swig may be using old camlp4 (now camlp5)
> libraries/syntax.  As a work-around, you could try dropping in camlp5
> in place of camlp4.

I'd rather fix this to use Camlp4. 

Thanks for the suggestion, though.

---
http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont






^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] fixing swig
  2010-12-29 21:43 ` Hezekiah M. Carty
  2010-12-29 21:47   ` Joel Reymont
@ 2010-12-29 23:29   ` Joel Reymont
  2011-01-02 19:31   ` Joel Reymont
  2 siblings, 0 replies; 5+ messages in thread
From: Joel Reymont @ 2010-12-29 23:29 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 567 bytes --]

The patch attached below almost does it. Example code still fails, e.g. this bit

---
let (xf,yf) = match _factor '((x to int),(y to int)) with
    C_list [ C_int a ; C_int b ] -> a,b
  | _ -> raise BadReturn
---

results in this error

---
File "example_prog.ml", line 19, characters 20-27:
Parse error: "with" expected after [sequence] (in [expr])
File "example_prog.ml", line 1, characters 0-1:
Error: Preprocessor error
---

I'll see if I can figure it out.

---
http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont



[-- Attachment #2: 0001-no-errors.patch --]
[-- Type: application/octet-stream, Size: 9052 bytes --]

From ab2da507db52e02805fb9bf8bcdef861f5b53b6f Mon Sep 17 00:00:00 2001
From: wagerlabs <joelr1@gmail.com>
Date: Wed, 29 Dec 2010 22:06:17 +0000
Subject: [PATCH] no errors

---
 swigp4.ml |   91 +++++++++++++++++++++++++++++++-----------------------------
 1 files changed, 47 insertions(+), 44 deletions(-)

diff --git a/swigp4.ml b/swigp4.ml
index ab29e6f..0c3e248 100644
--- a/swigp4.ml
+++ b/swigp4.ml
@@ -1,5 +1,8 @@
-open Pcaml ;;
+open Camlp4.PreCast
+open Camlp4.Sig
+open Syntax
 
+let _loc = Loc.ghost
 let lap x y = x :: y
 let c_ify e loc = 	  
   match e with
@@ -15,39 +18,39 @@ let mk_list args loc f =
     match args with
 	[] -> <:expr< [] >>
       | x :: xs ->
-	  (let loc = MLast.loc_of_expr x in
-	     <:expr< [ ($f x loc$) ] @ ($mk_list_inner xs loc f$) >>) in
+	  (let loc = Ast.loc_of_expr x in
+	     <:expr< [ ($f x _loc$) ] @ ($mk_list_inner xs loc f$) >>) in
     match args with
 	[] -> <:expr< (Obj.magic C_void) >>
-      | [ a ] -> <:expr< (Obj.magic $f a loc$) >>
+      | [ a ] -> <:expr< (Obj.magic $f a _loc$) >>
       | _ -> <:expr< (Obj.magic (C_list ($mk_list_inner args loc f$))) >>
 
-EXTEND
+EXTEND Gram
   expr:
   [ [ e1 = expr ; "'" ; "[" ; e2 = expr ; "]" ->
-	<:expr< (invoke $e1$) "[]" (C_list [ $c_ify e2 loc$ ]) >>
+	<:expr< (invoke $e1$) "[]" (C_list [ $c_ify e2 _loc$ ]) >>
     | e1 = expr ; "->" ; l = LIDENT ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" ->
-	<:expr< (invoke $e1$) $str:l$ ($mk_list args loc c_ify$) >>
+	<:expr< (invoke $e1$) $str:l$ ($mk_list args _loc c_ify$) >>
     | e1 = expr ; "->" ; u = UIDENT ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" ->
-	<:expr< (invoke $e1$) $str:u$ ($mk_list args loc c_ify$) >>
+	<:expr< (invoke $e1$) $str:u$ ($mk_list args _loc c_ify$) >>
     | e1 = expr ; "->" ; s = expr LEVEL "simple" ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" ->
-	<:expr< (invoke $e1$) $s$ ($mk_list args loc c_ify$) >>
+	<:expr< (invoke $e1$) $s$ ($mk_list args _loc c_ify$) >>
     | e1 = expr ; "'" ; "." ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" ->
-	<:expr< (invoke $e1$) "()" ($mk_list args loc c_ify$) >>
+	<:expr< (invoke $e1$) "()" ($mk_list args _loc c_ify$) >>
     | e1 = expr ; "'" ; "->" ; l = LIDENT ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" ->
-	<:expr< (invoke ((invoke $e1$) "->" C_void)) $str:l$ ($mk_list args loc c_ify$) >>
+	<:expr< (invoke ((invoke $e1$) "->" C_void)) $str:l$ ($mk_list args _loc c_ify$) >>
     | e1 = expr ; "'" ; "->" ; u = UIDENT ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" ->
-	<:expr< (invoke ((invoke $e1$) "->" C_void)) $str:u$ ($mk_list args loc c_ify$) >>
+	<:expr< (invoke ((invoke $e1$) "->" C_void)) $str:u$ ($mk_list args _loc c_ify$) >>
     | e1 = expr ; "'" ; "->" ; s = expr LEVEL "simple" ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" ->
-	<:expr< (invoke ((invoke $e1$) "->" C_void)) $s$ ($mk_list args loc c_ify$) >>
+	<:expr< (invoke ((invoke $e1$) "->" C_void)) $s$ ($mk_list args _loc c_ify$) >>
     | e1 = expr ; "'" ; "++" ->
 	<:expr< (invoke $e1$) "++" C_void >>
     | e1 = expr ; "'" ; "--" ->
 	<:expr< (invoke $e1$) "--" C_void >>
     | e1 = expr ; "'" ; "-" ; e2 = expr ->
-	<:expr< (invoke $e1$) "-" (C_list [ $c_ify e2 loc$ ]) >>
-    | e1 = expr ; "'" ; "+" ; e2 = expr -> <:expr< (invoke $e1$) "+" (C_list [ $c_ify e2 loc$ ])  >> 
-    | e1 = expr ; "'" ; "*" ; e2 = expr -> <:expr< (invoke $e1$) "*" (C_list [ $c_ify e2 loc$ ])  >> 
+	<:expr< (invoke $e1$) "-" (C_list [ $c_ify e2 _loc$ ]) >>
+    | e1 = expr ; "'" ; "+" ; e2 = expr -> <:expr< (invoke $e1$) "+" (C_list [ $c_ify e2 _loc$ ])  >> 
+    | e1 = expr ; "'" ; "*" ; e2 = expr -> <:expr< (invoke $e1$) "*" (C_list [ $c_ify e2 _loc$ ])  >> 
     | "'" ; "&" ; e1 = expr -> 
 	<:expr< (invoke $e1$) "&" C_void >> 
     | "'" ; "!" ; e1 = expr ->
@@ -55,64 +58,64 @@ EXTEND
     | "'" ; "~" ; e1 = expr ->
 	<:expr< (invoke $e1$) "~" C_void >>
     | e1 = expr ; "'" ; "/" ; e2 = expr ->
-	<:expr< (invoke $e1$) "/" (C_list [ $c_ify e2 loc$ ]) >>
+	<:expr< (invoke $e1$) "/" (C_list [ $c_ify e2 _loc$ ]) >>
     | e1 = expr ; "'" ; "%" ; e2 = expr ->
-	<:expr< (invoke $e1$) "%" (C_list [ $c_ify e2 loc$ ]) >>
+	<:expr< (invoke $e1$) "%" (C_list [ $c_ify e2 _loc$ ]) >>
     | e1 = expr ; "'" ; "lsl" ; e2 = expr ->
-	<:expr< (invoke $e1$) ("<" ^ "<") (C_list [ $c_ify e2 loc$ ]) >>
+	<:expr< (invoke $e1$) ("<" ^ "<") (C_list [ $c_ify e2 _loc$ ]) >>
     | e1 = expr ; "'" ; "lsr" ; e2 = expr ->
-	<:expr< (invoke $e1$) (">" ^ ">") (C_list [ $c_ify e2 loc$ ]) >>
+	<:expr< (invoke $e1$) (">" ^ ">") (C_list [ $c_ify e2 _loc$ ]) >>
     | e1 = expr ; "'" ; "<" ; e2 = expr ->
-	<:expr< (invoke $e1$) "<" (C_list [ $c_ify e2 loc$ ]) >>
+	<:expr< (invoke $e1$) "<" (C_list [ $c_ify e2 _loc$ ]) >>
     | e1 = expr ; "'" ; "<=" ; e2 = expr ->
-	<:expr< (invoke $e1$) "<=" (C_list [ $c_ify e2 loc$ ]) >>
+	<:expr< (invoke $e1$) "<=" (C_list [ $c_ify e2 _loc$ ]) >>
     | e1 = expr ; "'" ; ">" ; e2 = expr ->
-	<:expr< (invoke $e1$) ">" (C_list [ $c_ify e2 loc$ ]) >>
+	<:expr< (invoke $e1$) ">" (C_list [ $c_ify e2 _loc$ ]) >>
     | e1 = expr ; "'" ; ">=" ; e2 = expr ->
-	<:expr< (invoke $e1$) ">=" (C_list [ $c_ify e2 loc$ ]) >>
+	<:expr< (invoke $e1$) ">=" (C_list [ $c_ify e2 _loc$ ]) >>
     | e1 = expr ; "'" ; "==" ; e2 = expr ->
-	<:expr< (invoke $e1$) "==" (C_list [ $c_ify e2 loc$ ]) >>
+	<:expr< (invoke $e1$) "==" (C_list [ $c_ify e2 _loc$ ]) >>
     | e1 = expr ; "'" ; "!=" ; e2 = expr ->
-	<:expr< (invoke $e1$) "!=" (C_list [ $c_ify e2 loc$ ]) >>
+	<:expr< (invoke $e1$) "!=" (C_list [ $c_ify e2 _loc$ ]) >>
     | e1 = expr ; "'" ; "&" ; e2 = expr ->
-	<:expr< (invoke $e1$) "&" (C_list [ $c_ify e2 loc$ ]) >>
+	<:expr< (invoke $e1$) "&" (C_list [ $c_ify e2 _loc$ ]) >>
     | e1 = expr ; "'" ; "^" ; e2 = expr ->
-	<:expr< (invoke $e1$) "^" (C_list [ $c_ify e2 loc$ ]) >>
+	<:expr< (invoke $e1$) "^" (C_list [ $c_ify e2 _loc$ ]) >>
     | e1 = expr ; "'" ; "|" ; e2 = expr ->
-	<:expr< (invoke $e1$) "|" (C_list [ $c_ify e2 loc$ ]) >>
+	<:expr< (invoke $e1$) "|" (C_list [ $c_ify e2 _loc$ ]) >>
     | e1 = expr ; "'" ; "&&" ; e2 = expr ->
-	<:expr< (invoke $e1$) "&&" (C_list [ $c_ify e2 loc$ ]) >>
+	<:expr< (invoke $e1$) "&&" (C_list [ $c_ify e2 _loc$ ]) >>
     | e1 = expr ; "'" ; "||" ; e2 = expr ->
-	<:expr< (invoke $e1$) "||" (C_list [ $c_ify e2 loc$ ]) >>
+	<:expr< (invoke $e1$) "||" (C_list [ $c_ify e2 _loc$ ]) >>
     | e1 = expr ; "'" ; "=" ; e2 = expr ->
-	<:expr< (invoke $e1$) "=" (C_list [ $c_ify e2 loc$ ]) >>
+	<:expr< (invoke $e1$) "=" (C_list [ $c_ify e2 _loc$ ]) >>
     | e1 = expr ; "'" ; "+=" ; e2 = expr ->
-	<:expr< (invoke $e1$) "+=" (C_list [ $c_ify e2 loc$ ]) >>
+	<:expr< (invoke $e1$) "+=" (C_list [ $c_ify e2 _loc$ ]) >>
     | e1 = expr ; "'" ; "-=" ; e2 = expr ->
-	<:expr< (invoke $e1$) "-=" (C_list [ $c_ify e2 loc$ ]) >>
+	<:expr< (invoke $e1$) "-=" (C_list [ $c_ify e2 _loc$ ]) >>
     | e1 = expr ; "'" ; "*=" ; e2 = expr ->
-	<:expr< (invoke $e1$) "*=" (C_list [ $c_ify e2 loc$ ]) >>
+	<:expr< (invoke $e1$) "*=" (C_list [ $c_ify e2 _loc$ ]) >>
     | e1 = expr ; "'" ; "/=" ; e2 = expr ->
-	<:expr< (invoke $e1$) "/=" (C_list [ $c_ify e2 loc$ ]) >>
+	<:expr< (invoke $e1$) "/=" (C_list [ $c_ify e2 _loc$ ]) >>
     | e1 = expr ; "'" ; "%=" ; e2 = expr ->
-	<:expr< (invoke $e1$) "%=" (C_list [ $c_ify e2 loc$ ]) >>
+	<:expr< (invoke $e1$) "%=" (C_list [ $c_ify e2 _loc$ ]) >>
     | e1 = expr ; "'" ; "lsl" ; "=" ; e2 = expr ->
-	<:expr< (invoke $e1$) ("<" ^ "<=") (C_list [ $c_ify e2 loc$ ]) >>
+	<:expr< (invoke $e1$) ("<" ^ "<=") (C_list [ $c_ify e2 _loc$ ]) >>
     | e1 = expr ; "'" ; "lsr" ; "=" ; e2 = expr ->
-	<:expr< (invoke $e1$) (">" ^ ">=") (C_list [ $c_ify e2 loc$ ]) >>
+	<:expr< (invoke $e1$) (">" ^ ">=") (C_list [ $c_ify e2 _loc$ ]) >>
     | e1 = expr ; "'" ; "&=" ; e2 = expr ->
-	<:expr< (invoke $e1$) "&=" (C_list [ $c_ify e2 loc$ ]) >>
+	<:expr< (invoke $e1$) "&=" (C_list [ $c_ify e2 _loc$ ]) >>
     | e1 = expr ; "'" ; "^=" ; e2 = expr ->
-	<:expr< (invoke $e1$) "^=" (C_list [ $c_ify e2 loc$ ]) >> 
+	<:expr< (invoke $e1$) "^=" (C_list [ $c_ify e2 _loc$ ]) >> 
     | e1 = expr ; "'" ; "|=" ; e2 = expr ->
-	<:expr< (invoke $e1$) "|=" (C_list [ $c_ify e2 loc$ ]) >>
-    | "'" ; e = expr -> c_ify e loc
+	<:expr< (invoke $e1$) "|=" (C_list [ $c_ify e2 _loc$ ]) >>
+    | "'" ; e = expr -> c_ify e _loc
     | c = expr ; "as" ; id = LIDENT -> <:expr< $lid:"get_" ^ id$ $c$ >>
     | c = expr ; "to" ; id = LIDENT -> <:expr< $uid:"C_" ^ id$ $c$ >>
     | "`" ; "`" ; l = LIDENT -> <:expr< C_enum `$lid:l$ >>
     | "`" ; "`" ; u = UIDENT -> <:expr< C_enum `$uid:u$ >>
     | f = expr ; "'" ; "(" ; args = LIST0 (expr LEVEL "simple") SEP "," ; ")" -> 
-	<:expr< $f$ ($mk_list args loc c_ify$) >>
+	<:expr< $f$ ($mk_list args _loc c_ify$) >>
     ] ] ;
 END ;;
       
-- 
1.7.3.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] fixing swig
  2010-12-29 21:43 ` Hezekiah M. Carty
  2010-12-29 21:47   ` Joel Reymont
  2010-12-29 23:29   ` Joel Reymont
@ 2011-01-02 19:31   ` Joel Reymont
  2 siblings, 0 replies; 5+ messages in thread
From: Joel Reymont @ 2011-01-02 19:31 UTC (permalink / raw)
  To: caml-list

I was able to update the SWIG OCaml code. Examples mostly work. 

A couple of examples crash but I should be able to fix that.

I will polish things up a bit and submit my patches to the SWIG maintainers.

	Happy New Year!

---
http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont






^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-01-02 19:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-29  0:22 [Caml-list] fixing swig Joel Reymont
2010-12-29 21:43 ` Hezekiah M. Carty
2010-12-29 21:47   ` Joel Reymont
2010-12-29 23:29   ` Joel Reymont
2011-01-02 19:31   ` Joel Reymont

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).