Module Jsont.Meta

Abstract syntax tree node metadata.

This type keeps information about source text locations and whitespace.

type t

The type for node metadata.

val make : ?ws_before:string -> ?ws_after:string -> Textloc.t -> t

make textloc ~ws_before ~ws_after is metadata with text location textloc whitespace ws_before before the node ws_after after the node. Both default to "".

val none : t

none is metadata for when there is none. Its textloc is Textloc.none and its whitespace is empty.

val textloc : t -> Textloc.t

textloc m is the text location of m.

val ws_before : t -> string

ws_before m is source whitespace before the node.

val ws_after : t -> string

ws_after m is source whitespace after the node.

val with_textloc : t -> Textloc.t -> t

with_textloc m l is m with text location l

val clear_ws : t -> t

clear_ws m is m with ws_before and ws_after set to "".