Skip to content

Commit

Permalink
ready for v.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
fponticelli committed Nov 25, 2018
1 parent ed5de60 commit db401e1
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 48 deletions.
35 changes: 15 additions & 20 deletions docs/classes/decoder.html
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ <h3>at<wbr>Least</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/fponticelli/partsing/blob/master/src/core/decoder.ts#L216">core/decoder.ts:216</a></li>
<li>Defined in <a href="https://github.com/fponticelli/partsing/blob/master/src/core/decoder.ts#L210">core/decoder.ts:210</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -254,7 +254,7 @@ <h3>at<wbr>Least<wbr>With<wbr>Separator</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/fponticelli/partsing/blob/master/src/core/decoder.ts#L287">core/decoder.ts:287</a></li>
<li>Defined in <a href="https://github.com/fponticelli/partsing/blob/master/src/core/decoder.ts#L281">core/decoder.ts:281</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -293,7 +293,7 @@ <h3>at<wbr>Most</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/fponticelli/partsing/blob/master/src/core/decoder.ts#L278">core/decoder.ts:278</a></li>
<li>Defined in <a href="https://github.com/fponticelli/partsing/blob/master/src/core/decoder.ts#L272">core/decoder.ts:272</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -323,7 +323,7 @@ <h3>at<wbr>Most<wbr>With<wbr>Separator</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/fponticelli/partsing/blob/master/src/core/decoder.ts#L296">core/decoder.ts:296</a></li>
<li>Defined in <a href="https://github.com/fponticelli/partsing/blob/master/src/core/decoder.ts#L290">core/decoder.ts:290</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -362,7 +362,7 @@ <h3>between</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/fponticelli/partsing/blob/master/src/core/decoder.ts#L243">core/decoder.ts:243</a></li>
<li>Defined in <a href="https://github.com/fponticelli/partsing/blob/master/src/core/decoder.ts#L237">core/decoder.ts:237</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -393,7 +393,7 @@ <h3>between<wbr>With<wbr>Separator</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/fponticelli/partsing/blob/master/src/core/decoder.ts#L321">core/decoder.ts:321</a></li>
<li>Defined in <a href="https://github.com/fponticelli/partsing/blob/master/src/core/decoder.ts#L315">core/decoder.ts:315</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -576,7 +576,7 @@ <h3>many</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/fponticelli/partsing/blob/master/src/core/decoder.ts#L236">core/decoder.ts:236</a></li>
<li>Defined in <a href="https://github.com/fponticelli/partsing/blob/master/src/core/decoder.ts#L230">core/decoder.ts:230</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand All @@ -598,7 +598,7 @@ <h3>many<wbr>With<wbr>Separator</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/fponticelli/partsing/blob/master/src/core/decoder.ts#L304">core/decoder.ts:304</a></li>
<li>Defined in <a href="https://github.com/fponticelli/partsing/blob/master/src/core/decoder.ts#L298">core/decoder.ts:298</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -741,19 +741,14 @@ <h3>or</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/fponticelli/partsing/blob/master/src/core/decoder.ts#L193">core/decoder.ts:193</a></li>
<li>Defined in <a href="https://github.com/fponticelli/partsing/blob/master/src/core/decoder.ts#L187">core/decoder.ts:187</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>If the current decoder fails, it tries the ones passed as arguments until
one of them succeeds or they all fail.</p>
</div>
<p>The first argument <code>combineErrors</code> is optional (if omitted <code>undefined</code>
needs to be passed). The provided function is used to combine an array of
<code>Err</code> into one. If you are using <a href="../globals.html#decodeerror">DecodeError</a> you can pass
{@link DecodeError.combine}.
If not passed, the failure will report the failure of the current decoder.</p>
</div>
<h4 class="tsd-type-parameters-title">Type parameters</h4>
<ul class="tsd-type-parameters">
Expand Down Expand Up @@ -818,7 +813,7 @@ <h3>probe</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/fponticelli/partsing/blob/master/src/core/decoder.ts#L422">core/decoder.ts:422</a></li>
<li>Defined in <a href="https://github.com/fponticelli/partsing/blob/master/src/core/decoder.ts#L389">core/decoder.ts:389</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -867,7 +862,7 @@ <h3>repeat</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/fponticelli/partsing/blob/master/src/core/decoder.ts#L268">core/decoder.ts:268</a></li>
<li>Defined in <a href="https://github.com/fponticelli/partsing/blob/master/src/core/decoder.ts#L262">core/decoder.ts:262</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -895,7 +890,7 @@ <h3>repeat<wbr>With<wbr>Separator</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/fponticelli/partsing/blob/master/src/core/decoder.ts#L313">core/decoder.ts:313</a></li>
<li>Defined in <a href="https://github.com/fponticelli/partsing/blob/master/src/core/decoder.ts#L307">core/decoder.ts:307</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -1052,7 +1047,7 @@ <h3>test</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/fponticelli/partsing/blob/master/src/core/decoder.ts#L401">core/decoder.ts:401</a></li>
<li>Defined in <a href="https://github.com/fponticelli/partsing/blob/master/src/core/decoder.ts#L368">core/decoder.ts:368</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -1103,7 +1098,7 @@ <h3>with<wbr>Failure</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/fponticelli/partsing/blob/master/src/core/decoder.ts#L441">core/decoder.ts:441</a></li>
<li>Defined in <a href="https://github.com/fponticelli/partsing/blob/master/src/core/decoder.ts#L408">core/decoder.ts:408</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -1137,7 +1132,7 @@ <h3>with<wbr>Result</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/fponticelli/partsing/blob/master/src/core/decoder.ts#L434">core/decoder.ts:434</a></li>
<li>Defined in <a href="https://github.com/fponticelli/partsing/blob/master/src/core/decoder.ts#L401">core/decoder.ts:401</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down
37 changes: 13 additions & 24 deletions docs/globals.html
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,7 @@ <h3><span class="tsd-flag ts-flagConst">Const</span> fail</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/fponticelli/partsing/blob/master/src/core/decoder.ts#L500">core/decoder.ts:500</a></li>
<li>Defined in <a href="https://github.com/fponticelli/partsing/blob/master/src/core/decoder.ts#L477">core/decoder.ts:477</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -1197,7 +1197,7 @@ <h3><span class="tsd-flag ts-flagConst">Const</span> lazy</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/fponticelli/partsing/blob/master/src/core/decoder.ts#L511">core/decoder.ts:511</a></li>
<li>Defined in <a href="https://github.com/fponticelli/partsing/blob/master/src/core/decoder.ts#L488">core/decoder.ts:488</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -1632,43 +1632,37 @@ <h4 class="tsd-returns-title">Returns <a href="globals.html#valuedecoder" class=
<a name="oneof" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagConst">Const</span> one<wbr>Of</h3>
<ul class="tsd-signatures tsd-kind-function tsd-has-type-parameter">
<li class="tsd-signature tsd-kind-icon">one<wbr>Of&lt;In, U, Err&gt;<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span>decoders<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="classes/decoder.html" class="tsd-signature-type">Decoder</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">In</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">U[number]</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">Err</span><span class="tsd-signature-symbol">&gt;</span></li>
<li class="tsd-signature tsd-kind-icon">one<wbr>Of&lt;U, D&gt;<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span>decoders<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">D</span><span class="tsd-signature-symbol"> &amp; </span><span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="classes/decoder.html" class="tsd-signature-type">Decoder</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">D[0][&quot;_I&quot;]</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">U[number]</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">D[0][&quot;_E&quot;]</span><span class="tsd-signature-symbol">&gt;</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/fponticelli/partsing/blob/master/src/core/decoder.ts#L475">core/decoder.ts:475</a></li>
<li>Defined in <a href="https://github.com/fponticelli/partsing/blob/master/src/core/decoder.ts#L445">core/decoder.ts:445</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Given an array of decoders, it traverses them all until one succeeds or they
all fail.</p>
</div>
<p><code>combineErrors</code> works the same as in <a href="classes/decoder.html#or">or</a>.</p>
</div>
<h4 class="tsd-type-parameters-title">Type parameters</h4>
<ul class="tsd-type-parameters">
<li>
<h4>In</h4>
</li>
<li>
<h4>U<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></h4>
</li>
<li>
<h4>Err</h4>
<h4>D<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">object</span></h4>
</li>
</ul>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5><span class="tsd-flag ts-flagRest">Rest</span> <span class="tsd-signature-symbol">...</span>decoders: <span class="tsd-signature-type">object</span></h5>
<ul class="tsd-parameters">
</ul>
<h5><span class="tsd-flag ts-flagRest">Rest</span> <span class="tsd-signature-symbol">...</span>decoders: <span class="tsd-signature-type">D</span><span class="tsd-signature-symbol"> &amp; </span><span class="tsd-signature-type">object</span></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <a href="classes/decoder.html" class="tsd-signature-type">Decoder</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">In</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">U[number]</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">Err</span><span class="tsd-signature-symbol">&gt;</span></h4>
<h4 class="tsd-returns-title">Returns <a href="classes/decoder.html" class="tsd-signature-type">Decoder</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">D[0][&quot;_I&quot;]</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">U[number]</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">D[0][&quot;_E&quot;]</span><span class="tsd-signature-symbol">&gt;</span></h4>
</li>
</ul>
</section>
Expand Down Expand Up @@ -1776,13 +1770,13 @@ <h4 class="tsd-returns-title">Returns <a href="globals.html#textdecoder" class="
<a name="sequence" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagConst">Const</span> sequence</h3>
<ul class="tsd-signatures tsd-kind-function tsd-has-type-parameter">
<li class="tsd-signature tsd-kind-icon">sequence&lt;In, U, Err&gt;<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span>decoders<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="classes/decoder.html" class="tsd-signature-type">Decoder</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">In</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">Err</span><span class="tsd-signature-symbol">&gt;</span></li>
<li class="tsd-signature tsd-kind-icon">sequence&lt;U, D&gt;<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span>decoders<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">D</span><span class="tsd-signature-symbol"> &amp; </span><span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="classes/decoder.html" class="tsd-signature-type">Decoder</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">D[0][&quot;_I&quot;]</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">D[0][&quot;_E&quot;]</span><span class="tsd-signature-symbol">&gt;</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/fponticelli/partsing/blob/master/src/core/decoder.ts#L451">core/decoder.ts:451</a></li>
<li>Defined in <a href="https://github.com/fponticelli/partsing/blob/master/src/core/decoder.ts#L418">core/decoder.ts:418</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand All @@ -1794,25 +1788,20 @@ <h3><span class="tsd-flag ts-flagConst">Const</span> sequence</h3>
</div>
<h4 class="tsd-type-parameters-title">Type parameters</h4>
<ul class="tsd-type-parameters">
<li>
<h4>In</h4>
</li>
<li>
<h4>U<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></h4>
</li>
<li>
<h4>Err</h4>
<h4>D<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">object</span></h4>
</li>
</ul>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5><span class="tsd-flag ts-flagRest">Rest</span> <span class="tsd-signature-symbol">...</span>decoders: <span class="tsd-signature-type">object</span></h5>
<ul class="tsd-parameters">
</ul>
<h5><span class="tsd-flag ts-flagRest">Rest</span> <span class="tsd-signature-symbol">...</span>decoders: <span class="tsd-signature-type">D</span><span class="tsd-signature-symbol"> &amp; </span><span class="tsd-signature-type">object</span></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <a href="classes/decoder.html" class="tsd-signature-type">Decoder</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">In</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">Err</span><span class="tsd-signature-symbol">&gt;</span></h4>
<h4 class="tsd-returns-title">Returns <a href="classes/decoder.html" class="tsd-signature-type">Decoder</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">D[0][&quot;_I&quot;]</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">D[0][&quot;_E&quot;]</span><span class="tsd-signature-symbol">&gt;</span></h4>
</li>
</ul>
</section>
Expand All @@ -1826,7 +1815,7 @@ <h3><span class="tsd-flag ts-flagConst">Const</span> succeed</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/fponticelli/partsing/blob/master/src/core/decoder.ts#L495">core/decoder.ts:495</a></li>
<li>Defined in <a href="https://github.com/fponticelli/partsing/blob/master/src/core/decoder.ts#L472">core/decoder.ts:472</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down
5 changes: 3 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ <h1> ParTSing</h1>
<div class="row">
<div class="col-8 col-content">
<div class="tsd-panel tsd-typography">
<p><a href="https://travis-ci.org/fponticelli/partsing"><img src="https://travis-ci.org/fponticelli/partsing.svg?branch=master" alt="Build Status"></a></p>
<h1 id="partsing">ParTSing</h1>
<p><em>ParTSing</em> is a decoder combinator library. You can use it to build parsers/decoders from string or really any input values.</p>
<p>If you want full control over what to decode your should start from <code>partsing/core/decoder</code>. It provides 3 types parameters</p>
Expand Down Expand Up @@ -117,7 +118,7 @@ <h2 id="example">Example</h2>
.skipNext(match(<span class="hljs-string">')'</span>))

<span class="hljs-keyword">const</span> colorTextDecoder = decodeText(
oneOf&lt;TextInput, Color[], DecodeError&gt;(
oneOf(
DecodeError.combine,
rgbDecoder,
greyDecoder,
Expand Down Expand Up @@ -160,7 +161,7 @@ <h2 id="example">Example</h2>
).map(<span class="hljs-function"><span class="hljs-params">v</span> =&gt;</span> <span class="hljs-keyword">new</span> HSL(v.h, v.s, v.l))

<span class="hljs-keyword">const</span> colorValueDecoder = decodeValue(
oneOf&lt;ValueInput, Color[], DecodeError&gt;(
oneOf(
DecodeError.combine,
rgbValue,
greyValue,
Expand Down
Loading

0 comments on commit db401e1

Please sign in to comment.