Packages

A fast, spec compliant, generic JSON parser and encoder in Gleam

Current section

Files

Jump to
gj gen docs gj_decode index.html
Raw

gen/docs/gj_decode/index.html

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>gj_decode - gj</title>
<link rel="stylesheet" href="../index.css" type="text/css" />
</head>
<body>
<header class="page-header">
<h2>
gj<!-- - -->
</h2>
</header>
<div class="page">
<nav class="sidebar">
<a class="sidebar-toggle" href="#">
<svg
aria-hidden="true"
focusable="false"
data-prefix="fas"
data-icon="bars"
class="svg-inline--fa fa-bars fa-w-14"
role="img"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 448 512"
>
<path
fill="#fff"
d="M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"
>
</path>
</svg>
</a>
<h2>Pages</h2>
<ul>
<li><a href="../index.html">README</a></li>
</ul>
<h2>Modules</h2>
<ul>
<li><a href="../generic_json&#x2f;">generic_json</a></li>
<li><a href="../gj&#x2f;">gj</a></li>
<li><a href="../gj_decode&#x2f;">gj_decode</a></li>
<li><a href="../gj_encode&#x2f;">gj_encode</a></li>
</ul>
<h2>Types</h2>
<ul>
<li><a href="#ParseError">ParseError</a></li>
<li><a href="#ParseErrorLocation">ParseErrorLocation</a></li>
</ul>
<h2>Functions</h2>
<ul>
<li><a href="#decode">decode</a></li>
</ul>
</nav>
<main class="content">
<h1 class="module-name">gj_decode</h1>
<p>Decoder module for GJ</p>
<p>See module gj for the public interface</p>
<section class="module-members">
<a href="#module-types">
<h1 id="module-types" class="module-member-kind">Types</h1>
</a>
<div class="member">
<a href="#ParseError">
<h2 id="ParseError" class="member-name">
ParseError
</h2>
</a>
<div class="custom-type-constructors">
<div class="rendered-markdown"><p>Types of errors that can occur during parsing</p>
</div>
<pre>pub type ParseError {
UnexpectedToken(String)
UnexpectedEndOfInput
InvalidString
InvalidUnicodeSequence
InvalidNumber
}</pre>
<h3>
Constructors
</h3>
<ul>
<li>
<code class="constructor-name">UnexpectedToken(String)</code>
</li>
<li>
<code class="constructor-name">UnexpectedEndOfInput</code>
</li>
<li>
<code class="constructor-name">InvalidString</code>
</li>
<li>
<code class="constructor-name">InvalidUnicodeSequence</code>
</li>
<li>
<code class="constructor-name">InvalidNumber</code>
</li>
</ul>
</div>
</div>
<div class="member">
<a href="#ParseErrorLocation">
<h2 id="ParseErrorLocation" class="member-name">
ParseErrorLocation
</h2>
</a>
<div class="custom-type-constructors">
<div class="rendered-markdown"><p>Location of a parser error</p>
</div>
<pre>pub type ParseErrorLocation {
ParseErrorLocation(row: Int, column: Int)
}</pre>
<h3>
Constructors
</h3>
<ul>
<li>
<code class="constructor-name">ParseErrorLocation(row: Int, column: Int)</code>
</li>
</ul>
</div>
</div>
</section>
<section class="module-members">
<a href="#module-functions">
<h1 id="module-functions" class="module-member-kind">Functions</h1>
</a>
<div class="member">
<a href="#decode">
<h2 id="decode" class="member-name">
decode
</h2>
</a>
<pre>pub fn decode(
str: String,
) -&gt; Result(JSON, tuple(ParseError, ParseErrorLocation))</pre>
<div class="rendered-markdown"></div>
</div>
</section>
</main>
</div>
<script>const pride = () => document.querySelector('body').classList.toggle('show-pride')</script>
<a class="pride-button" onclick="pride()"></a>
<footer class="pride" onclick="pride()">
<div class="blue">Lucy</div>
<div class="pink">says</div>
<div class="white">trans</div>
<div class="pink">rights</div>
<div class="blue"></div>
</footer>
</body>
</html>