Commit | Line | Data |
---|---|---|
9d42904e JM |
1 | #!/usr/bin/env lua |
2 | ||
3 | local readline = require('readline') | |
4 | ||
5 | function READ(str) | |
6 | return str | |
7 | end | |
8 | ||
9 | function EVAL(ast, any) | |
10 | return ast | |
11 | end | |
12 | ||
13 | function PRINT(exp) | |
14 | return exp | |
15 | end | |
16 | ||
17 | function rep(str) | |
18 | return PRINT(EVAL(READ(str),"")) | |
19 | end | |
20 | ||
10b07148 JM |
21 | if #arg > 0 and arg[1] == "--raw" then |
22 | readline.raw = true | |
23 | end | |
24 | ||
9d42904e JM |
25 | while true do |
26 | line = readline.readline("user> ") | |
27 | if not line then break end | |
28 | print(rep(line)) | |
29 | end |