Skip to content

Commit

Permalink
Delete type content_signal and some row types
Browse files Browse the repository at this point in the history
Resolves #59.
  • Loading branch information
aantron committed Oct 25, 2020
1 parent 69f9e84 commit 22666fd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 14 deletions.
1 change: 0 additions & 1 deletion src/markup.ml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ type doctype = Common.doctype =
force_quirks : bool}

type signal = Common.signal
type content_signal = Common.content_signal

let signal_to_string = Common.signal_to_string

Expand Down
15 changes: 3 additions & 12 deletions src/markup.mli
Original file line number Diff line number Diff line change
Expand Up @@ -296,15 +296,6 @@ content ::= `Text | element | `PI | `Comment
exceeds about [Sys.max_string_length / 2], they will emit a [`Text] signal
with several strings. *)

type content_signal =
[ `Start_element of name * (name * string) list
| `End_element
| `Text of string list ]
(** A restriction of type {!signal} to only elements and text, i.e. no comments,
processing instructions, or declarations. This can be useful for pattern
matching in applications that only care about the content and element
structure of a document. See the helper {!content}. *)

val signal_to_string : [< signal ] -> string
(** Provides a human-readable representation of signals for debugging. *)

Expand Down Expand Up @@ -545,7 +536,7 @@ val to_list : ('a, sync) stream -> 'a list

(** {2 Utility} *)

val content : ([< signal ], 's) stream -> (content_signal, 's) stream
val content : ([< signal ], 's) stream -> (signal, 's) stream
(** Converts a {!signal} stream into a {!content_signal} stream by filtering out
all signals besides [`Start_element], [`End_element], and [`Text]. *)

Expand Down Expand Up @@ -677,7 +668,7 @@ val text : ([< signal ], 's) stream -> (char, 's) stream
[`Text ss] signal, the result stream has the bytes of the strings [ss], and
all other signals are ignored. *)

val trim : ([> content_signal ] as 'a, 's) stream -> ('a, 's) stream
val trim : (signal, 's) stream -> (signal, 's) stream
(** Trims insignificant whitespace in an HTML signal stream. Whitespace around
flow ("block") content does not matter, but whitespace in phrasing
("inline") content does. So, if the input stream is
Expand Down Expand Up @@ -707,7 +698,7 @@ val normalize_text :
after parsing, or generating streams from scratch, and would like to clean
up the [`Text] signals. *)

val pretty_print : ([> content_signal ] as 'a, 's) stream -> ('a, 's) stream
val pretty_print : (signal, 's) stream -> (signal, 's) stream
(** Adjusts the whitespace in the [`Text] signals in the given stream so that
the output appears nicely-indented when the stream is converted to bytes and
written.
Expand Down
2 changes: 1 addition & 1 deletion src/utility.ml
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ let rec trim_string_list trim = function
let trim signals =
let signals = normalize_text signals in

let signals_and_flow : ('signal * bool) Kstream.t =
let signals_and_flow =
Kstream.transform begin fun phrasing_nesting_level signal _throw k ->
match signal with
| `Start_element (name, _) ->
Expand Down

0 comments on commit 22666fd

Please sign in to comment.