Version française
Home     About     Download     Resources     Contact us    
Browse thread
camlp4 Filters changed?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Joel Reymont <joelr1@g...>
Subject: Re: [Caml-list] camlp4 Filters changed?

On Jan 27, 2008, at 4:32 PM, Nicolas Pouillard wrote:

> That's certainly because you need to define your types as one big  
> definition (using "and").
>
> type t1 = ...
> and t2 = ...
> and t3 = ...
>
> class map = Camlp4MapGenerator.generated;
>
> Because the generation declaration take only the last definition  
> group now.


That's exactly what my AST looks like. Then I have (in a different ml  
file)

open Easy_ast

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;;

This used to work just fine before.

	Thanks, Joel

--
http://wagerlabs.com