2015-08-05 06:20:58 +03:00
|
|
|
import { readline } from './node_readline'
|
2015-07-31 05:15:55 +03:00
|
|
|
|
|
|
|
// read
|
2015-08-05 06:20:58 +03:00
|
|
|
const READ = (str) => str
|
2015-07-31 05:15:55 +03:00
|
|
|
|
|
|
|
// eval
|
2015-08-05 06:20:58 +03:00
|
|
|
const EVAL = (ast, env) => ast
|
2015-07-31 05:15:55 +03:00
|
|
|
|
|
|
|
// print
|
2015-08-05 06:20:58 +03:00
|
|
|
const PRINT = (exp) => exp
|
2015-07-31 05:15:55 +03:00
|
|
|
|
|
|
|
// repl
|
2015-08-05 06:20:58 +03:00
|
|
|
const REP = (str) => PRINT(EVAL(READ(str), {}))
|
2015-07-31 05:15:55 +03:00
|
|
|
|
|
|
|
while (true) {
|
2015-08-05 06:20:58 +03:00
|
|
|
let line = readline('user> ')
|
|
|
|
if (line == null) break
|
2015-07-31 05:15:55 +03:00
|
|
|
if (line) { console.log(REP(line)); }
|
|
|
|
}
|