diff --git a/src/reqtraceCmt.ml b/src/reqtraceCmt.ml index d900403..7cff444 100644 --- a/src/reqtraceCmt.ml +++ b/src/reqtraceCmt.ml @@ -16,7 +16,7 @@ * *) -open ReqtraceTypes +open ReqtraceTypes.Refs open Asttypes open Parsetree open Typedtree @@ -164,8 +164,8 @@ let read_structure ~rfcs str = let module MyIterator = TypedtreeIter.MakeIterator(MyIteratorArgument) in MyIterator.iter_structure str; { - ReqtraceTypes.docs = state.docs; - ReqtraceTypes.refs = state.refs; + docs = state.docs; + refs = state.refs; } diff --git a/src/reqtraceDocXml.ml b/src/reqtraceDocXml.ml index 5a92171..4e116bb 100644 --- a/src/reqtraceDocXml.ml +++ b/src/reqtraceDocXml.ml @@ -15,7 +15,7 @@ * *) -open ReqtraceTypes +open ReqtraceTypes.RFC let xmlns = "" diff --git a/src/reqtraceHtmlCmd.ml b/src/reqtraceHtmlCmd.ml index e212879..03e06d9 100644 --- a/src/reqtraceHtmlCmd.ml +++ b/src/reqtraceHtmlCmd.ml @@ -220,7 +220,7 @@ let render_rfc rfc out_file scheme css = let normal_uri = normal_uri ~scheme in let uri_of_path = uri_of_path ~scheme in let body = Ezxmlm.make_tag "body" ([], []) (*ReqtraceHtml.of_package ~name ~rfc ~normal_uri ~uri_of_path*) in - let title = rfc.ReqtraceTypes.title in + let title = rfc.ReqtraceTypes.RFC.title in write_html ~css ~title out_file body; `Ok () diff --git a/src/reqtraceRefXml.ml b/src/reqtraceRefXml.ml index d1c4af0..0fe3efd 100644 --- a/src/reqtraceRefXml.ml +++ b/src/reqtraceRefXml.ml @@ -16,7 +16,7 @@ *) open Ezxmlm -open ReqtraceTypes +open ReqtraceTypes.Refs let ns = "https://github.com/infidel/reqtrace" diff --git a/src/reqtraceTypes.ml b/src/reqtraceTypes.ml index 65446a0..f464bf9 100644 --- a/src/reqtraceTypes.ml +++ b/src/reqtraceTypes.ml @@ -17,30 +17,55 @@ type elemid = string -type linesub = { start_offset: int; end_offset: int; text: string } -type clause = { id: elemid option; lines: linesub list } -type paragraph = { id: elemid option; lines: linesub list; clauses: clause list } -type section = { name: string; id: elemid option; paras: paragraph list; } -type rfc = { number: int; title: string; sections: section list; } +module RFC = struct + type linesub = { + start_offset: int; + end_offset: int; + text: string; + } + type clause = { + id: elemid option; + lines: linesub list; + } -type docid = RFC of int | Uri of string + type paragraph = { + id: elemid option; + lines: linesub list; + clauses: clause list; + } -type docbind = string * docid + type section = { + name: string; + id: elemid option; + paras: paragraph list; + } -type docref = Bound of string | Unbound of docid + type rfc = { + number: int; + title: string; + sections: section list; + } +end -type reftype = Impl | Test | Unknown +module Refs = struct + type docid = RFC of int | Uri of string -type reqref = { - docref : docref; - reqid : string; - loc : Location.t; - reftype : reftype; -} + type docbind = string * docid -type impl_unit = { - docs : docbind list; - refs : reqref list; -} + type docref = Bound of string | Unbound of docid + type reftype = Impl | Test | Unknown + + type reqref = { + docref : docref; + reqid : string; + loc : Location.t; + reftype : reftype; + } + + type impl_unit = { + docs : docbind list; + refs : reqref list; + } +end