For_testing.Parse_queuetype token_with_loc = Css_parser_common.Token.t * Css_parser_common.Location.tval sexp_of_token_with_loc : token_with_loc -> Sexplib0.Sexp.tval throw_error_for_token :
f:(Css_parser_common.Token.t -> string) ->
token_with_loc ->
'aval raise : loc:Css_parser_common.Location.t -> string -> 'amodule Match : sig ... endmodule Typed_match : sig ... endval of_list : parsing_config:Parsing_config.t -> token_with_loc list -> tval to_list : t -> token_with_loc listval dequeue : t -> token_with_loc optionval drain :
while_:(token_with_loc -> bool) ->
f:(token_with_loc -> unit) ->
t ->
unitval dequeue_exn : ?error_msg:string Core.Lazy.t -> t -> token_with_locval dequeue_and_ignore_exn : t -> unitval require_next_token_to_match :
matches:'a Typed_match.t ->
error_msg:(Css_parser_common.Token.t -> string) ->
t ->
'a * Css_parser_common.Location.tval token :
'a Css_parser_common.Token.Typed_variant.t ->
error_message:(Css_parser_common.Token.t -> string) ->
t ->
'a * Css_parser_common.Location.tval require_next_token_to_match_and_ignore :
matches:Match.t ->
error_msg:(Css_parser_common.Token.t -> string) ->
t ->
unitval peek : t -> token_with_loc optionval peek_exn : t -> token_with_locval peek_token : t -> Css_parser_common.Token.t optionval peek_token_exn : t -> Css_parser_common.Token.tval get_nth_token_exn : n:int -> t -> Css_parser_common.Token.tval process :
while_:Match.t ->
f:(Css_parser_common.Token.t -> unit) ->
t ->
unitUnlike drain, process does not dequeue the token. Preventing infinite loops by making sure that the first element in the queue is not the same as in the last loop using phys_equal. This is __very__ rudimentary, but good enough for the CSS parsers needs
val fold_until :
t ->
init:'a ->
f:
('a -> (token_with_loc -> ('a, 'b) Base.Continue_or_stop.t) @ local) @ local ->
(finish:('a -> 'b) @ local ->
'b) @ localval maybe_throw_ocaml_code_error : t -> unitval process_into_list :
?allow_ocaml_code:bool ->
while_:Match.t ->
f:(Css_parser_common.Token.t -> 'a option) ->
t ->
'a listval consume_and_ignore_whitespaces : t -> unitval consume_comments_only : t -> (string * Css_parser_common.Location.t) listval handle_recoverable_error : t -> Recoverable_error.t -> unitval consume_comment_and_whitespace :
t ->
[ `Comment of string * Css_parser_common.Location.t
| `Whitespace of Css_parser_common.Location.t ]
listval consume_comments_and_ignore_whitespaces :
t ->
(string * Css_parser_common.Location.t) listval with_context : Css_parser_common.Context.t -> f:(t -> 'a) -> t -> 'aWrap f by pushing then popping a Context.t from the context stack
val with_loc :
?context:Css_parser_common.Context.t option ->
f:(t -> 'a) ->
t ->
('a * Css_parser_common.Location.t) optionwith_loc retrieves the location of the next token before f is run, and then the location of the last token that was processed after f is run. Optionally, wrap the inner call to f with with_context if a Context.t is provided.
This function should _never_ mutate tokens itself, only f should mutate tokens
val with_loc_exn :
?context:Css_parser_common.Context.t option ->
here:lexing_position ->
f:(t -> 'a) ->
t ->
'a * Css_parser_common.Location.t