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: Nicolas Pouillard <nicolas.pouillard@g...>
Subject: Re: [Caml-list] camlp4 Filters changed?
Excerpts from joelr1's message of Sun Jan 27 17:37:58 +0100 2008:
> 
> 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
> 

Move it there
> module Camlp4Trash = struct
>    INCLUDE "easy_ast.ml";;
> end;;

> 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;;
> 
> 
> This used to work just fine before.

The  generator  works  on  the  last  defined  types  before  the "class map =
Camlp4MapGenerator.generated;;".

-- 
Nicolas Pouillard aka Ertai