1
0
Fork 0
mirror of https://github.com/jashkenas/coffeescript.git synced 2022-11-09 12:23:24 -05:00

Remove hyphen in coffee-script

This commit is contained in:
Geoffrey 2017-02-12 17:00:05 -08:00
parent d2e94c6ebd
commit 4cc701a9da
63 changed files with 129 additions and 129 deletions

View file

@ -4,6 +4,6 @@
* Before sending a pull request for a feature, be sure to have [tests](https://github.com/jashkenas/coffeescript/tree/master/test). * Before sending a pull request for a feature, be sure to have [tests](https://github.com/jashkenas/coffeescript/tree/master/test).
* Use the same coding style as the rest of the [codebase](https://github.com/jashkenas/coffeescript/tree/master/src). If you're just getting started with CoffeeScript, there's a nice [style guide](https://github.com/polarmobile/coffeescript-style-guide). * Use the same coding style as the rest of the [codebase](https://github.com/jashkenas/coffeescript/tree/master/src). If youre just getting started with CoffeeScript, theres a nice [style guide](https://github.com/polarmobile/coffeescript-style-guide).
* In your pull request, do not add documentation to `index.html` or re-build the minified `coffee-script.js` file. We'll do those things before cutting a new release. * In your pull request, do not add documentation to `index.html` or re-build the minified `coffeescript.js` file. Well do those things before cutting a new release.

View file

@ -2,8 +2,8 @@ fs = require 'fs'
path = require 'path' path = require 'path'
_ = require 'underscore' _ = require 'underscore'
{ spawn, exec, execSync } = require 'child_process' { spawn, exec, execSync } = require 'child_process'
CoffeeScript = require './lib/coffee-script' CoffeeScript = require './lib/coffeescript'
helpers = require './lib/coffee-script/helpers' helpers = require './lib/coffeescript/helpers'
# ANSI Terminal Colors. # ANSI Terminal Colors.
bold = red = green = reset = '' bold = red = green = reset = ''
@ -31,7 +31,7 @@ majorVersion = parseInt CoffeeScript.VERSION.split('.')[0], 10
build = (cb) -> build = (cb) ->
files = fs.readdirSync 'src' files = fs.readdirSync 'src'
files = ('src/' + file for file in files when file.match(/\.(lit)?coffee$/)) files = ('src/' + file for file in files when file.match(/\.(lit)?coffee$/))
run ['-c', '-o', 'lib/coffee-script'].concat(files), cb run ['-c', '-o', 'lib/coffeescript'].concat(files), cb
# Run a CoffeeScript through our node/coffee interpreter. # Run a CoffeeScript through our node/coffee interpreter.
run = (args, cb) -> run = (args, cb) ->
@ -49,9 +49,9 @@ option '-p', '--prefix [DIR]', 'set the installation prefix for `cake install`'
task 'install', 'install CoffeeScript into /usr/local (or --prefix)', (options) -> task 'install', 'install CoffeeScript into /usr/local (or --prefix)', (options) ->
base = options.prefix or '/usr/local' base = options.prefix or '/usr/local'
lib = "#{base}/lib/coffee-script" lib = "#{base}/lib/coffeescript"
bin = "#{base}/bin" bin = "#{base}/bin"
node = "~/.node_libraries/coffee-script" node = "~/.node_libraries/coffeescript"
console.log "Installing CoffeeScript to #{lib}" console.log "Installing CoffeeScript to #{lib}"
console.log "Linking to #{node}" console.log "Linking to #{node}"
console.log "Linking 'coffee' to #{bin}/coffee" console.log "Linking 'coffee' to #{bin}/coffee"
@ -61,7 +61,7 @@ task 'install', 'install CoffeeScript into /usr/local (or --prefix)', (options)
"ln -sfn #{lib}/bin/coffee #{bin}/coffee" "ln -sfn #{lib}/bin/coffee #{bin}/coffee"
"ln -sfn #{lib}/bin/cake #{bin}/cake" "ln -sfn #{lib}/bin/cake #{bin}/cake"
"mkdir -p ~/.node_libraries" "mkdir -p ~/.node_libraries"
"ln -sfn #{lib}/lib/coffee-script #{node}" "ln -sfn #{lib}/lib/coffeescript #{node}"
].join(' && '), (err, stdout, stderr) -> ].join(' && '), (err, stdout, stderr) ->
if err then console.log stderr.trim() else log 'done', green if err then console.log stderr.trim() else log 'done', green
) )
@ -72,7 +72,7 @@ task 'build', 'build the CoffeeScript language from source', build
task 'build:full', 'rebuild the source twice, and run the tests', -> task 'build:full', 'rebuild the source twice, and run the tests', ->
build -> build ->
build -> build ->
csPath = './lib/coffee-script' csPath = './lib/coffeescript'
csDir = path.dirname require.resolve csPath csDir = path.dirname require.resolve csPath
for mod of require.cache when csDir is mod[0 ... csDir.length] for mod of require.cache when csDir is mod[0 ... csDir.length]
@ -85,7 +85,7 @@ task 'build:full', 'rebuild the source twice, and run the tests', ->
task 'build:parser', 'rebuild the Jison parser (run build first)', -> task 'build:parser', 'rebuild the Jison parser (run build first)', ->
helpers.extend global, require 'util' helpers.extend global, require 'util'
require 'jison' require 'jison'
parser = require('./lib/coffee-script/grammar').parser.generate() parser = require('./lib/coffeescript/grammar').parser.generate()
# Patch Jisons output, until https://github.com/zaach/jison/pull/339 is accepted, # Patch Jisons output, until https://github.com/zaach/jison/pull/339 is accepted,
# to ensure that require('fs') is only called where it exists. # to ensure that require('fs') is only called where it exists.
parser = parser.replace "var source = require('fs')", """ parser = parser.replace "var source = require('fs')", """
@ -93,7 +93,7 @@ task 'build:parser', 'rebuild the Jison parser (run build first)', ->
var fs = require('fs'); var fs = require('fs');
if (typeof fs !== 'undefined' && fs !== null) if (typeof fs !== 'undefined' && fs !== null)
source = fs""" source = fs"""
fs.writeFileSync 'lib/coffee-script/parser.js', parser fs.writeFileSync 'lib/coffeescript/parser.js', parser
task 'build:browser', 'rebuild the merged script for inclusion in the browser', -> task 'build:browser', 'rebuild the merged script for inclusion in the browser', ->
@ -110,11 +110,11 @@ task 'build:browser', 'rebuild the merged script for inclusion in the browser',
return module.exports; return module.exports;
})(); })();
""" """
for name in ['helpers', 'rewriter', 'lexer', 'parser', 'scope', 'nodes', 'sourcemap', 'coffee-script', 'browser'] for name in ['helpers', 'rewriter', 'lexer', 'parser', 'scope', 'nodes', 'sourcemap', 'coffeescript', 'browser']
code += """ code += """
require['./#{name}'] = (function() { require['./#{name}'] = (function() {
var exports = {}, module = {exports: exports}; var exports = {}, module = {exports: exports};
#{fs.readFileSync "lib/coffee-script/#{name}.js"} #{fs.readFileSync "lib/coffeescript/#{name}.js"}
return module.exports; return module.exports;
})(); })();
""" """
@ -123,7 +123,7 @@ task 'build:browser', 'rebuild the merged script for inclusion in the browser',
var CoffeeScript = function() { var CoffeeScript = function() {
function require(path){ return require[path]; } function require(path){ return require[path]; }
#{code} #{code}
return require['./coffee-script']; return require['./coffeescript'];
}(); }();
if (typeof define === 'function' && define.amd) { if (typeof define === 'function' && define.amd) {
@ -141,7 +141,7 @@ task 'build:browser', 'rebuild the merged script for inclusion in the browser',
] ]
outputFolder = "docs/v#{majorVersion}/browser-compiler" outputFolder = "docs/v#{majorVersion}/browser-compiler"
fs.mkdirSync outputFolder unless fs.existsSync outputFolder fs.mkdirSync outputFolder unless fs.existsSync outputFolder
fs.writeFileSync "#{outputFolder}/coffee-script.js", header + '\n' + code fs.writeFileSync "#{outputFolder}/coffeescript.js", header + '\n' + code
console.log "built ... running browser tests:" console.log "built ... running browser tests:"
invoke 'test:browser' invoke 'test:browser'
@ -272,8 +272,8 @@ task 'doc:source', 'rebuild the annotated source documentation', ->
task 'bench', 'quick benchmark of compilation time', -> task 'bench', 'quick benchmark of compilation time', ->
{Rewriter} = require './lib/coffee-script/rewriter' {Rewriter} = require './lib/coffeescript/rewriter'
sources = ['coffee-script', 'grammar', 'helpers', 'lexer', 'nodes', 'rewriter'] sources = ['coffeescript', 'grammar', 'helpers', 'lexer', 'nodes', 'rewriter']
coffee = sources.map((name) -> fs.readFileSync "src/#{name}.coffee").join '\n' coffee = sources.map((name) -> fs.readFileSync "src/#{name}.coffee").join '\n'
litcoffee = fs.readFileSync("src/scope.litcoffee").toString() litcoffee = fs.readFileSync("src/scope.litcoffee").toString()
fmt = (ms) -> " #{bold}#{ " #{ms}".slice -4 }#{reset} ms" fmt = (ms) -> " #{bold}#{ " #{ms}".slice -4 }#{reset} ms"
@ -309,7 +309,7 @@ runTests = (CoffeeScript) ->
# Convenience aliases. # Convenience aliases.
global.CoffeeScript = CoffeeScript global.CoffeeScript = CoffeeScript
global.Repl = require './lib/coffee-script/repl' global.Repl = require './lib/coffeescript/repl'
# Our test helper function for delimiting different test cases. # Our test helper function for delimiting different test cases.
global.test = (description, fn) -> global.test = (description, fn) ->
@ -365,7 +365,7 @@ task 'test', 'run the CoffeeScript language test suite', ->
task 'test:browser', 'run the test suite against the merged browser script', -> task 'test:browser', 'run the test suite against the merged browser script', ->
source = fs.readFileSync "docs/v#{majorVersion}/browser-compiler/coffee-script.js", 'utf-8' source = fs.readFileSync "docs/v#{majorVersion}/browser-compiler/coffeescript.js", 'utf-8'
result = {} result = {}
global.testingBrowser = yes global.testingBrowser = yes
(-> eval source).call result (-> eval source).call result

View file

@ -25,10 +25,10 @@ CoffeeScript is a little language that compiles into JavaScript.
If you have the node package manager, npm, installed: If you have the node package manager, npm, installed:
```shell ```shell
npm install -g coffee-script npm install -g coffeescript
``` ```
Leave off the `-g` if you don't wish to install globally. If you don't wish to use npm: Leave off the `-g` if you dont wish to install globally. If you dont wish to use npm:
```shell ```shell
git clone https://github.com/jashkenas/coffeescript.git git clone https://github.com/jashkenas/coffeescript.git
@ -53,7 +53,7 @@ For documentation, usage, and examples, see: http://coffeescript.org/
To suggest a feature or report a bug: http://github.com/jashkenas/coffeescript/issues To suggest a feature or report a bug: http://github.com/jashkenas/coffeescript/issues
If you'd like to chat, drop by #coffeescript on Freenode IRC. If youd like to chat, drop by #coffeescript on Freenode IRC.
The source repository: https://github.com/jashkenas/coffeescript.git The source repository: https://github.com/jashkenas/coffeescript.git

View file

@ -4,4 +4,4 @@ var path = require('path');
var fs = require('fs'); var fs = require('fs');
var lib = path.join(path.dirname(fs.realpathSync(__filename)), '../lib'); var lib = path.join(path.dirname(fs.realpathSync(__filename)), '../lib');
require(lib + '/coffee-script/cake').run(); require(lib + '/coffeescript/cake').run();

View file

@ -4,4 +4,4 @@ var path = require('path');
var fs = require('fs'); var fs = require('fs');
var lib = path.join(path.dirname(fs.realpathSync(__filename)), '../lib'); var lib = path.join(path.dirname(fs.realpathSync(__filename)), '../lib');
require(lib + '/coffee-script/command').run(); require(lib + '/coffeescript/command').run();

View file

