Commit eedd1057 authored by POTTIER Francois's avatar POTTIER Francois
Browse files

Produce comments in the generated .mli file.

parent 26a3eb72
* Include comments in the generated .mli file (Interface)?
* Document the incremental interface * Document the incremental interface
* Confirm and understand why the code back-end slows down by 50% * Confirm and understand why the code back-end slows down by 50%
......
...@@ -50,6 +50,8 @@ and interface_item = ...@@ -50,6 +50,8 @@ and interface_item =
| IIInclude of module_type | IIInclude of module_type
(* Submodule. *) (* Submodule. *)
| IIModule of string * module_type | IIModule of string * module_type
(* Comment. *)
| IIComment of string
and module_type = and module_type =
| MTNamedModuleType of string | MTNamedModuleType of string
......
...@@ -62,6 +62,7 @@ let entrytypescheme_incremental symbol = ...@@ -62,6 +62,7 @@ let entrytypescheme_incremental symbol =
let table_interface = let table_interface =
if Settings.table then [ if Settings.table then [
IIComment "The incremental API.";
IIModule ( IIModule (
interpreter, interpreter,
MTWithType ( MTWithType (
...@@ -71,6 +72,7 @@ let table_interface = ...@@ -71,6 +72,7 @@ let table_interface =
ttoken ttoken
) )
); );
IIComment "The entry points to the incremental API.";
IIValDecls ( IIValDecls (
StringSet.fold (fun symbol decls -> StringSet.fold (fun symbol decls ->
(incremental symbol, entrytypescheme_incremental symbol) :: decls (incremental symbol, entrytypescheme_incremental symbol) :: decls
...@@ -82,8 +84,11 @@ let table_interface = ...@@ -82,8 +84,11 @@ let table_interface =
let interface = [ let interface = [
IIFunctor (PreFront.grammar.parameters, [ IIFunctor (PreFront.grammar.parameters, [
IIComment "This exception is raised by the monolithic API functions.";
IIExcDecls [ excdef ]; IIExcDecls [ excdef ];
IIComment "The type of tokens.";
IITypeDecls tokentypedef; IITypeDecls tokentypedef;
IIComment "The monolithic API.";
IIValDecls ( IIValDecls (
StringSet.fold (fun symbol decls -> StringSet.fold (fun symbol decls ->
(Misc.normalize symbol, entrytypescheme symbol) :: decls (Misc.normalize symbol, entrytypescheme symbol) :: decls
......
...@@ -685,6 +685,8 @@ and interface_item f = function ...@@ -685,6 +685,8 @@ and interface_item f = function
fprintf f "include %a%t%t" module_type mt nl nl fprintf f "include %a%t%t" module_type mt nl nl
| IIModule (name, mt) -> | IIModule (name, mt) ->
fprintf f "module %s : %a%t%t" name module_type mt nl nl fprintf f "module %s : %a%t%t" name module_type mt nl nl
| IIComment comment ->
fprintf f "(* %s *)%t" comment nl
and interface f i = and interface f i =
list interface_item nothing f i list interface_item nothing f i
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment