
org.snapscript.tree.constraint.SetConstraint Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of snap Show documentation
Show all versions of snap Show documentation
Dynamic scripting for the JVM
package org.snapscript.tree.constraint;
import java.util.Set;
import org.snapscript.core.Context;
import org.snapscript.core.Evaluation;
import org.snapscript.core.Module;
import org.snapscript.core.Scope;
import org.snapscript.core.Type;
import org.snapscript.core.TypeLoader;
import org.snapscript.core.Value;
import org.snapscript.parse.StringToken;
public class SetConstraint extends Evaluation {
private final StringToken token;
public SetConstraint(StringToken token) {
this.token = token;
}
@Override
public Value evaluate(Scope scope, Object left) throws Exception {
Module module = scope.getModule();
Context context = module.getContext();
TypeLoader loader = context.getLoader();
Type type = loader.loadType(Set.class);
return Value.getTransient(type);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy