mirror of
https://github.com/ocaml-tracing/ocaml-trace.git
synced 2026-03-10 12:45:44 -04:00
2 lines
3.1 KiB
HTML
2 lines
3.1 KiB
HTML
<!DOCTYPE html>
|
||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Base (ppxlib.Ppxlib.Expansion_context.Base)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 3.1.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> – <a href="../../../../index.html">Index</a> » <a href="../../../index.html">ppxlib</a> » <a href="../../index.html">Ppxlib</a> » <a href="../index.html">Expansion_context</a> » Base</nav><header class="odoc-preamble"><h1>Module <code><span>Expansion_context.Base</span></code></h1></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type anchored" id="type-t"><a href="#type-t" class="anchor"></a><code><span><span class="keyword">type</span> t</span></code></div><div class="spec-doc"><p>Type for the location independent parts of the expansion context</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-code_path"><a href="#val-code_path" class="anchor"></a><code><span><span class="keyword">val</span> code_path : <span><a href="#type-t">t</a> <span class="arrow">-></span></span> <a href="../../Code_path/index.html#type-t">Code_path.t</a></span></code></div><div class="spec-doc"><p>Return the code path for the given context In Driver, Deriving and Extension, the context is initialized so that the <code>file_path</code> component of the <code>code_path</code> is determined from the first location found in the input AST. That means that:</p><ul><li>It's the empty string in empty structures or signatures</li><li>It can be altered by line directives</li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-input_name"><a href="#val-input_name" class="anchor"></a><code><span><span class="keyword">val</span> input_name : <span><a href="#type-t">t</a> <span class="arrow">-></span></span> string</span></code></div><div class="spec-doc"><p>Return the input name for the given context. In Driver, Deriving and Extension, the context argument is initialized so that the <code>input_name</code> matches the input filename passed to the driver on the command line. That means that:</p><ul><li>It has a value even for empty files</li><li>It is not affected by line directives</li><li>It is <code>"_none_"</code> when using <code>Driver.map_structure</code> or <code>Driver.map_signature</code></li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-tool_name"><a href="#val-tool_name" class="anchor"></a><code><span><span class="keyword">val</span> tool_name : <span><a href="#type-t">t</a> <span class="arrow">-></span></span> string</span></code></div><div class="spec-doc"><p>Can be used within a ppx preprocessor to know which tool is calling it <code>"ocamlc"</code>, <code>"ocamlopt"</code>, <code>"ocamldep"</code>, <code>"ocaml"</code>, ... .</p></div></div></div></body></html>
|