package pacomb

  1. Overview
  2. Docs
type state

Type for the internal state of the preprocessor.

val initial_state : state

Initial state of the preprocessor.

val update : state -> string -> int -> string -> bool -> state * string * int * string option

update st name lnum data nl takes as input the state st of the preprocessor, the file name name, the number of the next input data lnum and the next input data itself. nl is true iff there is a newline at the end of data. It returns a tuple of the new state, the new file name, the new line number and None if the data must be ignored or Some(data) which is the new data. The new file name and line number can be used to implement line number directives. The function may raise Preprocessor_error in case of error.

val check_final : state -> string -> unit

check_final st name check that st indeed is a correct state of the preprocessor for the end of input of file name. If it is not the case, then the exception Preprocessor_error is raised.

OCaml

Innovation. Community. Security.