mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
beginnings of a build script
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
option_parser = null;
|
||||
// The CommandLine handles all of the functionality of the `coffee` utility.
|
||||
exports.run = function run() {
|
||||
var flags, separator;
|
||||
parse_options();
|
||||
if (options.interactive) {
|
||||
return require('./repl');
|
||||
@@ -25,6 +26,13 @@
|
||||
if (!(sources.length)) {
|
||||
usage();
|
||||
}
|
||||
separator = sources.indexOf('--');
|
||||
flags = [];
|
||||
if (separator >= 0) {
|
||||
flags = sources.slice((separator + 1), sources.length);
|
||||
sources = sources.slice(0, separator);
|
||||
}
|
||||
process.ARGV = flags;
|
||||
compile_scripts();
|
||||
return this;
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
(function(){
|
||||
var Parser, _1, _2, _3, _4, _5, _6, bnf, fs, grammar, js, name, non_terminal, o, operators, option, parser, parser_path, part, tokens, unwrap;
|
||||
var Parser, _1, _2, _3, _4, _5, _6, bnf, grammar, name, non_terminal, o, operators, option, part, tokens, unwrap;
|
||||
var __hasProp = Object.prototype.hasOwnProperty;
|
||||
Parser = require('jison').Parser;
|
||||
// DSL ===================================================================
|
||||
@@ -544,7 +544,7 @@
|
||||
}).call(this);
|
||||
}
|
||||
tokens = tokens.join(" ");
|
||||
parser = new Parser({
|
||||
exports.parser = new Parser({
|
||||
tokens: tokens,
|
||||
bnf: bnf,
|
||||
operators: operators.reverse(),
|
||||
@@ -552,12 +552,4 @@
|
||||
}, {
|
||||
debug: false
|
||||
});
|
||||
js = parser.generate();
|
||||
// Save the parser to a file.
|
||||
// puts parser.generate()
|
||||
fs = require('fs');
|
||||
parser_path = 'lib/coffee_script/parser.js';
|
||||
fs.open(parser_path, process.O_CREAT | process.O_WRONLY | process.O_TRUNC, parseInt('0755', 8)).addCallback(function(fd) {
|
||||
return fs.write(fd, js);
|
||||
});
|
||||
})();
|
||||
Reference in New Issue
Block a user