Mercurial Hosting > luan
comparison src/luan/tools/web_run.luan @ 156:925ba2d59b9d
fix String java calls;
improve web_run.luan;
git-svn-id: https://luan-java.googlecode.com/svn/trunk@157 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Wed, 18 Jun 2014 08:16:50 +0000 |
parents | 3b384dc5ca91 |
children | 1de3e4a6e82d |
comparison
equal
deleted
inserted
replaced
155:db7b3902e01c | 156:925ba2d59b9d |
---|---|
15 i = i + 1 | 15 i = i + 1 |
16 end | 16 end |
17 end | 17 end |
18 | 18 |
19 function page() | 19 function page() |
20 Http.response.set_content_type "text/plain" | |
21 Io.stdout = Http.response.text_writer() | 20 Io.stdout = Http.response.text_writer() |
22 local code = Http.request.get_parameter "code" | 21 local code = Http.request.get_parameter "code" |
22 local env = { | |
23 write = Io.stdout.write; | |
24 request = Http.request; | |
25 response = Http.response; | |
26 } | |
23 try | 27 try |
24 local fn = load(code,"<web_run>") | 28 local fn = load(code,"<web_run>",env) |
25 fn() | 29 fn() |
26 catch e do | 30 catch e do |
27 print(e) | 31 print(e) |
28 print() | 32 print() |
29 print() | 33 print() |