import org.simantics.scl.compiler.types.TVar;
import org.simantics.scl.compiler.types.Type;
import org.simantics.scl.compiler.types.Types;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public final class SSAFunction extends SSAClosure {
+ private static final Logger LOGGER = LoggerFactory.getLogger(SSAFunction.class);
+
TVar[] typeParameters;
Type effect;
SSABlock firstBlock;
import org.simantics.scl.compiler.internal.codegen.ssa.SSAFunction;
import org.simantics.scl.compiler.internal.codegen.ssa.SSAStatement;
import org.simantics.scl.compiler.internal.codegen.ssa.binders.BoundVarBinder;
+import org.simantics.scl.compiler.internal.codegen.ssa.binders.ClosureBinder;
import org.simantics.scl.compiler.internal.codegen.ssa.binders.ValRefBinder;
import org.simantics.scl.compiler.internal.codegen.ssa.exits.Jump;
import org.simantics.scl.compiler.internal.codegen.ssa.exits.Switch;
import org.simantics.scl.compiler.types.Types;
import org.simantics.scl.compiler.types.exceptions.MatchException;
import org.simantics.scl.compiler.types.util.MultiFunction;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class LetApply extends LetStatement implements ValRefBinder {
+ private static final Logger LOGGER = LoggerFactory.getLogger(LetApply.class);
+
private ValRef function;
private ValRef[] parameters;
Type effect;
SSABlock headBlock = getParent();
SSAFunction thisFunction = headBlock.getParent();
- if(thisFunction == function)
- return;
+ {
+ SSAFunction curParent=thisFunction;
+ while(true) {
+ if(curParent == function)
+ return;
+ ClosureBinder binder = curParent.getParent();
+ if(binder == null)
+ break;
+ curParent = binder.getParentFunction();
+ }
+ }
/*System.out.println("--- INLINING -------------------------------");
System.out.println(thisFunction);
import org.simantics.scl.compiler.environment.Environment;
import org.simantics.scl.compiler.internal.codegen.ssa.SSAModule;
import org.simantics.scl.compiler.top.SCLCompilerConfiguration;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class SSASimplificationContext {
+ private static final Logger LOGGER = LoggerFactory.getLogger(SSASimplificationContext.class);
+
SSAModule module;
Environment environment;
boolean modified = false;
@Test public void IndentationAndParenthesis() { test(); }
@Test public void Index() { test(); }
@Test public void Inline1() { test(); }
+ @Test public void InlineBug() { test(); }
@Test public void InstanceHierarchy() { test(); }
@Test public void InstanceIsTypoedAsClass() { test(); }
@Test public void InvalidClass1() { test(); }
--- /dev/null
+import "Prelude"
+import "Vector"
+import "File"
+
+@private
+copyDir2 :: File -> <Proc> ()
+copyDir2 sourceDir = iter copyDir $ vectorToList $ listFiles sourceDir
+
+@private
+copyDir :: File -> File -> <Proc> ()
+copyDir sourceDir targetDir = do
+ makeDirs targetDir
+ files = vectorToList $ listFiles sourceDir
+ iter (\sourceFile -> do
+ targetFile = childFile targetDir $ nameOfFile sourceFile
+ if isDirectory sourceFile then
+ copyDir sourceFile targetFile
+ else
+ copyFile sourceFile targetFile
+ ) files
+ ()
+
+main = "OK"
+----
+OK