Hello,

I would like to include several open statements at the top of the file 
when applying the extension. My first attempt used Martin Jambon's 
technique of stopping the parser and restarting it after inserting the 
open statement. This however does not work because the (original syntax) 
print out is flawed and hence I cannot use the file for compilation (I 
need to do this in order to avoid another bug in camlp4).

My second attempt does the following:

let set_opens loc s =
           if s = "Logic" then <:str_item< open Symbl_tbl3 >>
                          else <:str_item< open $uid:s$ >>

and

EXTEND
(*  Pcaml.expr: LEVEL "expr1" [*)
   Pcaml.expr: LEVEL "expr1" [
        ....
   Pcaml.str_item: LEVEL "top" [
         ["open" ; s = UIDENT -> set_opens loc s ]
   ];
END;;


This works ok for a single open statement. My question is: how can I 
substitute a single "open" for a set of those. I tried:

let set_opens loc s =
         let o1 = <:str_item< open Symbl_tbl3 >> in
         let opens = <:str_item<[$o1$]>>
         in
           if s = "Logic" then opens
                          else <:str_item< open $uid:s$ >>


but this does not even compile. Anyone know how to do this (fails at 
opens declaration)?

TIA,
Hugo Ferreira.



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"ocaml-developer" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/ocaml-developer?hl=en
For other OCaml forums, see http://caml.inria.fr/resources/forums.en.html
-~----------~----~----~----~------~----~------~--~---

Reply via email to