package org.metaborg.meta.lang.dynsem.interpreter.nodes.rules;

import org.metaborg.meta.lang.dynsem.interpreter.DynSemLanguage;
import org.metaborg.meta.lang.dynsem.interpreter.nodes.DynSemRootNode;

import com.oracle.truffle.api.frame.FrameDescriptor;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.source.SourceSection;

public abstract class Rule extends DynSemRootNode {

	private final DynSemLanguage lang;

	public Rule(DynSemLanguage lang, SourceSection source, FrameDescriptor fd) {
		super(lang, source, fd);
		this.lang = lang;
	}

	public Rule(DynSemLanguage lang, SourceSection source) {
		this(lang, source, null);
	}

	protected DynSemLanguage language() {
		return lang;
	}

	@Override
	public abstract RuleResult execute(VirtualFrame frame);

	@Override
	public boolean isCloningAllowed() {
		return false;
	}

	@Override
	protected boolean isCloneUninitializedSupported() {
		return false;
	}

	@Override
	protected abstract Rule cloneUninitialized();

	public Rule makeUninitializedClone() {
		return cloneUninitialized();
	}
}

@@ -835,36 +835,35 @@
 ed() %7B%0A%09%09return 
-fals
+tru
 e;%0A%09%7D%0A%0A%09@Overrid
@@ -930,12 +930,11 @@
 urn 
-fals
+tru
 e;%0A%09

Revert "Temporarily disallow rule cloning (for benchmarks)"