Mercurial Hosting > luan
comparison core/src/luan/modules/Io.luan @ 694:b620b8e1010f
remove Luan.load() allow_expression param and add Luan.eval()
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Wed, 20 Apr 2016 20:56:08 -0600 |
parents | ca169567ce07 |
children | d0280c7fdc3a |
comparison
equal
deleted
inserted
replaced
693:ca169567ce07 | 694:b620b8e1010f |
---|---|
157 end | 157 end |
158 local env = {} | 158 local env = {} |
159 for line in console do | 159 for line in console do |
160 try { | 160 try { |
161 function() | 161 function() |
162 local fn = load(line,"stdin",env,true) | 162 local fn |
163 try { | |
164 function() | |
165 fn = load("return "..line,"stdin",env) | |
166 end | |
167 catch = function(e) | |
168 fn = load(line,"stdin",env) | |
169 end | |
170 } | |
163 M.print( fn() ) | 171 M.print( fn() ) |
164 end; | 172 end |
165 catch = function(e) | 173 catch = function(e) |
166 M.print(e) | 174 M.print(e) |
167 end; | 175 end |
168 } | 176 } |
169 end | 177 end |
170 end | 178 end |
171 | 179 |
172 | 180 |