Skip to content
This repository has been archived by the owner on Jul 19, 2022. It is now read-only.

Commit

Permalink
ReqtraceTypes as two sub modules
Browse files Browse the repository at this point in the history
  • Loading branch information
lcdunstan committed Jun 11, 2015
1 parent 180c3f0 commit 99322ec
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 25 deletions.
6 changes: 3 additions & 3 deletions src/reqtraceCmt.ml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
*)

open ReqtraceTypes
open ReqtraceTypes.Refs
open Asttypes
open Parsetree
open Typedtree
Expand Down Expand Up @@ -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;
}


Expand Down
2 changes: 1 addition & 1 deletion src/reqtraceDocXml.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
*)

open ReqtraceTypes
open ReqtraceTypes.RFC

let xmlns = ""

Expand Down
2 changes: 1 addition & 1 deletion src/reqtraceHtmlCmd.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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 ()

Expand Down
2 changes: 1 addition & 1 deletion src/reqtraceRefXml.ml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*)

open Ezxmlm
open ReqtraceTypes
open ReqtraceTypes.Refs

let ns = "https://github.com/infidel/reqtrace"

Expand Down
63 changes: 44 additions & 19 deletions src/reqtraceTypes.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 99322ec

Please sign in to comment.