Fix unescaping in matlab, miniMAL and rpython.
[jackhill/mal.git] / vimscript / step1_read_print.vim
1 source readline.vim
2 source types.vim
3 source reader.vim
4 source printer.vim
5
6 function READ(str)
7 return ReadStr(a:str)
8 endfunction
9
10 function EVAL(ast, env)
11 return a:ast
12 endfunction
13
14 function PRINT(exp)
15 return PrStr(a:exp, 1)
16 endfunction
17
18 function REP(str)
19 return PRINT(EVAL(READ(a:str), {}))
20 endfunction
21
22 while 1
23 let [eof, line] = Readline("user> ")
24 if eof
25 break
26 endif
27 if line == ""
28 continue
29 endif
30 try
31 call PrintLn(REP(line))
32 catch
33 call PrintLn("Error: " . v:exception)
34 endtry
35 endwhile
36 qall!