anonl / nvlist

@@ -23,8 +23,10 @@
Loading
23 23
import nl.weeaboo.io.StreamUtil;
24 24
import nl.weeaboo.lua2.LuaException;
25 25
import nl.weeaboo.lua2.LuaRunState;
26 +
import nl.weeaboo.lua2.compiler.ScriptLoader;
26 27
import nl.weeaboo.lua2.lib.ILuaResourceFinder;
27 28
import nl.weeaboo.lua2.lib.LuaResource;
29 +
import nl.weeaboo.lua2.vm.Varargs;
28 30
import nl.weeaboo.vn.core.IEnvironment;
29 31
import nl.weeaboo.vn.core.MediaType;
30 32
import nl.weeaboo.vn.core.NovelPrefs;
@@ -35,6 +37,8 @@
Loading
35 37
import nl.weeaboo.vn.impl.script.lvn.LvnParseException;
36 38
import nl.weeaboo.vn.impl.script.lvn.LvnParserFactory;
37 39
import nl.weeaboo.vn.script.IScriptLoader;
40 +
import nl.weeaboo.vn.script.IScriptThread;
41 +
import nl.weeaboo.vn.script.ScriptException;
38 42
import nl.weeaboo.vn.stats.ISeenLogHolder;
39 43
40 44
/**
@@ -182,6 +186,18 @@
Loading
182 186
        };
183 187
    }
184 188
189 +
    @Override
190 +
    public void loadScript(IScriptThread thread, FilePath filename) throws ScriptException {
191 +
        ILuaScriptThread luaThread = (ILuaScriptThread)thread;
192 +
193 +
        Varargs loadResult = ScriptLoader.loadFile(filename.toString());
194 +
        if (!loadResult.arg1().isclosure()) {
195 +
            throw new ScriptException("Error loading script, " + filename + ": " + loadResult.arg(2));
196 +
        }
197 +
198 +
        luaThread.call(loadResult.checkclosure(1));
199 +
    }
200 +
185 201
    private static class LuaScriptResourceLoader extends ResourceLoader {
186 202
187 203
        private static final long serialVersionUID = 1L;
Files Complexity Coverage
api/src/main/java/nl/weeaboo/vn 91.53% 96.76%
buildtools/src/main/java/nl/weeaboo/vn/buildtools 81.13% 87.46%
core/src/main/java/nl/weeaboo/vn 83.34% 87.78%
desktop/src/main/java/nl/weeaboo/vn/desktop 75.71% 82.24%
Project Totals (384 files) 83.67% 88.24%
1
codecov:
2
  status:
3
    project: yes
4
    patch: no
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading