OCaml HTML5 parser/serialiser based on Python's JustHTML
1(** Base checker module for HTML5 conformance checking. *) 2 3module type S = sig 4 type state 5 6 val create : unit -> state 7 val reset : state -> unit 8 9 val start_element : 10 state -> 11 element:Element.t -> 12 Message_collector.t -> 13 unit 14 15 val end_element : 16 state -> 17 tag:Tag.element_tag -> 18 Message_collector.t -> 19 unit 20 21 val characters : state -> string -> Message_collector.t -> unit 22 val end_document : state -> Message_collector.t -> unit 23end 24 25type t = (module S) 26 27(** No-operation checker implementation. *) 28module Noop = struct 29 type state = unit 30 31 let create () = () 32 let reset () = () 33 34 let start_element () ~element:_ _ = () 35 let end_element () ~tag:_ _ = () 36 let characters () _ _ = () 37 let end_document () _ = () 38end 39 40let noop () = (module Noop : S)