1
1
mirror of https://github.com/kanaka/mal.git synced 2024-11-13 01:43:50 +03:00
mal/livescript/step1_read_print.ls
2017-05-10 17:57:31 +02:00

19 lines
411 B
Plaintext

readline = require './node_readline'
{id} = require 'prelude-ls'
{read_str, OnlyComment} = require './reader'
{pr_str} = require './printer'
EVAL = id
rep = (line) -> pr_str EVAL read_str line
loop
line = readline.readline 'user> '
break if not line? or line == ''
try
console.log rep line
catch {message}: ex
if ex not instanceof OnlyComment
console.log message