More implementation.
[wrappi.git] / generator-macros / pa_wrap.ml
index c176fe2..5ce6d08 100644 (file)
@@ -89,9 +89,13 @@ let add_typedef _loc name t =
 let () =
   (* Quotation expander for C code. *)
   let c_quotation_expander _loc _ code =
+    let loc = expr_of_loc _loc _loc in
+
     (* XXX Expand %- or $- expressions in code. *)
     (* XXX Escape >> in code. *)
-    ExStr (_loc, code)
+
+    <:expr< { Wrappi_types.cc_loc = $loc$;
+              cc_code = $str:code$ } >>
   in
   Quotation.add "c" Quotation.DynAst.expr_tag c_quotation_expander;
 
@@ -127,6 +131,7 @@ EXTEND Gram
   (* A return type. *)
   rtype: [
     [ "void" -> <:expr< Wrappi_types.RVoid >> ]
+  | [ "static_string" -> <:expr< Wrappi_types.RStaticString >> ]
   | [ t = ptype -> <:expr< Wrappi_types.Return $t$ >> ]
   ];