]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/contexts/TranslationContext.java
Fixed a bug related to the extent of variable frames (see test case)
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / elaboration / contexts / TranslationContext.java
index b71c0ad276e69937fbde4d6be0969954b3dd151d..535cc8c8b6cc1f17311945523447bc2f01c2da3b 100644 (file)
@@ -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;
                 }