Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manual: minimal documentation for compiler plugins #1187

Merged
merged 5 commits into from Jun 4, 2017

Conversation

Projects
None yet
4 participants
@Octachron
Copy link
Contributor

commented Jun 1, 2017

This PR adds a new chapter to the tool part of the manual in order to provide some minimal documentation on the new plugins infrastrucutre (beyond the laconic mention in the man pages).

Currently, the proposed documentation only contains a brief description of the available hooks in the compiler and a basic "hello world" plugin. This is still a very basic starting point, so I am open to any improvement propositions.

\begin{verbatim}
let add_hello name (mapper:Ast_mapper.mapper) structure =
let default = Ast_mapper.default_mapper in
(print_ensline name) :: (default.structure default structure)

This comment has been minimized.

Copy link
@hcarty

hcarty Jun 1, 2017

Contributor

Typo? s/ensline/endline/

{ Ast_mapper.default_mapper with structure = add_hello name }
\end{verbatim}%
%
Once this AST mapped constructed, we need to convert it to a hook and adds this

This comment has been minimized.

Copy link
@hcarty

hcarty Jun 1, 2017

Contributor

Typo? s/mapped constructed/mapper is constructed/

\end{verbatim}%
%
Once this AST mapped constructed, we need to convert it to a hook and adds this
hooks to the "Pparse.ImplementationsHooks".

This comment has been minimized.

Copy link
@hcarty

hcarty Jun 1, 2017

Contributor

Typo? s/hooks/hook/

This comment has been minimized.

Copy link
@Octachron

Octachron Jun 1, 2017

Author Contributor

Fixed, thanks.

@Drup

This comment has been minimized.

Copy link
Contributor

commented Jun 1, 2017

Maybe you should list the various hooks there too ?

@Octachron

This comment has been minimized.

Copy link
Contributor Author

commented Jun 1, 2017

@Drup, good idea, thanks for the suggestion:

I have added links or references to the Pparse, Typemod and Simplif modules and pulled them into the compiler-libs documentation since they provide plugins hooks.

I have also pulled the Clflags module to mention the possibility to defnine plugin specific arguments.

@gasche gasche merged commit 2072b5d into ocaml:trunk Jun 4, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@gasche

This comment has been minimized.

Copy link
Member

commented Jun 4, 2017

Merged, thanks! We would really a better separation between the all-users-facing standard library and the advanced-user-facing parts in the manual.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.