X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.scl.compiler%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Ftypes%2FTypes.java;h=9ea064cfd11bf4abf4094a900a53d9951dc24878;hp=b20ee9f121ba4890be21b58e53540de72b4a1a6a;hb=fad36d463b75c3a9944d875fc627c3533f6da74d;hpb=3448b94a8e90047c88eb62a0542c1596acb701b8 diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/types/Types.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/types/Types.java index b20ee9f12..9ea064cfd 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/types/Types.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/types/Types.java @@ -112,6 +112,9 @@ public class Types { public static final TCon PROC = con(BUILTIN, "Proc"); public static final TCon BRANCH_POINT = con(BUILTIN, "BranchPoint"); + + public static final TCon CHRContext = con(BUILTIN, "CHRContext"); + private volatile static TCon[] tupleCache = new TCon[] { UNIT, null @@ -128,7 +131,7 @@ public class Types { } }; - + public static boolean isPrimitive(Type type) { return type == BOOLEAN || type == BYTE || type == CHARACTER || type == SHORT || type == INTEGER || type == LONG || type == FLOAT || type == DOUBLE || type == STRING; @@ -1015,6 +1018,15 @@ public class Types { return result; } + public static TPred[] replace(TPred[] types, TVar[] from, Type[] to) { + if(types.length == 0) + return TPred.EMPTY_ARRAY; + TPred[] result = new TPred[types.length]; + for(int i=0;i Type[] replace(Type[] types, THashMap map) { if(types.length == 0) return Type.EMPTY_ARRAY;