flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [05/15] git commit: [flex-falcon] [refs/heads/develop] - fix separation of multiple interfaces in MXML and auto-import base class in MXML (FLEX-33669)
Date Mon, 26 Aug 2013 21:31:01 GMT
fix separation of multiple interfaces in MXML and auto-import base class in MXML (FLEX-33669)


Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/a867837d
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/a867837d
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/a867837d

Branch: refs/heads/develop
Commit: a867837db74a6f2447b156523cb7cec26efd76a4
Parents: 9e9b924
Author: Alex Harui <aharui@apache.org>
Authored: Thu Aug 15 21:29:58 2013 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Thu Aug 15 21:29:58 2013 -0700

----------------------------------------------------------------------
 .../internal/parsing/mxml/MXMLScopeBuilder.java        | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/a867837d/compiler/src/org/apache/flex/compiler/internal/parsing/mxml/MXMLScopeBuilder.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/parsing/mxml/MXMLScopeBuilder.java
b/compiler/src/org/apache/flex/compiler/internal/parsing/mxml/MXMLScopeBuilder.java
index 7687710..f12db2c 100644
--- a/compiler/src/org/apache/flex/compiler/internal/parsing/mxml/MXMLScopeBuilder.java
+++ b/compiler/src/org/apache/flex/compiler/internal/parsing/mxml/MXMLScopeBuilder.java
@@ -32,10 +32,12 @@ import org.apache.commons.io.IOUtils;
 
 import org.apache.flex.compiler.common.IFileSpecificationGetter;
 import org.apache.flex.compiler.common.Multiname;
+import org.apache.flex.compiler.definitions.IDefinition;
 import org.apache.flex.compiler.definitions.INamespaceDefinition;
 import org.apache.flex.compiler.definitions.metadata.IMetaTag;
 import org.apache.flex.compiler.definitions.references.INamespaceReference;
 import org.apache.flex.compiler.definitions.references.IReference;
+import org.apache.flex.compiler.definitions.references.IResolvedQualifiersReference;
 import org.apache.flex.compiler.definitions.references.ReferenceFactory;
 import org.apache.flex.compiler.filespecs.IFileSpecification;
 import org.apache.flex.compiler.internal.definitions.ClassDefinition;
@@ -81,7 +83,7 @@ import static org.apache.flex.compiler.mxml.IMXMLLanguageConstants.*;
 public class MXMLScopeBuilder
 {
     // RegEx for splitting implements="a.b.c , d.e.f"
-    private static final String IMPLEMENTS_SPLITTER = "\\s\\,\\s";
+    private static final String IMPLEMENTS_SPLITTER = ",";
 
     public MXMLScopeBuilder(MXMLCompilationUnit compilationUnit, IFileSpecificationGetter
fileSpecGetter, IMXMLData mxmlData, String qname, String fileName)
     {
@@ -185,7 +187,7 @@ public class MXMLScopeBuilder
             implementedInterfaces = new IReference[interfaces.length];
             for( int i = 0; i < interfaces.length; ++i )
             {
-                implementedInterfaces[i] = ReferenceFactory.packageQualifiedReference(project.getWorkspace(),
interfaces[i]);
+                implementedInterfaces[i] = ReferenceFactory.packageQualifiedReference(project.getWorkspace(),
interfaces[i].trim());
             }
         }
 
@@ -204,6 +206,13 @@ public class MXMLScopeBuilder
 
         currentClassScope = new TypeScope(packageScope, currentClassDefinition);
         currentClassScope.setContainingDefinition(currentClassDefinition);
+
+        if (baseClass instanceof IResolvedQualifiersReference)
+        {
+            IDefinition baseDef = ((IResolvedQualifiersReference)baseClass).resolve(project);
+            currentClassScope.addImport(baseDef.getQualifiedName());           
+        }
+
         currentClassDefinition.setContainedScope(currentClassScope);
         currentClassDefinition.setupThisAndSuper();
         


Mime
View raw message