Mercurial Hosting > luan
diff core/src/luan/modules/Debug.luan @ 326:db37d6aee4db
remove try-catch statement;
add Luan.try() and Luan.pcall();
git-svn-id: https://luan-java.googlecode.com/svn/trunk@327 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Thu, 19 Mar 2015 00:01:57 +0000 |
parents | f8ece87df2b1 |
children | 92c3d22745b8 |
line wrap: on
line diff
--- a/core/src/luan/modules/Debug.luan Tue Mar 03 06:00:59 2015 +0000 +++ b/core/src/luan/modules/Debug.luan Thu Mar 19 00:01:57 2015 +0000 @@ -1,5 +1,6 @@ local Luan = require "luan:Luan" local load = Luan.load +local try = Luan.try local Io = require "luan:Io" local print = Io.print local Table = require "luan:Table" @@ -18,12 +19,15 @@ end local env = {} for line in console do - try - local fn = load(line,"stdin",env,true) - print_if_something( fn() ) - catch e do - print(e) - end + try { + function() + local fn = load(line,"stdin",env,true) + print_if_something( fn() ) + end; + catch = function(e) + print(e) + end; + } end end