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%2Felaboration%2Fcontexts%2FTranslationContext.java;h=757aca8b5e272880e7c6526048f1b20837709f82;hp=b71c0ad276e69937fbde4d6be0969954b3dd151d;hb=e12e3ad357853a07b24923b341c4732962a94623;hpb=f238db98a6075e59973c5c391a1946eb7972c7a5 diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/contexts/TranslationContext.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/contexts/TranslationContext.java index b71c0ad27..757aca8b5 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/contexts/TranslationContext.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/contexts/TranslationContext.java @@ -119,7 +119,7 @@ public class TranslationContext extends TypeTranslationContext implements Enviro public static boolean isConstructorName(String name) { int p = name.lastIndexOf('.'); char firstChar = name.charAt(p<0 ? 0 : p+1); - return Character.isUpperCase(firstChar); + return Character.isUpperCase(firstChar) || firstChar == '('; } /* Tries to resolve name as a local variable. It is assumed @@ -201,7 +201,7 @@ public class TranslationContext extends TypeTranslationContext implements Enviro if(deprecatedDescription != null) errorLog.logWarning(location, "Deprecated value " + value.getName().name + "." + (deprecatedDescription.isEmpty() ? "" : " " + deprecatedDescription)); if(moduleDebugInfo != null) - moduleDebugInfo.symbolReferences.add(new SymbolReference(value.getName(), definitionName, location)); + moduleDebugInfo.symbolReferences.add(new SymbolReference(value.getName(), Name.create(compilationContext.module.getName(), definitionName), location)); return new EConstant(location, value); } catch (AmbiguousNameException e) { if(SCLCompilerConfiguration.ALLOW_OVERLOADING) @@ -229,7 +229,7 @@ public class TranslationContext extends TypeTranslationContext implements Enviro EConstant expression = new EConstant(altValue); expression.location = location; if(moduleDebugInfo != null) - moduleDebugInfo.symbolReferences.add(new SymbolReference(altValue.getName(), definitionName, location)); + moduleDebugInfo.symbolReferences.add(new SymbolReference(altValue.getName(), Name.create(compilationContext.module.getName(), definitionName), location)); return expression; } @@ -401,7 +401,7 @@ public class TranslationContext extends TypeTranslationContext implements Enviro chrConstraintFrames.add(chrConstraintEntries.size()); } - public void popCHRConstraintFrame(ArrayList constraints) { + public void popCHRConstraintFrame(CHRRuleset ruleset) { int frame = chrConstraintFrames.removeAt(chrConstraintFrames.size()-1); int i = chrConstraintEntries.size(); while(i > frame) { @@ -413,7 +413,7 @@ public class TranslationContext extends TypeTranslationContext implements Enviro else newConstraint = chrConstraints.put(entry.name, entry.constraint); if(newConstraint.implicitlyDeclared) - constraints.add(newConstraint); + ruleset.addConstraint(newConstraint); } }