Skip to content

Commit

Permalink
deploy: 56ff0f0
Browse files Browse the repository at this point in the history
  • Loading branch information
favonia committed Sep 24, 2023
1 parent 0128d43 commit 1ee333a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion asai/Asai/Diagnostic/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Diagnostic (asai.Asai.Diagnostic)</title><link rel="stylesheet" href="../../../odoc.support/odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.2.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../odoc.support/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">asai</a> &#x00BB; <a href="../index.html">Asai</a> &#x00BB; Diagnostic</nav><header class="odoc-preamble"><h1>Module <code><span>Asai.Diagnostic</span></code></h1><p>The definition of diagnostics and some utility functions.</p></header><nav class="odoc-toc"><ul><li><a href="#types">Types</a></li><li><a href="#constructions-of-messages">Constructions of Messages</a></li><li><a href="#constructions-of-diagnostics">Constructions of Diagnostics</a></li><li><a href="#other-helper-functions">Other Helper Functions</a></li></ul></nav><div class="odoc-content"><h2 id="types"><a href="#types" class="anchor"></a>Types</h2><div class="odoc-spec"><div class="spec type anchored" id="type-severity"><a href="#type-severity" class="anchor"></a><code><span><span class="keyword">type</span> severity</span><span> = </span></code><ol><li id="type-severity.Hint" class="def variant constructor anchored"><a href="#type-severity.Hint" class="anchor"></a><code><span>| </span><span><span class="constructor">Hint</span></span></code></li><li id="type-severity.Info" class="def variant constructor anchored"><a href="#type-severity.Info" class="anchor"></a><code><span>| </span><span><span class="constructor">Info</span></span></code></li><li id="type-severity.Warning" class="def variant constructor anchored"><a href="#type-severity.Warning" class="anchor"></a><code><span>| </span><span><span class="constructor">Warning</span></span></code></li><li id="type-severity.Error" class="def variant constructor anchored"><a href="#type-severity.Error" class="anchor"></a><code><span>| </span><span><span class="constructor">Error</span></span></code></li><li id="type-severity.Bug" class="def variant constructor anchored"><a href="#type-severity.Bug" class="anchor"></a><code><span>| </span><span><span class="constructor">Bug</span></span></code></li></ol></div><div class="spec-doc"><p>The type of severity.</p></div></div><div class="odoc-spec"><div class="spec module-type anchored" id="module-type-Code"><a href="#module-type-Code" class="anchor"></a><code><span><span class="keyword">module</span> <span class="keyword">type</span> <a href="module-type-Code/index.html">Code</a></span><span> = <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div><div class="spec-doc"><p>The signature of message code. An implementer should specify the message code used in their library or application.</p></div></div><div class="odoc-spec"><div class="spec type anchored" id="type-text"><a href="#type-text" class="anchor"></a><code><span><span class="keyword">type</span> text</span><span> = <span><span class="xref-unresolved">Stdlib</span>.Format.formatter <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p>The type of text.</p><p>When we render a diagnostic, the layout engine of the rendering backend should be the one making layout choices. Therefore, we cannot pass already formatted strings. Instead, a text is defined to be a function that takes a formatter and uses it to render the content. The following two conditions must be satisfied:</p><ol><li><b>All string (and char) literals must be encoded using UTF-8.</b></li><li><b>All string (and char) literals must not contain control characters (such as newlines <code>\n</code>).</b> It is okay to have break hints (such as <code>@,</code> and <code>@ </code>) but not literal control characters. This means you should avoid pre-formatted strings, and if you must use them, use <a href="#val-text"><code>text</code></a> to convert newline characters. Control characters include `U+0000-001F` (C0 controls), `U+007F` (backspace), and `U+0080-009F` (C1 controls); in particular, `U+000A` (newline) is a C0 control character. These characters are banned because they would mess up the cursor position.</li></ol></div></div><div class="odoc-spec"><div class="spec type anchored" id="type-message"><a href="#type-message" class="anchor"></a><code><span><span class="keyword">type</span> message</span><span> = <span><a href="#type-text">text</a> <a href="../Span/index.html#type-located">Span.located</a></span></span></code></div><div class="spec-doc"><p>A message is a located <a href="#type-text"><code>text</code></a>.</p></div></div><div class="odoc-spec"><div class="spec type anchored" id="type-backtrace"><a href="#type-backtrace" class="anchor"></a><code><span><span class="keyword">type</span> backtrace</span><span> = <span><a href="#type-message">message</a> <span class="xref-unresolved">Bwd</span>.bwd</span></span></code></div><div class="spec-doc"><p>A backtrace is a (backward) list of messages.</p></div></div><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> <span>'code t</span></span><span> = </span><span>{</span></code><ol><li id="type-t.severity" class="def record field anchored"><a href="#type-t.severity" class="anchor"></a><code><span>severity : <a href="#type-severity">severity</a>;</span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Severity of the diagnostic.</p><span class="comment-delim">*)</span></div></li><li id="type-t.code" class="def record field anchored"><a href="#type-t.code" class="anchor"></a><code><span>code : <span class="type-var">'code</span>;</span></code><div class="def-doc"><span class="comment-delim">(*</span><p>The message code.</p><span class="comment-delim">*)</span></div></li><li id="type-t.message" class="def record field anchored"><a href="#type-t.message" class="anchor"></a><code><span>message : <a href="#type-message">message</a>;</span></code><div class="def-doc"><span class="comment-delim">(*</span><p>The main message.</p><span class="comment-delim">*)</span></div></li><li id="type-t.backtrace" class="def record field anchored"><a href="#type-t.backtrace" class="anchor"></a><code><span>backtrace : <a href="#type-backtrace">backtrace</a>;</span></code><div class="def-doc"><span class="comment-delim">(*</span><p>The backtrace leading to this diagnostic.</p><span class="comment-delim">*)</span></div></li><li id="type-t.additional_messages" class="def record field anchored"><a href="#type-t.additional_messages" class="anchor"></a><code><span>additional_messages : <span><a href="#type-message">message</a> list</span>;</span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Additional messages relevant to the main message that are not part of the backtrace.</p><span class="comment-delim">*)</span></div></li></ol><code><span>}</span></code></div><div class="spec-doc"><p>The type of diagnostics.</p></div></div><h2 id="constructions-of-messages"><a href="#constructions-of-messages" class="anchor"></a>Constructions of Messages</h2><div class="odoc-spec"><div class="spec value anchored" id="val-text"><a href="#val-text" class="anchor"></a><code><span><span class="keyword">val</span> text : <span>string <span class="arrow">&#45;&gt;</span></span> <a href="#type-text">text</a></span></code></div><div class="spec-doc"><p><code>text str</code> converts the string <code>str</code> into a text, converting each <code>'\n'</code> into a call to <code>Format</code>.pp_force_newline.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-textf"><a href="#val-textf" class="anchor"></a><code><span><span class="keyword">val</span> textf : <span><span><span>(<span class="type-var">'a</span>, <span class="xref-unresolved">Stdlib</span>.Format.formatter, unit, <a href="#type-text">text</a>)</span> <span class="xref-unresolved">Stdlib</span>.format4</span> <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'a</span></span></code></div><div class="spec-doc"><p><code>textf format ...</code> constructs a text. It is an alias of <code>Format</code>.dprintf. Note that there should not be any literal control characters (e.g., literal newline characters).</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-ktextf"><a href="#val-ktextf" class="anchor"></a><code><span><span class="keyword">val</span> ktextf :
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Diagnostic (asai.Asai.Diagnostic)</title><link rel="stylesheet" href="../../../odoc.support/odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.2.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../odoc.support/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">asai</a> &#x00BB; <a href="../index.html">Asai</a> &#x00BB; Diagnostic</nav><header class="odoc-preamble"><h1>Module <code><span>Asai.Diagnostic</span></code></h1><p>The definition of diagnostics and some utility functions.</p></header><nav class="odoc-toc"><ul><li><a href="#types">Types</a></li><li><a href="#constructions-of-messages">Constructions of Messages</a></li><li><a href="#constructions-of-diagnostics">Constructions of Diagnostics</a></li><li><a href="#other-helper-functions">Other Helper Functions</a></li></ul></nav><div class="odoc-content"><h2 id="types"><a href="#types" class="anchor"></a>Types</h2><div class="odoc-spec"><div class="spec type anchored" id="type-severity"><a href="#type-severity" class="anchor"></a><code><span><span class="keyword">type</span> severity</span><span> = </span></code><ol><li id="type-severity.Hint" class="def variant constructor anchored"><a href="#type-severity.Hint" class="anchor"></a><code><span>| </span><span><span class="constructor">Hint</span></span></code></li><li id="type-severity.Info" class="def variant constructor anchored"><a href="#type-severity.Info" class="anchor"></a><code><span>| </span><span><span class="constructor">Info</span></span></code></li><li id="type-severity.Warning" class="def variant constructor anchored"><a href="#type-severity.Warning" class="anchor"></a><code><span>| </span><span><span class="constructor">Warning</span></span></code></li><li id="type-severity.Error" class="def variant constructor anchored"><a href="#type-severity.Error" class="anchor"></a><code><span>| </span><span><span class="constructor">Error</span></span></code></li><li id="type-severity.Bug" class="def variant constructor anchored"><a href="#type-severity.Bug" class="anchor"></a><code><span>| </span><span><span class="constructor">Bug</span></span></code></li></ol></div><div class="spec-doc"><p>The type of severity.</p></div></div><div class="odoc-spec"><div class="spec module-type anchored" id="module-type-Code"><a href="#module-type-Code" class="anchor"></a><code><span><span class="keyword">module</span> <span class="keyword">type</span> <a href="module-type-Code/index.html">Code</a></span><span> = <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div><div class="spec-doc"><p>The signature of message code. An implementer should specify the message code used in their library or application.</p></div></div><div class="odoc-spec"><div class="spec type anchored" id="type-text"><a href="#type-text" class="anchor"></a><code><span><span class="keyword">type</span> text</span><span> = <span><span class="xref-unresolved">Stdlib</span>.Format.formatter <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p>The type of text.</p><p>When we render a diagnostic, the layout engine of the rendering backend should be the one making layout choices. Therefore, we cannot pass already formatted strings. Instead, a text is defined to be a function that takes a formatter and uses it to render the content. The following two conditions must be satisfied:</p><ol><li><b>All string (and character) literals must be encoded using UTF-8.</b></li><li><b>All string (and character) literals must not contain control characters (such as newlines <code>\n</code>).</b> It is okay to have break hints (such as <code>@,</code> and <code>@ </code>) but not literal control characters. This means you should avoid pre-formatted strings, and if you must use them, use <a href="#val-text"><code>text</code></a> to convert newline characters. Control characters include `U+0000-001F` (C0 controls), `U+007F` (backspace), and `U+0080-009F` (C1 controls); in particular, `U+000A` (newline) is a C0 control character. These characters are banned because they would mess up the cursor position.</li></ol></div></div><div class="odoc-spec"><div class="spec type anchored" id="type-message"><a href="#type-message" class="anchor"></a><code><span><span class="keyword">type</span> message</span><span> = <span><a href="#type-text">text</a> <a href="../Span/index.html#type-located">Span.located</a></span></span></code></div><div class="spec-doc"><p>A message is a located <a href="#type-text"><code>text</code></a>.</p></div></div><div class="odoc-spec"><div class="spec type anchored" id="type-backtrace"><a href="#type-backtrace" class="anchor"></a><code><span><span class="keyword">type</span> backtrace</span><span> = <span><a href="#type-message">message</a> <span class="xref-unresolved">Bwd</span>.bwd</span></span></code></div><div class="spec-doc"><p>A backtrace is a (backward) list of messages.</p></div></div><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> <span>'code t</span></span><span> = </span><span>{</span></code><ol><li id="type-t.severity" class="def record field anchored"><a href="#type-t.severity" class="anchor"></a><code><span>severity : <a href="#type-severity">severity</a>;</span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Severity of the diagnostic.</p><span class="comment-delim">*)</span></div></li><li id="type-t.code" class="def record field anchored"><a href="#type-t.code" class="anchor"></a><code><span>code : <span class="type-var">'code</span>;</span></code><div class="def-doc"><span class="comment-delim">(*</span><p>The message code.</p><span class="comment-delim">*)</span></div></li><li id="type-t.message" class="def record field anchored"><a href="#type-t.message" class="anchor"></a><code><span>message : <a href="#type-message">message</a>;</span></code><div class="def-doc"><span class="comment-delim">(*</span><p>The main message.</p><span class="comment-delim">*)</span></div></li><li id="type-t.backtrace" class="def record field anchored"><a href="#type-t.backtrace" class="anchor"></a><code><span>backtrace : <a href="#type-backtrace">backtrace</a>;</span></code><div class="def-doc"><span class="comment-delim">(*</span><p>The backtrace leading to this diagnostic.</p><span class="comment-delim">*)</span></div></li><li id="type-t.additional_messages" class="def record field anchored"><a href="#type-t.additional_messages" class="anchor"></a><code><span>additional_messages : <span><a href="#type-message">message</a> list</span>;</span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Additional messages relevant to the main message that are not part of the backtrace.</p><span class="comment-delim">*)</span></div></li></ol><code><span>}</span></code></div><div class="spec-doc"><p>The type of diagnostics.</p></div></div><h2 id="constructions-of-messages"><a href="#constructions-of-messages" class="anchor"></a>Constructions of Messages</h2><div class="odoc-spec"><div class="spec value anchored" id="val-text"><a href="#val-text" class="anchor"></a><code><span><span class="keyword">val</span> text : <span>string <span class="arrow">&#45;&gt;</span></span> <a href="#type-text">text</a></span></code></div><div class="spec-doc"><p><code>text str</code> converts the string <code>str</code> into a text, converting each <code>'\n'</code> into a call to <code>Format</code>.pp_force_newline.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-textf"><a href="#val-textf" class="anchor"></a><code><span><span class="keyword">val</span> textf : <span><span><span>(<span class="type-var">'a</span>, <span class="xref-unresolved">Stdlib</span>.Format.formatter, unit, <a href="#type-text">text</a>)</span> <span class="xref-unresolved">Stdlib</span>.format4</span> <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'a</span></span></code></div><div class="spec-doc"><p><code>textf format ...</code> constructs a text. It is an alias of <code>Format</code>.dprintf. Note that there should not be any literal control characters (e.g., literal newline characters).</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-ktextf"><a href="#val-ktextf" class="anchor"></a><code><span><span class="keyword">val</span> ktextf :
<span><span>(<span><a href="#type-text">text</a> <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'b</span>)</span> <span class="arrow">&#45;&gt;</span></span>
<span><span><span>(<span class="type-var">'a</span>, <span class="xref-unresolved">Stdlib</span>.Format.formatter, unit, <span class="type-var">'b</span>)</span> <span class="xref-unresolved">Stdlib</span>.format4</span> <span class="arrow">&#45;&gt;</span></span>
<span class="type-var">'a</span></span></code></div><div class="spec-doc"><p><code>ktextf kont format ...</code> is <code>kont (textf code format ...)</code>. It is an alias of <code>Format</code>.kdprintf.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-message"><a href="#val-message" class="anchor"></a><code><span><span class="keyword">val</span> message : <span>?loc:<a href="../Span/index.html#type-t">Span.t</a> <span class="arrow">&#45;&gt;</span></span> <span>string <span class="arrow">&#45;&gt;</span></span> <a href="#type-message">message</a></span></code></div><div class="spec-doc"><p><code>message str</code> converts the string <code>str</code> into a message.</p><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">loc</span> <p>The location of the message (usually the code) to highlight.</p></li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-messagef"><a href="#val-messagef" class="anchor"></a><code><span><span class="keyword">val</span> messagef :
Expand Down

0 comments on commit 1ee333a

Please sign in to comment.