diff --git a/.gitignore b/.gitignore index f79bd9ae..4ed75b7f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ raw presentation test.coffee +test.litcoffee parser.output test/fixtures/underscore test/*.js diff --git a/Cakefile b/Cakefile index 45c7018c..6ce48a80 100644 --- a/Cakefile +++ b/Cakefile @@ -68,7 +68,7 @@ task 'install', 'install CoffeeScript into /usr/local (or --prefix)', (options) task 'build', 'build the CoffeeScript language from source', build = (cb) -> files = fs.readdirSync 'src' - files = ('src/' + file for file in files when file.match(/\.coffee$/)) + files = ('src/' + file for file in files when file.match(/\.(lit)?coffee$/)) run ['-c', '-o', 'lib/coffee-script'].concat(files), cb @@ -119,8 +119,7 @@ task 'build:browser', 'rebuild the merged script for inclusion in the browser', }(this)); """ unless process.env.MINIFY is 'false' - {parser, uglify} = require 'uglify-js' - code = uglify.gen_code uglify.ast_squeeze uglify.ast_mangle parser.parse code + {code} = require('uglify-js').minify code, fromString: true fs.writeFileSync 'extras/coffee-script.js', header + '\n' + code console.log "built ... running browser tests:" invoke 'test:browser' @@ -227,11 +226,12 @@ runTests = (CoffeeScript) -> # Run every test in the `test` folder, recording failures. files = fs.readdirSync 'test' - for file in files when file.match /\.coffee$/i + for file in files when file.match /\.(lit)?coffee$/i + literate = path.extname(file) is '.litcoffee' currentFile = filename = path.join 'test', file code = fs.readFileSync filename try - CoffeeScript.run code.toString(), {filename} + CoffeeScript.run code.toString(), {filename, literate} catch error failures.push {filename, error} return !failures.length diff --git a/documentation/index.html.erb b/documentation/index.html.erb index 901a6fff..3caa4ff8 100644 --- a/documentation/index.html.erb +++ b/documentation/index.html.erb @@ -127,8 +127,8 @@ The golden rule of CoffeeScript is: "It's just JavaScript". 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 and pretty-printed, passes through + seamlessly from CoffeeScript (and vice-versa). The compiled output is + readable and pretty-printed, passes through JavaScript Lint without warnings, will work in every JavaScript runtime, and tends to run as fast or faster than the equivalent handwritten JavaScript. @@ -176,7 +176,7 @@ npm install -g coffee-script
(Leave off the -g if you don't wish to install globally.)
- +If you'd prefer to install the latest master version of CoffeeScript, you can clone the CoffeeScript @@ -190,7 +190,7 @@ npm install -g coffee-script npm install -g http://github.com/jashkenas/coffee-script/tarball/master
- Or, if you want to install to /usr/local, and don't want to use + Or, if you want to install to /usr/local, and don't want to use npm to manage it, open the coffee-script directory and run:
@@ -288,7 +288,7 @@ sudo bin/cake install-b, --bare
--nodejs
- The best list of + The best list of open-source CoffeeScript examples can be found on GitHub. But just to throw out few more:
@@ -1115,7 +1116,7 @@ Expressions Change Log - +1.4.0 @@ -1123,7 +1124,7 @@ Expressions
1.3.3
@@ -1146,7 +1147,7 @@ Expressions
1.3.1 @@ -1173,26 +1174,26 @@ Expressions
1.2.0 @@ -1242,7 +1243,7 @@ Expressions
- +
1.1.3
@@ -1254,7 +1255,7 @@ Expressions
out and keep it readable, as you can see in the examples on this page.