Sha256: 221e982f32f58e2aed03fd9bfaf459b1f8757128cbe70c524dc82e0633398171

Contents?: true

Size: 600 Bytes

Versions: 7

Compression:

Stored size: 600 Bytes

Contents

# A CoffeeScript port/version of the Node.js REPL.

# Required modules.
coffee: require 'coffee-script'

# Shortcut variables.
prompt: 'coffee> '
quit:   -> 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: (code) ->
  try
    val: eval coffee.compile code, {no_wrap: true, globals: true}
    p val if val isnt undefined
  catch err
    puts err.stack or err.toString()
  print prompt

# Start up the REPL.
process.stdio.addListener 'data', readline
process.stdio.open()
print prompt

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
haml-more-0.5.1 vendor/coffee-script/src/repl.coffee
haml-more-0.5.0 vendor/coffee-script/src/repl.coffee
haml-more-0.4.0 vendor/coffee-script/src/repl.coffee
haml-more-0.4.0.d vendor/coffee-script/src/repl.coffee
haml-more-0.4.0.c vendor/coffee-script/src/repl.coffee
haml-more-0.4.0.b vendor/coffee-script/src/repl.coffee
haml-more-0.4.0.a vendor/coffee-script/src/repl.coffee