From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: ** X-Spam-Status: No, score=2.8 required=5.0 tests=DNS_FROM_RFC_POST,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 8FB89BBC4 for ; Thu, 5 Mar 2009 16:04:40 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsACACd5r0nRVduukWdsb2JhbACUQT8BAQEBCQkMBw+yTIEHkBUBAwEDhAUGgwg X-IronPort-AV: E=Sophos;i="4.38,307,1233529200"; d="scan'208";a="36142291" Received: from mail-ew0-f174.google.com ([209.85.219.174]) by mail4-smtp-sop.national.inria.fr with ESMTP; 05 Mar 2009 16:04:14 +0100 Received: by ewy22 with SMTP id 22so3108475ewy.27 for ; Thu, 05 Mar 2009 07:04:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :content-type:content-transfer-encoding:mime-version:subject:date :x-mailer; bh=PhMeXjlCnZx9g3dGaRrvRBVZiFbROJpHXZIMu4WLPY4=; b=V3ZoiA24fbwRvTeo9ITW6qNzlQzcifE7eM5gx9VvsTM16eEGiscu4+ddTdGKDi4lvV uiOGAi+bxtqHeDJzfZE93hcJiNxFVo36Md0a01eW18PoF6yP1+R4GXxCuzUt2EEJmRch vsObFXc8TGQ+Ll2hfisj+iBqrJXtyycNFBM/Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:content-type:content-transfer-encoding :mime-version:subject:date:x-mailer; b=blJnCS4LWFWrZjrGMIko6kTqaHKZbCatrIgVfVMXpOiOYHWNsyBJMt+XQUJym0wzoP /kwBMfPHezg8RDBRTK+gN6g46x3AGjdtrqTa1QMNl4vI/P/EuH/1o6WEB5zloSWagtEA OsPkV2r3FEKUfqPUdGnQy8TOSJN4CLcBWvZz4= Received: by 10.216.12.198 with SMTP id 48mr761312wez.223.1236265453169; Thu, 05 Mar 2009 07:04:13 -0800 (PST) Received: from ?10.10.30.14? (171.Red-88-3-3.dynamicIP.rima-tde.net [88.3.3.171]) by mx.google.com with ESMTPS id 7sm90046eyg.27.2009.03.05.07.04.12 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 05 Mar 2009 07:04:12 -0800 (PST) Message-Id: <333C38AD-C737-443A-B19A-9DF97E0DBF20@gmail.com> From: Joel Reymont To: O'Caml Mailing List Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Subject: using a camlp4 man filter with my own type Date: Thu, 5 Mar 2009 15:04:09 +0000 X-Mailer: Apple Mail (2.930.3) X-Spam: no; 0.00; camlp:01 camlp:01 wiki:01 ocamlfind:01 ocamlc:01 -package:01 -pp:01 cmo:01 expr:01 expr:01 symtab:01 typecheck:01 typecheck:01 inference:01 annotations:01 I looked at the Camlp4 filter wiki [1] but still can't figure this out. + ocamlfind ocamlc -package 'oUnit, dyp, extlib' -c -I +camlp4 -g -w a -pp 'camlp4of -I src -filter map' -I src -o src/easy_type_check.cmo src/easy_type_check.ml File "src/easy_type_check.ml", line 45, characters 10-15: Error: This expression has no method expr This used to work fine in 3.10.x and the error points to "match super#expr e with" in strip_token_loc below. Thanks, Joel --- Here's the code... open Easy_ast open Easy_symtab exception TypeCheck_error of string let type_check_error s = raise (TypeCheck_error s) (* Type inference *) let rec infer_type env = function | Int _ -> TyInt ... etc (* Remove annotations for unit testing *) class map = Camlp4MapGenerator.generated;; let strip_token_loc = object inherit map as super method expr e = match super#expr e with | TokenPos (a, _) -> a | e -> e end let strip_stmt x = strip_token_loc#statement x;; module Camlp4Trash = struct INCLUDE "easy_ast.ml";; end;; [1] http://brion.inria.fr/gallium/index.php/Camlp4MapGenerator --- http://tinyco.de Mac, C++, OCaml