caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Information for writting a ppx
@ 2016-06-17 17:10 Xavier Van de Woestyne
  2016-06-20 14:15 ` Anton Bachin
  0 siblings, 1 reply; 5+ messages in thread
From: Xavier Van de Woestyne @ 2016-06-17 17:10 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 870 bytes --]

Hello,

I have writted some ppx extension but I have a question,

Is there a proper way to add a start "file" structure.  

I have try using the "structure" member of the mapper :

  

`

let new_mapper =

 Ast_mapper.{  
   default_mapper with  
   structure = general_structure  
 }`

  

Where general_structure is just a

`my_begining_structure :: List.map (...)` but my begining

structure is repeated into each module. It is logic but I need

to add my own structure only at the begining of my file. In an

other project, I use a mandatory attribute ([@@@active_this_ppx]

for example), but imho, it is not a good approach.

  

Thanks a lot for your feedback and advices !

  

Xavier Van de Woestyne

Développeur à Derniercri.io

http://derniercri.io

![](https://link.nylas.com/open/3hl20o5fseo0be0el9ic747vo/local-
19c25162-3d3f?r=Y2FtbC1saXN0QGlucmlhLmZy)


[-- Attachment #2: Type: text/html, Size: 1485 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-06-20 15:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-17 17:10 [Caml-list] Information for writting a ppx Xavier Van de Woestyne
2016-06-20 14:15 ` Anton Bachin
2016-06-20 15:01   ` Xavier Van de Woestyne
2016-06-20 15:31     ` Marc Lasson
2016-06-20 15:33       ` Xavier Van de Woestyne

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).