throw context.getRuntime().newSystemStackError("stack level too deep", soe);
}
}
private Object run(String fileinfo, int line, Object scriptUnit) {
EvalUnit unit = null;
if (scriptUnit instanceof String) {
unit = container.parse(scriptUnit.toString(), line);
} else if (scriptUnit instanceof Reader) {
unit = container.parse((Reader)scriptUnit, fileinfo, line);
} else if (scriptUnit instanceof InputStream) {
unit = container.parse((InputStream)scriptUnit, fileinfo, line);
} else if (scriptUnit instanceof PathType) {
unit = container.parse((PathType)scriptUnit, fileinfo, line);
}
if (unit == null) {
return null;
}
IRubyObject ret = unit.run();
return JavaEmbedUtils.rubyToJava(ret);
}