diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs index 7ec1b20e..4e8aa177 100644 --- a/.settings/org.eclipse.core.resources.prefs +++ b/.settings/org.eclipse.core.resources.prefs @@ -1,5 +1,7 @@ eclipse.preferences.version=1 encoding//src/org/rascalmpl/core/library=UTF-8 +encoding//target/generated-test-resources=UTF-8 +encoding//target/generated-test-sources=UTF-8 encoding/=UTF-8 encoding/src=UTF-8 encoding/test=UTF-8 diff --git a/src/org/rascalmpl/core/library/CompileTestSources.rsc b/src/org/rascalmpl/core/library/CompileTestSources.rsc index 04066aa4..0191cb9d 100644 --- a/src/org/rascalmpl/core/library/CompileTestSources.rsc +++ b/src/org/rascalmpl/core/library/CompileTestSources.rsc @@ -9,7 +9,6 @@ import IO; import String; import Set; import List; -import Map; import util::Reflective; import lang::rascalcore::compile::Compile; import util::FileSystem; diff --git a/src/org/rascalmpl/core/library/lang/rascalcore/compile/Examples/Tst5.rsc b/src/org/rascalmpl/core/library/lang/rascalcore/compile/Examples/Tst5.rsc index 6f58adc7..076bf75f 100644 --- a/src/org/rascalmpl/core/library/lang/rascalcore/compile/Examples/Tst5.rsc +++ b/src/org/rascalmpl/core/library/lang/rascalcore/compile/Examples/Tst5.rsc @@ -1,14 +1,43 @@ module lang::rascalcore::compile::Examples::Tst5 -&T <: num makeSmallerThan(&T <: num n) { - &T <: num res; - if (int i := n) { - res = i; - return res; +value main(){ + if (int j := 1 || int j := 2) { + return j; } - return n; + return -1; } + + +//&T avoidEmpty(list[&T] l) { return 1; } +//&T avoidEmpty(list[&T] _) { throw "this should happen"; } +// +//test bool voidReturnIsNotAllowed() { +// try { +// avoidEmpty([]); +// return false; +// } catch "this should happen": +// return true; +//} + +//data Wrapper[&SAME] = something(&SAME wrapped); +// +//@synopsis{it matters for testing that '&SAME' is the same name as in the definition of Wrapper} +//&XXXSAME getIt(Wrapper[&XXXSAME] x) = x.wrapped; +// +//value main() { //test bool hygienicGenericADT() { +// // in the same context, we bind the same type parameter in +// // different ways to see if nothing is leaking. +// int i = something(1).wrapped; +// int j = getIt(something(2)); +// int k = getIt(something(3)); +// str x = something("x").wrapped; +// str y = getIt(something("y")); +// +// return i == 1 && j == 2 && k == 3 +// && x == "x" && y == "y"; +//} + //import List; // //value main(){ diff --git a/src/org/rascalmpl/core/library/lang/rascalcore/compile/Rascal2muRascal/RascalPattern.rsc b/src/org/rascalmpl/core/library/lang/rascalcore/compile/Rascal2muRascal/RascalPattern.rsc index 94f227a9..1f4a341e 100644 --- a/src/org/rascalmpl/core/library/lang/rascalcore/compile/Rascal2muRascal/RascalPattern.rsc +++ b/src/org/rascalmpl/core/library/lang/rascalcore/compile/Rascal2muRascal/RascalPattern.rsc @@ -353,7 +353,7 @@ tuple[MuExp exp, list[MuExp] vars] processRegExpLiteral(e: (RegExpLiteral) `/ 0){ fragmentCode += muCon(fragment); } - if(all(frag <- fragmentCode, muCon(_) := frag)){ + if(all(MuExp frag <- fragmentCode, muCon(_) := frag)){ buildRegExp = muCon(intercalate("", [s | muCon(str s) <- fragmentCode])); return ; } else {