Sha256: c5291daf05791e59271b7029284a9f15172f7cbc76d040a6b214da92ea63d433

Contents?: true

Size: 848 Bytes

Versions: 4

Compression:

Stored size: 848 Bytes

Contents

(function(){
  var coffee, prompt, quit, readline;
  // A CoffeeScript port/version of the Node.js REPL.
  // Required modules.
  coffee = require('coffee-script');
  // Shortcut variables.
  prompt = 'coffee> ';
  quit = function quit() {
    return process.exit(0);
  };
  // The main REPL function. Called everytime a line of code is entered.
  // Attempt to evaluate the command. If there's an exception, print it.
  readline = function readline(code) {
    var val;
    try {
      val = eval(coffee.compile(code, {
        no_wrap: true,
        globals: true
      }));
      if (val !== undefined) {
        p(val);
      }
    } catch (err) {
      puts(err.stack || err.toString());
    }
    return print(prompt);
  };
  // Start up the REPL.
  process.stdio.addListener('data', readline);
  process.stdio.open();
  print(prompt);
})();

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
haml-more-0.5.1 vendor/coffee-script/lib/repl.js
haml-more-0.5.0 vendor/coffee-script/lib/repl.js
haml-more-0.4.0 vendor/coffee-script/lib/repl.js
haml-more-0.4.0.d vendor/coffee-script/lib/repl.js