package ppxlib

  1. Overview
  2. Docs
Standard infrastructure for ppx rewriters

Install

Dune Dependency

Authors

Maintainers

Sources

ppxlib-0.35.0.tbz
sha256=d9d959fc9f84260487e45684dc741898a92fc5506b61a7f5cac65d21832db925
sha512=e428b1e3b89261c7efdaa18016264d1afbf067cb9b0d41124b04796c2487ac7ca8ee9a24a60d56f20d1774cb44aaa9ecf1512f17455812ba8d62d4ef93616ee7

doc/ppxlib/Ppxlib/Code_path/index.html

Module Ppxlib.Code_pathSource

This module contains type and functions for representing and manipulating path to AST nodes.

Sourcetype t

Type for path to AST nodes

Sourceval file_path : t -> string

Return the path to the .ml or .mli file for this code path.

Sourceval main_module_name : t -> string

Return the module name corresponding to the file to which this code path leads to.

Sourceval submodule_path : t -> string list

Return the path within the main module this code path represents as a list of module names.

Sourceval enclosing_module : t -> string

Return the nearest enclosing module name. Does descend into expressions.

Sourceval 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.

Sourceval 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.

Sourceval 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.

Sourceval 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.

OCaml

Innovation. Community. Security.