Skip to content

Commit

Permalink
1.12.6 missing updated output
Browse files Browse the repository at this point in the history
  • Loading branch information
GeoffreyBooth committed May 15, 2017
1 parent f661f91 commit f0e9837
Show file tree
Hide file tree
Showing 3 changed files with 423 additions and 395 deletions.
119 changes: 68 additions & 51 deletions docs/v1/annotated-source/rewriter.html
Original file line number Diff line number Diff line change
Expand Up @@ -450,9 +450,12 @@ <h1>rewriter.coffee</h1>

</div>

<div class="content"><div class='highlight'><pre><span class="hljs-function"> <span class="hljs-title">inImplicit</span> = -&gt;</span> stackTop()?[<span class="hljs-number">2</span>]?.ours
<span class="hljs-function"> <span class="hljs-title">inImplicitCall</span> = -&gt;</span> inImplicit() <span class="hljs-keyword">and</span> stackTop()?[<span class="hljs-number">0</span>] <span class="hljs-keyword">is</span> <span class="hljs-string">'('</span>
<span class="hljs-function"> <span class="hljs-title">inImplicitObject</span> = -&gt;</span> inImplicit() <span class="hljs-keyword">and</span> stackTop()?[<span class="hljs-number">0</span>] <span class="hljs-keyword">is</span> <span class="hljs-string">'{'</span></pre></div></div>
<div class="content"><div class='highlight'><pre><span class="hljs-function"> <span class="hljs-title">isImplicit</span> = <span class="hljs-params">(stackItem)</span> -&gt;</span> stackItem?[<span class="hljs-number">2</span>]?.ours
<span class="hljs-function"> <span class="hljs-title">isImplicitObject</span> = <span class="hljs-params">(stackItem)</span> -&gt;</span> isImplicit(stackItem) <span class="hljs-keyword">and</span> stackItem?[<span class="hljs-number">0</span>] <span class="hljs-keyword">is</span> <span class="hljs-string">'{'</span>
<span class="hljs-function"> <span class="hljs-title">isImplicitCall</span> = <span class="hljs-params">(stackItem)</span> -&gt;</span> isImplicit(stackItem) <span class="hljs-keyword">and</span> stackItem?[<span class="hljs-number">0</span>] <span class="hljs-keyword">is</span> <span class="hljs-string">'('</span>
<span class="hljs-function"> <span class="hljs-title">inImplicit</span> = -&gt;</span> isImplicit stackTop()
<span class="hljs-function"> <span class="hljs-title">inImplicitCall</span> = -&gt;</span> isImplicitCall stackTop()
<span class="hljs-function"> <span class="hljs-title">inImplicitObject</span> = -&gt;</span> isImplicitObject stackTop()</pre></div></div>

</li>

Expand Down Expand Up @@ -735,8 +738,22 @@ <h1>rewriter.coffee</h1>
</code></pre>
</div>

<div class="content"><div class='highlight'><pre>
stackTop()[<span class="hljs-number">2</span>].sameLine = <span class="hljs-literal">no</span> <span class="hljs-keyword">if</span> inImplicitObject() <span class="hljs-keyword">and</span> tag <span class="hljs-keyword">in</span> LINEBREAKS
</li>


<li id="section-29">
<div class="annotation">

<div class="pilwrap ">
<a class="pilcrow" href="#section-29">&#182;</a>
</div>
<p>Mark all enclosing objects as not sameLine</p>

</div>

<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> tag <span class="hljs-keyword">in</span> LINEBREAKS
<span class="hljs-keyword">for</span> stackItem <span class="hljs-keyword">in</span> stack <span class="hljs-keyword">by</span> <span class="hljs-number">-1</span> <span class="hljs-keyword">when</span> isImplicitObject stackItem
stackItem[<span class="hljs-number">2</span>].sameLine = <span class="hljs-literal">no</span>

newLine = prevTag <span class="hljs-keyword">is</span> <span class="hljs-string">'OUTDENT'</span> <span class="hljs-keyword">or</span> prevToken.newLine
<span class="hljs-keyword">if</span> tag <span class="hljs-keyword">in</span> IMPLICIT_END <span class="hljs-keyword">or</span> tag <span class="hljs-keyword">in</span> CALL_CLOSERS <span class="hljs-keyword">and</span> newLine
Expand All @@ -746,11 +763,11 @@ <h1>rewriter.coffee</h1>
</li>


<li id="section-29">
<li id="section-30">
<div class="annotation">

<div class="pilwrap ">
<a class="pilcrow" href="#section-29">&#182;</a>
<a class="pilcrow" href="#section-30">&#182;</a>
</div>
<p>Close implicit calls when reached end of argument list</p>

