working 'Try CoffeeScript' in the docs

This commit is contained in:
Jeremy Ashkenas
2010-02-13 16:23:03 -05:00
parent a90bf75395
commit 844c756940
5 changed files with 90 additions and 7 deletions

View File

@@ -1,5 +1,6 @@
(function(){
var compiler, lexer, parser, path;
// Set up for both the browser and the server.
if ((typeof process !== "undefined" && process !== null)) {
process.mixin(require('./nodes'));
path = require('path');
@@ -31,6 +32,10 @@
return this.pos;
}
};
// Improved error messages.
parser.parseError = function parseError(message, hash) {
throw new Error('Unexpected ' + hash.token + ' on line ' + hash.line);
};
exports.VERSION = '0.5.0';
// Compile CoffeeScript to JavaScript, using the Coffee/Jison compiler.
exports.compile = function compile(code, options) {