Version française
Home     About     Download     Resources     Contact us    
Browse thread
GenerateFold
[ 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: GenerateFold
I can remove everything but class fold = ... in my code [1] but I  
would still get the error I mentioned previously. Is there an issue  
with GenerateFold?

	Thanks, Joel

[1] Code...

(* Remove annotations for unit testing *)

class map = Camlp4Filters.GenerateMap.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;;

class fold = Camlp4Filters.GenerateFold.generated;;

let is_fun_arg = object
   inherit fold as super
   val found = false
   method found = found
   method input_decl x =
     match super#input_decl x with
       | `FunArgDecl _ -> {< found = true >}
       | _             -> self
end

let is_fun x = (is_fun_arg#statement x)#found;;

module Camlp4Trash = struct
   INCLUDE "easy_ast.ml";;
end;;


--
http://topdog.cc      - EasyLanguage to C# translator
http://wagerlabs.com  - Blog