Exemplo n.º 1
0
 @Override
 public CompiledScript compile(Reader script) throws ScriptException {
   try {
     InputStream is = new Utf8Encoder(script);
     try {
       final Globals g = context.globals;
       final LuaFunction f = g.load(script, "script").checkfunction();
       return new LuajCompiledScript(f, g);
     } catch (LuaError lee) {
       throw new ScriptException(lee.getMessage());
     } finally {
       is.close();
     }
   } catch (Exception e) {
     throw new ScriptException("eval threw " + e.toString());
   }
 }