Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

CoffeeScript 1.0.0

  • Loading branch information...
commit 33d2577fb52e371e5456d1543c0eaf51807fa7a4 1 parent 3be22bd
Jeremy Ashkenas authored December 24, 2010
2  documentation/coffee/block_comment.coffee
... ...
@@ -1,5 +1,5 @@
1 1
 ###
2  
-CoffeeScript Compiler v0.9.6
  2
+CoffeeScript Compiler v1.0.0
3 3
 Released under the MIT License
4 4
 ###
5 5
 
1  documentation/coffee/parallel_assignment.coffee
@@ -3,3 +3,4 @@ theSwitch = 0
3 3
 
4 4
 [theBait, theSwitch] = [theSwitch, theBait]
5 5
 
  6
+
37  documentation/css/docs.css
@@ -64,6 +64,7 @@ code, pre, tt, textarea {
64 64
   word-wrap: break-word;
65 65
 }
66 66
   tt {
  67
+    display: inline-block;
67 68
     background: #fff;
68 69
     border: 1px solid #dedede;
69 70
     padding: 0px 0.2em;
@@ -86,9 +87,10 @@ code, pre, tt, textarea {
86 87
 div.code {
87 88
   position: relative;
88 89
   background: #fff;
89  
-  -webkit-box-shadow: 0px 0px 5px rgba(0,0,0,0.3);
90  
-  -moz-box-shadow: 0px 0px 5px rgba(0,0,0,0.3);
91  
-  box-shadow: 0px 0px 5px rgba(0,0,0,0.3);
  90
+  border: 1px solid #d8d8d8;
  91
+  -webkit-box-shadow: 0px 0px 4px rgba(0,0,0,0.23);
  92
+  -moz-box-shadow: 0px 0px 4px rgba(0,0,0,0.23);
  93
+  box-shadow: 0px 0px 4px rgba(0,0,0,0.23);
92 94
   zoom: 1;
93 95
 }
94 96
   div.code .minibutton {
@@ -313,20 +315,23 @@ div.code {
313 315
       width: 47%; right: 50%;
314 316
       float: left;
315 317
     }
316  
-    #repl_source {
317  
-      padding-left: 5px;
318  
-      width: 100%;
319  
-      height: 100%;
320  
-      border: 0;
321  
-      overflow-y: auto;
322  
-      resize: none;
323  
-    }
324  
-    #repl_results {
325  
-      text-transform: none;
326  
-      overflow-y: auto;
327  
-      left: 50%;
328  
-      border-left-color: #555;
  318
+      #repl_source {
  319
+        padding-left: 5px;
  320
+        width: 100%;
  321
+        height: 100%;
  322
+        border: 0;
  323
+        overflow-y: auto;
  324
+        resize: none;
  325
+      }
  326
+    #repl_results_wrap {
  327
+      white-space: pre;
329 328
     }
  329
+      #repl_results {
  330
+        text-transform: none;
  331
+        overflow-y: auto;
  332
+        left: 50%;
  333
+        border-left-color: #555;
  334
+      }
330 335
 
331 336
 /*----------------------------- Mini Buttons ---------------------------------*/
332 337
 .minibutton {
2  documentation/docs/coffee-script.html
@@ -12,7 +12,7 @@
12 12
     <span class="nv">content = </span><span class="nx">compile</span> <span class="nx">fs</span><span class="p">.</span><span class="nx">readFileSync</span> <span class="nx">filename</span><span class="p">,</span> <span class="s1">&#39;utf8&#39;</span>
13 13
     <span class="nx">module</span><span class="p">.</span><span class="nx">_compile</span> <span class="nx">content</span><span class="p">,</span> <span class="nx">filename</span>
14 14
 <span class="k">else</span> <span class="k">if</span> <span class="nx">require</span><span class="p">.</span><span class="nx">registerExtension</span>
15  
-  <span class="nx">require</span><span class="p">.</span><span class="nx">registerExtension</span> <span class="s1">&#39;.coffee&#39;</span><span class="p">,</span> <span class="p">(</span><span class="nx">content</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nx">compile</span> <span class="nx">content</span></pre></div>             </td>           </tr>                               <tr id="section-3">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-3">&#182;</a>               </div>               <p>The current CoffeeScript version number.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">exports.VERSION = </span><span class="s1">&#39;0.9.6&#39;</span></pre></div>             </td>           </tr>                               <tr id="section-4">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-4">&#182;</a>               </div>               <p>Words that cannot be used as identifiers in CoffeeScript code</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">exports.RESERVED = </span><span class="nx">RESERVED</span></pre></div>             </td>           </tr>                               <tr id="section-5">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-5">&#182;</a>               </div>               <p>Expose helpers for testing.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">exports.helpers = </span><span class="nx">require</span> <span class="s1">&#39;./helpers&#39;</span></pre></div>             </td>           </tr>                               <tr id="section-6">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-6">&#182;</a>               </div>               <p>Compile a string of CoffeeScript code to JavaScript, using the Coffee/Jison
  15
+  <span class="nx">require</span><span class="p">.</span><span class="nx">registerExtension</span> <span class="s1">&#39;.coffee&#39;</span><span class="p">,</span> <span class="p">(</span><span class="nx">content</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nx">compile</span> <span class="nx">content</span></pre></div>             </td>           </tr>                               <tr id="section-3">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-3">&#182;</a>               </div>               <p>The current CoffeeScript version number.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">exports.VERSION = </span><span class="s1">&#39;1.0.0&#39;</span></pre></div>             </td>           </tr>                               <tr id="section-4">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-4">&#182;</a>               </div>               <p>Words that cannot be used as identifiers in CoffeeScript code</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">exports.RESERVED = </span><span class="nx">RESERVED</span></pre></div>             </td>           </tr>                               <tr id="section-5">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-5">&#182;</a>               </div>               <p>Expose helpers for testing.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">exports.helpers = </span><span class="nx">require</span> <span class="s1">&#39;./helpers&#39;</span></pre></div>             </td>           </tr>                               <tr id="section-6">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-6">&#182;</a>               </div>               <p>Compile a string of CoffeeScript code to JavaScript, using the Coffee/Jison
16 16
 compiler.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">exports.compile = compile = </span><span class="p">(</span><span class="nx">code</span><span class="p">,</span> <span class="nv">options = </span><span class="p">{})</span> <span class="o">-&gt;</span>
17 17
   <span class="k">try</span>
18 18
     <span class="p">(</span><span class="nx">parser</span><span class="p">.</span><span class="nx">parse</span> <span class="nx">lexer</span><span class="p">.</span><span class="nx">tokenize</span> <span class="nx">code</span><span class="p">).</span><span class="nx">compile</span> <span class="nx">options</span>
71  documentation/docs/command.html
@@ -18,6 +18,7 @@
18 18
   <span class="p">[</span><span class="s1">&#39;-c&#39;</span><span class="p">,</span> <span class="s1">&#39;--compile&#39;</span><span class="p">,</span>         <span class="s1">&#39;compile to JavaScript and save as .js files&#39;</span><span class="p">]</span>
19 19
   <span class="p">[</span><span class="s1">&#39;-i&#39;</span><span class="p">,</span> <span class="s1">&#39;--interactive&#39;</span><span class="p">,</span>     <span class="s1">&#39;run an interactive CoffeeScript REPL&#39;</span><span class="p">]</span>
20 20
   <span class="p">[</span><span class="s1">&#39;-o&#39;</span><span class="p">,</span> <span class="s1">&#39;--output [DIR]&#39;</span><span class="p">,</span>    <span class="s1">&#39;set the directory for compiled JavaScript&#39;</span><span class="p">]</span>
  21
+  <span class="p">[</span><span class="s1">&#39;-j&#39;</span><span class="p">,</span> <span class="s1">&#39;--join&#39;</span><span class="p">,</span>            <span class="s1">&#39;concatenate the scripts before compiling&#39;</span><span class="p">]</span>
21 22
   <span class="p">[</span><span class="s1">&#39;-w&#39;</span><span class="p">,</span> <span class="s1">&#39;--watch&#39;</span><span class="p">,</span>           <span class="s1">&#39;watch scripts for changes, and recompile&#39;</span><span class="p">]</span>
22 23
   <span class="p">[</span><span class="s1">&#39;-p&#39;</span><span class="p">,</span> <span class="s1">&#39;--print&#39;</span><span class="p">,</span>           <span class="s1">&#39;print the compiled JavaScript to stdout&#39;</span><span class="p">]</span>
23 24
   <span class="p">[</span><span class="s1">&#39;-l&#39;</span><span class="p">,</span> <span class="s1">&#39;--lint&#39;</span><span class="p">,</span>            <span class="s1">&#39;pipe the compiled JavaScript through JSLint&#39;</span><span class="p">]</span>
@@ -27,33 +28,27 @@
27 28
   <span class="p">[</span><span class="s1">&#39;-b&#39;</span><span class="p">,</span> <span class="s1">&#39;--bare&#39;</span><span class="p">,</span>            <span class="s1">&#39;compile without the top-level function wrapper&#39;</span><span class="p">]</span>
28 29
   <span class="p">[</span><span class="s1">&#39;-t&#39;</span><span class="p">,</span> <span class="s1">&#39;--tokens&#39;</span><span class="p">,</span>          <span class="s1">&#39;print the tokens that the lexer produces&#39;</span><span class="p">]</span>
29 30
   <span class="p">[</span><span class="s1">&#39;-n&#39;</span><span class="p">,</span> <span class="s1">&#39;--nodes&#39;</span><span class="p">,</span>           <span class="s1">&#39;print the parse tree that Jison produces&#39;</span><span class="p">]</span>
  31
+  <span class="p">[</span>      <span class="s1">&#39;--nodejs [ARGS]&#39;</span><span class="p">,</span>   <span class="s1">&#39;pass options through to the &quot;node&quot; binary&#39;</span><span class="p">]</span>
30 32
   <span class="p">[</span><span class="s1">&#39;-v&#39;</span><span class="p">,</span> <span class="s1">&#39;--version&#39;</span><span class="p">,</span>         <span class="s1">&#39;display CoffeeScript version&#39;</span><span class="p">]</span>
31 33
   <span class="p">[</span><span class="s1">&#39;-h&#39;</span><span class="p">,</span> <span class="s1">&#39;--help&#39;</span><span class="p">,</span>            <span class="s1">&#39;display this help message&#39;</span><span class="p">]</span>
32  
-<span class="p">]</span></pre></div>             </td>           </tr>                               <tr id="section-6">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-6">&#182;</a>               </div>               <p>Switches that are still supported, but will cause a warning message.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">DEPRECATED_SWITCHES = </span><span class="p">[</span>
33  
-  <span class="p">[</span><span class="s1">&#39;--no-wrap&#39;</span><span class="p">,</span>               <span class="s1">&#39;compile without the top-level function wrapper&#39;</span><span class="p">]</span>
34  
-<span class="p">]</span>
35  
-
36  
-<span class="nv">ALL_SWITCHES = </span><span class="nx">SWITCHES</span><span class="p">.</span><span class="nx">concat</span> <span class="nx">DEPRECATED_SWITCHES</span></pre></div>             </td>           </tr>                               <tr id="section-7">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-7">&#182;</a>               </div>               <p>Top-level objects shared by all the functions.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">opts         = </span><span class="p">{}</span>
  34
+<span class="p">]</span></pre></div>             </td>           </tr>                               <tr id="section-6">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-6">&#182;</a>               </div>               <p>Top-level objects shared by all the functions.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">opts         = </span><span class="p">{}</span>
37 35
 <span class="nv">sources      = </span><span class="p">[]</span>
38  
-<span class="nv">optionParser = </span><span class="kc">null</span></pre></div>             </td>           </tr>                               <tr id="section-8">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-8">&#182;</a>               </div>               <p>Run <code>coffee</code> by parsing passed options and determining what action to take.
  36
+<span class="nv">contents     = </span><span class="p">[]</span>
  37
+<span class="nv">optionParser = </span><span class="kc">null</span></pre></div>             </td>           </tr>                               <tr id="section-7">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-7">&#182;</a>               </div>               <p>Run <code>coffee</code> by parsing passed options and determining what action to take.
39 38
 Many flags cause us to divert before compiling anything. Flags passed after
40 39
 <code>--</code> will be passed verbatim to your script as arguments in <code>process.argv</code></p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">exports.run = </span><span class="o">-&gt;</span>
41 40
   <span class="nx">parseOptions</span><span class="p">()</span>
42  
-  <span class="k">return</span> <span class="nx">usage</span><span class="p">()</span>                              <span class="k">if</span> <span class="nx">opts</span><span class="p">.</span><span class="nx">help</span>
43  
-  <span class="k">return</span> <span class="nx">version</span><span class="p">()</span>                            <span class="k">if</span> <span class="nx">opts</span><span class="p">.</span><span class="nx">version</span>
44  
-  <span class="k">return</span> <span class="nx">require</span> <span class="s1">&#39;./repl&#39;</span>                     <span class="k">if</span> <span class="nx">opts</span><span class="p">.</span><span class="nx">interactive</span>
45  
-  <span class="k">return</span> <span class="nx">compileStdio</span><span class="p">()</span>                       <span class="k">if</span> <span class="nx">opts</span><span class="p">.</span><span class="nx">stdio</span>
46  
-  <span class="k">return</span> <span class="nx">compileScript</span> <span class="kc">null</span><span class="p">,</span> <span class="nx">sources</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>       <span class="k">if</span> <span class="nx">opts</span><span class="p">.</span><span class="nb">eval</span>
47  
-  <span class="k">return</span> <span class="nx">require</span> <span class="s1">&#39;./repl&#39;</span>                     <span class="nx">unless</span> <span class="nx">sources</span><span class="p">.</span><span class="nx">length</span>
48  
-  <span class="nv">separator = </span><span class="nx">sources</span><span class="p">.</span><span class="nx">indexOf</span> <span class="s1">&#39;--&#39;</span>
49  
-  <span class="nv">flags = </span><span class="p">[]</span>
50  
-  <span class="k">if</span> <span class="nx">separator</span> <span class="o">&gt;=</span> <span class="mi">0</span>
51  
-    <span class="nv">flags = </span><span class="nx">sources</span><span class="p">.</span><span class="nx">splice</span> <span class="nx">separator</span> <span class="o">+</span> <span class="mi">1</span>
52  
-    <span class="nx">sources</span><span class="p">.</span><span class="nx">pop</span><span class="p">()</span>
  41
+  <span class="k">return</span> <span class="nx">forkNode</span><span class="p">()</span>                      <span class="k">if</span> <span class="nx">opts</span><span class="p">.</span><span class="nx">nodejs</span>
  42
+  <span class="k">return</span> <span class="nx">usage</span><span class="p">()</span>                         <span class="k">if</span> <span class="nx">opts</span><span class="p">.</span><span class="nx">help</span>
  43
+  <span class="k">return</span> <span class="nx">version</span><span class="p">()</span>                       <span class="k">if</span> <span class="nx">opts</span><span class="p">.</span><span class="nx">version</span>
  44
+  <span class="k">return</span> <span class="nx">require</span> <span class="s1">&#39;./repl&#39;</span>                <span class="k">if</span> <span class="nx">opts</span><span class="p">.</span><span class="nx">interactive</span>
  45
+  <span class="k">return</span> <span class="nx">compileStdio</span><span class="p">()</span>                  <span class="k">if</span> <span class="nx">opts</span><span class="p">.</span><span class="nx">stdio</span>
  46
+  <span class="k">return</span> <span class="nx">compileScript</span> <span class="kc">null</span><span class="p">,</span> <span class="nx">sources</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>  <span class="k">if</span> <span class="nx">opts</span><span class="p">.</span><span class="nb">eval</span>
  47
+  <span class="k">return</span> <span class="nx">require</span> <span class="s1">&#39;./repl&#39;</span>                <span class="nx">unless</span> <span class="nx">sources</span><span class="p">.</span><span class="nx">length</span>
53 48
   <span class="k">if</span> <span class="nx">opts</span><span class="p">.</span><span class="nx">run</span>
54  
-    <span class="nv">flags = </span><span class="nx">sources</span><span class="p">.</span><span class="nx">splice</span><span class="p">(</span><span class="mi">1</span><span class="p">).</span><span class="nx">concat</span> <span class="nx">flags</span>
55  
-  <span class="nv">process.ARGV = process.argv = </span><span class="nx">process</span><span class="p">.</span><span class="nx">argv</span><span class="p">.</span><span class="nx">slice</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">2</span><span class="p">).</span><span class="nx">concat</span> <span class="nx">flags</span>
56  
-  <span class="nx">compileScripts</span><span class="p">()</span></pre></div>             </td>           </tr>                               <tr id="section-9">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-9">&#182;</a>               </div>               <p>Asynchronously read in each CoffeeScript in a list of source files and
  49
+    <span class="nv">opts.literals = </span><span class="nx">sources</span><span class="p">.</span><span class="nx">splice</span><span class="p">(</span><span class="mi">1</span><span class="p">).</span><span class="nx">concat</span> <span class="nx">opts</span><span class="p">.</span><span class="nx">literals</span>
  50
+  <span class="nv">process.ARGV = process.argv = </span><span class="nx">process</span><span class="p">.</span><span class="nx">argv</span><span class="p">.</span><span class="nx">slice</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">2</span><span class="p">).</span><span class="nx">concat</span> <span class="nx">opts</span><span class="p">.</span><span class="nx">literals</span>
  51
+  <span class="nx">compileScripts</span><span class="p">()</span></pre></div>             </td>           </tr>                               <tr id="section-8">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-8">&#182;</a>               </div>               <p>Asynchronously read in each CoffeeScript in a list of source files and
57 52
 compile them. If a directory is passed, recursively compile all
58 53
 '.coffee' extension source files in it and all subdirectories.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">compileScripts = </span><span class="o">-&gt;</span>
59 54
   <span class="k">for</span> <span class="nx">source</span> <span class="k">in</span> <span class="nx">sources</span>
@@ -67,9 +62,14 @@
67 62
               <span class="k">for</span> <span class="nx">file</span> <span class="k">in</span> <span class="nx">files</span>
68 63
                 <span class="nx">compile</span> <span class="nx">path</span><span class="p">.</span><span class="nx">join</span><span class="p">(</span><span class="nx">source</span><span class="p">,</span> <span class="nx">file</span><span class="p">)</span>
69 64
           <span class="k">else</span> <span class="k">if</span> <span class="nx">topLevel</span> <span class="o">or</span> <span class="nx">path</span><span class="p">.</span><span class="nx">extname</span><span class="p">(</span><span class="nx">source</span><span class="p">)</span> <span class="o">is</span> <span class="s1">&#39;.coffee&#39;</span>
70  
-            <span class="nx">fs</span><span class="p">.</span><span class="nx">readFile</span> <span class="nx">source</span><span class="p">,</span> <span class="p">(</span><span class="nx">err</span><span class="p">,</span> <span class="nx">code</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nx">compileScript</span><span class="p">(</span><span class="nx">source</span><span class="p">,</span> <span class="nx">code</span><span class="p">.</span><span class="nx">toString</span><span class="p">(),</span> <span class="nx">base</span><span class="p">)</span>
71  
-            <span class="nx">watch</span> <span class="nx">source</span><span class="p">,</span> <span class="nx">base</span> <span class="k">if</span> <span class="nx">opts</span><span class="p">.</span><span class="nx">watch</span>
72  
-    <span class="nx">compile</span> <span class="nx">source</span><span class="p">,</span> <span class="kc">true</span></pre></div>             </td>           </tr>                               <tr id="section-10">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-10">&#182;</a>               </div>               <p>Compile a single source script, containing the given code, according to the
  65
+            <span class="nx">fs</span><span class="p">.</span><span class="nx">readFile</span> <span class="nx">source</span><span class="p">,</span> <span class="p">(</span><span class="nx">err</span><span class="p">,</span> <span class="nx">code</span><span class="p">)</span> <span class="o">-&gt;</span>
  66
+              <span class="k">if</span> <span class="nx">opts</span><span class="p">.</span><span class="nx">join</span>
  67
+                <span class="nx">contents</span><span class="p">[</span><span class="nx">sources</span><span class="p">.</span><span class="nx">indexOf</span> <span class="nx">source</span><span class="p">]</span> <span class="o">=</span> <span class="nx">code</span><span class="p">.</span><span class="nx">toString</span><span class="p">()</span>
  68
+                <span class="nx">compileJoin</span><span class="p">()</span> <span class="k">if</span> <span class="nx">helpers</span><span class="p">.</span><span class="nx">compact</span><span class="p">(</span><span class="nx">contents</span><span class="p">).</span><span class="nx">length</span> <span class="o">is</span> <span class="nx">sources</span><span class="p">.</span><span class="nx">length</span>
  69
+              <span class="k">else</span>
  70
+                <span class="nx">compileScript</span><span class="p">(</span><span class="nx">source</span><span class="p">,</span> <span class="nx">code</span><span class="p">.</span><span class="nx">toString</span><span class="p">(),</span> <span class="nx">base</span><span class="p">)</span>
  71
+            <span class="nx">watch</span> <span class="nx">source</span><span class="p">,</span> <span class="nx">base</span> <span class="k">if</span> <span class="nx">opts</span><span class="p">.</span><span class="nx">watch</span> <span class="o">and</span> <span class="o">not</span> <span class="nx">opts</span><span class="p">.</span><span class="nx">join</span>
  72
+    <span class="nx">compile</span> <span class="nx">source</span><span class="p">,</span> <span class="kc">true</span></pre></div>             </td>           </tr>                               <tr id="section-9">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-9">&#182;</a>               </div>               <p>Compile a single source script, containing the given code, according to the
73 73
 requested options. If evaluating the script directly sets <code>__filename</code>,
74 74
 <code>__dirname</code> and <code>module.filename</code> to be correct relative to the script's path.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">compileScript = </span><span class="p">(</span><span class="nx">file</span><span class="p">,</span> <span class="nx">input</span><span class="p">,</span> <span class="nx">base</span><span class="p">)</span> <span class="o">-&gt;</span>
75 75
   <span class="nv">o = </span><span class="nx">opts</span>
@@ -93,14 +93,17 @@
93 93
     <span class="k">return</span> <span class="k">if</span> <span class="nx">CoffeeScript</span><span class="p">.</span><span class="nx">listeners</span><span class="p">(</span><span class="s1">&#39;failure&#39;</span><span class="p">).</span><span class="nx">length</span>
94 94
     <span class="k">return</span> <span class="nx">printLine</span> <span class="nx">err</span><span class="p">.</span><span class="nx">message</span> <span class="k">if</span> <span class="nx">o</span><span class="p">.</span><span class="nx">watch</span>
95 95
     <span class="nx">printWarn</span> <span class="nx">err</span><span class="p">.</span><span class="nx">stack</span>
96  
-    <span class="nx">process</span><span class="p">.</span><span class="nx">exit</span> <span class="mi">1</span></pre></div>             </td>           </tr>                               <tr id="section-11">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-11">&#182;</a>               </div>               <p>Attach the appropriate listeners to compile scripts incoming over <strong>stdin</strong>,
  96
+    <span class="nx">process</span><span class="p">.</span><span class="nx">exit</span> <span class="mi">1</span></pre></div>             </td>           </tr>                               <tr id="section-10">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-10">&#182;</a>               </div>               <p>Attach the appropriate listeners to compile scripts incoming over <strong>stdin</strong>,
97 97
 and write them back to <strong>stdout</strong>.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">compileStdio = </span><span class="o">-&gt;</span>
98 98
   <span class="nv">code = </span><span class="s1">&#39;&#39;</span>
99 99
   <span class="nv">stdin = </span><span class="nx">process</span><span class="p">.</span><span class="nx">openStdin</span><span class="p">()</span>
100 100
   <span class="nx">stdin</span><span class="p">.</span><span class="kc">on</span> <span class="s1">&#39;data&#39;</span><span class="p">,</span> <span class="p">(</span><span class="nx">buffer</span><span class="p">)</span> <span class="o">-&gt;</span>
101 101
     <span class="nx">code</span> <span class="o">+=</span> <span class="nx">buffer</span><span class="p">.</span><span class="nx">toString</span><span class="p">()</span> <span class="k">if</span> <span class="nx">buffer</span>
102 102
   <span class="nx">stdin</span><span class="p">.</span><span class="kc">on</span> <span class="s1">&#39;end&#39;</span><span class="p">,</span> <span class="o">-&gt;</span>
103  
-    <span class="nx">compileScript</span> <span class="kc">null</span><span class="p">,</span> <span class="nx">code</span></pre></div>             </td>           </tr>                               <tr id="section-12">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-12">&#182;</a>               </div>               <p>Watch a source CoffeeScript file using <code>fs.watchFile</code>, recompiling it every
  103
+    <span class="nx">compileScript</span> <span class="kc">null</span><span class="p">,</span> <span class="nx">code</span></pre></div>             </td>           </tr>                               <tr id="section-11">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-11">&#182;</a>               </div>               <p>After all of the source files are done being read, concatenate and compile
  104
+them together.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">compileJoin = </span><span class="o">-&gt;</span>
  105
+  <span class="nv">code = </span><span class="nx">contents</span><span class="p">.</span><span class="nx">join</span> <span class="s1">&#39;\n&#39;</span>
  106
+  <span class="nx">compileScript</span> <span class="s2">&quot;concatenation&quot;</span><span class="p">,</span> <span class="nx">code</span><span class="p">,</span> <span class="s2">&quot;concatenation&quot;</span></pre></div>             </td>           </tr>                               <tr id="section-12">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-12">&#182;</a>               </div>               <p>Watch a source CoffeeScript file using <code>fs.watchFile</code>, recompiling it every
104 107
 time the file is updated. May be used in combination with other options,
105 108
 such as <code>--lint</code> or <code>--print</code>.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">watch = </span><span class="p">(</span><span class="nx">source</span><span class="p">,</span> <span class="nx">base</span><span class="p">)</span> <span class="o">-&gt;</span>
106 109
   <span class="nx">fs</span><span class="p">.</span><span class="nx">watchFile</span> <span class="nx">source</span><span class="p">,</span> <span class="p">{</span><span class="nx">persistent</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span> <span class="nx">interval</span><span class="o">:</span> <span class="mi">500</span><span class="p">},</span> <span class="p">(</span><span class="nx">curr</span><span class="p">,</span> <span class="nx">prev</span><span class="p">)</span> <span class="o">-&gt;</span>
@@ -112,7 +115,7 @@
112 115
 directory can be customized with <code>--output</code>.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">writeJs = </span><span class="p">(</span><span class="nx">source</span><span class="p">,</span> <span class="nx">js</span><span class="p">,</span> <span class="nx">base</span><span class="p">)</span> <span class="o">-&gt;</span>
113 116
   <span class="nv">filename  = </span><span class="nx">path</span><span class="p">.</span><span class="nx">basename</span><span class="p">(</span><span class="nx">source</span><span class="p">,</span> <span class="nx">path</span><span class="p">.</span><span class="nx">extname</span><span class="p">(</span><span class="nx">source</span><span class="p">))</span> <span class="o">+</span> <span class="s1">&#39;.js&#39;</span>
114 117
   <span class="nv">srcDir    = </span><span class="nx">path</span><span class="p">.</span><span class="nx">dirname</span> <span class="nx">source</span>
115  
-  <span class="nv">baseDir   = </span><span class="nx">srcDir</span><span class="p">.</span><span class="nx">substring</span> <span class="nx">base</span><span class="p">.</span><span class="nx">length</span>
  118
+  <span class="nv">baseDir   = </span><span class="k">if</span> <span class="nx">base</span> <span class="o">is</span> <span class="s1">&#39;.&#39;</span> <span class="k">then</span> <span class="nx">srcDir</span> <span class="k">else</span> <span class="nx">srcDir</span><span class="p">.</span><span class="nx">substring</span> <span class="nx">base</span><span class="p">.</span><span class="nx">length</span>
116 119
   <span class="nv">dir       = </span><span class="k">if</span> <span class="nx">opts</span><span class="p">.</span><span class="nx">output</span> <span class="k">then</span> <span class="nx">path</span><span class="p">.</span><span class="nx">join</span> <span class="nx">opts</span><span class="p">.</span><span class="nx">output</span><span class="p">,</span> <span class="nx">baseDir</span> <span class="k">else</span> <span class="nx">srcDir</span>
117 120
   <span class="nv">jsPath    = </span><span class="nx">path</span><span class="p">.</span><span class="nx">join</span> <span class="nx">dir</span><span class="p">,</span> <span class="nx">filename</span>
118 121
   <span class="nv">compile   = </span><span class="o">-&gt;</span>
@@ -135,17 +138,23 @@
135 138
     <span class="s2">&quot;[#{tag} #{value}]&quot;</span>
136 139
   <span class="nx">printLine</span> <span class="nx">strings</span><span class="p">.</span><span class="nx">join</span><span class="p">(</span><span class="s1">&#39; &#39;</span><span class="p">)</span></pre></div>             </td>           </tr>                               <tr id="section-16">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-16">&#182;</a>               </div>               <p>Use the <a href="optparse.html">OptionParser module</a> to extract all options from
137 140
 <code>process.argv</code> that are specified in <code>SWITCHES</code>.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">parseOptions = </span><span class="o">-&gt;</span>
138  
-  <span class="nv">optionParser  = </span><span class="k">new</span> <span class="nx">optparse</span><span class="p">.</span><span class="nx">OptionParser</span> <span class="nx">ALL_SWITCHES</span><span class="p">,</span> <span class="nx">BANNER</span>
  141
+  <span class="nv">optionParser  = </span><span class="k">new</span> <span class="nx">optparse</span><span class="p">.</span><span class="nx">OptionParser</span> <span class="nx">SWITCHES</span><span class="p">,</span> <span class="nx">BANNER</span>
139 142
   <span class="nv">o = opts      = </span><span class="nx">optionParser</span><span class="p">.</span><span class="nx">parse</span> <span class="nx">process</span><span class="p">.</span><span class="nx">argv</span><span class="p">.</span><span class="nx">slice</span> <span class="mi">2</span>
140 143
   <span class="nx">o</span><span class="p">.</span><span class="nx">compile</span>     <span class="o">or=</span>  <span class="o">!!</span><span class="nx">o</span><span class="p">.</span><span class="nx">output</span>
141 144
   <span class="nv">o.run         = </span><span class="o">not</span> <span class="p">(</span><span class="nx">o</span><span class="p">.</span><span class="nx">compile</span> <span class="o">or</span> <span class="nx">o</span><span class="p">.</span><span class="nx">print</span> <span class="o">or</span> <span class="nx">o</span><span class="p">.</span><span class="nx">lint</span><span class="p">)</span>
142 145
   <span class="nv">o.print       = </span><span class="o">!!</span>  <span class="p">(</span><span class="nx">o</span><span class="p">.</span><span class="nx">print</span> <span class="o">or</span> <span class="p">(</span><span class="nx">o</span><span class="p">.</span><span class="nb">eval</span> <span class="o">or</span> <span class="nx">o</span><span class="p">.</span><span class="nx">stdio</span> <span class="o">and</span> <span class="nx">o</span><span class="p">.</span><span class="nx">compile</span><span class="p">))</span>
143  
-  <span class="nv">sources       = </span><span class="nx">o</span><span class="p">.</span><span class="nx">arguments</span>
144  
-  <span class="k">if</span> <span class="nx">opts</span><span class="p">[</span><span class="s1">&#39;no-wrap&#39;</span><span class="p">]</span>
145  
-    <span class="nx">printWarn</span> <span class="s1">&#39;--no-wrap is deprecated; please use --bare instead.&#39;</span></pre></div>             </td>           </tr>                               <tr id="section-17">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-17">&#182;</a>               </div>               <p>The compile-time options to pass to the CoffeeScript compiler.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">compileOptions = </span><span class="p">(</span><span class="nx">fileName</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="p">{</span><span class="nx">fileName</span><span class="p">,</span> <span class="nx">bare</span><span class="o">:</span> <span class="nx">opts</span><span class="p">.</span><span class="nx">bare</span> <span class="o">or</span> <span class="nx">opts</span><span class="p">[</span><span class="s1">&#39;no-wrap&#39;</span><span class="p">]}</span></pre></div>             </td>           </tr>                               <tr id="section-18">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-18">&#182;</a>               </div>               <p>Print the <code>--help</code> usage message and exit. Deprecated switches are not
  146
+  <span class="nv">sources       = </span><span class="nx">o</span><span class="p">.</span><span class="nx">arguments</span></pre></div>             </td>           </tr>                               <tr id="section-17">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-17">&#182;</a>               </div>               <p>The compile-time options to pass to the CoffeeScript compiler.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">compileOptions = </span><span class="p">(</span><span class="nx">fileName</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="p">{</span><span class="nx">fileName</span><span class="p">,</span> <span class="nx">bare</span><span class="o">:</span> <span class="nx">opts</span><span class="p">.</span><span class="nx">bare</span><span class="p">}</span></pre></div>             </td>           </tr>                               <tr id="section-18">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-18">&#182;</a>               </div>               <p>Start up a new Node.js instance with the arguments in <code>--nodejs</code> passed to
  147
+the <code>node</code> binary, preserving the other options.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">forkNode = </span><span class="o">-&gt;</span>
  148
+  <span class="nv">nodeArgs = </span><span class="nx">opts</span><span class="p">.</span><span class="nx">nodejs</span><span class="p">.</span><span class="nx">split</span> <span class="sr">/\s+/</span>
  149
+  <span class="nv">args     = </span><span class="nx">process</span><span class="p">.</span><span class="nx">argv</span><span class="p">[</span><span class="mi">1</span><span class="p">..]</span>
  150
+  <span class="nx">args</span><span class="p">.</span><span class="nx">splice</span> <span class="nx">args</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="s1">&#39;--nodejs&#39;</span><span class="p">),</span> <span class="mi">2</span>
  151
+  <span class="nx">spawn</span> <span class="nx">process</span><span class="p">.</span><span class="nx">execPath</span><span class="p">,</span> <span class="nx">nodeArgs</span><span class="p">.</span><span class="nx">concat</span><span class="p">(</span><span class="nx">args</span><span class="p">),</span>
  152
+    <span class="nx">cwd</span><span class="o">:</span>        <span class="nx">process</span><span class="p">.</span><span class="nx">cwd</span><span class="p">()</span>
  153
+    <span class="nx">env</span><span class="o">:</span>        <span class="nx">process</span><span class="p">.</span><span class="nx">env</span>
  154
+    <span class="nx">customFds</span><span class="o">:</span>  <span class="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">]</span></pre></div>             </td>           </tr>                               <tr id="section-19">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-19">&#182;</a>               </div>               <p>Print the <code>--help</code> usage message and exit. Deprecated switches are not
146 155
 shown.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">usage = </span><span class="o">-&gt;</span>
147 156
   <span class="nx">printLine</span> <span class="p">(</span><span class="k">new</span> <span class="nx">optparse</span><span class="p">.</span><span class="nx">OptionParser</span> <span class="nx">SWITCHES</span><span class="p">,</span> <span class="nx">BANNER</span><span class="p">).</span><span class="nx">help</span><span class="p">()</span>
148  
-  <span class="nx">process</span><span class="p">.</span><span class="nx">exit</span> <span class="mi">0</span></pre></div>             </td>           </tr>                               <tr id="section-19">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-19">&#182;</a>               </div>               <p>Print the <code>--version</code> message and exit.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">version = </span><span class="o">-&gt;</span>
  157
+  <span class="nx">process</span><span class="p">.</span><span class="nx">exit</span> <span class="mi">0</span></pre></div>             </td>           </tr>                               <tr id="section-20">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-20">&#182;</a>               </div>               <p>Print the <code>--version</code> message and exit.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">version = </span><span class="o">-&gt;</span>
149 158
   <span class="nx">printLine</span> <span class="s2">&quot;CoffeeScript version #{CoffeeScript.VERSION}&quot;</span>
150 159
   <span class="nx">process</span><span class="p">.</span><span class="nx">exit</span> <span class="mi">0</span>
151 160
 
33  documentation/docs/grammar.html
@@ -69,8 +69,8 @@
69 69
   <span class="p">]</span></pre></div>             </td>           </tr>                               <tr id="section-13">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-13">&#182;</a>               </div>               <p>An indented block of expressions. Note that the <a href="rewriter.html">Rewriter</a>
70 70
 will convert some postfix forms into blocks for us, by adjusting the
71 71
 token stream.</p>             </td>             <td class="code">               <div class="highlight"><pre>  <span class="nx">Block</span><span class="o">:</span> <span class="p">[</span>
72  
-    <span class="nx">o</span> <span class="s1">&#39;INDENT Body OUTDENT&#39;</span><span class="p">,</span>                    <span class="o">-&gt;</span> <span class="nx">$2</span>
73 72
     <span class="nx">o</span> <span class="s1">&#39;INDENT OUTDENT&#39;</span><span class="p">,</span>                         <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Expressions</span>
  73
+    <span class="nx">o</span> <span class="s1">&#39;INDENT Body OUTDENT&#39;</span><span class="p">,</span>                    <span class="o">-&gt;</span> <span class="nx">$2</span>
74 74
   <span class="p">]</span></pre></div>             </td>           </tr>                               <tr id="section-14">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-14">&#182;</a>               </div>               <p>A literal identifier, a variable name or property.</p>             </td>             <td class="code">               <div class="highlight"><pre>  <span class="nx">Identifier</span><span class="o">:</span> <span class="p">[</span>
75 75
     <span class="nx">o</span> <span class="s1">&#39;IDENTIFIER&#39;</span><span class="p">,</span>                             <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Literal</span> <span class="nx">$1</span>
76 76
   <span class="p">]</span></pre></div>             </td>           </tr>                               <tr id="section-15">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-15">&#182;</a>               </div>               <p>Alphanumerics are separated from the other <strong>Literal</strong> matchers because
@@ -185,10 +185,8 @@
185 185
   <span class="p">]</span></pre></div>             </td>           </tr>                               <tr id="section-35">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-35">&#182;</a>               </div>               <p>Ordinary function invocation, or a chained series of calls.</p>             </td>             <td class="code">               <div class="highlight"><pre>  <span class="nx">Invocation</span><span class="o">:</span> <span class="p">[</span>
186 186
     <span class="nx">o</span> <span class="s1">&#39;Value OptFuncExist Arguments&#39;</span><span class="p">,</span>           <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Call</span> <span class="nx">$1</span><span class="p">,</span> <span class="nx">$3</span><span class="p">,</span> <span class="nx">$2</span>
187 187
     <span class="nx">o</span> <span class="s1">&#39;Invocation OptFuncExist Arguments&#39;</span><span class="p">,</span>      <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Call</span> <span class="nx">$1</span><span class="p">,</span> <span class="nx">$3</span><span class="p">,</span> <span class="nx">$2</span>
188  
-    <span class="nx">o</span> <span class="s1">&#39;SUPER&#39;</span><span class="p">,</span>                                  <span class="o">-&gt;</span>
189  
-      <span class="k">new</span> <span class="nx">Call</span> <span class="s1">&#39;super&#39;</span><span class="p">,</span> <span class="p">[</span><span class="k">new</span> <span class="nx">Splat</span> <span class="k">new</span> <span class="nx">Literal</span> <span class="s1">&#39;arguments&#39;</span><span class="p">]</span>
190  
-    <span class="nx">o</span> <span class="s1">&#39;SUPER Arguments&#39;</span><span class="p">,</span>                        <span class="o">-&gt;</span>
191  
-      <span class="k">new</span> <span class="nx">Call</span> <span class="s1">&#39;super&#39;</span><span class="p">,</span> <span class="nx">$2</span>
  188
+    <span class="nx">o</span> <span class="s1">&#39;SUPER&#39;</span><span class="p">,</span>                                  <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Call</span> <span class="s1">&#39;super&#39;</span><span class="p">,</span> <span class="p">[</span><span class="k">new</span> <span class="nx">Splat</span> <span class="k">new</span> <span class="nx">Literal</span> <span class="s1">&#39;arguments&#39;</span><span class="p">]</span>
  189
+    <span class="nx">o</span> <span class="s1">&#39;SUPER Arguments&#39;</span><span class="p">,</span>                        <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Call</span> <span class="s1">&#39;super&#39;</span><span class="p">,</span> <span class="nx">$2</span>
192 190
   <span class="p">]</span></pre></div>             </td>           </tr>                               <tr id="section-36">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-36">&#182;</a>               </div>               <p>An optional existence check on a function.</p>             </td>             <td class="code">               <div class="highlight"><pre>  <span class="nx">OptFuncExist</span><span class="o">:</span> <span class="p">[</span>
193 191
     <span class="nx">o</span> <span class="s1">&#39;&#39;</span><span class="p">,</span>                                       <span class="o">-&gt;</span> <span class="kc">no</span>
194 192
     <span class="nx">o</span> <span class="s1">&#39;FUNC_EXIST&#39;</span><span class="p">,</span>                             <span class="o">-&gt;</span> <span class="kc">yes</span>
@@ -262,14 +260,14 @@
262 260
   <span class="p">]</span></pre></div>             </td>           </tr>                               <tr id="section-53">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-53">&#182;</a>               </div>               <p>Array, object, and range comprehensions, at the most generic level.
263 261
 Comprehensions can either be normal, with a block of expressions to execute,
264 262
 or postfix, with a single expression.</p>             </td>             <td class="code">               <div class="highlight"><pre>  <span class="nx">For</span><span class="o">:</span> <span class="p">[</span>
265  
-    <span class="nx">o</span> <span class="s1">&#39;Statement  ForBody&#39;</span><span class="p">,</span>                     <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">For</span> <span class="nx">$1</span><span class="p">,</span> <span class="nx">$2</span><span class="p">,</span> <span class="nx">$2</span><span class="p">.</span><span class="nx">vars</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="nx">$2</span><span class="p">.</span><span class="nx">vars</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span>
266  
-    <span class="nx">o</span> <span class="s1">&#39;Expression ForBody&#39;</span><span class="p">,</span>                     <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">For</span> <span class="nx">$1</span><span class="p">,</span> <span class="nx">$2</span><span class="p">,</span> <span class="nx">$2</span><span class="p">.</span><span class="nx">vars</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="nx">$2</span><span class="p">.</span><span class="nx">vars</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span>
267  
-    <span class="nx">o</span> <span class="s1">&#39;ForBody    Block&#39;</span><span class="p">,</span>                       <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">For</span> <span class="nx">$2</span><span class="p">,</span> <span class="nx">$1</span><span class="p">,</span> <span class="nx">$1</span><span class="p">.</span><span class="nx">vars</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="nx">$1</span><span class="p">.</span><span class="nx">vars</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span>
  263
+    <span class="nx">o</span> <span class="s1">&#39;Statement  ForBody&#39;</span><span class="p">,</span>                     <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">For</span> <span class="nx">$1</span><span class="p">,</span> <span class="nx">$2</span>
  264
+    <span class="nx">o</span> <span class="s1">&#39;Expression ForBody&#39;</span><span class="p">,</span>                     <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">For</span> <span class="nx">$1</span><span class="p">,</span> <span class="nx">$2</span>
  265
+    <span class="nx">o</span> <span class="s1">&#39;ForBody    Block&#39;</span><span class="p">,</span>                       <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">For</span> <span class="nx">$2</span><span class="p">,</span> <span class="nx">$1</span>
268 266
   <span class="p">]</span>
269 267
 
270 268
   <span class="nx">ForBody</span><span class="o">:</span> <span class="p">[</span>
271  
-    <span class="nx">o</span> <span class="s1">&#39;FOR Range&#39;</span><span class="p">,</span>                              <span class="o">-&gt;</span> <span class="nx">source</span><span class="o">:</span> <span class="k">new</span> <span class="nx">Value</span><span class="p">(</span><span class="nx">$2</span><span class="p">),</span> <span class="nx">vars</span><span class="o">:</span> <span class="p">[]</span>
272  
-    <span class="nx">o</span> <span class="s1">&#39;ForStart ForSource&#39;</span><span class="p">,</span>                     <span class="o">-&gt;</span> <span class="nv">$2.own = </span><span class="nx">$1</span><span class="p">.</span><span class="nx">own</span><span class="p">;</span> <span class="nv">$2.vars = </span><span class="nx">$1</span><span class="p">;</span> <span class="nx">$2</span>
  269
+    <span class="nx">o</span> <span class="s1">&#39;FOR Range&#39;</span><span class="p">,</span>                              <span class="o">-&gt;</span> <span class="nx">source</span><span class="o">:</span> <span class="k">new</span> <span class="nx">Value</span><span class="p">(</span><span class="nx">$2</span><span class="p">)</span>
  270
+    <span class="nx">o</span> <span class="s1">&#39;ForStart ForSource&#39;</span><span class="p">,</span>                     <span class="o">-&gt;</span> <span class="nv">$2.own = </span><span class="nx">$1</span><span class="p">.</span><span class="nx">own</span><span class="p">;</span> <span class="nv">$2.name = </span><span class="nx">$1</span><span class="p">[</span><span class="mi">0</span><span class="p">];</span> <span class="nv">$2.index = </span><span class="nx">$1</span><span class="p">[</span><span class="mi">1</span><span class="p">];</span> <span class="nx">$2</span>
273 271
   <span class="p">]</span>
274 272
 
275 273
   <span class="nx">ForStart</span><span class="o">:</span> <span class="p">[</span>
@@ -313,17 +311,14 @@
313 311
   <span class="p">]</span></pre></div>             </td>           </tr>                               <tr id="section-58">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-58">&#182;</a>               </div>               <p>The most basic form of <em>if</em> is a condition and an action. The following
314 312
 if-related rules are broken up along these lines in order to avoid
315 313
 ambiguity.</p>             </td>             <td class="code">               <div class="highlight"><pre>  <span class="nx">IfBlock</span><span class="o">:</span> <span class="p">[</span>
316  
-    <span class="nx">o</span> <span class="s1">&#39;IF Expression Block&#39;</span><span class="p">,</span>                    <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">If</span> <span class="nx">$2</span><span class="p">,</span> <span class="nx">$3</span>
317  
-    <span class="nx">o</span> <span class="s1">&#39;UNLESS Expression Block&#39;</span><span class="p">,</span>                <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">If</span> <span class="nx">$2</span><span class="p">,</span> <span class="nx">$3</span><span class="p">,</span> <span class="nx">invert</span><span class="o">:</span> <span class="kc">true</span>
318  
-    <span class="nx">o</span> <span class="s1">&#39;IfBlock ELSE IF Expression Block&#39;</span><span class="p">,</span>       <span class="o">-&gt;</span> <span class="nx">$1</span><span class="p">.</span><span class="nx">addElse</span> <span class="k">new</span> <span class="nx">If</span> <span class="nx">$4</span><span class="p">,</span> <span class="nx">$5</span>
  314
+    <span class="nx">o</span> <span class="s1">&#39;IF Expression Block&#39;</span><span class="p">,</span>                    <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">If</span> <span class="nx">$2</span><span class="p">,</span> <span class="nx">$3</span><span class="p">,</span> <span class="nx">type</span><span class="o">:</span> <span class="nx">$1</span>
  315
+    <span class="nx">o</span> <span class="s1">&#39;IfBlock ELSE IF Expression Block&#39;</span><span class="p">,</span>       <span class="o">-&gt;</span> <span class="nx">$1</span><span class="p">.</span><span class="nx">addElse</span> <span class="k">new</span> <span class="nx">If</span> <span class="nx">$4</span><span class="p">,</span> <span class="nx">$5</span><span class="p">,</span> <span class="nx">type</span><span class="o">:</span> <span class="nx">$3</span>
319 316
     <span class="nx">o</span> <span class="s1">&#39;IfBlock ELSE Block&#39;</span><span class="p">,</span>                     <span class="o">-&gt;</span> <span class="nx">$1</span><span class="p">.</span><span class="nx">addElse</span> <span class="nx">$3</span>
320 317
   <span class="p">]</span></pre></div>             </td>           </tr>                               <tr id="section-59">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-59">&#182;</a>               </div>               <p>The full complement of <em>if</em> expressions, including postfix one-liner
321 318
 <em>if</em> and <em>unless</em>.</p>             </td>             <td class="code">               <div class="highlight"><pre>  <span class="nx">If</span><span class="o">:</span> <span class="p">[</span>
322 319
     <span class="nx">o</span> <span class="s1">&#39;IfBlock&#39;</span>
323  
-    <span class="nx">o</span> <span class="s1">&#39;Statement  POST_IF Expression&#39;</span><span class="p">,</span>          <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">If</span> <span class="nx">$3</span><span class="p">,</span> <span class="nx">Expressions</span><span class="p">.</span><span class="nx">wrap</span><span class="p">([</span><span class="nx">$1</span><span class="p">]),</span> <span class="nx">statement</span><span class="o">:</span> <span class="kc">true</span>
324  
-    <span class="nx">o</span> <span class="s1">&#39;Expression POST_IF Expression&#39;</span><span class="p">,</span>          <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">If</span> <span class="nx">$3</span><span class="p">,</span> <span class="nx">Expressions</span><span class="p">.</span><span class="nx">wrap</span><span class="p">([</span><span class="nx">$1</span><span class="p">]),</span> <span class="nx">statement</span><span class="o">:</span> <span class="kc">true</span>
325  
-    <span class="nx">o</span> <span class="s1">&#39;Statement  POST_UNLESS Expression&#39;</span><span class="p">,</span>      <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">If</span> <span class="nx">$3</span><span class="p">,</span> <span class="nx">Expressions</span><span class="p">.</span><span class="nx">wrap</span><span class="p">([</span><span class="nx">$1</span><span class="p">]),</span> <span class="nx">statement</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span> <span class="nx">invert</span><span class="o">:</span> <span class="kc">true</span>
326  
-    <span class="nx">o</span> <span class="s1">&#39;Expression POST_UNLESS Expression&#39;</span><span class="p">,</span>      <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">If</span> <span class="nx">$3</span><span class="p">,</span> <span class="nx">Expressions</span><span class="p">.</span><span class="nx">wrap</span><span class="p">([</span><span class="nx">$1</span><span class="p">]),</span> <span class="nx">statement</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span> <span class="nx">invert</span><span class="o">:</span> <span class="kc">true</span>
  320
+    <span class="nx">o</span> <span class="s1">&#39;Statement  POST_IF Expression&#39;</span><span class="p">,</span>          <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">If</span> <span class="nx">$3</span><span class="p">,</span> <span class="nx">Expressions</span><span class="p">.</span><span class="nx">wrap</span><span class="p">([</span><span class="nx">$1</span><span class="p">]),</span> <span class="nx">type</span><span class="o">:</span> <span class="nx">$2</span><span class="p">,</span> <span class="nx">statement</span><span class="o">:</span> <span class="kc">true</span>
  321
+    <span class="nx">o</span> <span class="s1">&#39;Expression POST_IF Expression&#39;</span><span class="p">,</span>          <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">If</span> <span class="nx">$3</span><span class="p">,</span> <span class="nx">Expressions</span><span class="p">.</span><span class="nx">wrap</span><span class="p">([</span><span class="nx">$1</span><span class="p">]),</span> <span class="nx">type</span><span class="o">:</span> <span class="nx">$2</span><span class="p">,</span> <span class="nx">statement</span><span class="o">:</span> <span class="kc">true</span>
327 322
   <span class="p">]</span></pre></div>             </td>           </tr>                               <tr id="section-60">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-60">&#182;</a>               </div>               <p>Arithmetic and logical operators, working on one or more operands.
328 323
 Here they are grouped by order of precedence. The actual precedence rules
329 324
 are defined at the bottom of the page. It would be shorter if we could
@@ -381,8 +376,8 @@
381 376
   <span class="p">[</span><span class="s1">&#39;nonassoc&#39;</span><span class="p">,</span>  <span class="s1">&#39;INDENT&#39;</span><span class="p">,</span> <span class="s1">&#39;OUTDENT&#39;</span><span class="p">]</span>
382 377
   <span class="p">[</span><span class="s1">&#39;right&#39;</span><span class="p">,</span>     <span class="s1">&#39;=&#39;</span><span class="p">,</span> <span class="s1">&#39;:&#39;</span><span class="p">,</span> <span class="s1">&#39;COMPOUND_ASSIGN&#39;</span><span class="p">,</span> <span class="s1">&#39;RETURN&#39;</span><span class="p">,</span> <span class="s1">&#39;THROW&#39;</span><span class="p">,</span> <span class="s1">&#39;EXTENDS&#39;</span><span class="p">]</span>
383 378
   <span class="p">[</span><span class="s1">&#39;right&#39;</span><span class="p">,</span>     <span class="s1">&#39;FORIN&#39;</span><span class="p">,</span> <span class="s1">&#39;FOROF&#39;</span><span class="p">,</span> <span class="s1">&#39;BY&#39;</span><span class="p">,</span> <span class="s1">&#39;WHEN&#39;</span><span class="p">]</span>
384  
-  <span class="p">[</span><span class="s1">&#39;right&#39;</span><span class="p">,</span>     <span class="s1">&#39;IF&#39;</span><span class="p">,</span> <span class="s1">&#39;UNLESS&#39;</span><span class="p">,</span> <span class="s1">&#39;ELSE&#39;</span><span class="p">,</span> <span class="s1">&#39;FOR&#39;</span><span class="p">,</span> <span class="s1">&#39;WHILE&#39;</span><span class="p">,</span> <span class="s1">&#39;UNTIL&#39;</span><span class="p">,</span> <span class="s1">&#39;LOOP&#39;</span><span class="p">,</span> <span class="s1">&#39;SUPER&#39;</span><span class="p">,</span> <span class="s1">&#39;CLASS&#39;</span><span class="p">]</span>
385  
-  <span class="p">[</span><span class="s1">&#39;right&#39;</span><span class="p">,</span>     <span class="s1">&#39;POST_IF&#39;</span><span class="p">,</span> <span class="s1">&#39;POST_UNLESS&#39;</span><span class="p">]</span>
  379
+  <span class="p">[</span><span class="s1">&#39;right&#39;</span><span class="p">,</span>     <span class="s1">&#39;IF&#39;</span><span class="p">,</span> <span class="s1">&#39;ELSE&#39;</span><span class="p">,</span> <span class="s1">&#39;FOR&#39;</span><span class="p">,</span> <span class="s1">&#39;DO&#39;</span><span class="p">,</span> <span class="s1">&#39;WHILE&#39;</span><span class="p">,</span> <span class="s1">&#39;UNTIL&#39;</span><span class="p">,</span> <span class="s1">&#39;LOOP&#39;</span><span class="p">,</span> <span class="s1">&#39;SUPER&#39;</span><span class="p">,</span> <span class="s1">&#39;CLASS&#39;</span><span class="p">]</span>
  380
+  <span class="p">[</span><span class="s1">&#39;right&#39;</span><span class="p">,</span>     <span class="s1">&#39;POST_IF&#39;</span><span class="p">]</span>
386 381
 <span class="p">]</span></pre></div>             </td>           </tr>                               <tr id="section-64">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-64">&#182;</a>               </div>               <h2>Wrapping Up</h2>             </td>             <td class="code">               <div class="highlight"><pre></pre></div>             </td>           </tr>                               <tr id="section-65">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-65">&#182;</a>               </div>               <p>Finally, now what we have our <strong>grammar</strong> and our <strong>operators</strong>, we can create
387 382
 our <strong>Jison.Parser</strong>. We do this by processing all of our rules, recording all
388 383
 terminals (every symbol which does not appear as the name of a rule above)
5  documentation/docs/helpers.html
@@ -4,9 +4,10 @@
4 4
   <span class="nx">literal</span> <span class="o">is</span> <span class="nx">string</span><span class="p">.</span><span class="nx">substr</span> <span class="nx">start</span><span class="p">,</span> <span class="nx">literal</span><span class="p">.</span><span class="nx">length</span></pre></div>             </td>           </tr>                               <tr id="section-3">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-3">&#182;</a>               </div>               <p>Peek at the end of a given string to see if it matches a sequence.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">exports.ends = </span><span class="p">(</span><span class="nx">string</span><span class="p">,</span> <span class="nx">literal</span><span class="p">,</span> <span class="nx">back</span><span class="p">)</span> <span class="o">-&gt;</span>
5 5
   <span class="nv">len = </span><span class="nx">literal</span><span class="p">.</span><span class="nx">length</span>
6 6
   <span class="nx">literal</span> <span class="o">is</span> <span class="nx">string</span><span class="p">.</span><span class="nx">substr</span> <span class="nx">string</span><span class="p">.</span><span class="nx">length</span> <span class="o">-</span> <span class="nx">len</span> <span class="o">-</span> <span class="p">(</span><span class="nx">back</span> <span class="o">or</span> <span class="mi">0</span><span class="p">),</span> <span class="nx">len</span></pre></div>             </td>           </tr>                               <tr id="section-4">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-4">&#182;</a>               </div>               <p>Trim out all falsy values from an array.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">exports.compact = </span><span class="p">(</span><span class="nx">array</span><span class="p">)</span> <span class="o">-&gt;</span>
7  
-  <span class="nx">item</span> <span class="k">for</span> <span class="nx">item</span> <span class="k">in</span> <span class="nx">array</span> <span class="k">when</span> <span class="nx">item</span></pre></div>             </td>           </tr>                               <tr id="section-5">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-5">&#182;</a>               </div>               <p>Count the number of occurrences of a character in a string.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">exports.count = </span><span class="p">(</span><span class="nx">string</span><span class="p">,</span> <span class="nx">letter</span><span class="p">)</span> <span class="o">-&gt;</span>
  7
+  <span class="nx">item</span> <span class="k">for</span> <span class="nx">item</span> <span class="k">in</span> <span class="nx">array</span> <span class="k">when</span> <span class="nx">item</span></pre></div>             </td>           </tr>                               <tr id="section-5">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-5">&#182;</a>               </div>               <p>Count the number of occurrences of a string in a string.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">exports.count = </span><span class="p">(</span><span class="nx">string</span><span class="p">,</span> <span class="nx">substr</span><span class="p">)</span> <span class="o">-&gt;</span>
8 8
   <span class="nv">num = pos = </span><span class="mi">0</span>
9  
-  <span class="nx">num</span><span class="o">++</span> <span class="k">while</span> <span class="nv">pos = </span><span class="mi">1</span> <span class="o">+</span> <span class="nx">string</span><span class="p">.</span><span class="nx">indexOf</span> <span class="nx">letter</span><span class="p">,</span> <span class="nx">pos</span>
  9
+  <span class="k">return</span> <span class="mi">1</span><span class="o">/</span><span class="mi">0</span> <span class="nx">unless</span> <span class="nx">substr</span><span class="p">.</span><span class="nx">length</span>
  10
+  <span class="nx">num</span><span class="o">++</span> <span class="k">while</span> <span class="nv">pos = </span><span class="mi">1</span> <span class="o">+</span> <span class="nx">string</span><span class="p">.</span><span class="nx">indexOf</span> <span class="nx">substr</span><span class="p">,</span> <span class="nx">pos</span>
10 11
   <span class="nx">num</span></pre></div>             </td>           </tr>                               <tr id="section-6">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-6">&#182;</a>               </div>               <p>Merge objects, returning a fresh copy with attributes from both sides.
11 12
 Used every time <code>Base#compile</code> is called, to allow properties in the
12 13
 options hash to propagate down the tree without polluting other branches.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">exports.merge = </span><span class="p">(</span><span class="nx">options</span><span class="p">,</span> <span class="nx">overrides</span><span class="p">)</span> <span class="o">-&gt;</span>
43  documentation/docs/lexer.html
@@ -67,12 +67,14 @@
67 67
         <span class="nv">tag = </span><span class="s1">&#39;LEADING_WHEN&#39;</span>
68 68
       <span class="k">else</span> <span class="k">if</span> <span class="nx">tag</span> <span class="o">is</span> <span class="s1">&#39;FOR&#39;</span>
69 69
         <span class="vi">@seenFor = </span><span class="kc">yes</span>
  70
+      <span class="k">else</span> <span class="k">if</span> <span class="nx">tag</span> <span class="o">is</span> <span class="s1">&#39;UNLESS&#39;</span>
  71
+        <span class="nv">tag = </span><span class="s1">&#39;IF&#39;</span>
70 72
       <span class="k">else</span> <span class="k">if</span> <span class="nx">tag</span> <span class="k">in</span> <span class="nx">UNARY</span>
71 73
         <span class="nv">tag = </span><span class="s1">&#39;UNARY&#39;</span>
72 74
       <span class="k">else</span> <span class="k">if</span> <span class="nx">tag</span> <span class="k">in</span> <span class="nx">RELATION</span>
73 75
         <span class="k">if</span> <span class="nx">tag</span> <span class="o">isnt</span> <span class="s1">&#39;INSTANCEOF&#39;</span> <span class="o">and</span> <span class="nx">@seenFor</span>
74  
-          <span class="vi">@seenFor = </span><span class="kc">no</span>
75 76
           <span class="nv">tag = </span><span class="s1">&#39;FOR&#39;</span> <span class="o">+</span> <span class="nx">tag</span>
  77
+          <span class="vi">@seenFor = </span><span class="kc">no</span>
76 78
         <span class="k">else</span>
77 79
           <span class="nv">tag = </span><span class="s1">&#39;RELATION&#39;</span>
78 80
           <span class="k">if</span> <span class="nx">@value</span><span class="p">()</span> <span class="o">is</span> <span class="s1">&#39;!&#39;</span>
@@ -111,7 +113,7 @@
111 113
         <span class="k">return</span> <span class="mi">0</span> <span class="nx">unless</span> <span class="nv">match = </span><span class="nx">SIMPLESTR</span><span class="p">.</span><span class="nx">exec</span> <span class="nx">@chunk</span>
112 114
         <span class="nx">@token</span> <span class="s1">&#39;STRING&#39;</span><span class="p">,</span> <span class="p">(</span><span class="nv">string = </span><span class="nx">match</span><span class="p">[</span><span class="mi">0</span><span class="p">]).</span><span class="nx">replace</span> <span class="nx">MULTILINER</span><span class="p">,</span> <span class="s1">&#39;\\\n&#39;</span>
113 115
       <span class="k">when</span> <span class="s1">&#39;&quot;&#39;</span>
114  
-        <span class="k">return</span> <span class="mi">0</span> <span class="nx">unless</span> <span class="nv">string = </span><span class="nx">@balancedString</span> <span class="nx">@chunk</span><span class="p">,</span> <span class="p">[[</span><span class="s1">&#39;&quot;&#39;</span><span class="p">,</span> <span class="s1">&#39;&quot;&#39;</span><span class="p">],</span> <span class="p">[</span><span class="s1">&#39;#{&#39;</span><span class="p">,</span> <span class="s1">&#39;}&#39;</span><span class="p">]]</span>
  116
+        <span class="k">return</span> <span class="mi">0</span> <span class="nx">unless</span> <span class="nv">string = </span><span class="nx">@balancedString</span> <span class="nx">@chunk</span><span class="p">,</span> <span class="s1">&#39;&quot;&#39;</span>
115 117
         <span class="k">if</span> <span class="mi">0</span> <span class="o">&lt;</span> <span class="nx">string</span><span class="p">.</span><span class="nx">indexOf</span> <span class="s1">&#39;#{&#39;</span><span class="p">,</span> <span class="mi">1</span>
116 118
           <span class="nx">@interpolateString</span> <span class="nx">string</span><span class="p">.</span><span class="nx">slice</span> <span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span>
117 119
         <span class="k">else</span>
@@ -306,22 +308,27 @@
306 308
     <span class="k">throw</span> <span class="nx">SyntaxError</span> <span class="s2">&quot;Reserved word \&quot;#{@value()}\&quot; on line #{@line + 1} can&#39;t be assigned&quot;</span></pre></div>             </td>           </tr>                               <tr id="section-28">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-28">&#182;</a>               </div>               <p>Matches a balanced group such as a single or double-quoted string. Pass in
307 309
 a series of delimiters, all of which must be nested correctly within the
308 310
 contents of the string. This method allows us to have strings within
309  
-interpolations within strings, ad infinitum.</p>             </td>             <td class="code">               <div class="highlight"><pre>  <span class="nx">balancedString</span><span class="o">:</span> <span class="p">(</span><span class="nx">str</span><span class="p">,</span> <span class="nx">delimited</span><span class="p">,</span> <span class="nv">options = </span><span class="p">{})</span> <span class="o">-&gt;</span>
310  
-    <span class="nv">stack = </span><span class="p">[</span><span class="nx">delimited</span><span class="p">[</span><span class="mi">0</span><span class="p">]]</span>
  311
+interpolations within strings, ad infinitum.</p>             </td>             <td class="code">               <div class="highlight"><pre>  <span class="nx">balancedString</span><span class="o">:</span> <span class="p">(</span><span class="nx">str</span><span class="p">,</span> <span class="nx">end</span><span class="p">)</span> <span class="o">-&gt;</span>
  312
+    <span class="nv">stack = </span><span class="p">[</span><span class="nx">end</span><span class="p">]</span>
311 313
     <span class="k">for</span> <span class="nx">i</span> <span class="k">in</span> <span class="p">[</span><span class="mi">1</span><span class="p">...</span><span class="nx">str</span><span class="p">.</span><span class="nx">length</span><span class="p">]</span>
312  
-      <span class="k">switch</span> <span class="nx">str</span><span class="p">.</span><span class="nx">charAt</span> <span class="nx">i</span>
  314
+      <span class="k">switch</span> <span class="nv">letter = </span><span class="nx">str</span><span class="p">.</span><span class="nx">charAt</span> <span class="nx">i</span>
313 315
         <span class="k">when</span> <span class="s1">&#39;\\&#39;</span>
314 316
           <span class="nx">i</span><span class="o">++</span>
315 317
           <span class="k">continue</span>
316  
-        <span class="k">when</span> <span class="nx">stack</span><span class="p">[</span><span class="nx">stack</span><span class="p">.</span><span class="nx">length</span> <span class="o">-</span> <span class="mi">1</span><span class="p">][</span><span class="mi">1</span><span class="p">]</span>
  318
+        <span class="k">when</span> <span class="nx">end</span>
317 319
           <span class="nx">stack</span><span class="p">.</span><span class="nx">pop</span><span class="p">()</span>
318  
-          <span class="k">return</span> <span class="nx">str</span><span class="p">.</span><span class="nx">slice</span> <span class="mi">0</span><span class="p">,</span> <span class="nx">i</span> <span class="o">+</span> <span class="mi">1</span> <span class="nx">unless</span> <span class="nx">stack</span><span class="p">.</span><span class="nx">length</span>
  320
+          <span class="nx">unless</span> <span class="nx">stack</span><span class="p">.</span><span class="nx">length</span>
  321
+            <span class="k">return</span> <span class="nx">str</span><span class="p">.</span><span class="nx">slice</span> <span class="mi">0</span><span class="p">,</span> <span class="nx">i</span> <span class="o">+</span> <span class="mi">1</span>
  322
+          <span class="nv">end = </span><span class="nx">stack</span><span class="p">[</span><span class="nx">stack</span><span class="p">.</span><span class="nx">length</span> <span class="o">-</span> <span class="mi">1</span><span class="p">]</span>
319 323
           <span class="k">continue</span>
320  
-      <span class="k">for</span> <span class="nx">pair</span> <span class="k">in</span> <span class="nx">delimited</span> <span class="k">when</span> <span class="p">(</span><span class="nv">open = </span><span class="nx">pair</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> <span class="o">is</span> <span class="nx">str</span><span class="p">.</span><span class="nx">substr</span> <span class="nx">i</span><span class="p">,</span> <span class="nx">open</span><span class="p">.</span><span class="nx">length</span>
321  
-        <span class="nx">stack</span><span class="p">.</span><span class="nx">push</span> <span class="nx">pair</span>
322  
-        <span class="nx">i</span> <span class="o">+=</span> <span class="nx">open</span><span class="p">.</span><span class="nx">length</span> <span class="o">-</span> <span class="mi">1</span>
323  
-        <span class="k">break</span>
324  
-    <span class="k">throw</span> <span class="k">new</span> <span class="nb">Error</span> <span class="s2">&quot;unterminated #{ stack.pop()[0] } on line #{ @line + 1 }&quot;</span></pre></div>             </td>           </tr>                               <tr id="section-29">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-29">&#182;</a>               </div>               <p>Expand variables and expressions inside double-quoted strings using
  324
+      <span class="k">if</span> <span class="nx">end</span> <span class="o">is</span> <span class="s1">&#39;}&#39;</span> <span class="o">and</span> <span class="nx">letter</span> <span class="k">in</span> <span class="p">[</span><span class="s1">&#39;&quot;&#39;</span><span class="p">,</span> <span class="s2">&quot;&#39;&quot;</span><span class="p">]</span>
  325
+        <span class="nx">stack</span><span class="p">.</span><span class="nx">push</span> <span class="nv">end = </span><span class="nx">letter</span>
  326
+      <span class="k">else</span> <span class="k">if</span> <span class="nx">end</span> <span class="o">is</span> <span class="s1">&#39;}&#39;</span> <span class="o">and</span> <span class="nx">letter</span> <span class="o">is</span> <span class="s1">&#39;{&#39;</span>
  327
+        <span class="nx">stack</span><span class="p">.</span><span class="nx">push</span> <span class="nv">end = </span><span class="s1">&#39;}&#39;</span>
  328
+      <span class="k">else</span> <span class="k">if</span> <span class="nx">end</span> <span class="o">is</span> <span class="s1">&#39;&quot;&#39;</span> <span class="o">and</span> <span class="nx">prev</span> <span class="o">is</span> <span class="s1">&#39;#&#39;</span> <span class="o">and</span> <span class="nx">letter</span> <span class="o">is</span> <span class="s1">&#39;{&#39;</span>
  329
+        <span class="nx">stack</span><span class="p">.</span><span class="nx">push</span> <span class="nv">end = </span><span class="s1">&#39;}&#39;</span>
  330
+      <span class="nv">prev = </span><span class="nx">letter</span>
  331
+    <span class="k">throw</span> <span class="k">new</span> <span class="nb">Error</span> <span class="s2">&quot;missing #{ stack.pop() }, starting on line #{ @line + 1 }&quot;</span></pre></div>             </td>           </tr>                               <tr id="section-29">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-29">&#182;</a>               </div>               <p>Expand variables and expressions inside double-quoted strings using
325 332
 Ruby-like notation for substitution of arbitrary expressions.</p>
326 333
 
327 334
 <pre><code>"Hello #{name.capitalize()}."
@@ -339,7 +346,7 @@
339 346
         <span class="nx">i</span> <span class="o">+=</span> <span class="mi">1</span>
340 347
         <span class="k">continue</span>
341 348
       <span class="nx">unless</span> <span class="nx">letter</span> <span class="o">is</span> <span class="s1">&#39;#&#39;</span> <span class="o">and</span> <span class="nx">str</span><span class="p">.</span><span class="nx">charAt</span><span class="p">(</span><span class="nx">i</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span> <span class="o">is</span> <span class="s1">&#39;{&#39;</span> <span class="o">and</span>
342  
-             <span class="p">(</span><span class="nv">expr = </span><span class="nx">@balancedString</span> <span class="nx">str</span><span class="p">.</span><span class="nx">slice</span><span class="p">(</span><span class="nx">i</span><span class="o">+</span><span class="mi">1</span><span class="p">),</span> <span class="p">[[</span><span class="s1">&#39;{&#39;</span><span class="p">,</span> <span class="s1">&#39;}&#39;</span><span class="p">]])</span>
  349
+             <span class="p">(</span><span class="nv">expr = </span><span class="nx">@balancedString</span> <span class="nx">str</span><span class="p">.</span><span class="nx">slice</span><span class="p">(</span><span class="nx">i</span> <span class="o">+</span> <span class="mi">1</span><span class="p">),</span> <span class="s1">&#39;}&#39;</span><span class="p">)</span>
343 350
         <span class="k">continue</span>
344 351
       <span class="nx">tokens</span><span class="p">.</span><span class="nx">push</span> <span class="p">[</span><span class="s1">&#39;NEOSTRING&#39;</span><span class="p">,</span> <span class="nx">str</span><span class="p">.</span><span class="nx">slice</span><span class="p">(</span><span class="nx">pi</span><span class="p">,</span> <span class="nx">i</span><span class="p">)]</span> <span class="k">if</span> <span class="nx">pi</span> <span class="o">&lt;</span> <span class="nx">i</span>
345 352
       <span class="nv">inner = </span><span class="nx">expr</span><span class="p">.</span><span class="nx">slice</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
@@ -382,7 +389,7 @@
382 389
   <span class="s1">&#39;true&#39;</span><span class="p">,</span> <span class="s1">&#39;false&#39;</span><span class="p">,</span> <span class="s1">&#39;null&#39;</span><span class="p">,</span> <span class="s1">&#39;this&#39;</span>
383 390
   <span class="s1">&#39;new&#39;</span><span class="p">,</span> <span class="s1">&#39;delete&#39;</span><span class="p">,</span> <span class="s1">&#39;typeof&#39;</span><span class="p">,</span> <span class="s1">&#39;in&#39;</span><span class="p">,</span> <span class="s1">&#39;instanceof&#39;</span>
384 391
   <span class="s1">&#39;return&#39;</span><span class="p">,</span> <span class="s1">&#39;throw&#39;</span><span class="p">,</span> <span class="s1">&#39;break&#39;</span><span class="p">,</span> <span class="s1">&#39;continue&#39;</span><span class="p">,</span> <span class="s1">&#39;debugger&#39;</span>
385  
-  <span class="s1">&#39;if&#39;</span><span class="p">,</span> <span class="s1">&#39;else&#39;</span><span class="p">,</span> <span class="s1">&#39;switch&#39;</span><span class="p">,</span> <span class="s1">&#39;for&#39;</span><span class="p">,</span> <span class="s1">&#39;while&#39;</span><span class="p">,</span> <span class="s1">&#39;try&#39;</span><span class="p">,</span> <span class="s1">&#39;catch&#39;</span><span class="p">,</span> <span class="s1">&#39;finally&#39;</span>
  392
+  <span class="s1">&#39;if&#39;</span><span class="p">,</span> <span class="s1">&#39;else&#39;</span><span class="p">,</span> <span class="s1">&#39;switch&#39;</span><span class="p">,</span> <span class="s1">&#39;for&#39;</span><span class="p">,</span> <span class="s1">&#39;while&#39;</span><span class="p">,</span> <span class="s1">&#39;do&#39;</span><span class="p">,</span> <span class="s1">&#39;try&#39;</span><span class="p">,</span> <span class="s1">&#39;catch&#39;</span><span class="p">,</span> <span class="s1">&#39;finally&#39;</span>
386 393
   <span class="s1">&#39;class&#39;</span><span class="p">,</span> <span class="s1">&#39;extends&#39;</span><span class="p">,</span> <span class="s1">&#39;super&#39;</span>
387 394
 <span class="p">]</span></pre></div>             </td>           </tr>                               <tr id="section-39">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-39">&#182;</a>               </div>               <p>CoffeeScript-only keywords.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">COFFEE_KEYWORDS = </span><span class="p">[</span><span class="s1">&#39;undefined&#39;</span><span class="p">,</span> <span class="s1">&#39;then&#39;</span><span class="p">,</span> <span class="s1">&#39;unless&#39;</span><span class="p">,</span> <span class="s1">&#39;until&#39;</span><span class="p">,</span> <span class="s1">&#39;loop&#39;</span><span class="p">,</span> <span class="s1">&#39;of&#39;</span><span class="p">,</span> <span class="s1">&#39;by&#39;</span><span class="p">,</span> <span class="s1">&#39;when&#39;</span><span class="p">]</span>
388 395
 <span class="nx">COFFEE_KEYWORDS</span><span class="p">.</span><span class="nx">push</span> <span class="nx">op</span> <span class="k">for</span> <span class="nx">op</span> <span class="k">of</span> <span class="nv">COFFEE_ALIASES =</span>
@@ -397,9 +404,9 @@
397 404
   <span class="kc">off</span>  <span class="o">:</span> <span class="s1">&#39;false&#39;</span></pre></div>             </td>           </tr>                               <tr id="section-40">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-40">&#182;</a>               </div>               <p>The list of keywords that are reserved by JavaScript, but not used, or are
398 405
 used by CoffeeScript internally. We throw an error when these are encountered,
399 406
 to avoid having a JavaScript error at runtime.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">RESERVED = </span><span class="p">[</span>
400  
-  <span class="s1">&#39;case&#39;</span><span class="p">,</span> <span class="s1">&#39;default&#39;</span><span class="p">,</span> <span class="s1">&#39;function&#39;</span><span class="p">,</span> <span class="s1">&#39;var&#39;</span><span class="p">,</span> <span class="s1">&#39;void&#39;</span><span class="p">,</span> <span class="s1">&#39;with&#39;</span><span class="p">,</span> <span class="s1">&#39;do&#39;</span>
  407
+  <span class="s1">&#39;case&#39;</span><span class="p">,</span> <span class="s1">&#39;default&#39;</span><span class="p">,</span> <span class="s1">&#39;function&#39;</span><span class="p">,</span> <span class="s1">&#39;var&#39;</span><span class="p">,</span> <span class="s1">&#39;void&#39;</span><span class="p">,</span> <span class="s1">&#39;with&#39;</span>
401 408
   <span class="s1">&#39;const&#39;</span><span class="p">,</span> <span class="s1">&#39;let&#39;</span><span class="p">,</span> <span class="s1">&#39;enum&#39;</span><span class="p">,</span> <span class="s1">&#39;export&#39;</span><span class="p">,</span> <span class="s1">&#39;import&#39;</span><span class="p">,</span> <span class="s1">&#39;native&#39;</span>
402  
-  <span class="s1">&#39;__hasProp&#39;</span><span class="p">,</span> <span class="s1">&#39;__extends&#39;</span><span class="p">,</span> <span class="s1">&#39;__slice&#39;</span>
  409
+  <span class="s1">&#39;__hasProp&#39;</span><span class="p">,</span> <span class="s1">&#39;__extends&#39;</span><span class="p">,</span> <span class="s1">&#39;__slice&#39;</span><span class="p">,</span> <span class="s1">&#39;__bind&#39;</span><span class="p">,</span> <span class="s1">&#39;__indexOf&#39;</span>
403 410
 <span class="p">]</span></pre></div>             </td>           </tr>                               <tr id="section-41">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-41">&#182;</a>               </div>               <p>The superset of both JavaScript keywords and reserved words, none of which may
404 411
 be used as identifiers or properties.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">JS_FORBIDDEN = </span><span class="nx">JS_KEYWORDS</span><span class="p">.</span><span class="nx">concat</span> <span class="nx">RESERVED</span>
405 412
 
@@ -427,7 +434,7 @@
427 434
 
428 435
 <span class="nv">WHITESPACE = </span><span class="sr">/^[^\n\S]+/</span>
429 436
 
430  
-<span class="nv">COMMENT    = </span><span class="sr">/^###([^#][\s\S]*?)(?:###[^\n\S]*\n|(?:###)?$)|^(?:\s*#(?!##[^#]).*)+/</span>
  437
+<span class="nv">COMMENT    = </span><span class="sr">/^###([^#][\s\S]*?)(?:###[^\n\S]*|(?:###)?$)|^(?:\s*#(?!##[^#]).*)+/</span>
431 438
 
432 439
 <span class="nv">CODE       = </span><span class="sr">/^[-=]&gt;/</span>
433 440
 
@@ -467,7 +474,7 @@
467 474
   <span class="k">delete</span> <span class="o">|</span> <span class="k">typeof</span> <span class="o">|</span> <span class="k">instanceof</span>
468 475
 <span class="p">)</span> <span class="nx">$</span> <span class="err">///</span></pre></div>             </td>           </tr>                               <tr id="section-45">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-45">&#182;</a>               </div>               <p>Compound assignment tokens.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">COMPOUND_ASSIGN = </span><span class="p">[</span>
469 476
   <span class="s1">&#39;-=&#39;</span><span class="p">,</span> <span class="s1">&#39;+=&#39;</span><span class="p">,</span> <span class="s1">&#39;/=&#39;</span><span class="p">,</span> <span class="s1">&#39;*=&#39;</span><span class="p">,</span> <span class="s1">&#39;%=&#39;</span><span class="p">,</span> <span class="s1">&#39;||=&#39;</span><span class="p">,</span> <span class="s1">&#39;&amp;&amp;=&#39;</span><span class="p">,</span> <span class="s1">&#39;?=&#39;</span><span class="p">,</span> <span class="s1">&#39;&lt;&lt;=&#39;</span><span class="p">,</span> <span class="s1">&#39;&gt;&gt;=&#39;</span><span class="p">,</span> <span class="s1">&#39;&gt;&gt;&gt;=&#39;</span><span class="p">,</span> <span class="s1">&#39;&amp;=&#39;</span><span class="p">,</span> <span class="s1">&#39;^=&#39;</span><span class="p">,</span> <span class="s1">&#39;|=&#39;</span>
470  
-<span class="p">]</span></pre></div>             </td>           </tr>                               <tr id="section-46">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-46">&#182;</a>               </div>               <p>Unary tokens.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">UNARY   = </span><span class="p">[</span><span class="s1">&#39;!&#39;</span><span class="p">,</span> <span class="s1">&#39;~&#39;</span><span class="p">,</span> <span class="s1">&#39;NEW&#39;</span><span class="p">,</span> <span class="s1">&#39;TYPEOF&#39;</span><span class="p">,</span> <span class="s1">&#39;DELETE&#39;</span><span class="p">]</span></pre></div>             </td>           </tr>                               <tr id="section-47">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-47">&#182;</a>               </div>               <p>Logical tokens.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">LOGIC   = </span><span class="p">[</span><span class="s1">&#39;&amp;&amp;&#39;</span><span class="p">,</span> <span class="s1">&#39;||&#39;</span><span class="p">,</span> <span class="s1">&#39;&amp;&#39;</span><span class="p">,</span> <span class="s1">&#39;|&#39;</span><span class="p">,</span> <span class="s1">&#39;^&#39;</span><span class="p">]</span></pre></div>             </td>           </tr>                               <tr id="section-48">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-48">&#182;</a>               </div>               <p>Bit-shifting tokens.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">SHIFT   = </span><span class="p">[</span><span class="s1">&#39;&lt;&lt;&#39;</span><span class="p">,</span> <span class="s1">&#39;&gt;&gt;&#39;</span><span class="p">,</span> <span class="s1">&#39;&gt;&gt;&gt;&#39;</span><span class="p">]</span></pre></div>             </td>           </tr>                               <tr id="section-49">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-49">&#182;</a>               </div>               <p>Comparison tokens.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">COMPARE = </span><span class="p">[</span><span class="s1">&#39;==&#39;</span><span class="p">,</span> <span class="s1">&#39;!=&#39;</span><span class="p">,</span> <span class="s1">&#39;&lt;&#39;</span><span class="p">,</span> <span class="s1">&#39;&gt;&#39;</span><span class="p">,</span> <span class="s1">&#39;&lt;=&#39;</span><span class="p">,</span> <span class="s1">&#39;&gt;=&#39;</span><span class="p">]</span></pre></div>             </td>           </tr>                               <tr id="section-50">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-50">&#182;</a>               </div>               <p>Mathematical tokens.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">MATH    = </span><span class="p">[</span><span class="s1">&#39;*&#39;</span><span class="p">,</span> <span class="s1">&#39;/&#39;</span><span class="p">,</span> <span class="s1">&#39;%&#39;</span><span class="p">]</span></pre></div>             </td>           </tr>                               <tr id="section-51">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-51">&#182;</a>               </div>               <p>Relational tokens that are negatable with <code>not</code> prefix.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">RELATION = </span><span class="p">[</span><span class="s1">&#39;IN&#39;</span><span class="p">,</span> <span class="s1">&#39;OF&#39;</span><span class="p">,</span> <span class="s1">&#39;INSTANCEOF&#39;</span><span class="p">]</span></pre></div>             </td>           </tr>                               <tr id="section-52">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-52">&#182;</a>               </div>               <p>Boolean tokens.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">BOOL = </span><span class="p">[</span><span class="s1">&#39;TRUE&#39;</span><span class="p">,</span> <span class="s1">&#39;FALSE&#39;</span><span class="p">,</span> <span class="s1">&#39;NULL&#39;</span><span class="p">,</span> <span class="s1">&#39;UNDEFINED&#39;</span><span class="p">]</span></pre></div>             </td>           </tr>                               <tr id="section-53">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-53">&#182;</a>               </div>               <p>Tokens which a regular expression will never immediately follow, but which
  477
+<span class="p">]</span></pre></div>             </td>           </tr>                               <tr id="section-46">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-46">&#182;</a>               </div>               <p>Unary tokens.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">UNARY   = </span><span class="p">[</span><span class="s1">&#39;!&#39;</span><span class="p">,</span> <span class="s1">&#39;~&#39;</span><span class="p">,</span> <span class="s1">&#39;NEW&#39;</span><span class="p">,</span> <span class="s1">&#39;TYPEOF&#39;</span><span class="p">,</span> <span class="s1">&#39;DELETE&#39;</span><span class="p">,</span> <span class="s1">&#39;DO&#39;</span><span class="p">]</span></pre></div>             </td>           </tr>                               <tr id="section-47">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-47">&#182;</a>               </div>               <p>Logical tokens.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">LOGIC   = </span><span class="p">[</span><span class="s1">&#39;&amp;&amp;&#39;</span><span class="p">,</span> <span class="s1">&#39;||&#39;</span><span class="p">,</span> <span class="s1">&#39;&amp;&#39;</span><span class="p">,</span> <span class="s1">&#39;|&#39;</span><span class="p">,</span> <span class="s1">&#39;^&#39;</span><span class="p">]</span></pre></div>             </td>           </tr>                               <tr id="section-48">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-48">&#182;</a>               </div>               <p>Bit-shifting tokens.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">SHIFT   = </span><span class="p">[</span><span class="s1">&#39;&lt;&lt;&#39;</span><span class="p">,</span> <span class="s1">&#39;&gt;&gt;&#39;</span><span class="p">,</span> <span class="s1">&#39;&gt;&gt;&gt;&#39;</span><span class="p">]</span></pre></div>             </td>           </tr>                               <tr id="section-49">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-49">&#182;</a>               </div>               <p>Comparison tokens.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">COMPARE = </span><span class="p">[</span><span class="s1">&#39;==&#39;</span><span class="p">,</span> <span class="s1">&#39;!=&#39;</span><span class="p">,</span> <span class="s1">&#39;&lt;&#39;</span><span class="p">,</span> <span class="s1">&#39;&gt;&#39;</span><span class="p">,</span> <span class="s1">&#39;&lt;=&#39;</span><span class="p">,</span> <span class="s1">&#39;&gt;=&#39;</span><span class="p">]</span></pre></div>             </td>           </tr>                               <tr id="section-50">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-50">&#182;</a>               </div>               <p>Mathematical tokens.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">MATH    = </span><span class="p">[</span><span class="s1">&#39;*&#39;</span><span class="p">,</span> <span class="s1">&#39;/&#39;</span><span class="p">,</span> <span class="s1">&#39;%&#39;</span><span class="p">]</span></pre></div>             </td>           </tr>                               <tr id="section-51">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-51">&#182;</a>               </div>               <p>Relational tokens that are negatable with <code>not</code> prefix.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">RELATION = </span><span class="p">[</span><span class="s1">&#39;IN&#39;</span><span class="p">,</span> <span class="s1">&#39;OF&#39;</span><span class="p">,</span> <span class="s1">&#39;INSTANCEOF&#39;</span><span class="p">]</span></pre></div>             </td>           </tr>                               <tr id="section-52">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-52">&#182;</a>               </div>               <p>Boolean tokens.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">BOOL = </span><span class="p">[</span><span class="s1">&#39;TRUE&#39;</span><span class="p">,</span> <span class="s1">&#39;FALSE&#39;</span><span class="p">,</span> <span class="s1">&#39;NULL&#39;</span><span class="p">,</span> <span class="s1">&#39;UNDEFINED&#39;</span><span class="p">]</span></pre></div>             </td>           </tr>                               <tr id="section-53">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-53">&#182;</a>               </div>               <p>Tokens which a regular expression will never immediately follow, but which
471 478
 a division operator might.</p>
472 479
 
473 480
 <p>See: http://www.mozilla.org/js/language/js20-2002-04/rationale/syntax.html#regular-expressions</p>
550  documentation/docs/nodes.html
289 additions, 261 deletions not shown
13  documentation/docs/optparse.html
@@ -14,12 +14,17 @@
14 14
 <p>Along with an an optional banner for the usage help.</p>             </td>             <td class="code">               <div class="highlight"><pre>  <span class="nx">constructor</span><span class="o">:</span> <span class="p">(</span><span class="nx">rules</span><span class="p">,</span> <span class="nx">@banner</span><span class="p">)</span> <span class="o">-&gt;</span>
15 15
     <span class="vi">@rules = </span><span class="nx">buildRules</span> <span class="nx">rules</span></pre></div>             </td>           </tr>                               <tr id="section-3">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-3">&#182;</a>               </div>               <p>Parse the list of arguments, populating an <code>options</code> object with all of the
16 16
 specified options, and returning it. <code>options.arguments</code> will be an array
17  
-containing the remaining non-option arguments. This is a simpler API than
18  
-many option parsers that allow you to attach callback actions for every
19  
-flag. Instead, you're responsible for interpreting the options object.</p>             </td>             <td class="code">               <div class="highlight"><pre>  <span class="nx">parse</span><span class="o">:</span> <span class="p">(</span><span class="nx">args</span><span class="p">)</span> <span class="o">-&gt;</span>
20  
-    <span class="nv">options = </span><span class="nx">arguments</span><span class="o">:</span> <span class="p">[]</span>
  17
+containing the remaining non-option arguments. <code>options.literals</code> will be
  18
+an array of options that are meant to be passed through directly to the
  19
+executing script. This is a simpler API than many option parsers that allow
  20
+you to attach callback actions for every flag. Instead, you're responsible
  21
+for interpreting the options object.</p>             </td>             <td class="code">               <div class="highlight"><pre>  <span class="nx">parse</span><span class="o">:</span> <span class="p">(</span><span class="nx">args</span><span class="p">)</span> <span class="o">-&gt;</span>
  22
+    <span class="nv">options = </span><span class="nx">arguments</span><span class="o">:</span> <span class="p">[],</span> <span class="nx">literals</span><span class="o">:</span> <span class="p">[]</span>
21 23
     <span class="nv">args    = </span><span class="nx">normalizeArguments</span> <span class="nx">args</span>
22 24
     <span class="k">for</span> <span class="nx">arg</span><span class="p">,</span> <span class="nx">i</span> <span class="k">in</span> <span class="nx">args</span>
  25
+      <span class="k">if</span> <span class="nx">arg</span> <span class="o">is</span> <span class="s1">&#39;--&#39;</span>
  26
+        <span class="nv">options.literals = </span><span class="nx">args</span><span class="p">[(</span><span class="nx">i</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)..]</span>
  27
+        <span class="k">break</span>
23 28
       <span class="nv">isOption = </span><span class="o">!!</span><span class="p">(</span><span class="nx">arg</span><span class="p">.</span><span class="nx">match</span><span class="p">(</span><span class="nx">LONG_FLAG</span><span class="p">)</span> <span class="o">or</span> <span class="nx">arg</span><span class="p">.</span><span class="nx">match</span><span class="p">(</span><span class="nx">SHORT_FLAG</span><span class="p">))</span>
24 29
       <span class="nv">matchedRule = </span><span class="kc">no</span>
25 30
       <span class="k">for</span> <span class="nx">rule</span> <span class="k">in</span> <span class="nx">@rules</span>
16  documentation/docs/rewriter.html
@@ -106,22 +106,22 @@
106 106
       <span class="nx">@tokens</span><span class="p">.</span><span class="nx">splice</span> <span class="nx">idx</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="p">[</span><span class="s1">&#39;CALL_END&#39;</span><span class="p">,</span> <span class="s1">&#39;)&#39;</span><span class="p">,</span> <span class="nx">token</span><span class="p">[</span><span class="mi">2</span><span class="p">]]</span>
107 107
     <span class="nx">@scanTokens</span> <span class="p">(</span><span class="nx">token</span><span class="p">,</span> <span class="nx">i</span><span class="p">,</span> <span class="nx">tokens</span><span class="p">)</span> <span class="o">-&gt;</span>
108 108
       <span class="nv">tag     = </span><span class="nx">token</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
109  
-      <span class="nv">noCall  = </span><span class="kc">yes</span> <span class="k">if</span> <span class="nx">tag</span> <span class="k">in</span> <span class="p">[</span><span class="s1">&#39;CLASS&#39;</span><span class="p">,</span> <span class="s1">&#39;IF&#39;</span><span class="p">,</span> <span class="s1">&#39;UNLESS&#39;</span><span class="p">]</span>
  109
+      <span class="nv">noCall  = </span><span class="kc">yes</span> <span class="k">if</span> <span class="nx">tag</span> <span class="k">in</span> <span class="p">[</span><span class="s1">&#39;CLASS&#39;</span><span class="p">,</span> <span class="s1">&#39;IF&#39;</span><span class="p">]</span>
110 110
       <span class="p">[</span><span class="nx">prev</span><span class="p">,</span> <span class="nx">current</span><span class="p">,</span> <span class="nx">next</span><span class="p">]</span> <span class="o">=</span> <span class="nx">tokens</span><span class="p">[</span><span class="nx">i</span> <span class="o">-</span> <span class="mi">1</span> <span class="p">..</span> <span class="nx">i</span> <span class="o">+</span> <span class="mi">1</span><span class="p">]</span>
111 111
       <span class="nv">callObject = </span><span class="o">not</span> <span class="nx">noCall</span> <span class="o">and</span> <span class="nx">tag</span> <span class="o">is</span> <span class="s1">&#39;INDENT&#39;</span> <span class="o">and</span>
112 112
                    <span class="nx">next</span> <span class="o">and</span> <span class="nx">next</span><span class="p">.</span><span class="nx">generated</span> <span class="o">and</span> <span class="nx">next</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">is</span> <span class="s1">&#39;{&#39;</span> <span class="o">and</span>
113 113
                    <span class="nx">prev</span> <span class="o">and</span> <span class="nx">prev</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="k">in</span> <span class="nx">IMPLICIT_FUNC</span>
114 114
       <span class="nv">seenSingle = </span><span class="kc">no</span>
115  
-      <span class="nv">noCall     = </span><span class="kc">no</span>  <span class="k">if</span> <span class="nx">tag</span> <span class="k">in</span> <span class="nx">LINEBREAKS</span>
  115
+      <span class="nv">noCall     = </span><span class="kc">no</span> <span class="k">if</span> <span class="nx">tag</span> <span class="k">in</span> <span class="nx">LINEBREAKS</span>
116 116
       <span class="nv">token.call = </span><span class="kc">yes</span> <span class="k">if</span> <span class="nx">prev</span> <span class="o">and</span> <span class="o">not</span> <span class="nx">prev</span><span class="p">.</span><span class="nx">spaced</span> <span class="o">and</span> <span class="nx">tag</span> <span class="o">is</span> <span class="s1">&#39;?&#39;</span>
117 117
       <span class="k">return</span> <span class="mi">1</span> <span class="nx">unless</span> <span class="nx">callObject</span> <span class="o">or</span>
118 118
         <span class="nx">prev</span><span class="o">?</span><span class="p">.</span><span class="nx">spaced</span> <span class="o">and</span> <span class="p">(</span><span class="nx">prev</span><span class="p">.</span><span class="nx">call</span> <span class="o">or</span> <span class="nx">prev</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="k">in</span> <span class="nx">IMPLICIT_FUNC</span><span class="p">)</span> <span class="o">and</span>
119 119
         <span class="p">(</span><span class="nx">tag</span> <span class="k">in</span> <span class="nx">IMPLICIT_CALL</span> <span class="o">or</span> <span class="o">not</span> <span class="p">(</span><span class="nx">token</span><span class="p">.</span><span class="nx">spaced</span> <span class="o">or</span> <span class="nx">token</span><span class="p">.</span><span class="nx">newLine</span><span class="p">)</span> <span class="o">and</span> <span class="nx">tag</span> <span class="k">in</span> <span class="nx">IMPLICIT_UNSPACED_CALL</span><span class="p">)</span>
120 120
       <span class="nx">tokens</span><span class="p">.</span><span class="nx">splice</span> <span class="nx">i</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="p">[</span><span class="s1">&#39;CALL_START&#39;</span><span class="p">,</span> <span class="s1">&#39;(&#39;</span><span class="p">,</span> <span class="nx">token</span><span class="p">[</span><span class="mi">2</span><span class="p">]]</span>
121  
-      <span class="nx">@detectEnd</span> <span class="nx">i</span> <span class="o">+</span> <span class="p">(</span><span class="k">if</span> <span class="nx">callObject</span> <span class="k">then</span> <span class="mi">2</span> <span class="k">else</span> <span class="mi">1</span><span class="p">),</span> <span class="p">(</span><span class="nx">token</span><span class="p">,</span> <span class="nx">i</span><span class="p">)</span> <span class="o">-&gt;</span>
122  
-        <span class="k">return</span> <span class="kc">yes</span> <span class="k">if</span> <span class="o">not</span> <span class="nx">seenSingle</span> <span class="o">and</span> <span class="nx">token</span><span class="p">.</span><span class="nx">fromThen</span>
  121
+      <span class="nx">@detectEnd</span> <span class="nx">i</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="p">(</span><span class="nx">token</span><span class="p">,</span> <span class="nx">i</span><span class="p">)</span> <span class="o">-&gt;</span>
123 122
         <span class="p">[</span><span class="nx">tag</span><span class="p">]</span> <span class="o">=</span> <span class="nx">token</span>
124  
-        <span class="nv">seenSingle = </span><span class="kc">yes</span> <span class="k">if</span> <span class="nx">tag</span> <span class="k">in</span> <span class="p">[</span><span class="s1">&#39;IF&#39;</span><span class="p">,</span> <span class="s1">&#39;ELSE&#39;</span><span class="p">,</span> <span class="s1">&#39;UNLESS&#39;</span><span class="p">,</span> <span class="s1">&#39;-&gt;&#39;</span><span class="p">,</span> <span class="s1">&#39;=&gt;&#39;</span><span class="p">]</span>
  123
+        <span class="k">return</span> <span class="kc">yes</span> <span class="k">if</span> <span class="o">not</span> <span class="nx">seenSingle</span> <span class="o">and</span> <span class="nx">token</span><span class="p">.</span><span class="nx">fromThen</span>
  124
+        <span class="nv">seenSingle = </span><span class="kc">yes</span> <span class="k">if</span> <span class="nx">tag</span> <span class="k">in</span> <span class="p">[</span><span class="s1">&#39;IF&#39;</span><span class="p">,</span> <span class="s1">&#39;ELSE&#39;</span><span class="p">,</span> <span class="s1">&#39;-&gt;&#39;</span><span class="p">,</span> <span class="s1">&#39;=&gt;&#39;</span><span class="p">]</span>
125 125
         <span class="k">return</span> <span class="kc">yes</span> <span class="k">if</span> <span class="nx">tag</span> <span class="k">in</span> <span class="p">[</span><span class="s1">&#39;.&#39;</span><span class="p">,</span> <span class="s1">&#39;?.&#39;</span><span class="p">,</span> <span class="s1">&#39;::&#39;</span><span class="p">]</span> <span class="o">and</span> <span class="nx">@tag</span><span class="p">(</span><span class="nx">i</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span> <span class="o">is</span> <span class="s1">&#39;OUTDENT&#39;</span>
126 126
         <span class="o">not</span> <span class="nx">token</span><span class="p">.</span><span class="nx">generated</span> <span class="o">and</span> <span class="nx">@tag</span><span class="p">(</span><span class="nx">i</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span> <span class="o">isnt</span> <span class="s1">&#39;,&#39;</span> <span class="o">and</span> <span class="nx">tag</span> <span class="k">in</span> <span class="nx">IMPLICIT_END</span> <span class="o">and</span>
127 127
         <span class="p">(</span><span class="nx">tag</span> <span class="o">isnt</span> <span class="s1">&#39;INDENT&#39;</span> <span class="o">or</span>
@@ -163,7 +163,7 @@
163 163
 different precedence.</p>             </td>             <td class="code">               <div class="highlight"><pre>  <span class="nx">tagPostfixConditionals</span><span class="o">:</span> <span class="o">-&gt;</span>
164 164
     <span class="nv">condition = </span><span class="p">(</span><span class="nx">token</span><span class="p">,</span> <span class="nx">i</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nx">token</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="k">in</span> <span class="p">[</span><span class="s1">&#39;TERMINATOR&#39;</span><span class="p">,</span> <span class="s1">&#39;INDENT&#39;</span><span class="p">]</span>
165 165
     <span class="nx">@scanTokens</span> <span class="p">(</span><span class="nx">token</span><span class="p">,</span> <span class="nx">i</span><span class="p">)</span> <span class="o">-&gt;</span>
166  
-      <span class="k">return</span> <span class="mi">1</span> <span class="nx">unless</span> <span class="nx">token</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="k">in</span> <span class="p">[</span><span class="s1">&#39;IF&#39;</span><span class="p">,</span> <span class="s1">&#39;UNLESS&#39;</span><span class="p">]</span>
  166
+      <span class="k">return</span> <span class="mi">1</span> <span class="nx">unless</span> <span class="nx">token</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">is</span> <span class="s1">&#39;IF&#39;</span>
167 167
       <span class="nv">original = </span><span class="nx">token</span>
168 168
       <span class="nx">@detectEnd</span> <span class="nx">i</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="nx">condition</span><span class="p">,</span> <span class="p">(</span><span class="nx">token</span><span class="p">,</span> <span class="nx">i</span><span class="p">)</span> <span class="o">-&gt;</span>
169 169
         <span class="nx">original</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;POST_&#39;</span> <span class="o">+</span> <span class="nx">original</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="k">if</span> <span class="nx">token</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">isnt</span> <span class="s1">&#39;INDENT&#39;</span>
@@ -240,11 +240,11 @@
240 240
   <span class="nx">EXPRESSION_START</span><span class="p">.</span><span class="nx">push</span> <span class="nx">INVERSES</span><span class="p">[</span><span class="nx">rite</span><span class="p">]</span> <span class="o">=</span> <span class="nx">left</span>
241 241
   <span class="nx">EXPRESSION_END</span>  <span class="p">.</span><span class="nx">push</span> <span class="nx">INVERSES</span><span class="p">[</span><span class="nx">left</span><span class="p">]</span> <span class="o">=</span> <span class="nx">rite</span></pre></div>             </td>           </tr>                               <tr id="section-22">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-22">&#182;</a>               </div>               <p>Tokens that indicate the close of a clause of an expression.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">EXPRESSION_CLOSE = </span><span class="p">[</span><span class="s1">&#39;CATCH&#39;</span><span class="p">,</span> <span class="s1">&#39;WHEN&#39;</span><span class="p">,</span> <span class="s1">&#39;ELSE&#39;</span><span class="p">,</span> <span class="s1">&#39;FINALLY&#39;</span><span class="p">].</span><span class="nx">concat</span> <span class="nx">EXPRESSION_END</span></pre></div>             </td>           </tr>                               <tr id="section-23">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-23">&#182;</a>               </div>               <p>Tokens that, if followed by an <code>IMPLICIT_CALL</code>, indicate a function invocation.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">IMPLICIT_FUNC    = </span><span class="p">[</span><span class="s1">&#39;IDENTIFIER&#39;</span><span class="p">,</span> <span class="s1">&#39;SUPER&#39;</span><span class="p">,</span> <span class="s1">&#39;)&#39;</span><span class="p">,</span> <span class="s1">&#39;CALL_END&#39;</span><span class="p">,</span> <span class="s1">&#39;]&#39;</span><span class="p">,</span> <span class="s1">&#39;INDEX_END&#39;</span><span class="p">,</span> <span class="s1">&#39;@&#39;</span><span class="p">,</span> <span class="s1">&#39;THIS&#39;</span><span class="p">]</span></pre></div>             </td>           </tr>                               <tr id="section-24">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-24">&#182;</a>               </div>               <p>If preceded by an <code>IMPLICIT_FUNC</code>, indicates a function invocation.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">IMPLICIT_CALL    = </span><span class="p">[</span>
242 242
   <span class="s1">&#39;IDENTIFIER&#39;</span><span class="p">,</span> <span class="s1">&#39;NUMBER&#39;</span><span class="p">,</span> <span class="s1">&#39;STRING&#39;</span><span class="p">,</span> <span class="s1">&#39;JS&#39;</span><span class="p">,</span> <span class="s1">&#39;REGEX&#39;</span><span class="p">,</span> <span class="s1">&#39;NEW&#39;</span><span class="p">,</span> <span class="s1">&#39;PARAM_START&#39;</span><span class="p">,</span> <span class="s1">&#39;CLASS&#39;</span>
243  
-  <span class="s1">&#39;IF&#39;</span><span class="p">,</span> <span class="s1">&#39;UNLESS&#39;</span><span class="p">,</span> <span class="s1">&#39;TRY&#39;</span><span class="p">,</span> <span class="s1">&#39;SWITCH&#39;</span><span class="p">,</span> <span class="s1">&#39;THIS&#39;</span><span class="p">,</span> <span class="s1">&#39;BOOL&#39;</span><span class="p">,</span> <span class="s1">&#39;UNARY&#39;</span><span class="p">,</span>
  243
+  <span class="s1">&#39;IF&#39;</span><span class="p">,</span> <span class="s1">&#39;TRY&#39;</span><span class="p">,</span> <span class="s1">&#39;SWITCH&#39;</span><span class="p">,</span> <span class="s1">&#39;THIS&#39;</span><span class="p">,</span> <span class="s1">&#39;BOOL&#39;</span><span class="p">,</span> <span class="s1">&#39;UNARY&#39;</span><span class="p">,</span> <span class="s1">&#39;SUPER&#39;</span>
244 244
   <span class="s1">&#39;@&#39;</span><span class="p">,</span> <span class="s1">&#39;-&gt;&#39;</span><span class="p">,</span> <span class="s1">&#39;=&gt;&#39;</span><span class="p">,</span> <span class="s1">&#39;[&#39;</span><span class="p">,</span> <span class="s1">&#39;(&#39;</span><span class="p">,</span> <span class="s1">&#39;{&#39;</span><span class="p">,</span> <span class="s1">&#39;--&#39;</span><span class="p">,</span> <span class="s1">&#39;++&#39;</span>
245 245
 <span class="p">]</span>
246 246
 
247  
-<span class="nv">IMPLICIT_UNSPACED_CALL = </span><span class="p">[</span><span class="s1">&#39;+&#39;</span><span class="p">,</span> <span class="s1">&#39;-&#39;</span><span class="p">]</span></pre></div>             </td>           </tr>                               <tr id="section-25">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-25">&#182;</a>               </div>               <p>Tokens indicating that the implicit call must enclose a block of expressions.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">IMPLICIT_BLOCK   = </span><span class="p">[</span><span class="s1">&#39;-&gt;&#39;</span><span class="p">,</span> <span class="s1">&#39;=&gt;&#39;</span><span class="p">,</span> <span class="s1">&#39;{&#39;</span><span class="p">,</span> <span class="s1">&#39;[&#39;</span><span class="p">,</span> <span class="s1">&#39;,&#39;</span><span class="p">]</span></pre></div>             </td>           </tr>                               <tr id="section-26">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-26">&#182;</a>               </div>               <p>Tokens that always mark the end of an implicit call for single-liners.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">IMPLICIT_END     = </span><span class="p">[</span><span class="s1">&#39;POST_IF&#39;</span><span class="p">,</span> <span class="s1">&#39;POST_UNLESS&#39;</span><span class="p">,</span> <span class="s1">&#39;FOR&#39;</span><span class="p">,</span> <span class="s1">&#39;WHILE&#39;</span><span class="p">,</span> <span class="s1">&#39;UNTIL&#39;</span><span class="p">,</span> <span class="s1">&#39;WHEN&#39;</span><span class="p">,</span> <span class="s1">&#39;BY&#39;</span><span class="p">,</span> <span class="s1">&#39;LOOP&#39;</span><span class="p">,</span> <span class="s1">&#39;TERMINATOR&#39;</span><span class="p">,</span> <span class="s1">&#39;INDENT&#39;</span><span class="p">]</span></pre></div>             </td>           </tr>                               <tr id="section-27">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-27">&#182;</a>               </div>               <p>Single-line flavors of block expressions that have unclosed endings.
  247
+<span class="nv">IMPLICIT_UNSPACED_CALL = </span><span class="p">[</span><span class="s1">&#39;+&#39;</span><span class="p">,</span> <span class="s1">&#39;-&#39;</span><span class="p">]</span></pre></div>             </td>           </tr>                               <tr id="section-25">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-25">&#182;</a>               </div>               <p>Tokens indicating that the implicit call must enclose a block of expressions.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">IMPLICIT_BLOCK   = </span><span class="p">[</span><span class="s1">&#39;-&gt;&#39;</span><span class="p">,</span> <span class="s1">&#39;=&gt;&#39;</span><span class="p">,</span> <span class="s1">&#39;{&#39;</span><span class="p">,</span> <span class="s1">&#39;[&#39;</span><span class="p">,</span> <span class="s1">&#39;,&#39;</span><span class="p">]</span></pre></div>             </td>           </tr>                               <tr id="section-26">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-26">&#182;</a>               </div>               <p>Tokens that always mark the end of an implicit call for single-liners.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">IMPLICIT_END     = </span><span class="p">[</span><span class="s1">&#39;POST_IF&#39;</span><span class="p">,</span> <span class="s1">&#39;FOR&#39;</span><span class="p">,</span> <span class="s1">&#39;WHILE&#39;</span><span class="p">,</span> <span class="s1">&#39;UNTIL&#39;</span><span class="p">,</span> <span class="s1">&#39;WHEN&#39;</span><span class="p">,</span> <span class="s1">&#39;BY&#39;</span><span class="p">,</span> <span class="s1">&#39;LOOP&#39;</span><span class="p">,</span> <span class="s1">&#39;TERMINATOR&#39;</span><span class="p">,</span> <span class="s1">&#39;INDENT&#39;</span><span class="p">]</span></pre></div>             </td>           </tr>                               <tr id="section-27">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-27">&#182;</a>               </div>               <p>Single-line flavors of block expressions that have unclosed endings.
248 248
 The grammar can't disambiguate them, so we insert the implicit indentation.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">SINGLE_LINERS    = </span><span class="p">[</span><span class="s1">&#39;ELSE&#39;</span><span class="p">,</span> <span class="s1">&#39;-&gt;&#39;</span><span class="p">,</span> <span class="s1">&#39;=&gt;&#39;</span><span class="p">,</span> <span class="s1">&#39;TRY&#39;</span><span class="p">,</span> <span class="s1">&#39;FINALLY&#39;</span><span class="p">,</span> <span class="s1">&#39;THEN&#39;</span><span class="p">]</span>
249 249
 <span class="nv">SINGLE_CLOSERS   = </span><span class="p">[</span><span class="s1">&#39;TERMINATOR&#39;</span><span class="p">,</span> <span class="s1">&#39;CATCH&#39;</span><span class="p">,</span> <span class="s1">&#39;FINALLY&#39;</span><span class="p">,</span> <span class="s1">&#39;ELSE&#39;</span><span class="p">,</span> <span class="s1">&#39;OUTDENT&#39;</span><span class="p">,</span> <span class="s1">&#39;LEADING_WHEN&#39;</span><span class="p">]</span></pre></div>             </td>           </tr>                               <tr id="section-28">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-28">&#182;</a>               </div>               <p>Tokens that end a line.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">LINEBREAKS       = </span><span class="p">[</span><span class="s1">&#39;TERMINATOR&#39;</span><span class="p">,</span> <span class="s1">&#39;INDENT&#39;</span><span class="p">,</span> <span class="s1">&#39;OUTDENT&#39;</span><span class="p">]</span>
250 250
 
7  documentation/docs/scope.html
@@ -11,7 +11,8 @@
11 11
 it wraps.</p>             </td>             <td class="code">               <div class="highlight"><pre>  <span class="nx">constructor</span><span class="o">:</span><span class="p">(</span><span class="nx">@parent</span><span class="p">,</span> <span class="nx">@expressions</span><span class="p">,</span> <span class="nx">@method</span><span class="p">)</span> <span class="o">-&gt;</span>
12 12
     <span class="vi">@variables = </span><span class="p">[{</span><span class="nx">name</span><span class="o">:</span> <span class="s1">&#39;arguments&#39;</span><span class="p">,</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;arguments&#39;</span><span class="p">}]</span>
13 13
     <span class="vi">@positions = </span><span class="p">{}</span>
14  
-    <span class="nv">Scope.root = </span><span class="k">this</span> <span class="nx">unless</span> <span class="nx">@parent</span></pre></div>             </td>           </tr>                               <tr id="section-5">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-5">&#182;</a>               </div>               <p>Adds a new variable or overrides an existing one.</p>             </td>             <td class="code">               <div class="highlight"><pre>  <span class="nx">add</span><span class="o">:</span> <span class="p">(</span><span class="nx">name</span><span class="p">,</span> <span class="nx">type</span><span class="p">)</span> <span class="o">-&gt;</span>
  14
+    <span class="nv">Scope.root = </span><span class="k">this</span> <span class="nx">unless</span> <span class="nx">@parent</span></pre></div>             </td>           </tr>                               <tr id="section-5">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-5">&#182;</a>               </div>               <p>Adds a new variable or overrides an existing one.</p>             </td>             <td class="code">               <div class="highlight"><pre>  <span class="nx">add</span><span class="o">:</span> <span class="p">(</span><span class="nx">name</span><span class="p">,</span> <span class="nx">type</span><span class="p">,</span> <span class="nx">immediate</span><span class="p">)</span> <span class="o">-&gt;</span>
  15
+    <span class="k">return</span> <span class="nx">@parent</span><span class="p">.</span><span class="nx">add</span> <span class="nx">name</span><span class="p">,</span> <span class="nx">type</span><span class="p">,</span> <span class="nx">immediate</span> <span class="k">if</span> <span class="nx">@shared</span> <span class="o">and</span> <span class="o">not</span> <span class="nx">immediate</span>
15 16
     <span class="k">if</span> <span class="k">typeof</span> <span class="p">(</span><span class="nv">pos = </span><span class="nx">@positions</span><span class="p">[</span><span class="nx">name</span><span class="p">])</span> <span class="o">is</span> <span class="s1">&#39;number&#39;</span>
16 17
       <span class="nx">@variables</span><span class="p">[</span><span class="nx">pos</span><span class="p">].</span><span class="nv">type = </span><span class="nx">type</span>
17 18
     <span class="k">else</span>
@@ -21,7 +22,7 @@
21 22
     <span class="nx">@add</span> <span class="nx">name</span><span class="p">,</span> <span class="s1">&#39;var&#39;</span>
22 23
     <span class="kc">no</span></pre></div>             </td>           </tr>                               <tr id="section-7">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-7">&#182;</a>               </div>               <p>Reserve a variable name as originating from a function parameter for this
23 24
 scope. No <code>var</code> required for internal references.</p>             </td>             <td class="code">               <div class="highlight"><pre>  <span class="nx">parameter</span><span class="o">:</span> <span class="p">(</span><span class="nx">name</span><span class="p">)</span> <span class="o">-&gt;</span>
24  
-    <span class="k">return</span> <span class="k">if</span> <span class="nx">@shared</span> <span class="o">and</span> <span class="nx">@check</span> <span class="nx">name</span><span class="p">,</span> <span class="kc">yes</span>
  25
+    <span class="k">return</span> <span class="k">if</span> <span class="nx">@shared</span> <span class="o">and</span> <span class="nx">@parent</span><span class="p">.</span><span class="nx">check</span> <span class="nx">name</span><span class="p">,</span> <span class="kc">yes</span>
25 26
     <span class="nx">@add</span> <span class="nx">name</span><span class="p">,</span> <span class="s1">&#39;param&#39;</span></pre></div>             </td>           </tr>                               <tr id="section-8">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-8">&#182;</a>               </div>               <p>Just check to see if a variable has already been declared, without reserving,
26 27
 walks up to the root scope.</p>             </td>             <td class="code">               <div class="highlight"><pre>  <span class="nx">check</span><span class="o">:</span> <span class="p">(</span><span class="nx">name</span><span class="p">,</span> <span class="nx">immediate</span><span class="p">)</span> <span class="o">-&gt;</span>
27 28
     <span class="nv">found = </span><span class="o">!!</span><span class="nx">@type</span><span class="p">(</span><span class="nx">name</span><span class="p">)</span>
@@ -36,7 +37,7 @@
36 37
 compiler-generated variable. <code>_var</code>, <code>_var2</code>, and so on...</p>             </td>             <td class="code">               <div class="highlight"><pre>  <span class="nx">freeVariable</span><span class="o">:</span> <span class="p">(</span><span class="nx">type</span><span class="p">)</span> <span class="o">-&gt;</span>
37 38
     <span class="nv">index = </span><span class="mi">0</span>
38 39
     <span class="nx">index</span><span class="o">++</span> <span class="k">while</span> <span class="nx">@check</span><span class="p">((</span><span class="nv">temp = </span><span class="nx">@temporary</span> <span class="nx">type</span><span class="p">,</span> <span class="nx">index</span><span class="p">),</span> <span class="kc">true</span><span class="p">)</span>
39  
-    <span class="nx">@add</span> <span class="nx">temp</span><span class="p">,</span> <span class="s1">&#39;var&#39;</span>
  40
+    <span class="nx">@add</span> <span class="nx">temp</span><span class="p">,</span> <span class="s1">&#39;var&#39;</span><span class="p">,</span> <span class="kc">yes</span>
40 41
     <span class="nx">temp</span></pre></div>             </td>           </tr>                               <tr id="section-12">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-12">&#182;</a>               </div>               <p>Ensure that an assignment is made at the top of this scope
41 42
 (or at the top-level scope, if requested).</p>             </td>             <td class="code">               <div class="highlight"><pre>  <span class="nx">assign</span><span class="o">:</span> <span class="p">(</span><span class="nx">name</span><span class="p">,</span> <span class="nx">value</span><span class="p">)</span> <span class="o">-&gt;</span>
42 43
     <span class="nx">@add</span> <span class="nx">name</span><span class="p">,</span> <span class="nx">value</span><span class="o">:</span> <span class="nx">value</span><span class="p">,</span> <span class="nx">assigned</span><span class="o">:</span> <span class="kc">true</span>
11  documentation/docs/underscore.html
@@ -31,7 +31,7 @@
31 31
     <span class="k">else</span> <span class="k">if</span> <span class="nx">_</span><span class="p">.</span><span class="nx">isNumber</span> <span class="nx">obj</span><span class="p">.</span><span class="nx">length</span>
32 32
       <span class="nx">iterator</span><span class="p">.</span><span class="nx">call</span> <span class="nx">context</span><span class="p">,</span> <span class="nx">obj</span><span class="p">[</span><span class="nx">i</span><span class="p">],</span> <span class="nx">i</span><span class="p">,</span> <span class="nx">obj</span> <span class="k">for</span> <span class="nx">i</span> <span class="k">in</span> <span class="p">[</span><span class="mi">0</span><span class="p">...</span><span class="nx">obj</span><span class="p">.</span><span class="nx">length</span><span class="p">]</span>
33 33
     <span class="k">else</span>
34  
-      <span class="nx">iterator</span><span class="p">.</span><span class="nx">call</span> <span class="nx">context</span><span class="p">,</span> <span class="nx">val</span><span class="p">,</span> <span class="nx">key</span><span class="p">,</span> <span class="nx">obj</span>  <span class="k">for</span> <span class="nx">key</span><span class="p">,</span> <span class="nx">val</span> <span class="k">of</span> <span class="nx">obj</span>
  34
+      <span class="nx">iterator</span><span class="p">.</span><span class="nx">call</span> <span class="nx">context</span><span class="p">,</span> <span class="nx">val</span><span class="p">,</span> <span class="nx">key</span><span class="p">,</span> <span class="nx">obj</span>  <span class="k">for</span> <span class="nx">own</span> <span class="nx">key</span><span class="p">,</span> <span class="nx">val</span> <span class="k">of</span> <span class="nx">obj</span>
35 35
   <span class="k">catch</span> <span class="nx">e</span>
36 36
     <span class="k">throw</span> <span class="nx">e</span> <span class="k">if</span> <span class="nx">e</span> <span class="o">isnt</span> <span class="nx">breaker</span>
37 37
   <span class="nx">obj</span></pre></div>             </td>           </tr>                               <tr id="section-16">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-16">&#182;</a>               </div>               <p>Return the results of applying the iterator to each element. Use JavaScript
@@ -86,8 +86,7 @@
86 86
   <span class="nx">result</span></pre></div>             </td>           </tr>                               <tr id="section-24">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-24">&#182;</a>               </div>               <p>Determine if a given value is included in the array or object,
87 87
 based on <code>===</code>.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">_.include = </span><span class="p">(</span><span class="nx">obj</span><span class="p">,</span> <span class="nx">target</span><span class="p">)</span> <span class="o">-&gt;</span>
88 88
   <span class="k">return</span> <span class="nx">_</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="nx">obj</span><span class="p">,</span> <span class="nx">target</span><span class="p">)</span> <span class="o">isnt</span> <span class="o">-</span><span class="mi">1</span> <span class="k">if</span> <span class="nx">nativeIndexOf</span> <span class="o">and</span> <span class="nx">obj</span><span class="p">.</span><span class="nx">indexOf</span> <span class="o">is</span> <span class="nx">nativeIndexOf</span>
89  
-  <span class="k">for</span> <span class="nx">key</span><span class="p">,</span> <span class="nx">val</span> <span class="k">of</span> <span class="nx">obj</span>
90  
-    <span class="k">return</span> <span class="kc">true</span> <span class="k">if</span> <span class="nx">val</span> <span class="o">is</span> <span class="nx">target</span>
  89
+  <span class="k">return</span> <span class="kc">true</span> <span class="k">for</span> <span class="nx">own</span> <span class="nx">key</span><span class="p">,</span> <span class="nx">val</span> <span class="k">of</span> <span class="nx">obj</span> <span class="k">when</span> <span class="nx">val</span> <span class="o">is</span> <span class="nx">target</span>
91 90
   <span class="kc">false</span></pre></div>             </td>           </tr>                               <tr id="section-25">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-25">&#182;</a>               </div>               <p>Invoke a method with arguments on every item in a collection.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">_.invoke = </span><span class="p">(</span><span class="nx">obj</span><span class="p">,</span> <span class="nx">method</span><span class="p">)</span> <span class="o">-&gt;</span>
92 91
   <span class="nv">args = </span><span class="nx">_</span><span class="p">.</span><span class="nx">rest</span> <span class="nx">arguments</span><span class="p">,</span> <span class="mi">2</span>
93 92
   <span class="p">(</span><span class="k">if</span> <span class="nx">method</span> <span class="k">then</span> <span class="nx">val</span><span class="p">[</span><span class="nx">method</span><span class="p">]</span> <span class="k">else</span> <span class="nx">val</span><span class="p">).</span><span class="nx">apply</span><span class="p">(</span><span class="nx">val</span><span class="p">,</span> <span class="nx">args</span><span class="p">)</span> <span class="k">for</span> <span class="nx">val</span> <span class="k">in</span> <span class="nx">obj</span></pre></div>             </td>           </tr>                               <tr id="section-26">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-26">&#182;</a>               </div>               <p>Convenience version of a common use case of <strong>map</strong>: fetching a property.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">_.pluck = </span><span class="p">(</span><span class="nx">obj</span><span class="p">,</span> <span class="nx">key</span><span class="p">)</span> <span class="o">-&gt;</span>
@@ -225,10 +224,10 @@
225 224
     <span class="k">return</span> <span class="nx">a</span><span class="p">.</span><span class="nx">source</span>     <span class="o">is</span> <span class="nx">b</span><span class="p">.</span><span class="nx">source</span> <span class="o">and</span>
226 225
            <span class="nx">a</span><span class="p">.</span><span class="nx">global</span>     <span class="o">is</span> <span class="nx">b</span><span class="p">.</span><span class="nx">global</span> <span class="o">and</span>
227 226
            <span class="nx">a</span><span class="p">.</span><span class="nx">ignoreCase</span> <span class="o">is</span> <span class="nx">b</span><span class="p">.</span><span class="nx">ignoreCase</span> <span class="o">and</span>
228  
-           <span class="nx">a</span><span class="p">.</span><span class="nx">multiline</span>  <span class="o">is</span> <span class="nx">b</span><span class="p">.</span><span class="nx">multiline</span></pre></div>             </td>           </tr>                               <tr id="section-70">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-70">&#182;</a>               </div>               <p>If a is not an object by this point, we can't handle it.</p>             </td>             <td class="code">               <div class="highlight"><pre>  <span class="k">return</span> <span class="kc">false</span> <span class="k">if</span> <span class="nx">atype</span> <span class="o">isnt</span> <span class="s1">&#39;object&#39;</span></pre></div>             </td>           </tr>                               <tr id="section-71">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-71">&#182;</a>               </div>               <p>Check for different array lengths before comparing contents.</p>             </td>             <td class="code">               <div class="highlight"><pre>  <span class="k">return</span> <span class="kc">false</span> <span class="k">if</span> <span class="nx">a</span><span class="p">.</span><span class="nx">length</span> <span class="o">and</span> <span class="p">(</span><span class="nx">a</span><span class="p">.</span><span class="nx">length</span> <span class="o">isnt</span> <span class="nx">b</span><span class="p">.</span><span class="nx">length</span><span class="p">)</span></pre></div>             </td>           </tr>                               <tr id="section-72">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-72">&#182;</a>               </div>               <p>Nothing else worked, deep compare the contents.</p>             </td>             <td class="code">               <div class="highlight"><pre>  <span class="nv">aKeys = </span><span class="nx">_</span><span class="p">.</span><span class="nx">keys</span><span class="p">(</span><span class="nx">a</span><span class="p">);</span> <span class="nv">bKeys = </span><span class="nx">_</span><span class="p">.</span><span class="nx">keys</span><span class="p">(</span><span class="nx">b</span><span class="p">)</span></pre></div>             </td>           </tr>                               <tr id="section-73">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-73">&#182;</a>               </div>               <p>Different object sizes?</p>             </td>             <td class="code">               <div class="highlight"><pre>  <span class="k">return</span> <span class="kc">false</span> <span class="k">if</span> <span class="nx">aKeys</span><span class="p">.</span><span class="nx">length</span> <span class="o">isnt</span> <span class="nx">bKeys</span><span class="p">.</span><span class="nx">length</span></pre></div>             </td>           </tr>                               <tr id="section-74">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-74">&#182;</a>               </div>               <p>Recursive comparison of contents.</p>             </td>             <td class="code">               <div class="highlight"><pre>  <span class="k">return</span> <span class="kc">false</span> <span class="k">for</span> <span class="nx">all</span> <span class="nx">key</span><span class="p">,</span> <span class="nx">val</span> <span class="k">of</span> <span class="nx">a</span> <span class="k">when</span> <span class="o">!</span><span class="p">(</span><span class="nx">key</span> <span class="k">of</span> <span class="nx">b</span><span class="p">)</span> <span class="o">or</span> <span class="o">!</span><span class="nx">_</span><span class="p">.</span><span class="nx">isEqual</span><span class="p">(</span><span class="nx">val</span><span class="p">,</span> <span class="nx">b</span><span class="p">[</span><span class="nx">key</span><span class="p">])</span>
  227
+           <span class="nx">a</span><span class="p">.</span><span class="nx">multiline</span>  <span class="o">is</span> <span class="nx">b</span><span class="p">.</span><span class="nx">multiline</span></pre></div>             </td>           </tr>                               <tr id="section-70">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-70">&#182;</a>               </div>               <p>If a is not an object by this point, we can't handle it.</p>             </td>             <td class="code">               <div class="highlight"><pre>  <span class="k">return</span> <span class="kc">false</span> <span class="k">if</span> <span class="nx">atype</span> <span class="o">isnt</span> <span class="s1">&#39;object&#39;</span></pre></div>             </td>           </tr>                               <tr id="section-71">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-71">&#182;</a>               </div>               <p>Check for different array lengths before comparing contents.</p>             </td>             <td class="code">               <div class="highlight"><pre>  <span class="k">return</span> <span class="kc">false</span> <span class="k">if</span> <span class="nx">a</span><span class="p">.</span><span class="nx">length</span> <span class="o">and</span> <span class="p">(</span><span class="nx">a</span><span class="p">.</span><span class="nx">length</span> <span class="o">isnt</span> <span class="nx">b</span><span class="p">.</span><span class="nx">length</span><span class="p">)</span></pre></div>             </td>           </tr>                               <tr id="section-72">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-72">&#182;</a>               </div>               <p>Nothing else worked, deep compare the contents.</p>             </td>             <td class="code">               <div class="highlight"><pre>  <span class="nv">aKeys = </span><span class="nx">_</span><span class="p">.</span><span class="nx">keys</span><span class="p">(</span><span class="nx">a</span><span class="p">);</span> <span class="nv">bKeys = </span><span class="nx">_</span><span class="p">.</span><span class="nx">keys</span><span class="p">(</span><span class="nx">b</span><span class="p">)</span></pre></div>             </td>           </tr>                               <tr id="section-73">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-73">&#182;</a>               </div>               <p>Different object sizes?</p>             </td>             <td class="code">               <div class="highlight"><pre>  <span class="k">return</span> <span class="kc">false</span> <span class="k">if</span> <span class="nx">aKeys</span><span class="p">.</span><span class="nx">length</span> <span class="o">isnt</span> <span class="nx">bKeys</span><span class="p">.</span><span class="nx">length</span></pre></div>             </td>           </tr>                               <tr id="section-74">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-74">&#182;</a>               </div>               <p>Recursive comparison of contents.</p>             </td>             <td class="code">               <div class="highlight"><pre>  <span class="k">return</span> <span class="kc">false</span> <span class="k">for</span> <span class="nx">key</span><span class="p">,</span> <span class="nx">val</span> <span class="k">of</span> <span class="nx">a</span> <span class="k">when</span> <span class="o">!</span><span class="p">(</span><span class="nx">key</span> <span class="k">of</span> <span class="nx">b</span><span class="p">)</span> <span class="o">or</span> <span class="o">!</span><span class="nx">_</span><span class="p">.</span><span class="nx">isEqual</span><span class="p">(</span><span class="nx">val</span><span class="p">,</span> <span class="nx">b</span><span class="p">[</span><span class="nx">key</span><span class="p">])</span>
229 228
   <span class="kc">true</span></pre></div>             </td>           </tr>                               <tr id="section-75">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-75">&#182;</a>               </div>               <p>Is a given array or object empty?</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">_.isEmpty = </span><span class="p">(</span><span class="nx">obj</span><span class="p">)</span> <span class="o">-&gt;</span>
230 229
   <span class="k">return</span> <span class="nx">obj</span><span class="p">.</span><span class="nx">length</span> <span class="o">is</span> <span class="mi">0</span> <span class="k">if</span> <span class="nx">_</span><span class="p">.</span><span class="nx">isArray</span><span class="p">(</span><span class="nx">obj</span><span class="p">)</span> <span class="o">or</span> <span class="nx">_</span><span class="p">.</span><span class="nx">isString</span><span class="p">(</span><span class="nx">obj</span><span class="p">)</span>
231  
-  <span class="k">return</span> <span class="kc">false</span> <span class="k">for</span> <span class="nx">key</span> <span class="k">of</span> <span class="nx">obj</span> <span class="k">when</span> <span class="nx">hasOwnProperty</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="nx">obj</span><span class="p">,</span> <span class="nx">key</span><span class="p">)</span>
  230
+  <span class="k">return</span> <span class="kc">false</span> <span class="k">for</span> <span class="nx">own</span> <span class="nx">key</span> <span class="k">of</span> <span class="nx">obj</span>
232 231
   <span class="kc">true</span></pre></div>             </td>           </tr>                               <tr id="section-76">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-76">&#182;</a>               </div>               <p>Is a given value a DOM element?</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">_.isElement   = </span><span class="p">(</span><span class="nx">obj</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nx">obj</span> <span class="o">and</span> <span class="nx">obj</span><span class="p">.</span><span class="nx">nodeType</span> <span class="o">is</span> <span class="mi">1</span></pre></div>             </td>           </tr>                               <tr id="section-77">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-77">&#182;</a>               </div>               <p>Is a given value an array?</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">_.isArray     = </span><span class="nx">nativeIsArray</span> <span class="o">or</span> <span class="p">(</span><span class="nx">obj</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="o">!!</span><span class="p">(</span><span class="nx">obj</span> <span class="o">and</span> <span class="nx">obj</span><span class="p">.</span><span class="nx">concat</span> <span class="o">and</span> <span class="nx">obj</span><span class="p">.</span><span class="nx">unshift</span> <span class="o">and</span> <span class="o">not</span> <span class="nx">obj</span><span class="p">.</span><span class="nx">callee</span><span class="p">)</span></pre></div>             </td>           </tr>                               <tr id="section-78">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-78">&#182;</a>               </div>               <p>Is a given variable an arguments object?</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">_.isArguments = </span><span class="p">(</span><span class="nx">obj</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nx">obj</span> <span class="o">and</span> <span class="nx">obj</span><span class="p">.</span><span class="nx">callee</span></pre></div>             </td>           </tr>                               <tr id="section-79">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-79">&#182;</a>               </div>               <p>Is the given value a function?</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">_.isFunction  = </span><span class="p">(</span><span class="nx">obj</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="o">!!</span><span class="p">(</span><span class="nx">obj</span> <span class="o">and</span> <span class="nx">obj</span><span class="p">.</span><span class="nx">constructor</span> <span class="o">and</span> <span class="nx">obj</span><span class="p">.</span><span class="nx">call</span> <span class="o">and</span> <span class="nx">obj</span><span class="p">.</span><span class="nx">apply</span><span class="p">)</span></pre></div>             </td>           </tr>                               <tr id="section-80">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-80">&#182;</a>               </div>               <p>Is the given value a string?</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">_.isString    = </span><span class="p">(</span><span class="nx">obj</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="o">!!</span><span class="p">(</span><span class="nx">obj</span> <span class="o">is</span> <span class="s1">&#39;&#39;</span> <span class="o">or</span> <span class="p">(</span><span class="nx">obj</span> <span class="o">and</span> <span class="nx">obj</span><span class="p">.</span><span class="nx">charCodeAt</span> <span class="o">and</span> <span class="nx">obj</span><span class="p">.</span><span class="nx">substr</span><span class="p">))</span></pre></div>             </td>           </tr>                               <tr id="section-81">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-81">&#182;</a>               </div>               <p>Is a given value a number?</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">_.isNumber    = </span><span class="p">(</span><span class="nx">obj</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="p">(</span><span class="nx">obj</span> <span class="o">is</span> <span class="o">+</span><span class="nx">obj</span><span class="p">)</span> <span class="o">or</span> <span class="nx">toString</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="nx">obj</span><span class="p">)</span> <span class="o">is</span> <span class="s1">&#39;[object Number]&#39;</span></pre></div>             </td>           </tr>                               <tr id="section-82">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-82">&#182;</a>               </div>               <p>Is a given value a boolean?</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">_.isBoolean   = </span><span class="p">(</span><span class="nx">obj</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nx">obj</span> <span class="o">is</span> <span class="kc">true</span> <span class="o">or</span> <span class="nx">obj</span> <span class="o">is</span> <span class="kc">false</span></pre></div>             </td>           </tr>                               <tr id="section-83">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-83">&#182;</a>               </div>               <p>Is a given value a Date?</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">_.isDate      = </span><span class="p">(</span><span class="nx">obj</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="o">!!</span><span class="p">(</span><span class="nx">obj</span> <span class="o">and</span> <span class="nx">obj</span><span class="p">.</span><span class="nx">getTimezoneOffset</span> <span class="o">and</span> <span class="nx">obj</span><span class="p">.</span><span class="nx">setUTCFullYear</span><span class="p">)</span></pre></div>             </td>           </tr>                               <tr id="section-84">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-84">&#182;</a>               </div>               <p>Is the given value a regular expression?</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">_.isRegExp    = </span><span class="p">(</span><span class="nx">obj</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="o">!!</span><span class="p">(</span><span class="nx">obj</span> <span class="o">and</span> <span class="nx">obj</span><span class="p">.</span><span class="nx">exec</span> <span class="o">and</span> <span class="p">(</span><span class="nx">obj</span><span class="p">.</span><span class="nx">ignoreCase</span> <span class="o">or</span> <span class="nx">obj</span><span class="p">.</span><span class="nx">ignoreCase</span> <span class="o">is</span> <span class="kc">false</span><span class="p">))</span></pre></div>             </td>           </tr>                               <tr id="section-85">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-85">&#182;</a>               </div>               <p>Is the given value NaN -- this one is interesting. <code>NaN != NaN</code>, and
233 232
 <code>isNaN(undefined) == true</code>, so we make sure it's a number first.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">_.isNaN       = </span><span class="p">(</span><span class="nx">obj</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nx">_</span><span class="p">.</span><span class="nx">isNumber</span><span class="p">(</span><span class="nx">obj</span><span class="p">)</span> <span class="o">and</span> <span class="nb">window</span><span class="p">.</span><span class="nb">isNaN</span><span class="p">(</span><span class="nx">obj</span><span class="p">)</span></pre></div>             </td>           </tr>                               <tr id="section-86">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-86">&#182;</a>               </div>               <p>Is a given value equal to null?</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">_.isNull      = </span><span class="p">(</span><span class="nx">obj</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nx">obj</span> <span class="o">is</span> <span class="kc">null</span></pre></div>             </td>           </tr>                               <tr id="section-87">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-87">&#182;</a>               </div>               <p>Is a given variable undefined?</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">_.isUndefined = </span><span class="p">(</span><span class="nx">obj</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="k">typeof</span> <span class="nx">obj</span> <span class="o">is</span> <span class="s1">&#39;undefined&#39;</span></pre></div>             </td>           </tr>                               <tr id="section-88">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-88">&#182;</a>               </div>               <h2>Utility Functions</h2>             </td>             <td class="code">               <div class="highlight"><pre></pre></div>             </td>           </tr>                               <tr id="section-89">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-89">&#182;</a>               </div>               <p>Run Underscore.js in noConflict mode, returning the <code>_</code> variable to its
234 233
 previous owner. Returns a reference to the Underscore object.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nv">_.noConflict = </span><span class="o">-&gt;</span>
@@ -282,7 +281,7 @@
282 281
   <span class="nx">wrapper</span><span class="p">.</span><span class="nx">prototype</span><span class="p">[</span><span class="nx">name</span><span class="p">]</span> <span class="o">=</span> <span class="o">-&gt;</span>
283 282
     <span class="nv">args = </span><span class="nx">_</span><span class="p">.</span><span class="nx">toArray</span> <span class="nx">arguments</span>
284 283
     <span class="nx">unshift</span><span class="p">.</span><span class="nx">call</span> <span class="nx">args</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_wrapped</span>
285  
-    <span class="nx">result</span> <span class="nx">func</span><span class="p">.</span><span class="nx">apply</span><span class="p">(</span><span class="nx">_</span><span class="p">,</span> <span class="nx">args</span><span class="p">),</span> <span class="k">this</span><span class="p">.</span><span class="nx">_chain</span></pre></div>             </td>           </tr>                               <tr id="section-102">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-102">&#182;</a>               </div>               <p>Add all of the Underscore functions to the wrapper object.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nx">_</span><span class="p">.</span><span class="nx">mixin</span> <span class="nx">_</span></pre></div>             </td>           </tr>                               <tr id="section-103">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-103">&#182;</a>               </div>               <p>Add all mutator Array functions to the wrapper.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nx">_</span><span class="p">.</span><span class="nx">each</span> <span class="p">[</span><span class="s1">&#39;pop&#39;</span><span class="p">,</span> <span class="s1">&#39;push&#39;</span><span class="p">,</span> <span class="s1">&#39;reverse&#39;</span><span class="p">,</span> <span class="s1">&#39;shift&#39;</span><span class="p">,</span> <span class="s1">&#39;sort&#39;</span><span class="p">,</span> <span class="s1">&#39;splice&#39;</span><span class="p">,</span> <span class="s1">&#39;unshift&#39;</span><span class="p">],</span> <span class="p">(</span><span class="nx">name</span><span class="p">)</span> <span class="o">-&gt;</span>
  284
+    <span class="nx">result</span> <span class="nx">func</span><span class="p">.</span><span class="nx">apply</span><span class="p">(</span><span class="nx">_</span><span class="p">,</span> <span class="nx">args</span><span class="p">),</span> <span class="k">this</span><span class="p">.</span><span class="nx">_chain</span></pre></div>             </td>           </tr>                               <tr id="section-102">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-102">&#182;</a>               </div>               <p>Add all ofthe Underscore functions to the wrapper object.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nx">_</span><span class="p">.</span><span class="nx">mixin</span> <span class="nx">_</span></pre></div>             </td>           </tr>                               <tr id="section-103">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-103">&#182;</a>               </div>               <p>Add all mutator Array functions to the wrapper.</p>             </td>             <td class="code">               <div class="highlight"><pre><span class="nx">_</span><span class="p">.</span><span class="nx">each</span> <span class="p">[</span><span class="s1">&#39;pop&#39;</span><span class="p">,</span> <span class="s1">&#39;push&#39;</span><span class="p">,</span> <span class="s1">&#39;reverse&#39;</span><span class="p">,</span> <span class="s1">&#39;shift&#39;</span><span class="p">,</span> <span class="s1">&#39;sort&#39;</span><span class="p">,</span> <span class="s1">&#39;splice&#39;</span><span class="p">,</span> <span class="s1">&#39;unshift&#39;</span><span class="p">],</span> <span class="p">(</span><span class="nx">name</span><span class="p">)</span> <span class="o">-&gt;</span>
286 285
   <span class="nv">method = </span><span class="nb">Array</span><span class="p">.</span><span class="nx">prototype</span><span class="p">[</span><span class="nx">name</span><span class="p">]</span>
287 286
   <span class="nx">wrapper</span><span class="p">.</span><span class="nx">prototype</span><span class="p">[</span><span class="nx">name</span><span class="p">]</span> <span class="o">=</span> <span class="o">-&gt;</span>
288 287
     <span class="nx">method</span><span class="p">.</span><span class="nx">apply</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_wrapped</span><span class="p">,</span> <span class="nx">arguments</span><span class="p">)</span>
61  documentation/index.html.erb
@@ -82,7 +82,7 @@
82 82
           <div id="repl_source_wrap">
83 83
             <textarea id="repl_source" rows="100">alert "Hello CoffeeScript!"</textarea>
84 84
           </div>
85  
-          <pre id="repl_results"></pre>
  85
+          <div id="repl_results_wrap"><pre id="repl_results"></pre></div>
86 86
           <div class="minibutton dark run">Run</div>
87 87
           <br class="clear" />
88 88
         </div>
@@ -131,7 +131,7 @@
131 131
 
132 132
     <p>
133 133
       <b>Latest Version:</b>
134  
-      <a href="http://github.com/jashkenas/coffee-script/tarball/0.9.6">0.9.6</a>
  134
+      <a href="http://github.com/jashkenas/coffee-script/tarball/1.0.0">1.0.0</a>
135 135
     </p>
136 136
 
137 137
     <h2>
@@ -474,22 +474,8 @@ Expressions
474 474
 
475 475
     <p>
476 476
       <span id="loops" class="bookmark"></span>
477  
-      <b class="header">Loops</b>
478  
-      The only low-level loop that CoffeeScript provides is the <b>while</b> loop. The
479  
-      main difference from JavaScript is that the <b>while</b> loop can be used
480  
-      as an expression, returning an array containing the result of each iteration
481  
-      through the loop.
482  
-    </p>
483  
-    <%= code_for('while', 'lyrics.join("\n")') %>
484  
-    <p>
485  
-      For readability, the <b>until</b> keyword is equivalent to <tt>while not</tt>,
486  
-      and the <b>loop</b> keyword is equivalent to <tt>while true</tt>.
487  
-    </p>
488  
-
489  
-    <p>
490  
-      <span id="comprehensions" class="bookmark"></span>
491  
-      <b class="header">Comprehensions</b>
492  
-      Hopefully, the majority of your loops can be implemented with <b>comprehensions</b>
  477
+      <b class="header">Loops and Comprehensions</b>
  478
+      Most of the loops you'll write in CoffeeScript will be <b>comprehensions</b>
493 479
       over arrays, objects, and ranges. Comprehensions replace (and compile into)
494 480
       <b>for</b> loops, with optional guard clauses and the value of the current array index.
495 481
       Unlike for loops, array comprehensions are expressions, and can be returned
@@ -530,10 +516,22 @@ Expressions
530 516
       <tt>for own key, value of object</tt>
531 517
     </p>
532 518
     <p>
  519
+      The only low-level loop that CoffeeScript provides is the <b>while</b> loop. The
  520
+      main difference from JavaScript is that the <b>while</b> loop can be used
  521
+      as an expression, returning an array containing the result of each iteration
  522
+      through the loop.
  523
+    </p>
  524
+    <%= code_for('while', 'lyrics.join("\n")') %>
  525
+    <p>
  526
+      For readability, the <b>until</b> keyword is equivalent to <tt>while not</tt>,
  527
+      and the <b>loop</b> keyword is equivalent to <tt>while true</tt>.
  528
+    </p>
  529
+    <p>
533 530
       When using a JavaScript loop to generate functions, it's common to insert
534 531
       a closure wrapper in order to ensure that loop variables are closed over,
535 532
       and all the generated functions don't just share the final values. CoffeeScript
536  
-      provides the <tt>do</tt> keyword, which immediately invokes a passed function.
  533
+      provides the <tt>do</tt> keyword, which immediately invokes a passed function,
  534
+      forwarding any arguments.
537 535
     </p>
538 536
     <%= code_for('do') %>
539 537
 
@@ -980,7 +978,10 @@ Expressions
980 978
       </li>
981 979
       <li>
982 980
         <b>satyr</b>'s <a href="http://github.com/satyr/coco">Coco</a>
983  
-        &mdash; a CoffeeScript dialect that aims to be more radical and practical.
  981
+        &mdash; An avant-garde dialect of CoffeeScript that frequently pioneers
  982
+        features and optimizations, some of which CoffeeScript later adopts.
  983
+        Check out the <a href="https://github.com/satyr/coco/wiki/additions">list of additions</a>
  984
+        to the language.
984 985
       </li>
985 986
       <li>
986 987
         <b>yeungda</b>'s <a href="http://github.com/yeungda/jcoffeescript">JCoffeeScript</a>
@@ -1089,6 +1090,20 @@ Expressions
1089 1090
     </h2>
1090 1091
 
1091 1092
     <p>
  1093
+      <b class="header" style="margin-top: 20px;">1.0.0
  1094
+        <span class="timestamp"> &ndash; <small>Dec 24, 2010</small></span>
  1095
+      </b>
  1096
+      CoffeeScript loops no longer try to preserve block scope when functions
  1097
+      are being generated within the loop body. Instead, you can use the
  1098
+      <tt>do</tt> keyword to create a convenient closure wrapper.
  1099
+      Added a <tt>--nodejs</tt> flag for passing through options directly
  1100
+      to the <tt>node</tt> executable.
  1101
+      Better behavior around the use of pure statements within expressions.
  1102
+      Fixed inclusive slicing through <tt>-1</tt>, for all browsers, and splicing
  1103
+      with arbitrary expressions as endpoints.
  1104
+    </p>
  1105
+
  1106
+    <p>
1092 1107
       <b class="header" style="margin-top: 20px;">0.9.6
1093 1108
         <span class="timestamp"> &ndash; <small>Dec 6, 2010</small></span>
1094 1109
       </b>
@@ -1534,7 +1549,11 @@ Expressions
1534 1549
       window.compiledJS = ''
1535 1550
       try
1536 1551
         window.compiledJS = CoffeeScript.compile source, bare: on
1537  
-        $('#repl_results').text window.compiledJS
  1552
+        el = $('#repl_results')[0]
  1553
+        if el.innerText
  1554
+          el.innerText = window.compiledJS
  1555
+        else
  1556
+          $(el).text window.compiledJS
1538 1557
         $('#error').hide()
1539 1558
       catch error
1540 1559
         $('#error').text(error.message).show()
2  documentation/js/block_comment.js
... ...
@@ -1,4 +1,4 @@
1 1
 /*
2  
-CoffeeScript Compiler v0.9.6
  2
+CoffeeScript Compiler v1.0.0
3 3
 Released under the MIT License
4 4
 */
4  extras/coffee-script.js
2 additions, 2 deletions not shown
166  index.html
@@ -60,7 +60,7 @@
60 60
           <div id="repl_source_wrap">
61 61
             <textarea id="repl_source" rows="100">alert "Hello CoffeeScript!"</textarea>
62 62
           </div>
63  
-          <pre id="repl_results"></pre>
  63
+          <div id="repl_results_wrap"><pre id="repl_results"></pre></div>
64 64
           <div class="minibutton dark run">Run</div>
65 65
           <br class="clear" />
66 66
         </div>
@@ -109,7 +109,7 @@
109 109
 
110 110
     <p>
111 111
       <b>Latest Version:</b>
112  
-      <a href="http://github.com/jashkenas/coffee-script/tarball/0.9.6">0.9.6</a>
  112
+      <a href="http://github.com/jashkenas/coffee-script/tarball/1.0.0">1.0.0</a>
113 113
     </p>
114 114
 
115 115
     <h2>
@@ -747,67 +747,8 @@
747 747
 
748 748
     <p>
749 749
       <span id="loops" class="bookmark"></span>
750  
-      <b class="header">Loops</b>
751  
-      The only low-level loop that CoffeeScript provides is the <b>while</b> loop. The
752  
-      main difference from JavaScript is that the <b>while</b> loop can be used
753  
-      as an expression, returning an array containing the result of each iteration
754  
-      through the loop.
755  
-    </p>
756  
-    <div class='code'><pre class="idle"><span class="Comment"><span class="Comment">#</span> Econ 101</span>
757  
-<span class="Keyword">if</span> <span class="Variable">this</span>.studyingEconomics
758  
-  buy()  <span class="Keyword">while</span> supply <span class="Keyword">&gt;</span> demand
759  
-  sell() <span class="Keyword">until</span> supply <span class="Keyword">&gt;</span> demand
760  
-
761  
-<span class="Comment"><span class="Comment">#</span> Nursery Rhyme</span>
762  
-num <span class="Keyword">=</span> <span class="Number">6</span>
763  
-lyrics <span class="Keyword">=</span> <span class="Keyword">while</span> num <span class="Keyword">-</span><span class="Keyword">=</span> <span class="Number">1</span>
764  
-  num <span class="Keyword">+</span> <span class="String"><span class="String">&quot;</span> little monkeys, jumping on the bed.</span>
765  
-<span class="String">    One fell out and bumped his head.<span class="String">&quot;</span></span>
766  
-</pre><pre class="idle"><span class="Storage">var</span> lyrics, num;
767  
-<span class="Keyword">if</span> (<span class="Variable">this</span>.studyingEconomics) {
768  
-  <span class="Keyword">while</span> (supply <span class="Keyword">&gt;</span> demand) {
769  
-    buy();
770  
-  }
771  
-  <span class="Keyword">while</span> (<span class="Keyword">!</span>(supply <span class="Keyword">&gt;</span> demand)) {
772  
-    sell();
773  
-  }
774  
-}
775  
-num <span class="Keyword">=</span> <span class="Number">6</span>;
776  
-lyrics <span class="Keyword">=</span> (<span class="Storage">function</span>() {
777  
-  <span class="Storage">var</span> _results;
778  
-  _results <span class="Keyword">=</span> [];
779  
-  <span class="Keyword">while</span> (num <span class="Keyword">-</span><span class="Keyword">=</span> <span class="Number">1</span>) {
780  
-    _results.<span class="LibraryFunction">push</span>(num <span class="Keyword">+</span> <span class="String"><span class="String">&quot;</span> little monkeys, jumping on the bed.    One fell out and bumped his head.<span class="String">&quot;</span></span>);
781  
-  }
782  
-  <span class="Keyword">return</span> _results;
783  
-})();
784  
-</pre><script>window.example9 = "# Econ 101\nif this.studyingEconomics\n  buy()  while supply > demand\n  sell() until supply > demand\n\n# Nursery Rhyme\nnum = 6\nlyrics = while num -= 1\n  num + \" little monkeys, jumping on the bed.\n    One fell out and bumped his head.\"\n\nalert lyrics.join(\"\\n\")"</script><div class='minibutton load' onclick='javascript: loadConsole(example9);'>load</div><div class='minibutton ok' onclick='javascript: var lyrics, num;
785  
-if (this.studyingEconomics) {
786  
-  while (supply > demand) {
787  
-    buy();
788  
-  }
789  
-  while (!(supply > demand)) {
790  
-    sell();
791  
-  }
792  
-}
793  
-num = 6;
794  
-lyrics = (function() {
795  
-  var _results;
796  
-  _results = [];
797  
-  while (num -= 1) {
798  
-    _results.push(num + " little monkeys, jumping on the bed.    One fell out and bumped his head.");
799  
-  }
800  
-  return _results;
801  
-})();;alert(lyrics.join("\n"));'>run: lyrics.join("\n")</div><br class='clear' /></div>
802  
-    <p>
803  
-      For readability, the <b>until</b> keyword is equivalent to <tt>while not</tt>,
804  
-      and the <b>loop</b> keyword is equivalent to <tt>while true</tt>.
805  
-    </p>
806  
-
807  
-    <p>
808  
-      <span id="comprehensions" class="bookmark"></span>
809  
-      <b class="header">Comprehensions</b>
810  
-      Hopefully, the majority of your loops can be implemented with <b>comprehensions</b>
  750
+      <b class="header">Loops and Comprehensions</b>
  751
+      Most of the loops you'll write in CoffeeScript will be <b>comprehensions</b>
811 752
       over arrays, objects, and ranges. Comprehensions replace (and compile into)
812 753
       <b>for</b> loops, with optional guard clauses and the value of the current array index.
813 754
       Unlike for loops, array comprehensions are expressions, and can be returned
@@ -822,7 +763,7 @@
822 763
   food <span class="Keyword">=</span> _ref[_i];
823 764
   eat(food);
824 765
 }
825  
-</pre><script>window.example10 = "# Eat lunch.\neat food for food in ['toast', 'cheese', 'wine']\n"</script><div class='minibutton load' onclick='javascript: loadConsole(example10);'>load</div><br class='clear' /></div>
  766
+</pre><script>window.example9 = "# Eat lunch.\neat food for food in ['toast', 'cheese', 'wine']\n"</script><div class='minibutton load' onclick='javascript: loadConsole(example9);'>load</div><br class='clear' /></div>
826 767
     <p>
827 768
       If you know the start and end of your loop, or would like to step through
828 769
       in fixed-size increments, you can use a range to specify the start and
@@ -839,7 +780,7 @@
839 780
   }
840 781
   <span class="Keyword">return</span> _results;
841 782
 })();
842  
-</pre><script>window.example11 = "countdown = (num for num in [10..1])\n\nalert countdown"</script><div class='minibutton load' onclick='javascript: loadConsole(example11);'>load</div><div class='minibutton ok' onclick='javascript: var countdown, num;
  783
+</pre><script>window.example10 = "countdown = (num for num in [10..1])\n\nalert countdown"</script><div class='minibutton load' onclick='javascript: loadConsole(example10);'>load</div><div class='minibutton ok' onclick='javascript: var countdown, num;
843 784
 countdown = (function() {
844 785
   var _results;
845 786
   _results = [];
@@ -886,7 +827,7 @@
886 827
   }
887 828
   <span class="Keyword">return</span> _results;
888 829
 })();
889  
-</pre><script>window.example12 = "yearsOld = max: 10, ida: 9, tim: 11\n\nages = for child, age of yearsOld\n  child + \" is \" + age\n\nalert ages.join(\", \")"</script><div class='minibutton load' onclick='javascript: loadConsole(example12);'>load</div><div class='minibutton ok' onclick='javascript: var age, ages, child, yearsOld;
  830
+</pre><script>window.example11 = "yearsOld = max: 10, ida: 9, tim: 11\n\nages = for child, age of yearsOld\n  child + \" is \" + age\n\nalert ages.join(\", \")"</script><div class='minibutton load' onclick='javascript: loadConsole(example11);'>load</div><div class='minibutton ok' onclick='javascript: var age, ages, child, yearsOld;
890 831
 yearsOld = {
891 832
   max: 10,
892 833
   ida: 9,
@@ -908,13 +849,70 @@
908 849
       <tt>for own key, value of object</tt>
909 850
     </p>
910 851
     <p>
  852
+      The only low-level loop that CoffeeScript provides is the <b>while</b> loop. The
  853
+      main difference from JavaScript is that the <b>while</b> loop can be used
  854
+      as an expression, returning an array containing the result of each iteration
  855
+      through the loop.
  856
+    </p>
  857
+    <div class='code'><pre class="idle"><span class="Comment"><span class="Comment">#</span> Econ 101</span>
  858
+<span class="Keyword">if</span> <span class="Variable">this</span>.studyingEconomics
  859
+  buy()  <span class="Keyword">while</span> supply <span class="Keyword">&gt;</span> demand
  860
+  sell() <span class="Keyword">until</span> supply <span class="Keyword">&gt;</span> demand
  861
+
  862
+<span class="Comment"