Module Bcfg_out

module Writer : sig ... end
type cfg

Type for output configuration values.

val config : ?margin:int -> ?indent:int -> ?tab:bool -> ?escape:[ `All_with_hex | `Normal ] -> ?hex:[ `Lower | `Upper ] -> unit -> cfg

config () allows you to define a configuration for how to generate a bcfg configuration file.

val emitter : cfg:cfg -> Bcfg_type.t -> Writer.ctx -> Writer.t

emitter ~cfg bcfg ctx creates a writer's state.

val lexeme_emitter : cfg:cfg -> (unit -> Bcfg_type.Stream.lexeme option) -> Writer.ctx -> Writer.t

lexeme_emitter ~cfg next ctx is a streaming emitter which pulls lexemes from next (until it returns None) and produces the same output as emitter would on the equivalent Bcfg_type.t. The memory footprint is bounded by the nesting depth of the configuration.