package yuujinchou
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=805292aa48221618fdea6cf9aea30a63
sha512=a31c31f6a98c06844f973ecbef21e78e387b7d139bee78b9e9920ac92a90685f8282d08fc5f5a2a0adeab0d8ce7e1e4790fe0957ab04658b79e7cac82f21841a
doc/yuujinchou/Yuujinchou/Language/index.html
Module Yuujinchou.LanguageSource
The Language module defines the language of modifiers.
Types
The abstract type of modifiers, parametrized by the type of hook labels. See hook for hook labels. One can largely ignore hook labels unless hook is used.
The idea is to construct a modifier using builders in Language and then execute it using Modifier.S.modify.
Modifier Builders
Basics
all keeps the content of the current tree. The Modifier.S.Perform.not_found effect will be performed if the tree is empty (nothing to keep). To avoid the emptiness checking, use the identity modifier id. This is equivalent to only [].
only path keeps the subtree rooted at path. Bindings outside the subtree are dropped. The Modifier.S.Perform.not_found effect will be performed if the subtree is empty (nothing to keep).
Negation
none drops everything. The Modifier.S.Perform.not_found effect will be performed if the tree was already empty (nothing to drop). To avoid the emptiness checking, use the empty modifier union [].
except p drops the subtree rooted at p. The Modifier.S.Perform.not_found effect will be performed if the subtree was already empty (nothing to drop). This is equivalent to in_ p none.
Renaming
renaming path path' relocates the subtree rooted at path to path'. The existing bindings with the prefix path' (if any) will be dropped. The Modifier.S.Perform.not_found effect will be performed if the subtree was empty (nothing to move).
Sequencing
seq [m0; m1; m2; ...; mn] runs the modifiers m0, m1, m2, ..., mn in order. In particular, seq [] is the identity modifier id.
Union
union [m0; m1; m2; ...; mn] calculates the union of the results of individual modifiers m0, m1, m2, ..., mn.
In particular, union [] is the empty modifier; unlike none, union [] will not check whether the tree was already empty.
The Modifier.S.Perform.shadow effect will be performed to resolve name conflicts while calculating the union, assuming that the results from a later modifier are intended to shadow the results from an earlier modifier.
Custom Hooks
hook h applies the hook labelled h to the entire tree by performing the Modifier.S.Perform.hook effect.
Ugly Printing
dump dump_hook m dumps the internal representation of m for debugging, where dump_hook is the ugly printer for hook labels (see hook).