Expand All @@ -762,11 +779,11 @@ <h1>rewriter.coffee</h1>
</li>


<li id="section-30">
<li id="section-31">
<div class="annotation">

<div class="pilwrap ">
<a class="pilcrow" href="#section-30">&#182;</a>
<a class="pilcrow" href="#section-31">&#182;</a>
</div>
<p>Close implicit objects such as:
return a: 1, b: 2 unless true</p>
Expand All @@ -780,11 +797,11 @@ <h1>rewriter.coffee</h1>
</li>


<li id="section-31">
<li id="section-32">
<div class="annotation">

<div class="pilwrap ">
<a class="pilcrow" href="#section-31">&#182;</a>
<a class="pilcrow" href="#section-32">&#182;</a>
</div>
<p>Close implicit objects when at end of line, line didn’t end with a comma
and the implicit object didn’t start the line or the next line doesn’t look like
Expand All @@ -802,11 +819,11 @@ <h1>rewriter.coffee</h1>
</li>


<li id="section-32">
<li id="section-33">
<div class="annotation">

<div class="pilwrap ">
<a class="pilcrow" href="#section-32">&#182;</a>
<a class="pilcrow" href="#section-33">&#182;</a>
</div>
<p>Close implicit object if comma is the last character
and what comes after doesn’t look like it belongs.
Expand All @@ -827,11 +844,11 @@ <h1>rewriter.coffee</h1>
</li>


<li id="section-33">
<li id="section-34">
<div class="annotation">

<div class="pilwrap ">
<a class="pilcrow" href="#section-33">&#182;</a>
<a class="pilcrow" href="#section-34">&#182;</a>
</div>
<p>When nextTag is OUTDENT the comma is insignificant and
should just be ignored so embed it in the implicit object.</p>
Expand All @@ -849,11 +866,11 @@ <h1>rewriter.coffee</h1>
</li>


<li id="section-34">
<li id="section-35">
<div class="annotation">

<div class="pilwrap ">
<a class="pilcrow" href="#section-34">&#182;</a>
<a class="pilcrow" href="#section-35">&#182;</a>
</div>
<p>Add location data to all tokens generated by the rewriter.</p>

Expand All @@ -879,11 +896,11 @@ <h1>rewriter.coffee</h1>
</li>


<li id="section-35">
<li id="section-36">
<div class="annotation">

<div class="pilwrap ">
<a class="pilcrow" href="#section-35">&#182;</a>
<a class="pilcrow" href="#section-36">&#182;</a>
</div>
<p>OUTDENT tokens should always be positioned at the last character of the
previous token, so that AST nodes ending in an OUTDENT token end up with a
Expand All @@ -907,11 +924,11 @@ <h1>rewriter.coffee</h1>
</li>


<li id="section-36">
<li id="section-37">
<div class="annotation">

<div class="pilwrap ">
<a class="pilcrow" href="#section-36">&#182;</a>
<a class="pilcrow" href="#section-37">&#182;</a>
</div>
<p>Because our grammar is LALR(1), it can’t handle some single-line
expressions that lack ending delimiters. The <strong>Rewriter</strong> adds the implicit
Expand Down Expand Up @@ -962,11 +979,11 @@ <h1>rewriter.coffee</h1>
</li>


<li id="section-37">
<li id="section-38">
<div class="annotation">

<div class="pilwrap ">
<a class="pilcrow" href="#section-37">&#182;</a>
<a class="pilcrow" href="#section-38">&#182;</a>
</div>
<p>Tag postfix conditionals as such, so that we can parse them with a
different precedence.</p>
Expand Down Expand Up @@ -995,11 +1012,11 @@ <h1>rewriter.coffee</h1>
</li>


<li id="section-38">
<li id="section-39">
<div class="annotation">

<div class="pilwrap ">
<a class="pilcrow" href="#section-38">&#182;</a>
<a class="pilcrow" href="#section-39">&#182;</a>
</div>
<p>Generate the indentation tokens, based on another token on the same line.</p>

Expand All @@ -1020,11 +1037,11 @@ <h1>rewriter.coffee</h1>
</li>


<li id="section-39">
<li id="section-40">
<div class="annotation">

<div class="pilwrap ">
<a class="pilcrow" href="#section-39">&#182;</a>
<a class="pilcrow" href="#section-40">&#182;</a>
</div>
<p>Look up a tag by token index.</p>

Expand All @@ -1035,11 +1052,11 @@ <h1>rewriter.coffee</h1>
</li>


<li id="section-40">
<li id="section-41">
<div class="annotation">

<div class="pilwrap ">
<a class="pilcrow" href="#section-40">&#182;</a>
<a class="pilcrow" href="#section-41">&#182;</a>
</div>
<h2 id="constants">Constants</h2>

Expand All @@ -1048,23 +1065,23 @@ <h2 id="constants">Constants</h2>
</li>


<li id="section-41">
<li id="section-42">
<div class="annotation">

<div class="pilwrap ">
<a class="pilcrow" href="#section-41">&#182;</a>
<a class="pilcrow" href="#section-42">&#182;</a>
</div>

</div>

</li>


<li id="section-42">
<li id="section-43">
<div class="annotation">

<div class="pilwrap ">
<a class="pilcrow" href="#section-42">&#182;</a>
<a class="pilcrow" href="#section-43">&#182;</a>
</div>
<p>List of the token pairs that must be balanced.</p>

Expand All @@ -1085,11 +1102,11 @@ <h2 id="constants">Constants</h2>
</li>


<li id="section-43">
<li id="section-44">
<div class="annotation">

<div class="pilwrap ">
<a class="pilcrow" href="#section-43">&#182;</a>
<a class="pilcrow" href="#section-44">&#182;</a>
</div>
<p>The inverse mappings of <code>BALANCED_PAIRS</code> we’re trying to fix up, so we can
look things up from either end.</p>
Expand All @@ -1101,11 +1118,11 @@ <h2 id="constants">Constants</h2>
</li>


<li id="section-44">
<li id="section-45">
<div class="annotation">

<div class="pilwrap ">
<a class="pilcrow" href="#section-44">&#182;</a>
<a class="pilcrow" href="#section-45">&#182;</a>
</div>
<p>The tokens that signal the start/end of a balanced pair.</p>

Expand All @@ -1121,11 +1138,11 @@ <h2 id="constants">Constants</h2>
</li>


<li id="section-45">
<li id="section-46">
<div class="annotation">

<div class="pilwrap ">
<a class="pilcrow" href="#section-45">&#182;</a>
<a class="pilcrow" href="#section-46">&#182;</a>
</div>
<p>Tokens that indicate the close of a clause of an expression.</p>

Expand All @@ -1136,11 +1153,11 @@ <h2 id="constants">Constants</h2>
</li>


<li id="section-46">
<li id="section-47">
<div class="annotation">

<div class="pilwrap ">
<a class="pilcrow" href="#section-46">&#182;</a>
<a class="pilcrow" href="#section-47">&#182;</a>
</div>
<p>Tokens that, if followed by an <code>IMPLICIT_CALL</code>, indicate a function invocation.</p>

Expand All @@ -1151,11 +1168,11 @@ <h2 id="constants">Constants</h2>
</li>


<li id="section-47">
<li id="section-48">
<div class="annotation">

<div class="pilwrap ">
<a class="pilcrow" href="#section-47">&#182;</a>
<a class="pilcrow" href="#section-48">&#182;</a>
</div>
<p>If preceded by an <code>IMPLICIT_FUNC</code>, indicates a function invocation.</p>

Expand All @@ -1175,11 +1192,11 @@ <h2 id="constants">Constants</h2>
</li>


<li id="section-48">
<li id="section-49">
<div class="annotation">

<div class="pilwrap ">
<a class="pilcrow" href="#section-48">&#182;</a>
<a class="pilcrow" href="#section-49">&#182;</a>
</div>
<p>Tokens that always mark the end of an implicit call for single-liners.</p>

Expand All @@ -1191,11 +1208,11 @@ <h2 id="constants">Constants</h2>
</li>


<li id="section-49">
<li id="section-50">
<div class="annotation">

<div class="pilwrap ">
<a class="pilcrow" href="#section-49">&#182;</a>
<a class="pilcrow" href="#section-50">&#182;</a>
</div>
<p>Single-line flavors of block expressions that have unclosed endings.
The grammar can’t disambiguate them, so we insert the implicit indentation.</p>
Expand All @@ -1208,11 +1225,11 @@ <h2 id="constants">Constants</h2>
</li>


<li id="section-50">
<li id="section-51">
<div class="annotation">

<div class="pilwrap ">
<a class="pilcrow" href="#section-50">&#182;</a>
<a class="pilcrow" href="#section-51">&#182;</a>
</div>
<p>Tokens that end a line.</p>

Expand All @@ -1223,11 +1240,11 @@ <h2 id="constants">Constants</h2>
</li>


<li id="section-51">
<li id="section-52">
<div class="annotation">

<div class="pilwrap ">
<a class="pilcrow" href="#section-51">&#182;</a>
<a class="pilcrow" href="#section-52">&#182;</a>
</div>
<p>Tokens that close open calls when they follow a newline.</p>

Expand Down
Loading

0 comments on commit f0e9837

Please sign in to comment.