Skip to content

Commit f0e9837

Browse files
committed
1.12.6 missing updated output
1 parent f661f91 commit f0e9837

File tree

3 files changed

+423
-395
lines changed

3 files changed

+423
-395
lines changed

docs/v1/annotated-source/rewriter.html

+68-51
Original file line numberDiff line numberDiff line change
@@ -450,9 +450,12 @@ <h1>rewriter.coffee</h1>
450450

451451
</div>
452452

453-
<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
454-
<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>
455-
<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>
453+
<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
454+
<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>
455+
<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>
456+
<span class="hljs-function"> <span class="hljs-title">inImplicit</span> = -&gt;</span> isImplicit stackTop()
457+
<span class="hljs-function"> <span class="hljs-title">inImplicitCall</span> = -&gt;</span> isImplicitCall stackTop()
458+
<span class="hljs-function"> <span class="hljs-title">inImplicitObject</span> = -&gt;</span> isImplicitObject stackTop()</pre></div></div>
456459

457460
</li>
458461

@@ -735,8 +738,22 @@ <h1>rewriter.coffee</h1>
735738
</code></pre>
736739
</div>
737740

738-
<div class="content"><div class='highlight'><pre>
739-
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
741+
</li>
742+
743+
744+
<li id="section-29">
745+
<div class="annotation">
746+
747+
<div class="pilwrap ">
748+
<a class="pilcrow" href="#section-29">&#182;</a>
749+
</div>
750+
<p>Mark all enclosing objects as not sameLine</p>
751+
752+
</div>
753+
754+
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> tag <span class="hljs-keyword">in</span> LINEBREAKS
755+
<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
756+
stackItem[<span class="hljs-number">2</span>].sameLine = <span class="hljs-literal">no</span>
740757

741758
newLine = prevTag <span class="hljs-keyword">is</span> <span class="hljs-string">'OUTDENT'</span> <span class="hljs-keyword">or</span> prevToken.newLine
742759
<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
@@ -746,11 +763,11 @@ <h1>rewriter.coffee</h1>
746763
</li>
747764

748765

749-
<li id="section-29">
766+
<li id="section-30">
750767
<div class="annotation">
751768

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

@@ -762,11 +779,11 @@ <h1>rewriter.coffee</h1>
762779
</li>
763780

764781

765-
<li id="section-30">
782+
<li id="section-31">
766783
<div class="annotation">
767784

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

782799

783-
<li id="section-31">
800+
<li id="section-32">
784801
<div class="annotation">
785802

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

804821

805-
<li id="section-32">
822+
<li id="section-33">
806823
<div class="annotation">
807824

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

829846

830-
<li id="section-33">
847+
<li id="section-34">
831848
<div class="annotation">
832849

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

851868

852-
<li id="section-34">
869+
<li id="section-35">
853870
<div class="annotation">
854871

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

@@ -879,11 +896,11 @@ <h1>rewriter.coffee</h1>
879896
</li>
880897

881898

882-
<li id="section-35">
899+
<li id="section-36">
883900
<div class="annotation">
884901

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

909926

910-
<li id="section-36">
927+
<li id="section-37">
911928
<div class="annotation">
912929

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

964981

965-
<li id="section-37">
982+
<li id="section-38">
966983
<div class="annotation">
967984

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

9971014

998-
<li id="section-38">
1015+
<li id="section-39">
9991016
<div class="annotation">
10001017

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

@@ -1020,11 +1037,11 @@ <h1>rewriter.coffee</h1>
10201037
</li>
10211038

10221039

1023-
<li id="section-39">
1040+
<li id="section-40">
10241041
<div class="annotation">
10251042

10261043
<div class="pilwrap ">
1027-
<a class="pilcrow" href="#section-39">&#182;</a>
1044+
<a class="pilcrow" href="#section-40">&#182;</a>
10281045
</div>
10291046
<p>Look up a tag by token index.</p>
10301047

@@ -1035,11 +1052,11 @@ <h1>rewriter.coffee</h1>
10351052
</li>
10361053

10371054

1038-
<li id="section-40">
1055+
<li id="section-41">
10391056
<div class="annotation">
10401057

10411058
<div class="pilwrap ">
1042-
<a class="pilcrow" href="#section-40">&#182;</a>
1059+
<a class="pilcrow" href="#section-41">&#182;</a>
10431060
</div>
10441061
<h2 id="constants">Constants</h2>
10451062

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

10501067

1051-
<li id="section-41">
1068+
<li id="section-42">
10521069
<div class="annotation">
10531070

10541071
<div class="pilwrap ">
1055-
<a class="pilcrow" href="#section-41">&#182;</a>
1072+
<a class="pilcrow" href="#section-42">&#182;</a>
10561073
</div>
10571074

10581075
</div>
10591076

10601077
</li>
10611078

10621079

1063-
<li id="section-42">
1080+
<li id="section-43">
10641081
<div class="annotation">
10651082

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

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

10871104

1088-
<li id="section-43">
1105+
<li id="section-44">
10891106
<div class="annotation">
10901107

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

11031120

1104-
<li id="section-44">
1121+
<li id="section-45">
11051122
<div class="annotation">
11061123

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

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

11231140

1124-
<li id="section-45">
1141+
<li id="section-46">
11251142
<div class="annotation">
11261143

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

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

11381155

1139-
<li id="section-46">
1156+
<li id="section-47">
11401157
<div class="annotation">
11411158

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

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

11531170

1154-
<li id="section-47">
1171+
<li id="section-48">
11551172
<div class="annotation">
11561173

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

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

11771194

1178-
<li id="section-48">
1195+
<li id="section-49">
11791196
<div class="annotation">
11801197

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

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

11931210

1194-
<li id="section-49">
1211+
<li id="section-50">
11951212
<div class="annotation">
11961213

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

12101227

1211-
<li id="section-50">
1228+
<li id="section-51">
12121229
<div class="annotation">
12131230

12141231
<div class="pilwrap ">
1215-
<a class="pilcrow" href="#section-50">&#182;</a>
1232+
<a class="pilcrow" href="#section-51">&#182;</a>
12161233
</div>
12171234
<p>Tokens that end a line.</p>
12181235

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

12251242

1226-
<li id="section-51">
1243+
<li id="section-52">
12271244
<div class="annotation">
12281245

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

0 commit comments

Comments
 (0)