Skip to content

Commit 2459cc9

Browse files
committed
fix injector
1 parent 7b138c6 commit 2459cc9

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

key.core/src/main/java/de/uka/ilkd/key/scripts/meta/ValueInjector.java

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import java.util.*;
77
import java.util.stream.Collectors;
8+
import java.util.stream.Stream;
89

910
import de.uka.ilkd.key.scripts.ProofScriptCommand;
1011
import de.uka.ilkd.key.scripts.ScriptCommandAst;
@@ -169,10 +170,18 @@ private void injectIntoField(ProofScriptArgument meta, ScriptCommandAst args, Ob
169170
if (meta.isFlag()) {
170171
val = args.namedArgs().get(meta.getName());
171172
if (val == null) {
172-
// can also be given w/o colon or equal sign.
173-
// command hide;
174-
val = args.positionalArgs().stream()
175-
.anyMatch(it -> it.toString().equals(meta.getName()));
173+
// can also be given w/o colon or equal sign, e.g.,
174+
// "command hide;"
175+
var stringStream = args.positionalArgs().stream()
176+
.map(it -> {
177+
try {
178+
return convert(it, String.class);
179+
} catch (NoSpecifiedConverterException | ConversionException e) {
180+
return "";
181+
}
182+
});
183+
// val == true iff the name of the flag appear as a positional argument.
184+
val = stringStream.anyMatch(it -> Objects.equals(it, meta.getName()));
176185
}
177186
}
178187

key.ui/build.gradle

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,13 @@ tasks.register('runWithProfiler', JavaExec) {
9090
}
9191
}
9292

93+
tasks.register('runInExperimentalMode', JavaExec) {
94+
group = "application"
95+
classpath = sourceSets.main.runtimeClasspath
96+
mainClass.set("de.uka.ilkd.key.core.Main")
97+
args("--experimental")
98+
}
99+
93100
/**
94101
* Go and scan all registered README.txt files for files that need to be
95102
* included into examples.zip. Thus only those files that can actually be

0 commit comments

Comments
 (0)