Sexplib.Path
Path: Module for Substitutions within S-expressions
type el =
| Pos of int | (*
|
| Match of string * int | (*
|
| Rec of string | (*
|
Type of substitution elements
type t = el list
Type of substitution paths
val parse : string -> t
parse str
get ?path ?str sexp
if path
is provided, use it as path. Otherwise, if str
is provided, parse it as a path. If neither is provided, assume an empty path.
replace ?path ?str sexp ~subst
like get
, but does not extract a sub-expression but substitutes it with subst
.
replace_no_path ~str sexp ~subst
like replace
, but does not take optional arguments. str
must be specified.
extract_match tag n sexp