package ppxlib
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=507cc73ccf895f22eeb5257a2243838c18a38a09105fcff55eeef9148555422b
sha512=73fef8ab8761bfbfde6ae87cc51eaacc5a5c937f0d628a890f0abdb2bffbf073932c25287a9e3baa2a1947c37f3dfa7f83ddd33c440e2e800971015addc97cd2
doc/ppxlib/Ppxlib/Code_path/index.html
Module Ppxlib.Code_path
This module contains type and functions for representing and manipulating path to AST nodes.
val file_path : t -> string
Return the path to the .ml or .mli file for this code path.
val main_module_name : t -> string
Return the module name corresponding to the file to which this code path leads to.
val submodule_path : t -> string list
Return the path within the main module this code path represents as a list of module names.
val enclosing_module : t -> string
Return the nearest enclosing module name. Does descend into expressions.
val value : t -> string option
Return the name of the value to which this code path leads or None
if it leads to the toplevel of a module or submodule.
val enclosing_value : t -> string option
Like value
, returns the name of an enclosing value definition. Unlike value
, includes names inside expressions, not just names that the code path can reach from the toplevel module.
val fully_qualified_path : t -> string
Return the fully qualified path to the module or value this code path leads to, eg "Some_main_module.Some_submodule.some_value"
. Note that the fully qualified path doesn't descend into expressions which means it will always stop at the first value description or value binding.
val to_string_path : t -> string
Return the string version of this code path as built by Ast_traverse.map_with_path
. Used for compatibility with path from version 0.5.0 and lower.