Skip to content

Commit 54f2eee

Browse files
committed
Fix last dynsem test.
1 parent c770dc4 commit 54f2eee

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

org.metaborg.spoofax.shell.core/src/main/java/org/metaborg/spoofax/shell/core/DynSemEvaluationStrategy.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import org.spoofax.interpreter.terms.IStrategoConstructor;
2424
import org.spoofax.interpreter.terms.IStrategoTerm;
2525
import org.spoofax.interpreter.terms.ITermFactory;
26-
import org.spoofax.jsglr.client.imploder.ImploderAttachment;
2726
import org.spoofax.terms.StrategoString;
2827
import org.spoofax.terms.TermFactory;
2928

@@ -176,7 +175,7 @@ private void initializeExecutionEnvironment()
176175
ITermFactory termFactory = termFactService.getGeneric();
177176
IStrategoConstructor termConstr = termFactory.makeConstructor("ShellInit", 0);
178177
IStrategoAppl shellInitAppl = termFactory.makeAppl(termConstr);
179-
ImploderAttachment.putImploderAttachment(shellInitAppl, false, "ShellInit", null, null);
178+
StrategoUtil.setSortForTerm(shellInitAppl, "ShellInit");
180179
Value shellInitRule = polyglotEngine.findGlobalSymbol(RuleRegistry
181180
.makeKey("init", termConstr.getName(), termConstr.getArity()));
182181
try {

org.metaborg.spoofax.shell.core/src/main/java/org/metaborg/spoofax/shell/util/StrategoUtil.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,16 @@
33
import javax.annotation.Nullable;
44

55
import org.spoofax.interpreter.terms.IStrategoTerm;
6+
import org.spoofax.jsglr.client.imploder.IToken;
67
import org.spoofax.jsglr.client.imploder.ImploderAttachment;
8+
import org.spoofax.jsglr.client.imploder.Token;
79

810
/**
911
* Contains utility functions for dealing with {@link IStrategoTerm}s.
1012
*/
1113
public final class StrategoUtil {
14+
private static final Token BOGUS_TOKEN = new Token(null, 0, 0, 0, 0, 0,
15+
IToken.TK_NO_TOKEN_KIND);
1216

1317
/* private due to checkstyle. */
1418
private StrategoUtil() {
@@ -22,7 +26,7 @@ private StrategoUtil() {
2226
*/
2327
public static void setSortForTerm(IStrategoTerm term, String sort) {
2428
ImploderAttachment.putImploderAttachment(term, false,
25-
sort, null, null);
29+
sort, BOGUS_TOKEN, BOGUS_TOKEN);
2630
}
2731

2832
/**

0 commit comments

Comments
 (0)