Commits

camlspotter  committed 00d2383

cleanups

  • Participants
  • Parent commits 86a2146

Comments (0)

Files changed (7)

File lib/OMakefile

 # OCamlGeneratedFiles(parser.ml lexer.ml)
 
 LIBFILES[] =
-   mtypes
    position
    result
    elem
+open Spotlib.Spot
+
 (** Type of the stream element *)
 module type S = sig
   type t (** the element of the stream *)

File lib/elem.mli

+open Spotlib.Spot
+
 (** Type of the stream element *)
 module type S = sig
 

File lib/pbase.ml

 open Spotlib.Spot
 open Result
 
-module Make(Str : Stream_intf.S) : sig
+module type S = sig
+  include Planck_intf.S
+  val run : 'a t -> Str.t -> ('a * Str.t, error) Result.t
+end
 
-  type error = Str.Pos.t * string
-  exception Critical_error of error
-
-  type 'a t = Str.t -> ('a * Str.t, error) Result.t
-  (* CR jfuruse: Damn, we must expose the implementation, 
-     for recursive definitions of 'a t
-  *)
-
-  include Planck_intf.S 
-    with module Str = Str
-    with type 'a t := 'a t 
-    with type error := error
-
-  val run : 'a t -> Str.t -> ('a * Str.t, error) Result.t
-
-end = struct
+module Make(Str : Stream_intf.S) = struct
   module Str = Str
 
   type error = Str.Pos.t * string

File lib/pbase.mli

 (** The basic monadic parser module. See Planck_intf.ml for more details *)
 
-module Make( S : Stream_intf.S ) : sig
-  type error = S.Pos.t * string
-  type 'a t = S.t -> ('a * S.t, error) Result.t
-  (* CR jfuruse: Damn, we must expose the implementation, 
-     for recursive definitions of 'a t
-  *)
-
+module type S = sig
   include Planck_intf.S
-    with module Str = S
-    with type 'a t := 'a t
-    with type error := error
   val run : 'a t -> Str.t -> ('a * Str.t, error) Result.t
 end
+
+module Make( Str : Stream_intf.S ) 
+  : S with module Str = Str
+      and  type error = Str.Pos.t * string
+      and  type 'a t = Str.t 
+                       -> ('a * Str.t, Str.Pos.t * string (* =error *)) Result.t
 (** Functor [Make] takes a stream implementation [S] and create a monadic parser module for [S].
     The parse uses the element, position and attribute from [S].
-    The monad is a function type [S.t -> ('a * S.t, S.Pos.t * string) Result.t].
+    The monad is a function type [Str.t -> ('a * Str.t, error) Result.t].
 *)

File lib/position.ml

+open Spotlib.Spot
 open Sexplib.Conv
 
 (* Abstract position interface *)

File lib/position.mli

+open Spotlib.Spot
+
 module type S = sig
   type t
   include Mtypes.Printable with type t := t