@ -1,7 +1,7 @@
{ {
"name": "coffee-script", "name": "coffeescript",
"main": [ "main": [
"lib/coffee-script/coffee-script.js" "lib/coffeescript/coffeescript.js"
], ],
"description": "Unfancy JavaScript", "description": "Unfancy JavaScript",
"keywords": [ "keywords": [

View file

@ -30,8 +30,8 @@
</a> </a>
<a class="source" href="coffee-script.html"> <a class="source" href="coffeescript.html">
coffee-script.coffee coffeescript.coffee
</a> </a>
@ -123,7 +123,7 @@ We add support for loading remote Coffee scripts via <strong>XHR</strong>, and
</div> </div>
<div class="content"><div class='highlight'><pre> <div class="content"><div class='highlight'><pre>
CoffeeScript = <span class="hljs-built_in">require</span> <span class="hljs-string">'./coffee-script'</span> CoffeeScript = <span class="hljs-built_in">require</span> <span class="hljs-string">'./coffeescript'</span>
CoffeeScript.<span class="hljs-built_in">require</span> = <span class="hljs-built_in">require</span> CoffeeScript.<span class="hljs-built_in">require</span> = <span class="hljs-built_in">require</span>
compile = CoffeeScript.compile</pre></div></div> compile = CoffeeScript.compile</pre></div></div>

View file

@ -30,8 +30,8 @@
</a> </a>
<a class="source" href="coffee-script.html"> <a class="source" href="coffeescript.html">
coffee-script.coffee coffeescript.coffee
</a> </a>
@ -141,7 +141,7 @@ current directorys Cakefile.</p>
path = <span class="hljs-built_in">require</span> <span class="hljs-string">'path'</span> path = <span class="hljs-built_in">require</span> <span class="hljs-string">'path'</span>
helpers = <span class="hljs-built_in">require</span> <span class="hljs-string">'./helpers'</span> helpers = <span class="hljs-built_in">require</span> <span class="hljs-string">'./helpers'</span>
optparse = <span class="hljs-built_in">require</span> <span class="hljs-string">'./optparse'</span> optparse = <span class="hljs-built_in">require</span> <span class="hljs-string">'./optparse'</span>
CoffeeScript = <span class="hljs-built_in">require</span> <span class="hljs-string">'./coffee-script'</span></pre></div></div> CoffeeScript = <span class="hljs-built_in">require</span> <span class="hljs-string">'./coffeescript'</span></pre></div></div>
</li> </li>

View file

@ -2,7 +2,7 @@
<html> <html>
<head> <head>
<title>coffee-script.coffee</title> <title>coffeescript.coffee</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> <meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"> <meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
<link rel="stylesheet" media="all" href="docco.css" /> <link rel="stylesheet" media="all" href="docco.css" />
@ -30,8 +30,8 @@
</a> </a>
<a class="source" href="coffee-script.html"> <a class="source" href="coffeescript.html">
coffee-script.coffee coffeescript.coffee
</a> </a>
@ -103,7 +103,7 @@
<li id="title"> <li id="title">
<div class="annotation"> <div class="annotation">
<h1>coffee-script.coffee</h1> <h1>coffeescript.coffee</h1>
</div> </div>
</li> </li>
@ -141,7 +141,7 @@ SourceMap = <span class="hljs-built_in">require</span> <span class="hljs-str
<a class="pilcrow" href="#section-2">&#182;</a> <a class="pilcrow" href="#section-2">&#182;</a>
</div> </div>
<p>Require <code>package.json</code>, which is two levels above this file, as this file is <p>Require <code>package.json</code>, which is two levels above this file, as this file is
evaluated from <code>lib/coffee-script</code>.</p> evaluated from <code>lib/coffeescript</code>.</p>
</div> </div>
@ -668,7 +668,7 @@ exports.register = <span class="hljs-function">-&gt;</span> <span class="hljs-bu
<span class="hljs-keyword">for</span> ext <span class="hljs-keyword">in</span> @FILE_EXTENSIONS <span class="hljs-keyword">then</span> <span class="hljs-keyword">do</span> (ext) -&gt; <span class="hljs-keyword">for</span> ext <span class="hljs-keyword">in</span> @FILE_EXTENSIONS <span class="hljs-keyword">then</span> <span class="hljs-keyword">do</span> (ext) -&gt;
<span class="hljs-built_in">require</span>.extensions[ext] ?= <span class="hljs-function">-&gt;</span> <span class="hljs-built_in">require</span>.extensions[ext] ?= <span class="hljs-function">-&gt;</span>
<span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> Error <span class="hljs-string">""" <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> Error <span class="hljs-string">"""
Use CoffeeScript.register() or require the coffee-script/register module to require <span class="hljs-subst">#{ext}</span> files. Use CoffeeScript.register() or require the coffeescript/register module to require <span class="hljs-subst">#{ext}</span> files.
"""</span> """</span>
exports._compileFile = <span class="hljs-function"><span class="hljs-params">(filename, sourceMap = <span class="hljs-literal">no</span>, inlineMap = <span class="hljs-literal">no</span>)</span> -&gt;</span> exports._compileFile = <span class="hljs-function"><span class="hljs-params">(filename, sourceMap = <span class="hljs-literal">no</span>, inlineMap = <span class="hljs-literal">no</span>)</span> -&gt;</span>

View file

@ -30,8 +30,8 @@
</a> </a>
<a class="source" href="coffee-script.html"> <a class="source" href="coffeescript.html">
coffee-script.coffee coffeescript.coffee
</a> </a>
@ -140,7 +140,7 @@ interactive REPL.</p>
path = <span class="hljs-built_in">require</span> <span class="hljs-string">'path'</span> path = <span class="hljs-built_in">require</span> <span class="hljs-string">'path'</span>
helpers = <span class="hljs-built_in">require</span> <span class="hljs-string">'./helpers'</span> helpers = <span class="hljs-built_in">require</span> <span class="hljs-string">'./helpers'</span>
optparse = <span class="hljs-built_in">require</span> <span class="hljs-string">'./optparse'</span> optparse = <span class="hljs-built_in">require</span> <span class="hljs-string">'./optparse'</span>
CoffeeScript = <span class="hljs-built_in">require</span> <span class="hljs-string">'./coffee-script'</span> CoffeeScript = <span class="hljs-built_in">require</span> <span class="hljs-string">'./coffeescript'</span>
{spawn, exec} = <span class="hljs-built_in">require</span> <span class="hljs-string">'child_process'</span> {spawn, exec} = <span class="hljs-built_in">require</span> <span class="hljs-string">'child_process'</span>
{EventEmitter} = <span class="hljs-built_in">require</span> <span class="hljs-string">'events'</span> {EventEmitter} = <span class="hljs-built_in">require</span> <span class="hljs-string">'events'</span>
@ -214,7 +214,7 @@ useWinPathSep = path.sep <span class="hljs-keyword">is</span> <span class="hljs
[<span class="hljs-string">'-p'</span>, <span class="hljs-string">'--print'</span>, <span class="hljs-string">'print out the compiled JavaScript'</span>] [<span class="hljs-string">'-p'</span>, <span class="hljs-string">'--print'</span>, <span class="hljs-string">'print out the compiled JavaScript'</span>]
[<span class="hljs-string">'-r'</span>, <span class="hljs-string">'--require [MODULE*]'</span>, <span class="hljs-string">'require the given module before eval or REPL'</span>] [<span class="hljs-string">'-r'</span>, <span class="hljs-string">'--require [MODULE*]'</span>, <span class="hljs-string">'require the given module before eval or REPL'</span>]
[<span class="hljs-string">'-s'</span>, <span class="hljs-string">'--stdio'</span>, <span class="hljs-string">'listen for and compile scripts over stdio'</span>] [<span class="hljs-string">'-s'</span>, <span class="hljs-string">'--stdio'</span>, <span class="hljs-string">'listen for and compile scripts over stdio'</span>]
[<span class="hljs-string">'-l'</span>, <span class="hljs-string">'--literate'</span>, <span class="hljs-string">'treat stdio as literate style coffee-script'</span>] [<span class="hljs-string">'-l'</span>, <span class="hljs-string">'--literate'</span>, <span class="hljs-string">'treat stdio as literate style coffeescript'</span>]
[<span class="hljs-string">'-t'</span>, <span class="hljs-string">'--tokens'</span>, <span class="hljs-string">'print out the tokens that the lexer/rewriter produce'</span>] [<span class="hljs-string">'-t'</span>, <span class="hljs-string">'--tokens'</span>, <span class="hljs-string">'print out the tokens that the lexer/rewriter produce'</span>]
[<span class="hljs-string">'-v'</span>, <span class="hljs-string">'--version'</span>, <span class="hljs-string">'display the version number'</span>] [<span class="hljs-string">'-v'</span>, <span class="hljs-string">'--version'</span>, <span class="hljs-string">'display the version number'</span>]
[<span class="hljs-string">'-w'</span>, <span class="hljs-string">'--watch'</span>, <span class="hljs-string">'watch scripts for changes and rerun commands'</span>] [<span class="hljs-string">'-w'</span>, <span class="hljs-string">'--watch'</span>, <span class="hljs-string">'watch scripts for changes and rerun commands'</span>]

View file

@ -30,8 +30,8 @@
</a> </a>
<a class="source" href="coffee-script.html"> <a class="source" href="coffeescript.html">
coffee-script.coffee coffeescript.coffee
</a> </a>

View file

@ -30,8 +30,8 @@
</a> </a>
<a class="source" href="coffee-script.html"> <a class="source" href="coffeescript.html">
coffee-script.coffee coffeescript.coffee
</a> </a>

View file

@ -30,8 +30,8 @@
</a> </a>
<a class="source" href="coffee-script.html"> <a class="source" href="coffeescript.html">
coffee-script.coffee coffeescript.coffee
</a> </a>
@ -119,7 +119,7 @@
</div> </div>
<div class="content"><div class='highlight'><pre>exports[key] = val <span class="hljs-keyword">for</span> key, val <span class="hljs-keyword">of</span> <span class="hljs-built_in">require</span> <span class="hljs-string">'./coffee-script'</span></pre></div></div> <div class="content"><div class='highlight'><pre>exports[key] = val <span class="hljs-keyword">for</span> key, val <span class="hljs-keyword">of</span> <span class="hljs-built_in">require</span> <span class="hljs-string">'./coffeescript'</span></pre></div></div>
</li> </li>

View file

@ -30,8 +30,8 @@
</a> </a>
<a class="source" href="coffee-script.html"> <a class="source" href="coffeescript.html">
coffee-script.coffee coffeescript.coffee
</a> </a>
@ -122,7 +122,7 @@ form:</p>
<pre><code>[tag, value, locationData] <pre><code>[tag, value, locationData]
</code></pre><p>where locationData is {first_line, first_column, last_line, last_column}, which is a </code></pre><p>where locationData is {first_line, first_column, last_line, last_column}, which is a
format that can be fed directly into <a href="http://github.com/zaach/jison">Jison</a>. These format that can be fed directly into <a href="http://github.com/zaach/jison">Jison</a>. These
are read by jison in the <code>parser.lexer</code> function defined in coffee-script.coffee.</p> are read by jison in the <code>parser.lexer</code> function defined in coffeescript.coffee.</p>
</div> </div>

View file

@ -30,8 +30,8 @@
</a> </a>
<a class="source" href="coffee-script.html"> <a class="source" href="coffeescript.html">
coffee-script.coffee coffeescript.coffee
</a> </a>

View file

@ -30,8 +30,8 @@
</a> </a>
<a class="source" href="coffee-script.html"> <a class="source" href="coffeescript.html">
coffee-script.coffee coffeescript.coffee
</a> </a>

View file

@ -30,8 +30,8 @@
</a> </a>
<a class="source" href="coffee-script.html"> <a class="source" href="coffeescript.html">
coffee-script.coffee coffeescript.coffee
</a> </a>
@ -118,7 +118,7 @@
</div> </div>
<div class="content"><div class='highlight'><pre>CoffeeScript = <span class="hljs-built_in">require</span> <span class="hljs-string">'./coffee-script'</span> <div class="content"><div class='highlight'><pre>CoffeeScript = <span class="hljs-built_in">require</span> <span class="hljs-string">'./coffeescript'</span>
child_process = <span class="hljs-built_in">require</span> <span class="hljs-string">'child_process'</span> child_process = <span class="hljs-built_in">require</span> <span class="hljs-string">'child_process'</span>
helpers = <span class="hljs-built_in">require</span> <span class="hljs-string">'./helpers'</span> helpers = <span class="hljs-built_in">require</span> <span class="hljs-string">'./helpers'</span>
path = <span class="hljs-built_in">require</span> <span class="hljs-string">'path'</span></pre></div></div> path = <span class="hljs-built_in">require</span> <span class="hljs-string">'path'</span></pre></div></div>

View file

@ -30,8 +30,8 @@
</a> </a>
<a class="source" href="coffee-script.html"> <a class="source" href="coffeescript.html">
coffee-script.coffee coffeescript.coffee
</a> </a>
@ -122,7 +122,7 @@
path = <span class="hljs-built_in">require</span> <span class="hljs-string">'path'</span> path = <span class="hljs-built_in">require</span> <span class="hljs-string">'path'</span>
vm = <span class="hljs-built_in">require</span> <span class="hljs-string">'vm'</span> vm = <span class="hljs-built_in">require</span> <span class="hljs-string">'vm'</span>
nodeREPL = <span class="hljs-built_in">require</span> <span class="hljs-string">'repl'</span> nodeREPL = <span class="hljs-built_in">require</span> <span class="hljs-string">'repl'</span>
CoffeeScript = <span class="hljs-built_in">require</span> <span class="hljs-string">'./coffee-script'</span> CoffeeScript = <span class="hljs-built_in">require</span> <span class="hljs-string">'./coffeescript'</span>
{merge, updateSyntaxError} = <span class="hljs-built_in">require</span> <span class="hljs-string">'./helpers'</span> {merge, updateSyntaxError} = <span class="hljs-built_in">require</span> <span class="hljs-string">'./helpers'</span>
replDefaults = replDefaults =

View file

@ -30,8 +30,8 @@
</a> </a>
<a class="source" href="coffee-script.html"> <a class="source" href="coffeescript.html">
coffee-script.coffee coffeescript.coffee
</a> </a>

View file

@ -30,8 +30,8 @@
</a> </a>
<a class="source" href="coffee-script.html"> <a class="source" href="coffeescript.html">
coffee-script.coffee coffeescript.coffee
</a> </a>

View file

@ -30,8 +30,8 @@
</a> </a>
<a class="source" href="coffee-script.html"> <a class="source" href="coffeescript.html">
coffee-script.coffee coffeescript.coffee
</a> </a>

View file

@ -15,7 +15,7 @@ $jscomp.polyfill=function(q,ra,ua,k){if(ra){ua=$jscomp.global;q=q.split(".");for
$jscomp.polyfill("String.prototype.repeat",function(q){return q?q:function(q){var ua=$jscomp.checkStringArgs(this,null,"repeat");if(0>q||1342177279<q)throw new RangeError("Invalid count value");q|=0;for(var k="";q;)if(q&1&&(k+=ua),q>>>=1)ua+=ua;return k}},"es6-impl","es3");$jscomp.findInternal=function(q,ra,ua){q instanceof String&&(q=String(q));for(var k=q.length,xa=0;xa<k;xa++){var sa=q[xa];if(ra.call(ua,sa,xa,q))return{i:xa,v:sa}}return{i:-1,v:void 0}}; $jscomp.polyfill("String.prototype.repeat",function(q){return q?q:function(q){var ua=$jscomp.checkStringArgs(this,null,"repeat");if(0>q||1342177279<q)throw new RangeError("Invalid count value");q|=0;for(var k="";q;)if(q&1&&(k+=ua),q>>>=1)ua+=ua;return k}},"es6-impl","es3");$jscomp.findInternal=function(q,ra,ua){q instanceof String&&(q=String(q));for(var k=q.length,xa=0;xa<k;xa++){var sa=q[xa];if(ra.call(ua,sa,xa,q))return{i:xa,v:sa}}return{i:-1,v:void 0}};
$jscomp.polyfill("Array.prototype.find",function(q){return q?q:function(q,ua){return $jscomp.findInternal(this,q,ua).v}},"es6-impl","es3");$jscomp.array=$jscomp.array||{};$jscomp.iteratorFromArray=function(q,ra){$jscomp.initSymbolIterator();q instanceof String&&(q+="");var ua=0,k={next:function(){if(ua<q.length){var xa=ua++;return{value:ra(xa,q[xa]),done:!1}}k.next=function(){return{done:!0,value:void 0}};return k.next()}};k[Symbol.iterator]=function(){return k};return k}; $jscomp.polyfill("Array.prototype.find",function(q){return q?q:function(q,ua){return $jscomp.findInternal(this,q,ua).v}},"es6-impl","es3");$jscomp.array=$jscomp.array||{};$jscomp.iteratorFromArray=function(q,ra){$jscomp.initSymbolIterator();q instanceof String&&(q+="");var ua=0,k={next:function(){if(ua<q.length){var xa=ua++;return{value:ra(xa,q[xa]),done:!1}}k.next=function(){return{done:!0,value:void 0}};return k.next()}};k[Symbol.iterator]=function(){return k};return k};
$jscomp.polyfill("Array.prototype.keys",function(q){return q?q:function(){return $jscomp.iteratorFromArray(this,function(q){return q})}},"es6-impl","es3"); $jscomp.polyfill("Array.prototype.keys",function(q){return q?q:function(){return $jscomp.iteratorFromArray(this,function(q){return q})}},"es6-impl","es3");
(function(q){var ra=function(){function q(k){return q[k]}q["../../package.json"]={name:"coffee-script",description:"Unfancy JavaScript",keywords:["javascript","language","coffeescript","compiler"],author:"Jeremy Ashkenas",version:"2.0.0-alpha1",license:"MIT",engines:{node:"\x3e\x3d7.2.1"},directories:{lib:"./lib/coffee-script"},main:"./lib/coffee-script/coffee-script",bin:{coffee:"./bin/coffee",cake:"./bin/cake"},files:["bin","lib","register.js","repl.js"],preferGlobal:!0,scripts:{test:"node ./bin/cake test", (function(q){var ra=function(){function q(k){return q[k]}q["../../package.json"]={name:"coffeescript",description:"Unfancy JavaScript",keywords:["javascript","language","coffeescript","compiler"],author:"Jeremy Ashkenas",version:"2.0.0-alpha1",license:"MIT",engines:{node:"\x3e\x3d7.2.1"},directories:{lib:"./lib/coffeescript"},main:"./lib/coffeescript/coffeescript",bin:{coffee:"./bin/coffee",cake:"./bin/cake"},files:["bin","lib","register.js","repl.js"],preferGlobal:!0,scripts:{test:"node ./bin/cake test",
"test-harmony":"node --harmony ./bin/cake test"},homepage:"http://coffeescript.org",bugs:"https://github.com/jashkenas/coffeescript/issues",repository:{type:"git",url:"git://github.com/jashkenas/coffeescript.git"},devDependencies:{docco:"~0.7.0","google-closure-compiler-js":"^20170124.0.0","highlight.js":"~9.9.0",jison:"\x3e\x3d0.4.17",marked:"^0.3.6",underscore:"~1.8.3"},dependencies:{marked:"~0.3.6"}};q.marked=function(){var k={},q={exports:k};(function(){function sa(a){this.tokens=[];this.tokens.links= "test-harmony":"node --harmony ./bin/cake test"},homepage:"http://coffeescript.org",bugs:"https://github.com/jashkenas/coffeescript/issues",repository:{type:"git",url:"git://github.com/jashkenas/coffeescript.git"},devDependencies:{docco:"~0.7.0","google-closure-compiler-js":"^20170124.0.0","highlight.js":"~9.9.0",jison:"\x3e\x3d0.4.17",marked:"^0.3.6",underscore:"~1.8.3"},dependencies:{marked:"~0.3.6"}};q.marked=function(){var k={},q={exports:k};(function(){function sa(a){this.tokens=[];this.tokens.links=
{};this.options=a||B.defaults;this.rules=z.normal;this.options.gfm&&(this.rules=this.options.tables?z.tables:z.gfm)}function ha(l,c){this.options=c||B.defaults;this.links=l;this.rules=w.normal;this.renderer=this.options.renderer||new a;this.renderer.options=this.options;if(!this.links)throw Error("Tokens array requires a `links` property.");this.options.gfm?this.rules=this.options.breaks?w.breaks:w.gfm:this.options.pedantic&&(this.rules=w.pedantic)}function a(a){this.options=a||{}}function g(l){this.tokens= {};this.options=a||B.defaults;this.rules=z.normal;this.options.gfm&&(this.rules=this.options.tables?z.tables:z.gfm)}function ha(l,c){this.options=c||B.defaults;this.links=l;this.rules=w.normal;this.renderer=this.options.renderer||new a;this.renderer.options=this.options;if(!this.links)throw Error("Tokens array requires a `links` property.");this.options.gfm?this.rules=this.options.breaks?w.breaks:w.gfm:this.options.pedantic&&(this.rules=w.pedantic)}function a(a){this.options=a||{}}function g(l){this.tokens=
[];this.token=null;this.options=l||B.defaults;this.options.renderer=this.options.renderer||new a;this.renderer=this.options.renderer;this.renderer.options=this.options}function ta(a,c){return a.replace(c?/&/g:/&(?!#?\w+;)/g,"\x26amp;").replace(/</g,"\x26lt;").replace(/>/g,"\x26gt;").replace(/"/g,"\x26quot;").replace(/'/g,"\x26#39;")}function m(a){return a.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/g,function(a,l){l=l.toLowerCase();return"colon"===l?":":"#"===l.charAt(0)?"x"===l.charAt(1)?String.fromCharCode(parseInt(l.substring(2), [];this.token=null;this.options=l||B.defaults;this.options.renderer=this.options.renderer||new a;this.renderer=this.options.renderer;this.renderer.options=this.options}function ta(a,c){return a.replace(c?/&/g:/&(?!#?\w+;)/g,"\x26amp;").replace(/</g,"\x26lt;").replace(/>/g,"\x26gt;").replace(/"/g,"\x26quot;").replace(/'/g,"\x26#39;")}function m(a){return a.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/g,function(a,l){l=l.toLowerCase();return"colon"===l?":":"#"===l.charAt(0)?"x"===l.charAt(1)?String.fromCharCode(parseInt(l.substring(2),
@ -437,20 +437,20 @@ function(a,c){var b,d;d=c.scope.root;if(a in d.utilities)return d.utilities[a];b
a.body,a.body=new I(c),a}}).call(this);return k}();q["./sourcemap"]=function(){var k={};(function(){var q=function(k){this.line=k;this.columns=[]};q.prototype.add=function(k,q,a){var g;g=q[0];q=q[1];void 0===a&&(a={});if(!this.columns[k]||!a.noReplace)return this.columns[k]={line:this.line,column:k,sourceLine:g,sourceColumn:q}};q.prototype.sourceLocation=function(k){for(var q;!((q=this.columns[k])||0>=k);)k--;return q&&[q.sourceLine,q.sourceColumn]};k=function(){var k,ha,a,g,ta=function(){this.lines= a.body,a.body=new I(c),a}}).call(this);return k}();q["./sourcemap"]=function(){var k={};(function(){var q=function(k){this.line=k;this.columns=[]};q.prototype.add=function(k,q,a){var g;g=q[0];q=q[1];void 0===a&&(a={});if(!this.columns[k]||!a.noReplace)return this.columns[k]={line:this.line,column:k,sourceLine:g,sourceColumn:q}};q.prototype.sourceLocation=function(k){for(var q;!((q=this.columns[k])||0>=k);)k--;return q&&[q.sourceLine,q.sourceColumn]};k=function(){var k,ha,a,g,ta=function(){this.lines=
[]};ta.prototype.add=function(a,c,e){e=void 0===e?{}:e;var g,k;k=c[0];c=c[1];return((g=this.lines)[k]||(g[k]=new q(k))).add(c,a,e)};ta.prototype.sourceLocation=function(a){var c,e;c=a[0];for(a=a[1];!((e=this.lines[c])||0>=c);)c--;return e&&e.sourceLocation(a)};ta.prototype.generate=function(a,c){a=void 0===a?{}:a;c=void 0===c?null:c;var e,g,k,m,q,l,D,A,G,J,p,ha,h;q=l=m=h=0;J=!1;e="";p=this.lines;k=g=0;for(D=p.length;g<D;k=++g)if(k=p[k])for(ha=k.columns,k=0,A=ha.length;k<A;k++)if(G=ha[k]){for(;h<G.line;)m= []};ta.prototype.add=function(a,c,e){e=void 0===e?{}:e;var g,k;k=c[0];c=c[1];return((g=this.lines)[k]||(g[k]=new q(k))).add(c,a,e)};ta.prototype.sourceLocation=function(a){var c,e;c=a[0];for(a=a[1];!((e=this.lines[c])||0>=c);)c--;return e&&e.sourceLocation(a)};ta.prototype.generate=function(a,c){a=void 0===a?{}:a;c=void 0===c?null:c;var e,g,k,m,q,l,D,A,G,J,p,ha,h;q=l=m=h=0;J=!1;e="";p=this.lines;k=g=0;for(D=p.length;g<D;k=++g)if(k=p[k])for(ha=k.columns,k=0,A=ha.length;k<A;k++)if(G=ha[k]){for(;h<G.line;)m=
0,J=!1,e+=";",h++;J&&(e+=",");e+=this.encodeVlq(G.column-m);m=G.column;e+=this.encodeVlq(0);e+=this.encodeVlq(G.sourceLine-l);l=G.sourceLine;e+=this.encodeVlq(G.sourceColumn-q);q=G.sourceColumn;J=!0}e={version:3,file:a.generatedFile||"",sourceRoot:a.sourceRoot||"",sources:a.sourceFiles||[""],names:[],mappings:e};a.inlineMap&&(e.sourcesContent=[c]);return e};ta.prototype.encodeVlq=function(k){var c,e;c="";for(e=(Math.abs(k)<<1)+(0>k?1:0);e||!c;)k=e&g,(e>>=a)&&(k|=ha),c+=this.encodeBase64(k);return c}; 0,J=!1,e+=";",h++;J&&(e+=",");e+=this.encodeVlq(G.column-m);m=G.column;e+=this.encodeVlq(0);e+=this.encodeVlq(G.sourceLine-l);l=G.sourceLine;e+=this.encodeVlq(G.sourceColumn-q);q=G.sourceColumn;J=!0}e={version:3,file:a.generatedFile||"",sourceRoot:a.sourceRoot||"",sources:a.sourceFiles||[""],names:[],mappings:e};a.inlineMap&&(e.sourcesContent=[c]);return e};ta.prototype.encodeVlq=function(k){var c,e;c="";for(e=(Math.abs(k)<<1)+(0>k?1:0);e||!c;)k=e&g,(e>>=a)&&(k|=ha),c+=this.encodeBase64(k);return c};
ta.prototype.encodeBase64=function(a){var c;if(!(c=k[a]))throw Error("Cannot Base64 encode value: "+a);return c};a=5;ha=1<<a;g=ha-1;k="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";return ta}()}).call(this);return k}();q["./coffee-script"]=function(){var k={};(function(){var ra,sa,ha,a,g,ta,m,c,e,x,B,z,w,l,D,A,G,J,p,ua={}.hasOwnProperty;c=q("fs");p=q("vm");D=q("path");ra=q("./lexer").Lexer;l=q("./parser").parser;x=q("./helpers");sa=q("./sourcemap");g=q("../../package.json");k.VERSION= ta.prototype.encodeBase64=function(a){var c;if(!(c=k[a]))throw Error("Cannot Base64 encode value: "+a);return c};a=5;ha=1<<a;g=ha-1;k="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";return ta}()}).call(this);return k}();q["./coffeescript"]=function(){var k={};(function(){var ra,sa,ha,a,g,ta,m,c,e,x,B,z,w,l,D,A,G,J,p,ua={}.hasOwnProperty;c=q("fs");p=q("vm");D=q("path");ra=q("./lexer").Lexer;l=q("./parser").parser;x=q("./helpers");sa=q("./sourcemap");g=q("../../package.json");k.VERSION=
g.version;k.FILE_EXTENSIONS=[".coffee",".litcoffee",".coffee.md"];k.helpers=x;ha=function(a){switch(!1){case "function"!==typeof Buffer:return Buffer.from(a).toString("base64");case "function"!==typeof btoa:return btoa(encodeURIComponent(a).replace(/%([0-9A-F]{2})/g,function(a,c){return String.fromCharCode("0x"+c)}));default:throw Error("Unable to base64 encode inline sourcemap.");}};g=function(a){return function(c,e){e=void 0===e?{}:e;try{return a.call(this,c,e)}catch(t){if("string"!==typeof c)throw t; g.version;k.FILE_EXTENSIONS=[".coffee",".litcoffee",".coffee.md"];k.helpers=x;ha=function(a){switch(!1){case "function"!==typeof Buffer:return Buffer.from(a).toString("base64");case "function"!==typeof btoa:return btoa(encodeURIComponent(a).replace(/%([0-9A-F]{2})/g,function(a,c){return String.fromCharCode("0x"+c)}));default:throw Error("Unable to base64 encode inline sourcemap.");}};g=function(a){return function(c,e){e=void 0===e?{}:e;try{return a.call(this,c,e)}catch(t){if("string"!==typeof c)throw t;
throw x.updateSyntaxError(t,c,e.filename);}}};J={};G={};k.compile=a=g(function(a,c){var e,h,g,k,n,m,p,q,A,z,D,B,P;g=x.extend;c=g({},c);m=c.sourceMap||c.inlineMap||null==c.filename;g=c.filename||"\x3canonymous\x3e";J[g]=a;m&&(z=new sa);h=w.tokenize(a,c);k=c;A=[];n=0;for(p=h.length;n<p;n++)e=h[n],"IDENTIFIER"===e[0]&&A.push(e[1]);k.referencedVars=A;if(null==c.bare||!0!==c.bare)for(k=0,n=h.length;k<n;k++)if(e=h[k],"IMPORT"===(q=e[0])||"EXPORT"===q){c.bare=!0;break}n=l.parse(h).compileToFragments(c); throw x.updateSyntaxError(t,c,e.filename);}}};J={};G={};k.compile=a=g(function(a,c){var e,h,g,k,n,m,p,q,A,z,D,B,P;g=x.extend;c=g({},c);m=c.sourceMap||c.inlineMap||null==c.filename;g=c.filename||"\x3canonymous\x3e";J[g]=a;m&&(z=new sa);h=w.tokenize(a,c);k=c;A=[];n=0;for(p=h.length;n<p;n++)e=h[n],"IDENTIFIER"===e[0]&&A.push(e[1]);k.referencedVars=A;if(null==c.bare||!0!==c.bare)for(k=0,n=h.length;k<n;k++)if(e=h[k],"IMPORT"===(q=e[0])||"EXPORT"===q){c.bare=!0;break}n=l.parse(h).compileToFragments(c);
h=0;c.header&&(h+=1);c.shiftLine&&(h+=1);e=0;q="";p=0;for(A=n.length;p<A;p++)k=n[p],m&&(k.locationData&&!/^[;\s]*$/.test(k.code)&&z.add([k.locationData.first_line,k.locationData.first_column],[h,e],{noReplace:!0}),D=x.count(k.code,"\n"),h+=D,e=D?k.code.length-(k.code.lastIndexOf("\n")+1):e+k.code.length),q+=k.code;c.header&&(e="Generated by CoffeeScript "+this.VERSION,q="// "+e+"\n"+q);m&&(P=z.generate(c,a),G[g]=z);c.inlineMap&&(a=ha(JSON.stringify(P)),g="//# sourceURL\x3d"+(null!=(B=c.filename)? h=0;c.header&&(h+=1);c.shiftLine&&(h+=1);e=0;q="";p=0;for(A=n.length;p<A;p++)k=n[p],m&&(k.locationData&&!/^[;\s]*$/.test(k.code)&&z.add([k.locationData.first_line,k.locationData.first_column],[h,e],{noReplace:!0}),D=x.count(k.code,"\n"),h+=D,e=D?k.code.length-(k.code.lastIndexOf("\n")+1):e+k.code.length),q+=k.code;c.header&&(e="Generated by CoffeeScript "+this.VERSION,q="// "+e+"\n"+q);m&&(P=z.generate(c,a),G[g]=z);c.inlineMap&&(a=ha(JSON.stringify(P)),g="//# sourceURL\x3d"+(null!=(B=c.filename)?
B:"coffeescript"),q=q+"\n"+("//# sourceMappingURL\x3ddata:application/json;base64,"+a)+"\n"+g);return c.sourceMap?{js:q,sourceMap:z,v3SourceMap:JSON.stringify(P,null,2)}:q});k.tokens=g(function(a,c){return w.tokenize(a,c)});k.nodes=g(function(a,c){return"string"===typeof a?l.parse(w.tokenize(a,c)):l.parse(a)});k.run=function(e,g){g=void 0===g?{}:g;var h,k,l;k=q.main;k.filename=process.argv[1]=g.filename?c.realpathSync(g.filename):"\x3canonymous\x3e";k.moduleCache&&(k.moduleCache={});h=null!=g.filename? B:"coffeescript"),q=q+"\n"+("//# sourceMappingURL\x3ddata:application/json;base64,"+a)+"\n"+g);return c.sourceMap?{js:q,sourceMap:z,v3SourceMap:JSON.stringify(P,null,2)}:q});k.tokens=g(function(a,c){return w.tokenize(a,c)});k.nodes=g(function(a,c){return"string"===typeof a?l.parse(w.tokenize(a,c)):l.parse(a)});k.run=function(e,g){g=void 0===g?{}:g;var h,k,l;k=q.main;k.filename=process.argv[1]=g.filename?c.realpathSync(g.filename):"\x3canonymous\x3e";k.moduleCache&&(k.moduleCache={});h=null!=g.filename?
D.dirname(c.realpathSync(g.filename)):c.realpathSync(".");k.paths=q("module")._nodeModulePaths(h);if(!x.isCoffee(k.filename)||q.extensions)e=a(e,g),e=null!=(l=e.js)?l:e;return k._compile(e,k.filename)};k.eval=function(c,e){e=void 0===e?{}:e;var h,g,k,l,m,n,x,A,z,w;if(c=c.trim()){l=null!=(m=p.Script.createContext)?m:p.createContext;m=null!=(k=p.isContext)?k:function(a){return e.sandbox instanceof l().constructor};if(l){if(null!=e.sandbox){if(m(e.sandbox))w=e.sandbox;else for(n in w=l(),m=e.sandbox, D.dirname(c.realpathSync(g.filename)):c.realpathSync(".");k.paths=q("module")._nodeModulePaths(h);if(!x.isCoffee(k.filename)||q.extensions)e=a(e,g),e=null!=(l=e.js)?l:e;return k._compile(e,k.filename)};k.eval=function(c,e){e=void 0===e?{}:e;var h,g,k,l,m,n,x,A,z,w;if(c=c.trim()){l=null!=(m=p.Script.createContext)?m:p.createContext;m=null!=(k=p.isContext)?k:function(a){return e.sandbox instanceof l().constructor};if(l){if(null!=e.sandbox){if(m(e.sandbox))w=e.sandbox;else for(n in w=l(),m=e.sandbox,
m)ua.call(m,n)&&(k=m[n],w[n]=k);w.global=w.root=w.GLOBAL=w}else w=global;w.__filename=e.filename||"eval";w.__dirname=D.dirname(w.__filename);if(w===global&&!w.module&&!w.require){h=q("module");w.module=g=new h(e.modulename||"eval");w.require=k=function(a){return h._load(a,g,!0)};g.filename=w.__filename;z=Object.getOwnPropertyNames(q);m=0;for(x=z.length;m<x;m++)A=z[m],"paths"!==A&&"arguments"!==A&&"caller"!==A&&(k[A]=q[A]);k.paths=g.paths=h._nodeModulePaths(process.cwd());k.resolve=function(a){return h._resolveFilename(a, m)ua.call(m,n)&&(k=m[n],w[n]=k);w.global=w.root=w.GLOBAL=w}else w=global;w.__filename=e.filename||"eval";w.__dirname=D.dirname(w.__filename);if(w===global&&!w.module&&!w.require){h=q("module");w.module=g=new h(e.modulename||"eval");w.require=k=function(a){return h._load(a,g,!0)};g.filename=w.__filename;z=Object.getOwnPropertyNames(q);m=0;for(x=z.length;m<x;m++)A=z[m],"paths"!==A&&"arguments"!==A&&"caller"!==A&&(k[A]=q[A]);k.paths=g.paths=h._nodeModulePaths(process.cwd());k.resolve=function(a){return h._resolveFilename(a,
g)}}}m={};for(n in e)ua.call(e,n)&&(k=e[n],m[n]=k);m.bare=!0;c=a(c,m);return w===global?p.runInThisContext(c):p.runInContext(c,w)}};k.register=function(){return q("./register")};if(q.extensions)for(A=this.FILE_EXTENSIONS,ta=function(a){var c;return null!=(c=q.extensions)[a]?c[a]:c[a]=function(){throw Error("Use CoffeeScript.register() or require the coffee-script/register module to require "+a+" files.");}},B=0,z=A.length;B<z;B++)g=A[B],ta(g);k._compileFile=function(e,g,k){g=void 0===g?!1:g;k=void 0=== g)}}}m={};for(n in e)ua.call(e,n)&&(k=e[n],m[n]=k);m.bare=!0;c=a(c,m);return w===global?p.runInThisContext(c):p.runInContext(c,w)}};k.register=function(){return q("./register")};if(q.extensions)for(A=this.FILE_EXTENSIONS,ta=function(a){var c;return null!=(c=q.extensions)[a]?c[a]:c[a]=function(){throw Error("Use CoffeeScript.register() or require the coffeescript/register module to require "+a+" files.");}},B=0,z=A.length;B<z;B++)g=A[B],ta(g);k._compileFile=function(e,g,k){g=void 0===g?!1:g;k=void 0===
k?!1:k;var h,l;l=c.readFileSync(e,"utf8");l=65279===l.charCodeAt(0)?l.substring(1):l;try{h=a(l,{filename:e,sourceMap:g,inlineMap:k,sourceFiles:[e],literate:x.isLiterate(e)})}catch(y){throw x.updateSyntaxError(y,l,e);}return h};w=new ra;l.lexer={lex:function(){var a,c;(c=l.tokens[this.pos++])?(a=c[0],this.yytext=c[1],this.yylloc=c[2],l.errorToken=c.origin||c,this.yylineno=this.yylloc.first_line):a="";return a},setInput:function(a){l.tokens=a;return this.pos=0},upcomingInput:function(){return""}};l.yy= k?!1:k;var h,l;l=c.readFileSync(e,"utf8");l=65279===l.charCodeAt(0)?l.substring(1):l;try{h=a(l,{filename:e,sourceMap:g,inlineMap:k,sourceFiles:[e],literate:x.isLiterate(e)})}catch(y){throw x.updateSyntaxError(y,l,e);}return h};w=new ra;l.lexer={lex:function(){var a,c;(c=l.tokens[this.pos++])?(a=c[0],this.yytext=c[1],this.yylloc=c[2],l.errorToken=c.origin||c,this.yylineno=this.yylloc.first_line):a="";return a},setInput:function(a){l.tokens=a;return this.pos=0},upcomingInput:function(){return""}};l.yy=
q("./nodes");l.yy.parseError=function(a,c){var e,h,g,k;g=l.errorToken;k=l.tokens;e=g[0];h=g[1];a=g[2];h=function(){switch(!1){case g!==k[k.length-1]:return"end of input";case "INDENT"!==e&&"OUTDENT"!==e:return"indentation";case "IDENTIFIER"!==e&&"NUMBER"!==e&&"INFINITY"!==e&&"STRING"!==e&&"STRING_START"!==e&&"REGEX"!==e&&"REGEX_START"!==e:return e.replace(/_START$/,"").toLowerCase();default:return x.nameWhitespaceCharacter(h)}}();return x.throwSyntaxError("unexpected "+h,a)};m=function(a,c){var e, q("./nodes");l.yy.parseError=function(a,c){var e,h,g,k;g=l.errorToken;k=l.tokens;e=g[0];h=g[1];a=g[2];h=function(){switch(!1){case g!==k[k.length-1]:return"end of input";case "INDENT"!==e&&"OUTDENT"!==e:return"indentation";case "IDENTIFIER"!==e&&"NUMBER"!==e&&"INFINITY"!==e&&"STRING"!==e&&"STRING_START"!==e&&"REGEX"!==e&&"REGEX_START"!==e:return e.replace(/_START$/,"").toLowerCase();default:return x.nameWhitespaceCharacter(h)}}();return x.throwSyntaxError("unexpected "+h,a)};m=function(a,c){var e,
g,h,k;a.isNative()?e="native":(a.isEval()?(g=a.getScriptNameOrSourceURL())||a.getEvalOrigin():g=a.getFileName(),g||(g="\x3canonymous\x3e"),h=a.getLineNumber(),e=a.getColumnNumber(),e=(c=c(g,h,e))?g+":"+c[0]+":"+c[1]:g+":"+h+":"+e);g=a.getFunctionName();h=a.isConstructor();if(a.isToplevel()||h)return h?"new "+(g||"\x3canonymous\x3e")+" ("+e+")":g?g+" ("+e+")":e;h=a.getMethodName();k=a.getTypeName();return g?(c=a="",k&&g.indexOf(k)&&(c=k+"."),h&&g.indexOf("."+h)!==g.length-h.length-1&&(a=" [as "+h+ g,h,k;a.isNative()?e="native":(a.isEval()?(g=a.getScriptNameOrSourceURL())||a.getEvalOrigin():g=a.getFileName(),g||(g="\x3canonymous\x3e"),h=a.getLineNumber(),e=a.getColumnNumber(),e=(c=c(g,h,e))?g+":"+c[0]+":"+c[1]:g+":"+h+":"+e);g=a.getFunctionName();h=a.isConstructor();if(a.isToplevel()||h)return h?"new "+(g||"\x3canonymous\x3e")+" ("+e+")":g?g+" ("+e+")":e;h=a.getMethodName();k=a.getTypeName();return g?(c=a="",k&&g.indexOf(k)&&(c=k+"."),h&&g.indexOf("."+h)!==g.length-h.length-1&&(a=" [as "+h+
"]"),""+c+g+a+" ("+e+")"):k+"."+(h||"\x3canonymous\x3e")+" ("+e+")"};e=function(c){return null!=G[c]?G[c]:null!=G["\x3canonymous\x3e"]?G["\x3canonymous\x3e"]:null!=J[c]?(c=a(J[c],{filename:c,sourceMap:!0,literate:x.isLiterate(c)}),c.sourceMap):null};Error.prepareStackTrace=function(a,c){var g,h,l;l=function(a,c,g){var h;a=e(a);null!=a&&(h=a.sourceLocation([c-1,g-1]));return null!=h?[h[0]+1,h[1]+1]:null};h=function(){var a,e,h;h=[];a=0;for(e=c.length;a<e;a++){g=c[a];if(g.getFunction()===k.run)break; "]"),""+c+g+a+" ("+e+")"):k+"."+(h||"\x3canonymous\x3e")+" ("+e+")"};e=function(c){return null!=G[c]?G[c]:null!=G["\x3canonymous\x3e"]?G["\x3canonymous\x3e"]:null!=J[c]?(c=a(J[c],{filename:c,sourceMap:!0,literate:x.isLiterate(c)}),c.sourceMap):null};Error.prepareStackTrace=function(a,c){var g,h,l;l=function(a,c,g){var h;a=e(a);null!=a&&(h=a.sourceLocation([c-1,g-1]));return null!=h?[h[0]+1,h[1]+1]:null};h=function(){var a,e,h;h=[];a=0;for(e=c.length;a<e;a++){g=c[a];if(g.getFunction()===k.run)break;
h.push(" at "+m(g,l))}return h}();return a.toString()+"\n"+h.join("\n")+"\n"}}).call(this);return k}();q["./browser"]=function(){(function(){var k,ra,sa,ha=[].indexOf||function(a){for(var g=0,k=this.length;g<k;g++)if(g in this&&this[g]===a)return g;return-1};k=q("./coffee-script");k.require=q;ra=k.compile;k.eval=function(a,g){g=void 0===g?{}:g;null==g.bare&&(g.bare=!0);return eval(ra(a,g))};k.run=function(a,g){g=void 0===g?{}:g;g.bare=!0;g.shiftLine=!0;return Function(ra(a,g))()};"undefined"!== h.push(" at "+m(g,l))}return h}();return a.toString()+"\n"+h.join("\n")+"\n"}}).call(this);return k}();q["./browser"]=function(){(function(){var k,ra,sa,ha=[].indexOf||function(a){for(var g=0,k=this.length;g<k;g++)if(g in this&&this[g]===a)return g;return-1};k=q("./coffeescript");k.require=q;ra=k.compile;k.eval=function(a,g){g=void 0===g?{}:g;null==g.bare&&(g.bare=!0);return eval(ra(a,g))};k.run=function(a,g){g=void 0===g?{}:g;g.bare=!0;g.shiftLine=!0;return Function(ra(a,g))()};"undefined"!==
typeof window&&null!==window&&("undefined"!==typeof btoa&&null!==btoa&&"undefined"!==typeof JSON&&null!==JSON&&(ra=function(a,g){g=void 0===g?{}:g;g.inlineMap=!0;return k.compile(a,g)}),k.load=function(a,g,q,m){q=void 0===q?{}:q;m=void 0===m?!1:m;var c;q.sourceFiles=[a];c=window.ActiveXObject?new window.ActiveXObject("Microsoft.XMLHTTP"):new window.XMLHttpRequest;c.open("GET",a,!0);"overrideMimeType"in c&&c.overrideMimeType("text/plain");c.onreadystatechange=function(){var e;if(4===c.readyState){if(0=== typeof window&&null!==window&&("undefined"!==typeof btoa&&null!==btoa&&"undefined"!==typeof JSON&&null!==JSON&&(ra=function(a,g){g=void 0===g?{}:g;g.inlineMap=!0;return k.compile(a,g)}),k.load=function(a,g,q,m){q=void 0===q?{}:q;m=void 0===m?!1:m;var c;q.sourceFiles=[a];c=window.ActiveXObject?new window.ActiveXObject("Microsoft.XMLHTTP"):new window.XMLHttpRequest;c.open("GET",a,!0);"overrideMimeType"in c&&c.overrideMimeType("text/plain");c.onreadystatechange=function(){var e;if(4===c.readyState){if(0===
(e=c.status)||200===e)e=[c.responseText,q],m||k.run.apply(k,[].concat($jscomp.arrayFromIterable(e)));else throw Error("Could not load "+a);if(g)return g(e)}};return c.send(null)},sa=function(){var a,g,q,m,c,e,x,B,z,w,l;l=window.document.getElementsByTagName("script");g=["text/coffeescript","text/literate-coffeescript"];a=function(){var a,c,e,k;k=[];a=0;for(c=l.length;a<c;a++)z=l[a],(e=z.type,0<=ha.call(g,e))&&k.push(z);return k}();e=0;q=function(){var c;c=a[e];if(c instanceof Array)return k.run.apply(k, (e=c.status)||200===e)e=[c.responseText,q],m||k.run.apply(k,[].concat($jscomp.arrayFromIterable(e)));else throw Error("Could not load "+a);if(g)return g(e)}};return c.send(null)},sa=function(){var a,g,q,m,c,e,x,B,z,w,l;l=window.document.getElementsByTagName("script");g=["text/coffeescript","text/literate-coffeescript"];a=function(){var a,c,e,k;k=[];a=0;for(c=l.length;a<c;a++)z=l[a],(e=z.type,0<=ha.call(g,e))&&k.push(z);return k}();e=0;q=function(){var c;c=a[e];if(c instanceof Array)return k.run.apply(k,
[].concat($jscomp.arrayFromIterable(c))),e++,q()};m=function(c,e){var l,m;l={literate:c.type===g[1]};if(m=c.src||c.getAttribute("data-src"))return k.load(m,function(c){a[e]=c;return q()},l,!0);l.sourceFiles=["embedded"];return a[e]=[c.innerHTML,l]};c=x=0;for(B=a.length;x<B;c=++x)w=a[c],m(w,c);return q()},window.addEventListener?window.addEventListener("DOMContentLoaded",sa,!1):window.attachEvent("onload",sa))}).call(this);return{}}();return q["./coffee-script"]}();"function"===typeof define&&define.amd? [].concat($jscomp.arrayFromIterable(c))),e++,q()};m=function(c,e){var l,m;l={literate:c.type===g[1]};if(m=c.src||c.getAttribute("data-src"))return k.load(m,function(c){a[e]=c;return q()},l,!0);l.sourceFiles=["embedded"];return a[e]=[c.innerHTML,l]};c=x=0;for(B=a.length;x<B;c=++x)w=a[c],m(w,c);return q()},window.addEventListener?window.addEventListener("DOMContentLoaded",sa,!1):window.attachEvent("onload",sa))}).call(this);return{}}();return q["./coffeescript"]}();"function"===typeof define&&define.amd?
define(function(){return ra}):q.CoffeeScript=ra})(this); define(function(){return ra}):q.CoffeeScript=ra})(this);

View file

@ -669,7 +669,7 @@ textarea {
<section id="overview"> <section id="overview">
<p><strong>CoffeeScript is a little language that compiles into JavaScript.</strong> Underneath that awkward Java-esque patina, JavaScript has always had a gorgeous heart. CoffeeScript is an attempt to expose the good parts of JavaScript in a simple way.</p> <p><strong>CoffeeScript is a little language that compiles into JavaScript.</strong> Underneath that awkward Java-esque patina, JavaScript has always had a gorgeous heart. CoffeeScript is an attempt to expose the good parts of JavaScript in a simple way.</p>
<p>The golden rule of CoffeeScript is: <em>“Its just JavaScript.”</em> The code compiles one-to-one into the equivalent JS, and there is no interpretation at runtime. You can use any existing JavaScript library seamlessly from CoffeeScript (and vice-versa). The compiled output is readable, pretty-printed, and tends to run as fast or faster than the equivalent handwritten JavaScript.</p> <p>The golden rule of CoffeeScript is: <em>“Its just JavaScript.”</em> The code compiles one-to-one into the equivalent JS, and there is no interpretation at runtime. You can use any existing JavaScript library seamlessly from CoffeeScript (and vice-versa). The compiled output is readable, pretty-printed, and tends to run as fast or faster than the equivalent handwritten JavaScript.</p>
<p><strong>Latest Version:</strong> <a href="http://github.com/jashkenas/coffeescript/tarball/2.0.0-alpha">2.0.0-alpha</a></p> <p><strong>Latest Version:</strong> <a href="http://github.com/jashkenas/coffeescript/tarball/2.0.0-alpha1">2.0.0-alpha1</a></p>
<blockquote> <blockquote>
<pre><code>npm install -g coffeescript</code></pre></blockquote> <pre><code>npm install -g coffeescript</code></pre></blockquote>
@ -768,7 +768,7 @@ cubes = (function() {
</section> </section>
<section id="installation"> <section id="installation">
<h2>Installation</h2><p>The command-line version of <code>coffee</code> is available as a <a href="http://nodejs.org/">Node.js</a> utility. The <a href="v2/browser-compiler/coffee-script.js">core compiler</a> however, does not depend on Node, and can be run in any JavaScript environment, or in the browser (see <a href="#try">Try CoffeeScript</a>).</p> <h2>Installation</h2><p>The command-line version of <code>coffee</code> is available as a <a href="http://nodejs.org/">Node.js</a> utility. The <a href="v2/browser-compiler/coffeescript.js">core compiler</a> however, does not depend on Node, and can be run in any JavaScript environment, or in the browser (see <a href="#try">Try CoffeeScript</a>).</p>
<p>To install, first make sure you have a working copy of the latest stable version of <a href="http://nodejs.org/">Node.js</a>. You can then install CoffeeScript globally with <a href="http://npmjs.org">npm</a>:</p> <p>To install, first make sure you have a working copy of the latest stable version of <a href="http://nodejs.org/">Node.js</a>. You can then install CoffeeScript globally with <a href="http://npmjs.org">npm</a>:</p>
<blockquote> <blockquote>
<pre><code>npm install --global coffeescript</code></pre></blockquote> <pre><code>npm install --global coffeescript</code></pre></blockquote>
@ -2814,7 +2814,7 @@ greet = function(name, adjective) {
<div class="row"> <div class="row">
<div class="col-md-6 coffeescript-input-column"> <div class="col-md-6 coffeescript-input-column">
<textarea class="coffeescript-input" id="modules-coffee">import 'local-file.coffee' <textarea class="coffeescript-input" id="modules-coffee">import 'local-file.coffee'
import 'coffee-script' import 'coffeescript'
import _ from 'underscore' import _ from 'underscore'
import * as underscore from 'underscore' import * as underscore from 'underscore'
@ -2840,7 +2840,7 @@ export { max, min } from 'underscore'
<div class="col-md-6 javascript-output-column"> <div class="col-md-6 javascript-output-column">
<textarea class="javascript-output" id="modules-js">import 'local-file.coffee'; <textarea class="javascript-output" id="modules-js">import 'local-file.coffee';
import 'coffee-script'; import 'coffeescript';
import _ from 'underscore'; import _ from 'underscore';
@ -3227,7 +3227,7 @@ task('build:parser', 'rebuild the Jison parser', function(options) {
</section> </section>
<section id="scripts"> <section id="scripts">
<h2><code>&quot;text/coffeescript&quot;</code> Script Tags</h2><p>While its not recommended for serious use, CoffeeScripts may be included directly within the browser using <code>&lt;script type=&quot;text/coffeescript&quot;&gt;</code> tags. The source includes a compressed and minified version of the compiler (<a href="v2/browser-compiler/coffee-script.js">Download current version here, 51k when gzipped</a>) as <code>v2/browser-compiler/coffee-script.js</code>. Include this file on a page with inline CoffeeScript tags, and it will compile and evaluate them in order.</p> <h2><code>&quot;text/coffeescript&quot;</code> Script Tags</h2><p>While its not recommended for serious use, CoffeeScripts may be included directly within the browser using <code>&lt;script type=&quot;text/coffeescript&quot;&gt;</code> tags. The source includes a compressed and minified version of the compiler (<a href="v2/browser-compiler/coffeescript.js">Download current version here, 51k when gzipped</a>) as <code>v2/browser-compiler/coffeescript.js</code>. Include this file on a page with inline CoffeeScript tags, and it will compile and evaluate them in order.</p>
<p>In fact, the little bit of glue script that runs <a href="#try">Try CoffeeScript</a>, as well as the code examples and other interactive parts of this site, is implemented in just this way. View source and look at the bottom of the page to see the example. Including the script also gives you access to <code>CoffeeScript.compile()</code> so you can pop open your JavaScript console and try compiling some strings.</p> <p>In fact, the little bit of glue script that runs <a href="#try">Try CoffeeScript</a>, as well as the code examples and other interactive parts of this site, is implemented in just this way. View source and look at the bottom of the page to see the example. Including the script also gives you access to <code>CoffeeScript.compile()</code> so you can pop open your JavaScript console and try compiling some strings.</p>
<p>The usual caveats about CoffeeScript apply — your inline scripts will run within a closure wrapper, so if you want to expose global variables or functions, attach them to the <code>window</code> object.</p> <p>The usual caveats about CoffeeScript apply — your inline scripts will run within a closure wrapper, so if you want to expose global variables or functions, attach them to the <code>window</code> object.</p>
@ -3290,7 +3290,7 @@ The CoffeeScript logo is available in SVG for use in presentations.</li>
</section> </section>
<section id="annotated-source"> <section id="annotated-source">
<h2>Annotated Source</h2><p>You can browse the CoffeeScript 2.0.0-alpha source in readable, annotated form <a href="http://coffeescript.org/v2/annotated-source/">here</a>. You can also jump directly to a particular source file:</p> <h2>Annotated Source</h2><p>You can browse the CoffeeScript 2.0.0-alpha1 source in readable, annotated form <a href="http://coffeescript.org/v2/annotated-source/">here</a>. You can also jump directly to a particular source file:</p>
<ul> <ul>
<li><a href="http://coffeescript.org/v2/annotated-source/grammar.html">Grammar Rules — src/grammar</a></li> <li><a href="http://coffeescript.org/v2/annotated-source/grammar.html">Grammar Rules — src/grammar</a></li>
<li><a href="http://coffeescript.org/v2/annotated-source/lexer.html">Lexing Tokens — src/lexer</a></li> <li><a href="http://coffeescript.org/v2/annotated-source/lexer.html">Lexing Tokens — src/lexer</a></li>
@ -3298,7 +3298,7 @@ The CoffeeScript logo is available in SVG for use in presentations.</li>
<li><a href="http://coffeescript.org/v2/annotated-source/nodes.html">The Syntax Tree — src/nodes</a></li> <li><a href="http://coffeescript.org/v2/annotated-source/nodes.html">The Syntax Tree — src/nodes</a></li>
<li><a href="http://coffeescript.org/v2/annotated-source/scope.html">Lexical Scope — src/scope</a></li> <li><a href="http://coffeescript.org/v2/annotated-source/scope.html">Lexical Scope — src/scope</a></li>
<li><a href="http://coffeescript.org/v2/annotated-source/helpers.html">Helpers &amp; Utility Functions — src/helpers</a></li> <li><a href="http://coffeescript.org/v2/annotated-source/helpers.html">Helpers &amp; Utility Functions — src/helpers</a></li>
<li><a href="http://coffeescript.org/v2/annotated-source/coffee-script.html">The CoffeeScript Module — src/coffee-script</a></li> <li><a href="http://coffeescript.org/v2/annotated-source/coffeescript.html">The CoffeeScript Module — src/coffeescript</a></li>
<li><a href="http://coffeescript.org/v2/annotated-source/cake.html">Cake &amp; Cakefiles — src/cake</a></li> <li><a href="http://coffeescript.org/v2/annotated-source/cake.html">Cake &amp; Cakefiles — src/cake</a></li>
<li><a href="http://coffeescript.org/v2/annotated-source/command.html">“coffee” Command-Line Utility — src/command</a></li> <li><a href="http://coffeescript.org/v2/annotated-source/command.html">“coffee” Command-Line Utility — src/command</a></li>
<li><a href="http://coffeescript.org/v2/annotated-source/optparse.html">Option Parsing — src/optparse</a></li> <li><a href="http://coffeescript.org/v2/annotated-source/optparse.html">Option Parsing — src/optparse</a></li>
@ -3489,7 +3489,7 @@ six = ->
<li>Fixed a slight formatting error in CoffeeScripts source map-patched stack traces.</li> <li>Fixed a slight formatting error in CoffeeScripts source map-patched stack traces.</li>
<li>The <code>%%</code> operator now coerces its right operand only once.</li> <li>The <code>%%</code> operator now coerces its right operand only once.</li>
<li>It is now possible to require CoffeeScript files from Cakefiles without having to register the compiler first.</li> <li>It is now possible to require CoffeeScript files from Cakefiles without having to register the compiler first.</li>
<li>The CoffeeScript REPL is now exported and can be required using <code>require &#39;coffee-script/repl&#39;</code>.</li> <li>The CoffeeScript REPL is now exported and can be required using <code>require &#39;coffeescript/repl&#39;</code>.</li>
<li>Fixes for the REPL in Node 0.11.</li> <li>Fixes for the REPL in Node 0.11.</li>
</ul> </ul>
<div class="anchor" id="1.7.1"></div> <div class="anchor" id="1.7.1"></div>
@ -3504,7 +3504,7 @@ six = ->
<a href="https://github.com/jashkenas/coffeescript/compare/1.6.3...1.7.0">1.7.0</a> <a href="https://github.com/jashkenas/coffeescript/compare/1.6.3...1.7.0">1.7.0</a>
<span class="timestamp"> &mdash; <time datetime="2014-01-28">January 28, 2014</time></span> <span class="timestamp"> &mdash; <time datetime="2014-01-28">January 28, 2014</time></span>
</h2><ul> </h2><ul>
<li>When requiring CoffeeScript files in Node you must now explicitly register the compiler. This can be done with <code>require &#39;coffee-script/register&#39;</code> or <code>CoffeeScript.register()</code>. Also for configuration such as Mochas, use <strong>coffee-script/register</strong>.</li> <li>When requiring CoffeeScript files in Node you must now explicitly register the compiler. This can be done with <code>require &#39;coffeescript/register&#39;</code> or <code>CoffeeScript.register()</code>. Also for configuration such as Mochas, use <strong>coffeescript/register</strong>.</li>
<li>Improved error messages, source maps and stack traces. Source maps now use the updated <code>//#</code> syntax.</li> <li>Improved error messages, source maps and stack traces. Source maps now use the updated <code>//#</code> syntax.</li>
<li>Leading <code>.</code> now closes all open calls, allowing for simpler chaining syntax.</li> <li>Leading <code>.</code> now closes all open calls, allowing for simpler chaining syntax.</li>
</ul> </ul>
@ -3630,7 +3630,7 @@ six = ->
<li>Ahh, whitespace. CoffeeScripts compiled JS now tries to space things out and keep it readable, as you can see in the examples on this page.</li> <li>Ahh, whitespace. CoffeeScripts compiled JS now tries to space things out and keep it readable, as you can see in the examples on this page.</li>
<li>You can now call <code>super</code> in class level methods in class bodies, and bound class methods now preserve their correct context.</li> <li>You can now call <code>super</code> in class level methods in class bodies, and bound class methods now preserve their correct context.</li>
<li>JavaScript has always supported octal numbers <code>010 is 8</code>, and hexadecimal numbers <code>0xf is 15</code>, but CoffeeScript now also supports binary numbers: <code>0b10 is 2</code>.</li> <li>JavaScript has always supported octal numbers <code>010 is 8</code>, and hexadecimal numbers <code>0xf is 15</code>, but CoffeeScript now also supports binary numbers: <code>0b10 is 2</code>.</li>
<li>The CoffeeScript module has been nested under a subdirectory to make it easier to <code>require</code> individual components separately, without having to use <strong>npm</strong>. For example, after adding the CoffeeScript folder to your path: <code>require(&#39;coffee-script/lexer&#39;)</code></li> <li>The CoffeeScript module has been nested under a subdirectory to make it easier to <code>require</code> individual components separately, without having to use <strong>npm</strong>. For example, after adding the CoffeeScript folder to your path: <code>require(&#39;coffeescript/lexer&#39;)</code></li>
<li>Theres a new “link” feature in Try CoffeeScript on this webpage. Use it to get a shareable permalink for your example script.</li> <li>Theres a new “link” feature in Try CoffeeScript on this webpage. Use it to get a shareable permalink for your example script.</li>
<li>The <code>coffee --watch</code> feature now only works on Node.js 0.6.0 and higher, but now also works properly on Windows.</li> <li>The <code>coffee --watch</code> feature now only works on Node.js 0.6.0 and higher, but now also works properly on Windows.</li>
<li>Lots of small bug fixes from <strong><a href="https://github.com/michaelficarra">@michaelficarra</a></strong>, <strong><a href="https://github.com/geraldalewis">@geraldalewis</a></strong>, <strong><a href="https://github.com/satyr">@satyr</a></strong>, and <strong><a href="https://github.com/trevorburnham">@trevorburnham</a></strong>.</li> <li>Lots of small bug fixes from <strong><a href="https://github.com/michaelficarra">@michaelficarra</a></strong>, <strong><a href="https://github.com/geraldalewis">@geraldalewis</a></strong>, <strong><a href="https://github.com/satyr">@satyr</a></strong>, and <strong><a href="https://github.com/trevorburnham">@trevorburnham</a></strong>.</li>
@ -3731,7 +3731,7 @@ used to parse as <code>result = (i for i in list)</code> by default … it now p
<h2 class="header"> <h2 class="header">
<a href="https://github.com/jashkenas/coffeescript/compare/0.5.5...0.5.6">0.5.6</a> <a href="https://github.com/jashkenas/coffeescript/compare/0.5.5...0.5.6">0.5.6</a>
<span class="timestamp"> &mdash; <time datetime="2010-03-23">March 23, 2010</time></span> <span class="timestamp"> &mdash; <time datetime="2010-03-23">March 23, 2010</time></span>
</h2><p>Interpolation can now be used within regular expressions and heredocs, as well as strings. Added the <code>&lt;-</code> bind operator. Allowing assignment to half-expressions instead of special <code>||=</code>-style operators. The arguments object is no longer automatically converted into an array. After requiring <code>coffee-script</code>, Node.js can now directly load <code>.coffee</code> files, thanks to <strong>registerExtension</strong>. Multiple splats can now be used in function calls, arrays, and pattern matching.</p> </h2><p>Interpolation can now be used within regular expressions and heredocs, as well as strings. Added the <code>&lt;-</code> bind operator. Allowing assignment to half-expressions instead of special <code>||=</code>-style operators. The arguments object is no longer automatically converted into an array. After requiring <code>coffeescript</code>, Node.js can now directly load <code>.coffee</code> files, thanks to <strong>registerExtension</strong>. Multiple splats can now be used in function calls, arrays, and pattern matching.</p>
<div class="anchor" id="0.5.5"></div> <div class="anchor" id="0.5.5"></div>
<h2 class="header"> <h2 class="header">
<a href="https://github.com/jashkenas/coffeescript/compare/0.5.4...0.5.5">0.5.5</a> <a href="https://github.com/jashkenas/coffeescript/compare/0.5.4...0.5.5">0.5.5</a>
@ -3752,7 +3752,7 @@ used to parse as <code>result = (i for i in list)</code> by default … it now p
<a href="https://github.com/jashkenas/coffeescript/compare/0.5.1...0.5.2">0.5.2</a> <a href="https://github.com/jashkenas/coffeescript/compare/0.5.1...0.5.2">0.5.2</a>
<span class="timestamp"> &mdash; <time datetime="2010-02-25">February 25, 2010</time></span> <span class="timestamp"> &mdash; <time datetime="2010-02-25">February 25, 2010</time></span>
</h2><p>Added a compressed version of the compiler for inclusion in web pages as </h2><p>Added a compressed version of the compiler for inclusion in web pages as
<code>v2/browser-compiler/coffee-script.js</code>. Itll automatically run any script tags with type <code>text/coffeescript</code> for you. Added a <code>--stdio</code> option to the <code>coffee</code> command, for piped-in compiles.</p> <code>v2/browser-compiler/coffeescript.js</code>. Itll automatically run any script tags with type <code>text/coffeescript</code> for you. Added a <code>--stdio</code> option to the <code>coffee</code> command, for piped-in compiles.</p>
<div class="anchor" id="0.5.1"></div> <div class="anchor" id="0.5.1"></div>
<h2 class="header"> <h2 class="header">
<a href="https://github.com/jashkenas/coffeescript/compare/0.5.0...0.5.1">0.5.1</a> <a href="https://github.com/jashkenas/coffeescript/compare/0.5.0...0.5.1">0.5.1</a>
@ -3828,7 +3828,7 @@ The <code>extends</code> keyword now functions identically to <code>goog.inherit
<h2 class="header"> <h2 class="header">
<a href="https://github.com/jashkenas/coffeescript/compare/0.1.4...0.1.5">0.1.5</a> <a href="https://github.com/jashkenas/coffeescript/compare/0.1.4...0.1.5">0.1.5</a>
<span class="timestamp"> &mdash; <time datetime="2009-12-26">December 26, 2009</time></span> <span class="timestamp"> &mdash; <time datetime="2009-12-26">December 26, 2009</time></span>
</h2><p>Array slice literals and array comprehensions can now both take Ruby-style ranges to specify the start and end. JavaScript variable declaration is now pushed up to the top of the scope, making all assignment statements into expressions. You can use <code>\</code> to escape newlines. The <code>coffee-script</code> command is now called <code>coffee</code>.</p> </h2><p>Array slice literals and array comprehensions can now both take Ruby-style ranges to specify the start and end. JavaScript variable declaration is now pushed up to the top of the scope, making all assignment statements into expressions. You can use <code>\</code> to escape newlines. The <code>coffeescript</code> command is now called <code>coffee</code>.</p>
<div class="anchor" id="0.1.4"></div> <div class="anchor" id="0.1.4"></div>
<h2 class="header"> <h2 class="header">
<a href="https://github.com/jashkenas/coffeescript/compare/0.1.3...0.1.4">0.1.4</a> <a href="https://github.com/jashkenas/coffeescript/compare/0.1.3...0.1.4">0.1.4</a>
@ -3869,7 +3869,7 @@ The <code>extends</code> keyword now functions identically to <code>goog.inherit
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/js/bootstrap.min.js" integrity="sha384-BLiI7JTZm+JWlgKa0M0kGRpJbF2J8q+qreVrKBC47e3K6BW78kGLrCkeRX6I9RoK" crossorigin="anonymous"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/js/bootstrap.min.js" integrity="sha384-BLiI7JTZm+JWlgKa0M0kGRpJbF2J8q+qreVrKBC47e3K6BW78kGLrCkeRX6I9RoK" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/g/codemirror@4.5.0(codemirror.min.js+mode/coffeescript/coffeescript.js+addon/lint/coffeescript-lint.js+mode/javascript/javascript.js)" crossorigin="anonymous"></script> <script src="https://cdn.jsdelivr.net/g/codemirror@4.5.0(codemirror.min.js+mode/coffeescript/coffeescript.js+addon/lint/coffeescript-lint.js+mode/javascript/javascript.js)" crossorigin="anonymous"></script>
<script src="browser-compiler/coffee-script.js"></script> <script src="browser-compiler/coffeescript.js"></script>
<script type="text/coffeescript"> <script type="text/coffeescript">
$(document).ready -> $(document).ready ->
# Mobile navigation # Mobile navigation

View file

@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>CoffeeScript Test Suite</title> <title>CoffeeScript Test Suite</title>
<script src="browser-compiler/coffee-script.js"></script> <script src="browser-compiler/coffeescript.js"></script>
<script src="https://cdn.jsdelivr.net/underscorejs/1.8.3/underscore-min.js"></script> <script src="https://cdn.jsdelivr.net/underscorejs/1.8.3/underscore-min.js"></script>
<style> <style>
body, pre { body, pre {
@ -10704,7 +10704,7 @@ test "'new' target", ->
# Ensure that the OptionParser handles arguments correctly. # Ensure that the OptionParser handles arguments correctly.
return unless require? return unless require?
{OptionParser} = require './../lib/coffee-script/optparse' {OptionParser} = require './../lib/coffeescript/optparse'
opt = new OptionParser [ opt = new OptionParser [
['-r', '--required [DIR]', 'desc required'] ['-r', '--required [DIR]', 'desc required']

View file

@ -1,5 +1,5 @@
import 'local-file.coffee' import 'local-file.coffee'
import 'coffee-script' import 'coffeescript'
import _ from 'underscore' import _ from 'underscore'
import * as underscore from 'underscore' import * as underscore from 'underscore'

View file

@ -8,7 +8,7 @@ You can browse the CoffeeScript <%= fullVersion %> source in readable, annotated
- [The Syntax Tree — src/nodes](http://coffeescript.org/v<%= majorVersion %>/annotated-source/nodes.html) - [The Syntax Tree — src/nodes](http://coffeescript.org/v<%= majorVersion %>/annotated-source/nodes.html)
- [Lexical Scope — src/scope](http://coffeescript.org/v<%= majorVersion %>/annotated-source/scope.html) - [Lexical Scope — src/scope](http://coffeescript.org/v<%= majorVersion %>/annotated-source/scope.html)
- [Helpers &amp; Utility Functions — src/helpers](http://coffeescript.org/v<%= majorVersion %>/annotated-source/helpers.html) - [Helpers &amp; Utility Functions — src/helpers](http://coffeescript.org/v<%= majorVersion %>/annotated-source/helpers.html)
- [The CoffeeScript Module — src/coffee-script](http://coffeescript.org/v<%= majorVersion %>/annotated-source/coffee-script.html) - [The CoffeeScript Module — src/coffeescript](http://coffeescript.org/v<%= majorVersion %>/annotated-source/coffeescript.html)
- [Cake &amp; Cakefiles — src/cake](http://coffeescript.org/v<%= majorVersion %>/annotated-source/cake.html) - [Cake &amp; Cakefiles — src/cake](http://coffeescript.org/v<%= majorVersion %>/annotated-source/cake.html)
- [“coffee” Command-Line Utility — src/command](http://coffeescript.org/v<%= majorVersion %>/annotated-source/command.html) - [“coffee” Command-Line Utility — src/command](http://coffeescript.org/v<%= majorVersion %>/annotated-source/command.html)
- [Option Parsing — src/optparse](http://coffeescript.org/v<%= majorVersion %>/annotated-source/optparse.html) - [Option Parsing — src/optparse](http://coffeescript.org/v<%= majorVersion %>/annotated-source/optparse.html)

View file

@ -162,7 +162,7 @@ releaseHeader('2014-08-26', '1.8.0', '1.7.1')
* Fixed a slight formatting error in CoffeeScripts source map-patched stack traces. * Fixed a slight formatting error in CoffeeScripts source map-patched stack traces.
* The `%%` operator now coerces its right operand only once. * The `%%` operator now coerces its right operand only once.
* It is now possible to require CoffeeScript files from Cakefiles without having to register the compiler first. * It is now possible to require CoffeeScript files from Cakefiles without having to register the compiler first.
* The CoffeeScript REPL is now exported and can be required using `require 'coffee-script/repl'`. * The CoffeeScript REPL is now exported and can be required using `require 'coffeescript/repl'`.
* Fixes for the REPL in Node 0.11. * Fixes for the REPL in Node 0.11.
``` ```
@ -175,7 +175,7 @@ releaseHeader('2014-01-29', '1.7.1', '1.7.0')
releaseHeader('2014-01-28', '1.7.0', '1.6.3') releaseHeader('2014-01-28', '1.7.0', '1.6.3')
``` ```
* When requiring CoffeeScript files in Node you must now explicitly register the compiler. This can be done with `require 'coffee-script/register'` or `CoffeeScript.register()`. Also for configuration such as Mochas, use **coffee-script/register**. * When requiring CoffeeScript files in Node you must now explicitly register the compiler. This can be done with `require 'coffeescript/register'` or `CoffeeScript.register()`. Also for configuration such as Mochas, use **coffeescript/register**.
* Improved error messages, source maps and stack traces. Source maps now use the updated `//#` syntax. * Improved error messages, source maps and stack traces. Source maps now use the updated `//#` syntax.
* Leading `.` now closes all open calls, allowing for simpler chaining syntax. * Leading `.` now closes all open calls, allowing for simpler chaining syntax.
@ -275,7 +275,7 @@ releaseHeader('2011-11-08', '1.1.3', '1.1.2')
* Ahh, whitespace. CoffeeScripts compiled JS now tries to space things out and keep it readable, as you can see in the examples on this page. * Ahh, whitespace. CoffeeScripts compiled JS now tries to space things out and keep it readable, as you can see in the examples on this page.
* You can now call `super` in class level methods in class bodies, and bound class methods now preserve their correct context. * You can now call `super` in class level methods in class bodies, and bound class methods now preserve their correct context.
* JavaScript has always supported octal numbers `010 is 8`, and hexadecimal numbers `0xf is 15`, but CoffeeScript now also supports binary numbers: `0b10 is 2`. * JavaScript has always supported octal numbers `010 is 8`, and hexadecimal numbers `0xf is 15`, but CoffeeScript now also supports binary numbers: `0b10 is 2`.
* The CoffeeScript module has been nested under a subdirectory to make it easier to `require` individual components separately, without having to use **npm**. For example, after adding the CoffeeScript folder to your path: `require('coffee-script/lexer')` * The CoffeeScript module has been nested under a subdirectory to make it easier to `require` individual components separately, without having to use **npm**. For example, after adding the CoffeeScript folder to your path: `require('coffeescript/lexer')`
* Theres a new “link” feature in Try CoffeeScript on this webpage. Use it to get a shareable permalink for your example script. * Theres a new “link” feature in Try CoffeeScript on this webpage. Use it to get a shareable permalink for your example script.
* The `coffee --watch` feature now only works on Node.js 0.6.0 and higher, but now also works properly on Windows. * The `coffee --watch` feature now only works on Node.js 0.6.0 and higher, but now also works properly on Windows.
* Lots of small bug fixes from **[@michaelficarra](https://github.com/michaelficarra)**, **[@geraldalewis](https://github.com/geraldalewis)**, **[@satyr](https://github.com/satyr)**, and **[@trevorburnham](https://github.com/trevorburnham)**. * Lots of small bug fixes from **[@michaelficarra](https://github.com/michaelficarra)**, **[@geraldalewis](https://github.com/geraldalewis)**, **[@satyr](https://github.com/satyr)**, and **[@trevorburnham](https://github.com/trevorburnham)**.
@ -394,7 +394,7 @@ Trailing commas are now allowed, a-la Python. Static properties may be assigned
releaseHeader('2010-03-23', '0.5.6', '0.5.5') releaseHeader('2010-03-23', '0.5.6', '0.5.5')
``` ```
Interpolation can now be used within regular expressions and heredocs, as well as strings. Added the `<-` bind operator. Allowing assignment to half-expressions instead of special `||=`-style operators. The arguments object is no longer automatically converted into an array. After requiring `coffee-script`, Node.js can now directly load `.coffee` files, thanks to **registerExtension**. Multiple splats can now be used in function calls, arrays, and pattern matching. Interpolation can now be used within regular expressions and heredocs, as well as strings. Added the `<-` bind operator. Allowing assignment to half-expressions instead of special `||=`-style operators. The arguments object is no longer automatically converted into an array. After requiring `coffeescript`, Node.js can now directly load `.coffee` files, thanks to **registerExtension**. Multiple splats can now be used in function calls, arrays, and pattern matching.
``` ```
releaseHeader('2010-03-08', '0.5.5', '0.5.4') releaseHeader('2010-03-08', '0.5.5', '0.5.4')
@ -419,7 +419,7 @@ releaseHeader('2010-02-25', '0.5.2', '0.5.1')
``` ```
Added a compressed version of the compiler for inclusion in web pages as Added a compressed version of the compiler for inclusion in web pages as
`v<%= majorVersion %>/browser-compiler/coffee-script.js`. Itll automatically run any script tags with type `text/coffeescript` for you. Added a `--stdio` option to the `coffee` command, for piped-in compiles. `v<%= majorVersion %>/browser-compiler/coffeescript.js`. Itll automatically run any script tags with type `text/coffeescript` for you. Added a `--stdio` option to the `coffee` command, for piped-in compiles.
``` ```
releaseHeader('2010-02-24', '0.5.1', '0.5.0') releaseHeader('2010-02-24', '0.5.1', '0.5.0')
@ -508,7 +508,7 @@ Bugfix for running `coffee --interactive` and `--run` from outside of the Coffee
releaseHeader('2009-12-26', '0.1.5', '0.1.4') releaseHeader('2009-12-26', '0.1.5', '0.1.4')
``` ```
Array slice literals and array comprehensions can now both take Ruby-style ranges to specify the start and end. JavaScript variable declaration is now pushed up to the top of the scope, making all assignment statements into expressions. You can use `\` to escape newlines. The `coffee-script` command is now called `coffee`. Array slice literals and array comprehensions can now both take Ruby-style ranges to specify the start and end. JavaScript variable declaration is now pushed up to the top of the scope, making all assignment statements into expressions. You can use `\` to escape newlines. The `coffeescript` command is now called `coffee`.
``` ```
releaseHeader('2009-12-25', '0.1.4', '0.1.3') releaseHeader('2009-12-25', '0.1.4', '0.1.3')

View file

@ -1,6 +1,6 @@
## Installation ## Installation
The command-line version of `coffee` is available as a [Node.js](http://nodejs.org/) utility. The [core compiler](v<%= majorVersion %>/browser-compiler/coffee-script.js) however, does not depend on Node, and can be run in any JavaScript environment, or in the browser (see [Try CoffeeScript](#try)). The command-line version of `coffee` is available as a [Node.js](http://nodejs.org/) utility. The [core compiler](v<%= majorVersion %>/browser-compiler/coffeescript.js) however, does not depend on Node, and can be run in any JavaScript environment, or in the browser (see [Try CoffeeScript](#try)).
To install, first make sure you have a working copy of the latest stable version of [Node.js](http://nodejs.org/). You can then install CoffeeScript globally with [npm](http://npmjs.org): To install, first make sure you have a working copy of the latest stable version of [Node.js](http://nodejs.org/). You can then install CoffeeScript globally with [npm](http://npmjs.org):

View file

@ -1,6 +1,6 @@
## `"text/coffeescript"` Script Tags ## `"text/coffeescript"` Script Tags
While its not recommended for serious use, CoffeeScripts may be included directly within the browser using `<script type="text/coffeescript">` tags. The source includes a compressed and minified version of the compiler ([Download current version here, 51k when gzipped](v<%= majorVersion %>/browser-compiler/coffee-script.js)) as `v<%= majorVersion %>/browser-compiler/coffee-script.js`. Include this file on a page with inline CoffeeScript tags, and it will compile and evaluate them in order. While its not recommended for serious use, CoffeeScripts may be included directly within the browser using `<script type="text/coffeescript">` tags. The source includes a compressed and minified version of the compiler ([Download current version here, 51k when gzipped](v<%= majorVersion %>/browser-compiler/coffeescript.js)) as `v<%= majorVersion %>/browser-compiler/coffeescript.js`. Include this file on a page with inline CoffeeScript tags, and it will compile and evaluate them in order.
In fact, the little bit of glue script that runs [Try CoffeeScript](#try), as well as the code examples and other interactive parts of this site, is implemented in just this way. View source and look at the bottom of the page to see the example. Including the script also gives you access to `CoffeeScript.compile()` so you can pop open your JavaScript console and try compiling some strings. In fact, the little bit of glue script that runs [Try CoffeeScript](#try), as well as the code examples and other interactive parts of this site, is implemented in just this way. View source and look at the bottom of the page to see the example. Including the script also gives you access to `CoffeeScript.compile()` so you can pop open your JavaScript console and try compiling some strings.

View file

@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>CoffeeScript Test Suite</title> <title>CoffeeScript Test Suite</title>
<script src="browser-compiler/coffee-script.js"></script> <script src="browser-compiler/coffeescript.js"></script>
<script src="https://cdn.jsdelivr.net/underscorejs/1.8.3/underscore-min.js"></script> <script src="https://cdn.jsdelivr.net/underscorejs/1.8.3/underscore-min.js"></script>
<style> <style>
body, pre { body, pre {

View file

@ -70,7 +70,7 @@
<a href="v<%= majorVersion %>/annotated-source/nodes.html">The Syntax Tree — src/nodes</a> <a href="v<%= majorVersion %>/annotated-source/nodes.html">The Syntax Tree — src/nodes</a>
<a href="v<%= majorVersion %>/annotated-source/scope.html">Lexical Scope — src/scope</a> <a href="v<%= majorVersion %>/annotated-source/scope.html">Lexical Scope — src/scope</a>
<a href="v<%= majorVersion %>/annotated-source/helpers.html">Helpers &amp; Utility Functions — src/helpers</a> <a href="v<%= majorVersion %>/annotated-source/helpers.html">Helpers &amp; Utility Functions — src/helpers</a>
<a href="v<%= majorVersion %>/annotated-source/coffee-script.html">The CoffeeScript Module — src/coffee-script</a> <a href="v<%= majorVersion %>/annotated-source/coffeescript.html">The CoffeeScript Module — src/coffeescript</a>
<a href="v<%= majorVersion %>/annotated-source/cake.html">Cake &amp; Cakefiles — src/cake</a> <a href="v<%= majorVersion %>/annotated-source/cake.html">Cake &amp; Cakefiles — src/cake</a>
<a href="v<%= majorVersion %>/annotated-source/command.html">“coffee” Command-Line Utility — src/command</a> <a href="v<%= majorVersion %>/annotated-source/command.html">“coffee” Command-Line Utility — src/command</a>
<a href="v<%= majorVersion %>/annotated-source/optparse.html">Option Parsing — src/optparse</a> <a href="v<%= majorVersion %>/annotated-source/optparse.html">Option Parsing — src/optparse</a>

View file

@ -1,5 +1,5 @@
fs = require 'fs' fs = require 'fs'
CoffeeScript = require '../../lib/coffee-script' CoffeeScript = require '../../lib/coffeescript'
module.exports = -> module.exports = ->

View file

@ -3,4 +3,4 @@
</script> </script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="v<%= majorVersion %>/browser-compiler/coffee-script.js"></script> <script src="v<%= majorVersion %>/browser-compiler/coffeescript.js"></script>

View file

@ -1,6 +1,6 @@
fs = require 'fs' fs = require 'fs'
_ = require 'underscore' _ = require 'underscore'
CoffeeScript = require '../../lib/coffee-script' CoffeeScript = require '../../lib/coffeescript'
module.exports = -> module.exports = ->

View file

@ -5,7 +5,7 @@
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/js/bootstrap.min.js" integrity="sha384-BLiI7JTZm+JWlgKa0M0kGRpJbF2J8q+qreVrKBC47e3K6BW78kGLrCkeRX6I9RoK" crossorigin="anonymous"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/js/bootstrap.min.js" integrity="sha384-BLiI7JTZm+JWlgKa0M0kGRpJbF2J8q+qreVrKBC47e3K6BW78kGLrCkeRX6I9RoK" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/g/codemirror@4.5.0(codemirror.min.js+mode/coffeescript/coffeescript.js+addon/lint/coffeescript-lint.js+mode/javascript/javascript.js)" crossorigin="anonymous"></script> <script src="https://cdn.jsdelivr.net/g/codemirror@4.5.0(codemirror.min.js+mode/coffeescript/coffeescript.js+addon/lint/coffeescript-lint.js+mode/javascript/javascript.js)" crossorigin="anonymous"></script>
<script src="browser-compiler/coffee-script.js"></script> <script src="browser-compiler/coffeescript.js"></script>
<script type="text/coffeescript"> <script type="text/coffeescript">
<%= include('docs.coffee') %> <%= include('docs.coffee') %>
</script> </script>

View file

@ -3,7 +3,7 @@
var CoffeeScript, compile, runScripts, var CoffeeScript, compile, runScripts,
indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
CoffeeScript = require('./coffee-script'); CoffeeScript = require('./coffeescript');
CoffeeScript.require = require; CoffeeScript.require = require;

View file

@ -10,7 +10,7 @@
optparse = require('./optparse'); optparse = require('./optparse');
CoffeeScript = require('./coffee-script'); CoffeeScript = require('./coffeescript');
CoffeeScript.register(); CoffeeScript.register();

View file

@ -239,7 +239,7 @@
fn1 = function(ext) { fn1 = function(ext) {
var base; var base;
return (base = require.extensions)[ext] != null ? base[ext] : base[ext] = function() { return (base = require.extensions)[ext] != null ? base[ext] : base[ext] = function() {
throw new Error(`Use CoffeeScript.register() or require the coffee-script/register module to require ${ext} files.`); throw new Error(`Use CoffeeScript.register() or require the coffeescript/register module to require ${ext} files.`);
}; };
}; };
for (i = 0, len = ref.length; i < len; i++) { for (i = 0, len = ref.length; i < len; i++) {

View file

@ -11,7 +11,7 @@
optparse = require('./optparse'); optparse = require('./optparse');
CoffeeScript = require('./coffee-script'); CoffeeScript = require('./coffeescript');
ref = require('child_process'), spawn = ref.spawn, exec = ref.exec; ref = require('child_process'), spawn = ref.spawn, exec = ref.exec;
@ -35,7 +35,7 @@
BANNER = 'Usage: coffee [options] path/to/script.coffee -- [args]\n\nIf called without options, `coffee` will run your script.'; BANNER = 'Usage: coffee [options] path/to/script.coffee -- [args]\n\nIf called without options, `coffee` will run your script.';
SWITCHES = [['-b', '--bare', 'compile without a top-level function wrapper'], ['-c', '--compile', 'compile to JavaScript and save as .js files'], ['-e', '--eval', 'pass a string from the command line as input'], ['-h', '--help', 'display this help message'], ['-i', '--interactive', 'run an interactive CoffeeScript REPL'], ['-j', '--join [FILE]', 'concatenate the source CoffeeScript before compiling'], ['-m', '--map', 'generate source map and save as .js.map files'], ['-M', '--inline-map', 'generate source map and include it directly in output'], ['-n', '--nodes', 'print out the parse tree that the parser produces'], ['--nodejs [ARGS]', 'pass options directly to the "node" binary'], ['--no-header', 'suppress the "Generated by" header'], ['-o', '--output [DIR]', 'set the output directory for compiled JavaScript'], ['-p', '--print', 'print out the compiled JavaScript'], ['-r', '--require [MODULE*]', 'require the given module before eval or REPL'], ['-s', '--stdio', 'listen for and compile scripts over stdio'], ['-l', '--literate', 'treat stdio as literate style coffee-script'], ['-t', '--tokens', 'print out the tokens that the lexer/rewriter produce'], ['-v', '--version', 'display the version number'], ['-w', '--watch', 'watch scripts for changes and rerun commands']]; SWITCHES = [['-b', '--bare', 'compile without a top-level function wrapper'], ['-c', '--compile', 'compile to JavaScript and save as .js files'], ['-e', '--eval', 'pass a string from the command line as input'], ['-h', '--help', 'display this help message'], ['-i', '--interactive', 'run an interactive CoffeeScript REPL'], ['-j', '--join [FILE]', 'concatenate the source CoffeeScript before compiling'], ['-m', '--map', 'generate source map and save as .js.map files'], ['-M', '--inline-map', 'generate source map and include it directly in output'], ['-n', '--nodes', 'print out the parse tree that the parser produces'], ['--nodejs [ARGS]', 'pass options directly to the "node" binary'], ['--no-header', 'suppress the "Generated by" header'], ['-o', '--output [DIR]', 'set the output directory for compiled JavaScript'], ['-p', '--print', 'print out the compiled JavaScript'], ['-r', '--require [MODULE*]', 'require the given module before eval or REPL'], ['-s', '--stdio', 'listen for and compile scripts over stdio'], ['-l', '--literate', 'treat stdio as literate style coffeescript'], ['-t', '--tokens', 'print out the tokens that the lexer/rewriter produce'], ['-v', '--version', 'display the version number'], ['-w', '--watch', 'watch scripts for changes and rerun commands']];
opts = {}; opts = {};

View file

@ -2,7 +2,7 @@
(function() { (function() {
var key, ref, val; var key, ref, val;
ref = require('./coffee-script'); ref = require('./coffeescript');
for (key in ref) { for (key in ref) {
val = ref[key]; val = ref[key];
exports[key] = val; exports[key] = val;

View file

@ -2,7 +2,7 @@
(function() { (function() {
var CoffeeScript, Module, binary, child_process, ext, findExtension, fork, helpers, i, len, loadFile, path, ref; var CoffeeScript, Module, binary, child_process, ext, findExtension, fork, helpers, i, len, loadFile, path, ref;
CoffeeScript = require('./coffee-script'); CoffeeScript = require('./coffeescript');
child_process = require('child_process'); child_process = require('child_process');

View file

@ -10,7 +10,7 @@
nodeREPL = require('repl'); nodeREPL = require('repl');
CoffeeScript = require('./coffee-script'); CoffeeScript = require('./coffeescript');
ref = require('./helpers'), merge = ref.merge, updateSyntaxError = ref.updateSyntaxError; ref = require('./helpers'), merge = ref.merge, updateSyntaxError = ref.updateSyntaxError;

View file

@ -1,5 +1,5 @@
{ {
"name": "coffee-script", "name": "coffeescript",
"description": "Unfancy JavaScript", "description": "Unfancy JavaScript",
"keywords": [ "keywords": [
"javascript", "javascript",
@ -14,9 +14,9 @@
"node": ">=7.2.1" "node": ">=7.2.1"
}, },
"directories": { "directories": {
"lib": "./lib/coffee-script" "lib": "./lib/coffeescript"
}, },
"main": "./lib/coffee-script/coffee-script", "main": "./lib/coffeescript/coffeescript",
"bin": { "bin": {
"coffee": "./bin/coffee", "coffee": "./bin/coffee",
"cake": "./bin/cake" "cake": "./bin/cake"

View file

@ -1 +1 @@
require('./lib/coffee-script/register'); require('./lib/coffeescript/register');

View file

@ -1 +1 @@
module.exports = require('./lib/coffee-script/repl'); module.exports = require('./lib/coffeescript/repl');

View file

@ -3,7 +3,7 @@
# We add support for loading remote Coffee scripts via **XHR**, and # We add support for loading remote Coffee scripts via **XHR**, and
# `text/coffeescript` script tags, source maps via data-URLs, and so on. # `text/coffeescript` script tags, source maps via data-URLs, and so on.
CoffeeScript = require './coffee-script' CoffeeScript = require './coffeescript'
CoffeeScript.require = require CoffeeScript.require = require
compile = CoffeeScript.compile compile = CoffeeScript.compile

View file

@ -11,7 +11,7 @@ fs = require 'fs'
path = require 'path' path = require 'path'
helpers = require './helpers' helpers = require './helpers'
optparse = require './optparse' optparse = require './optparse'
CoffeeScript = require './coffee-script' CoffeeScript = require './coffeescript'
# Register .coffee extension # Register .coffee extension
CoffeeScript.register() CoffeeScript.register()

View file

@ -11,7 +11,7 @@ path = require 'path'
helpers = require './helpers' helpers = require './helpers'
SourceMap = require './sourcemap' SourceMap = require './sourcemap'
# Require `package.json`, which is two levels above this file, as this file is # Require `package.json`, which is two levels above this file, as this file is
# evaluated from `lib/coffee-script`. # evaluated from `lib/coffeescript`.
packageJson = require '../../package.json' packageJson = require '../../package.json'
# The current CoffeeScript version number. # The current CoffeeScript version number.
@ -230,7 +230,7 @@ if require.extensions
for ext in @FILE_EXTENSIONS then do (ext) -> for ext in @FILE_EXTENSIONS then do (ext) ->
require.extensions[ext] ?= -> require.extensions[ext] ?= ->
throw new Error """ throw new Error """
Use CoffeeScript.register() or require the coffee-script/register module to require #{ext} files. Use CoffeeScript.register() or require the coffeescript/register module to require #{ext} files.
""" """
exports._compileFile = (filename, sourceMap = no, inlineMap = no) -> exports._compileFile = (filename, sourceMap = no, inlineMap = no) ->

View file

@ -9,7 +9,7 @@ fs = require 'fs'
path = require 'path' path = require 'path'
helpers = require './helpers' helpers = require './helpers'
optparse = require './optparse' optparse = require './optparse'
CoffeeScript = require './coffee-script' CoffeeScript = require './coffeescript'
{spawn, exec} = require 'child_process' {spawn, exec} = require 'child_process'
{EventEmitter} = require 'events' {EventEmitter} = require 'events'
@ -47,7 +47,7 @@ SWITCHES = [
['-p', '--print', 'print out the compiled JavaScript'] ['-p', '--print', 'print out the compiled JavaScript']
['-r', '--require [MODULE*]', 'require the given module before eval or REPL'] ['-r', '--require [MODULE*]', 'require the given module before eval or REPL']
['-s', '--stdio', 'listen for and compile scripts over stdio'] ['-s', '--stdio', 'listen for and compile scripts over stdio']
['-l', '--literate', 'treat stdio as literate style coffee-script'] ['-l', '--literate', 'treat stdio as literate style coffeescript']
['-t', '--tokens', 'print out the tokens that the lexer/rewriter produce'] ['-t', '--tokens', 'print out the tokens that the lexer/rewriter produce']
['-v', '--version', 'display the version number'] ['-v', '--version', 'display the version number']
['-w', '--watch', 'watch scripts for changes and rerun commands'] ['-w', '--watch', 'watch scripts for changes and rerun commands']

View file

@ -1,2 +1,2 @@
# Loader for CoffeeScript as a Node.js library. # Loader for CoffeeScript as a Node.js library.
exports[key] = val for key, val of require './coffee-script' exports[key] = val for key, val of require './coffeescript'

View file

@ -7,7 +7,7 @@
# #
# where locationData is {first_line, first_column, last_line, last_column}, which is a # where locationData is {first_line, first_column, last_line, last_column}, which is a
# format that can be fed directly into [Jison](http://github.com/zaach/jison). These # format that can be fed directly into [Jison](http://github.com/zaach/jison). These
# are read by jison in the `parser.lexer` function defined in coffee-script.coffee. # are read by jison in the `parser.lexer` function defined in coffeescript.coffee.
{Rewriter, INVERSES} = require './rewriter' {Rewriter, INVERSES} = require './rewriter'

View file

@ -1,4 +1,4 @@
CoffeeScript = require './coffee-script' CoffeeScript = require './coffeescript'
child_process = require 'child_process' child_process = require 'child_process'
helpers = require './helpers' helpers = require './helpers'
path = require 'path' path = require 'path'

View file

@ -2,7 +2,7 @@ fs = require 'fs'
path = require 'path' path = require 'path'
vm = require 'vm' vm = require 'vm'
nodeREPL = require 'repl' nodeREPL = require 'repl'
CoffeeScript = require './coffee-script' CoffeeScript = require './coffeescript'
{merge, updateSyntaxError} = require './helpers' {merge, updateSyntaxError} = require './helpers'
replDefaults = replDefaults =

View file

@ -5,7 +5,7 @@
# Ensure that the OptionParser handles arguments correctly. # Ensure that the OptionParser handles arguments correctly.
return unless require? return unless require?
{OptionParser} = require './../lib/coffee-script/optparse' {OptionParser} = require './../lib/coffeescript/optparse'
opt = new OptionParser [ opt = new OptionParser [
['-r', '--required [DIR]', 'desc required'] ['-r', '--required [DIR]', 'desc required']