Skip to content

Commit 9c9541c

Browse files
committed
Add ScriptService with TODO
We should be using ScriptService to extract script OUTPUTs
1 parent b9ed622 commit 9c9541c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/main/java/org/scijava/plugins/scripting/matlab/MATLABScriptEngine.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
import org.scijava.options.OptionsService;
4747
import org.scijava.plugin.Parameter;
4848
import org.scijava.script.AbstractScriptEngine;
49+
import org.scijava.script.ScriptService;
4950

5051
/**
5152
* A MATLAB interpreter.
@@ -74,6 +75,9 @@ public class MATLABScriptEngine extends AbstractScriptEngine {
7475

7576
private static final String COMMENT = "%";
7677

78+
@Parameter
79+
private ScriptService scriptService;
80+
7781
@Parameter
7882
private OptionsService optionsService;
7983

@@ -111,6 +115,8 @@ public Object eval(final Reader reader) throws ScriptException {
111115
// the newline characters themselves on the comment lines will be
112116
// commented out and ignored - resulting in the first true line of
113117
// code being skipped unintentionally.
118+
// TODO use ScriptService to get OUTPUT names instead of reparsing
119+
// See https://github.com/scijava/scijava-common/issues/176
114120
if (line.matches("^[^\\w]*" + COMMENT + ".*")) {
115121
if (line.contains("OUTPUT")) {
116122
// Store variable names for retrieval later

0 commit comments

Comments
 (0)