Comparing changes
Open a pull request
|
|
jashkenas |
Issue #602. Adding JS's Bitwise Assignment operators.
|
398ec3b
|
|
|
jashkenas |
removing bound functions from the Rewriter.
|
ac752a4
|
|||
|
|
jashkenas |
Fixes Issue #603 -- a longstanding precedence issue involving prefix …
…vs postfix if and unless, involving using the entire single-line if statment as an expression. |
ba02ebc
|
|||
|
|
jashkenas |
Fixing implicit object literals with leading string keys.
|
2ec857e
|
|||
|
|
jashkenas |
Fixes Issue #574 ... number keys in implicit object literals.
|
d704afa
|
|||
|
|
jashkenas |
Reduced the time it takes to build the grammar from 80 seconds to 15,…
… by consolidating Operation terminals by precedence level. |
8c45aa4
|
|||
|
|
jashkenas |
Adding support for compound assignment to indented implicit objects.
|
fd6e9a1
|
|||
|
|
jashkenas |
fixing string interpolation docco.
|
083500f
|
|||
|
|
StanAngeloff |
Allow required files to change the input and output of compiled files.
|
d30c8b3
|
|
|
jashkenas |
allowing more flexible whitespace-started regexes. You have to wrap '…
…em in parens or assign to 'em, but it's better than nothing. |
1eebbfe
|
|
|
StanAngeloff |
'-r' should work with $NODE_PATH as well (where previously it was an …
…absolute/relative path) |
01cd547
|
|
|
jashkenas |
Revert "Fixes Issue #618. Close implicit arguments in the middle of p…
…aram lists." This reverts commit 474c372. |
098caa9
|
|||
|
|
jashkenas |
Adding a test for issue #631.
|
24f1174
|
|||
|
|
jashkenas |
Disallowing Splats outside of ParamLists and ArgLists ... where they …
…belong. This is in anticipation of the next commit... |
bf6bafa
|
|||
|
|
jashkenas |
Issue #621. Added the ability to leave the start and end index off of…
… arrays. list[5..] is now valid CoffeeScript, slicing to the end of the array. |
4ddd65a
|
|||
|
|
jashkenas |
Using unbounded ranges in a couple spots in the compiler.
|
2e59cc4
|
|
|
jashkenas |
Updating contributors in README.
|
6ed33fc
|
|
|
jashkenas |
Updating Underscore to 1.1.0, fixing a hasOwnProperty glitch in Scope…
…, and a double-semicolon bug in ParentheticalNode. |
87693d8
|
|||
|
|
jashkenas |
Issue #633. 'not instanceof'
|
13adc44
|
|||
|
|
jashkenas |
Issue #572. Block comments now compile to // for aesthetic reasons.
|
143c4d5
|
|||
|
|
jashkenas |
Fixing the longstanding and important Issue #637. I'm glad this one g…
…ot got. |
d5d5de5
|
|||
|
|
jashkenas |
Issue #619. 'new' operator misbehavior.
|
e7834de
|
|||
|
|
jashkenas |
Revert "Issue #619. 'new' operator misbehavior."
This reverts commit e7834de. |
117204a
|
|
|
jashkenas |
updating package.json for newer NPM.
|
9fd92bf
|
|
|
jashkenas |
Issue #572. Flexible JavaScript block comments, compatible with JSDoc…
…, YUI-compressor, and Google Closure compiler preservation syntax. |
f90fac0
|
|||
|
|
jashkenas |
more tweaks to the herecomment regex.
|
b4de17d
|
|||
|
|
jashkenas |
more tweaks and futzes to block comments.
|
1b88d18
|
|||
|
|
jashkenas |
Issue #641. Rename __superClass__ to __super__
|
bd3471b
|
|||
|
|
jashkenas |
CoffeeScript 0.9.2
|
e2c46d1
|
- +1 −2 Cakefile
- +2 −0 README
- +1 −1 Rakefile
- +1 −1 documentation/coffee/block_comment.coffee
- +5 −5 documentation/coffee/strings.coffee
- +1 −1 documentation/css/docs.css
- +22 −9 documentation/docs/coffee-script.html
- +38 −35 documentation/docs/command.html
- +63 −83 documentation/docs/grammar.html
- +37 −29 documentation/docs/lexer.html
- +193 −143 documentation/docs/nodes.html
- +48 −27 documentation/docs/rewriter.html
- +1 −1 documentation/docs/scope.html
- +34 −266 documentation/docs/underscore.html
- +22 −9 documentation/index.html.erb
- +2 −2 documentation/js/aliases.js
- +1 −1 documentation/js/block_comment.js
- +1 −1 documentation/js/cake_tasks.js
- +3 −3 documentation/js/classes.js
- +1 −1 documentation/js/conditionals.js
- +1 −1 documentation/js/interpolation_expression.js
- +1 −1 documentation/js/overview.js
- +1 −1 documentation/js/soaks.js
- +6 −6 documentation/js/strings.js
- +2 −2 documentation/js/while.js
- +43 −25 examples/underscore.coffee
- +2 −2 extras/coffee-script.js
- +44 −0 extras/jsl.conf
- +65 −52 index.html
- +3 −3 lib/cake.js
- +38 −17 lib/coffee-script.js
- +47 −45 lib/command.js
- +50 −79 lib/grammar.js
- +4 −4 lib/helpers.js
- +78 −44 lib/lexer.js
- +207 −141 lib/nodes.js
- +4 −4 lib/optparse.js
- +186 −214 lib/parser.js
- +78 −43 lib/rewriter.js
- +5 −5 lib/scope.js
- +5 −1 package.json
- +23 −10 src/coffee-script.coffee
- +38 −35 src/command.coffee
- +46 −63 src/grammar.coffee
- +52 −26 src/lexer.coffee
- +144 −94 src/nodes.coffee
- +46 −19 src/rewriter.coffee
- +1 −1 src/scope.coffee
- +15 −2 test/test_blocks.coffee
- +10 −2 test/test_classes.coffee
- +12 −1 test/test_existence.coffee
- +30 −1 test/test_if.coffee
- +27 −4 test/test_literals.coffee
- +43 −0 test/test_operations.coffee
- +17 −0 test/test_ranges_slices_and_splices.coffee
- +5 −0 test/test_regexps.coffee
| @@ -97,10 +97,9 @@ task 'test', 'run the CoffeeScript language test suite', -> | ||
| passedTests = failedTests = 0 | ||
| startTime = new Date | ||
| originalOk = ok | ||
| - helpers.extend global, { | ||
| + helpers.extend global, | ||
| ok: (args...) -> passedTests += 1; originalOk(args...) | ||
| CoffeeScript: CoffeeScript | ||
| - } | ||
| process.on 'exit', -> | ||
| time = ((new Date - startTime) / 1000).toFixed(2) | ||
| message = "passed #{passedTests} tests in #{time} seconds#{reset}" | ||
| @@ -56,10 +56,12 @@ | ||
| Timothy Jones (Tesco) | ||
| Chris Lloyd (chrislloyd) | ||
| Matt Lyon (mattly) | ||
| + Satoshi Murakami (satyr) | ||
| Jeff Olson (olsonjeffery) | ||
| Nathan Ostgard (noonat) | ||
| Samuel Reis (grgh) | ||
| Tom Robinson (tlrobinson) | ||
| Tim Smart (Tim-Smart) | ||
| + Sam Stephenson (sstephenson) | ||
| Dr. Nic Williams (drnic) | ||
| @@ -6,7 +6,7 @@ require 'yui/compressor' | ||
| HEADER = <<-EOS | ||
| /** | ||
| - * CoffeeScript Compiler v0.9.1 | ||
| + * CoffeeScript Compiler v0.9.2 | ||
| * http://coffeescript.org | ||
| * | ||
| * Copyright 2010, Jeremy Ashkenas | ||
| @@ -1,4 +1,4 @@ | ||
| ### | ||
| -CoffeeScript Compiler v0.9.1 | ||
| +CoffeeScript Compiler v0.9.2 | ||
| Released under the MIT License | ||
| ### |
| @@ -1,8 +1,8 @@ | ||
| mobyDick = "Call me Ishmael. Some years ago -- | ||
| -never mind how long precisely -- having little | ||
| -or no money in my purse, and nothing particular | ||
| -to interest me on shore, I thought I would sail | ||
| -about a little and see the watery part of the | ||
| -world..." | ||
| + never mind how long precisely -- having little | ||
| + or no money in my purse, and nothing particular | ||
| + to interest me on shore, I thought I would sail | ||
| + about a little and see the watery part of the | ||
| + world..." | ||
| @@ -15,7 +15,7 @@ a { | ||
| color: #000055; | ||
| } | ||
| h1, h2, h3, h4, h5, h6 { | ||
| - margin-top: 40px; | ||
| + margin-top: 50px; | ||
| } | ||
| br.clear { | ||
| height: 0; | ||
| @@ -16,7 +16,7 @@ | ||
| <span class="k">this</span><span class="p">.</span><span class="nv">exports = </span><span class="k">this</span><span class="p">.</span><span class="nv">CoffeeScript = </span><span class="p">{}</span> | ||
| <span class="nv">Lexer = </span><span class="k">this</span><span class="p">.</span><span class="nx">Lexer</span> | ||
| <span class="nv">parser = </span><span class="k">this</span><span class="p">.</span><span class="nx">parser</span> | ||
| - <span class="nv">helpers = </span><span class="k">this</span><span class="p">.</span><span class="nx">helpers</span></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="octowrap"> <a class="octothorpe" href="#section-3">#</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">'0.9.1'</span></pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="octowrap"> <a class="octothorpe" href="#section-4">#</a> </div> <p>Instantiate a Lexer for our use here.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">lexer = </span><span class="k">new</span> <span class="nx">Lexer</span></pre></div> </td> </tr> <tr id="section-5"> <td class="docs"> <div class="octowrap"> <a class="octothorpe" href="#section-5">#</a> </div> <p>Compile a string of CoffeeScript code to JavaScript, using the Coffee/Jison | ||
| + <span class="nv">helpers = </span><span class="k">this</span><span class="p">.</span><span class="nx">helpers</span></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="octowrap"> <a class="octothorpe" href="#section-3">#</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">'0.9.2'</span></pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="octowrap"> <a class="octothorpe" href="#section-4">#</a> </div> <p>Instantiate a Lexer for our use here.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">lexer = </span><span class="k">new</span> <span class="nx">Lexer</span></pre></div> </td> </tr> <tr id="section-5"> <td class="docs"> <div class="octowrap"> <a class="octothorpe" href="#section-5">#</a> </div> <p>Compile a string of CoffeeScript code to JavaScript, using the Coffee/Jison | ||
| 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="nx">options</span><span class="p">)</span> <span class="o">-></span> | ||
| <span class="nx">options</span> <span class="o">or=</span> <span class="p">{}</span> | ||
| <span class="k">try</span> | ||
| @@ -45,15 +45,28 @@ | ||
| <span class="vi">@tokens = </span><span class="nx">tokens</span> | ||
| <span class="vi">@pos = </span><span class="mi">0</span> | ||
| <span class="nx">upcomingInput</span><span class="o">:</span> <span class="o">-></span> <span class="s2">""</span></pre></div> </td> </tr> <tr id="section-10"> <td class="docs"> <div class="octowrap"> <a class="octothorpe" href="#section-10">#</a> </div> <p>Activate CoffeeScript in the browser by having it compile and evaluate | ||
| -all script tags with a content-type of <code>text/coffeescript</code>. This happens | ||
| -on page load. Unfortunately, the text contents of remote scripts cannot be | ||
| -accessed from the browser, so only inline script tags will work.</p> </td> <td class="code"> <div class="highlight"><pre><span class="k">if</span> <span class="nb">document</span><span class="o">?</span> <span class="o">and</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementsByTagName</span> | ||
| +all script tags with a content-type of <code>text/coffeescript</code>. | ||
| +This happens on page load.</p> </td> <td class="code"> <div class="highlight"><pre><span class="k">if</span> <span class="nb">document</span><span class="o">?</span><span class="p">.</span><span class="nx">getElementsByTagName</span> | ||
| + <span class="nv">grind = </span><span class="p">(</span><span class="nx">coffee</span><span class="p">)</span> <span class="o">-></span> | ||
| + <span class="nx">setTimeout</span> <span class="nx">exports</span><span class="p">.</span><span class="nx">compile</span> <span class="nx">coffee</span> | ||
| + <span class="nv">grindRemote = </span><span class="p">(</span><span class="nx">url</span><span class="p">)</span> <span class="o">-></span> | ||
| + <span class="nv">xhr = </span><span class="k">new</span> <span class="p">(</span><span class="nb">window</span><span class="p">.</span><span class="nx">ActiveXObject</span> <span class="o">or</span> <span class="nx">XMLHttpRequest</span><span class="p">)(</span><span class="s1">'Microsoft.XMLHTTP'</span><span class="p">)</span> | ||
| + <span class="nx">xhr</span><span class="p">.</span><span class="nx">open</span> <span class="s1">'GET'</span><span class="p">,</span> <span class="nx">url</span><span class="p">,</span> <span class="kc">true</span> | ||
| + <span class="nx">xhr</span><span class="p">.</span><span class="nx">overrideMimeType</span> <span class="s1">'text/plain'</span> <span class="k">if</span> <span class="s1">'overrideMimeType'</span> <span class="k">of</span> <span class="nx">xhr</span> | ||
| + <span class="nv">xhr.onreadystatechange = </span><span class="o">-></span> | ||
| + <span class="nx">grind</span> <span class="nx">xhr</span><span class="p">.</span><span class="nx">responseText</span> <span class="k">if</span> <span class="nx">xhr</span><span class="p">.</span><span class="nx">readyState</span> <span class="o">is</span> <span class="mi">4</span> | ||
| + <span class="nx">xhr</span><span class="p">.</span><span class="nx">send</span> <span class="kc">null</span> | ||
| <span class="nv">processScripts = </span><span class="o">-></span> | ||
| - <span class="k">for</span> <span class="nx">tag</span> <span class="k">in</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementsByTagName</span><span class="p">(</span><span class="s1">'script'</span><span class="p">)</span> <span class="k">when</span> <span class="nx">tag</span><span class="p">.</span><span class="nx">type</span> <span class="o">is</span> <span class="s1">'text/coffeescript'</span> | ||
| - <span class="nb">eval</span> <span class="nx">exports</span><span class="p">.</span><span class="nx">compile</span> <span class="nx">tag</span><span class="p">.</span><span class="nx">innerHTML</span> | ||
| + <span class="k">for</span> <span class="nx">script</span> <span class="k">in</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementsByTagName</span> <span class="s1">'script'</span> | ||
| + <span class="k">if</span> <span class="nx">script</span><span class="p">.</span><span class="nx">type</span> <span class="o">is</span> <span class="s1">'text/coffeescript'</span> | ||
| + <span class="k">if</span> <span class="nx">script</span><span class="p">.</span><span class="nx">src</span> | ||
| + <span class="nx">grindRemote</span> <span class="nx">script</span><span class="p">.</span><span class="nx">src</span> | ||
| + <span class="k">else</span> | ||
| + <span class="nx">grind</span> <span class="nx">script</span><span class="p">.</span><span class="nx">innerHTML</span> | ||
| + <span class="kc">null</span> | ||
| <span class="k">if</span> <span class="nb">window</span><span class="p">.</span><span class="nx">addEventListener</span> | ||
| - <span class="nb">window</span><span class="p">.</span><span class="nx">addEventListener</span> <span class="s1">'load'</span><span class="p">,</span> <span class="nx">processScripts</span><span class="p">,</span> <span class="kc">false</span> | ||
| - <span class="k">else</span> <span class="k">if</span> <span class="nb">window</span><span class="p">.</span><span class="nx">attachEvent</span> | ||
| - <span class="nb">window</span><span class="p">.</span><span class="nx">attachEvent</span> <span class="s1">'onload'</span><span class="p">,</span> <span class="nx">processScripts</span> | ||
| + <span class="nx">addEventListener</span> <span class="s1">'DOMContentLoaded'</span><span class="p">,</span> <span class="nx">processScripts</span><span class="p">,</span> <span class="kc">false</span> | ||
| + <span class="k">else</span> | ||
| + <span class="nx">attachEvent</span> <span class="s1">'onload'</span><span class="p">,</span> <span class="nx">processScripts</span> | ||
| </pre></div> </td> </tr> </tbody> </table> </div> </body> </html> | ||
Showing you all comments on commits in this comparison.
|
This is fantastic! I wish I had a working Jison from |
|
I just updated my NPM'd Jison to the latest (0.1.21), and it compiles fine for me:
|
|
I just get |
|
Ingenious! This was a really good idea, and solved most problems people will run into with white-space-leading regexes. |
|
You want to return |
|
I disagree strongly with this. Returning the value of the global |
|
Let's talk about it sometime on Needing to generate an undefined value with
... or what have you. There's little in JavaScript that isn't mutable. Special care about |