Version française
Home     About     Download     Resources     Contact us    
Browse thread
Upgrading sexplib-2.7.0 to camlp4 3.10
[ 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: Upgrading sexplib-2.7.0 to camlp4 3.10
One last chunk in that huge file...

---
Parse error: Deprecated syntax, the grammar module is expected
Preprocessor error
---

This points at "str" in Pcaml.str_item in DELETE_RULE. How do I fix?

Also, would you have any comments on the code in EXTEND?

	Thanks, Joel

---

DELETE_RULE
   Pcaml.str_item: "type"; LIST1 Pcaml.type_declaration SEP "and"
END

EXTEND
   GLOBAL: Pcaml.str_item;
   with_decl:
   [[ td = Pcaml.type_declaration; "with"; idl = LIST1 LIDENT SEP ","  
-> td, idl
   |  td = Pcaml.type_declaration -> td, [] ]];

   Pcaml.str_item:
   [[ "type"; twdl = LIST1 with_decl SEP "and" ->
     let tys = List.map fst twdl in
     let der_vals, der_tys =
       both List.concat List.concat
         (List.split (List.map gen_derived_defs twdl)) in
     let tydef = <:str_item< type $list:tys @ der_tys$ >> in
     let valdef = <:str_item< value rec $list:der_vals$ >> in
     match der_vals with
     | [] -> tydef
     | _ -> <:str_item< declare $tydef$; $valdef$; end >> ]];

   Pcaml.str_item:
   [[ "SEXP_CONV_PATH"; conv_path = STRING ->
     set_conv_path conv_path;
     StDcl (_loc, [])
   ]];
END

--
http://wagerlabs.com/