You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2014/10/02 00:36:57 UTC

[5/5] git commit: [flex-falcon] [refs/heads/develop] - handle fxArray and other things like it

handle fxArray and other things like it


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

Branch: refs/heads/develop
Commit: 70a6c2f0acdb81cb01adb002472c453582aa34c5
Parents: 736e33c
Author: Alex Harui <ah...@apache.org>
Authored: Wed Oct 1 15:26:07 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Wed Oct 1 15:26:07 2014 -0700

----------------------------------------------------------------------
 .../internal/tree/mxml/MXMLArrayNode.java       | 23 +++++++++++++++-----
 .../tree/mxml/MXMLDeclarationsNode.java         |  7 ++++++
 .../tree/mxml/MXMLPropertySpecifierNode.java    | 12 ++++++++--
 3 files changed, 34 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/70a6c2f0/compiler/src/org/apache/flex/compiler/internal/tree/mxml/MXMLArrayNode.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/tree/mxml/MXMLArrayNode.java b/compiler/src/org/apache/flex/compiler/internal/tree/mxml/MXMLArrayNode.java
index c412df4..b0e630d 100644
--- a/compiler/src/org/apache/flex/compiler/internal/tree/mxml/MXMLArrayNode.java
+++ b/compiler/src/org/apache/flex/compiler/internal/tree/mxml/MXMLArrayNode.java
@@ -36,6 +36,7 @@ import org.apache.flex.compiler.internal.parsing.ISourceFragment;
 import org.apache.flex.compiler.internal.parsing.SourceFragmentsReader;
 import org.apache.flex.compiler.internal.projects.FlexProject;
 import org.apache.flex.compiler.internal.tree.as.NodeBase;
+import org.apache.flex.compiler.mxml.IMXMLLanguageConstants;
 import org.apache.flex.compiler.mxml.IMXMLTagData;
 import org.apache.flex.compiler.mxml.IMXMLTextData;
 import org.apache.flex.compiler.mxml.IMXMLUnitData;
@@ -136,12 +137,6 @@ class MXMLArrayNode extends MXMLInstanceNode implements IMXMLArrayNode
         FlexProject project = builder.getProject();
 
         String tagName = builder.getFileScope().resolveTagToQualifiedName(childTag);
-        if (tagName == null)
-        {
-            builder.addProblem(new MXMLUnresolvedTagProblem(childTag));
-            return;
-        }
-
         IDefinition definition = project.getScope().findDefinitionByName(tagName);
         if (definition instanceof ClassDefinition)
         {
@@ -163,6 +158,18 @@ class MXMLArrayNode extends MXMLInstanceNode implements IMXMLArrayNode
                 }
             }
         }
+        else if (childTag.getURI().equals(IMXMLLanguageConstants.NAMESPACE_MXML_2009))
+        {
+            MXMLInstanceNode instanceNode = MXMLInstanceNode.createInstanceNode(
+                    builder, childTag.getShortName(), this);
+            instanceNode.setClassReference(project, childTag.getShortName());
+            instanceNode.initializeFromTag(builder, childTag);
+        }
+        else
+        {
+            builder.addProblem(new MXMLUnresolvedTagProblem(childTag));
+            return;
+        }
     }
 
     @Override
@@ -250,6 +257,10 @@ class MXMLArrayNode extends MXMLInstanceNode implements IMXMLArrayNode
                         childNode.initializeFromTag(builder, tag);
                         children.add(childNode);
                     }
+                    else
+                    {
+                        builder.getProblems().add(new MXMLUnresolvedTagProblem(tag));
+                    }
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/70a6c2f0/compiler/src/org/apache/flex/compiler/internal/tree/mxml/MXMLDeclarationsNode.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/tree/mxml/MXMLDeclarationsNode.java b/compiler/src/org/apache/flex/compiler/internal/tree/mxml/MXMLDeclarationsNode.java
index 89d1f37..9397caf 100644
--- a/compiler/src/org/apache/flex/compiler/internal/tree/mxml/MXMLDeclarationsNode.java
+++ b/compiler/src/org/apache/flex/compiler/internal/tree/mxml/MXMLDeclarationsNode.java
@@ -87,6 +87,13 @@ class MXMLDeclarationsNode extends MXMLNodeBase implements IMXMLDeclarationsNode
                 instanceNode.initializeFromTag(builder, childTag);
                 info.addChildNode(instanceNode);
             }
+            else if (childTag.getURI().equals(IMXMLLanguageConstants.NAMESPACE_MXML_2009))
+            {
+                MXMLInstanceNode instanceNode = MXMLInstanceNode.createInstanceNode(
+                        builder, childTag.getShortName(), this);
+                instanceNode.setClassReference(project, childTag.getShortName());
+                instanceNode.initializeFromTag(builder, childTag);
+            }
             else
             {
                 super.processChildTag(builder, tag, childTag, info);

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/70a6c2f0/compiler/src/org/apache/flex/compiler/internal/tree/mxml/MXMLPropertySpecifierNode.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/tree/mxml/MXMLPropertySpecifierNode.java b/compiler/src/org/apache/flex/compiler/internal/tree/mxml/MXMLPropertySpecifierNode.java
index b0d7913..d58cc4f 100644
--- a/compiler/src/org/apache/flex/compiler/internal/tree/mxml/MXMLPropertySpecifierNode.java
+++ b/compiler/src/org/apache/flex/compiler/internal/tree/mxml/MXMLPropertySpecifierNode.java
@@ -37,6 +37,7 @@ import org.apache.flex.compiler.internal.projects.FlexProject;
 import org.apache.flex.compiler.internal.scopes.ASScope;
 import org.apache.flex.compiler.internal.scopes.MXMLFileScope;
 import org.apache.flex.compiler.internal.tree.as.NodeBase;
+import org.apache.flex.compiler.mxml.IMXMLLanguageConstants;
 import org.apache.flex.compiler.mxml.IMXMLTagAttributeData;
 import org.apache.flex.compiler.mxml.IMXMLTagData;
 import org.apache.flex.compiler.mxml.IMXMLTextData;
@@ -451,6 +452,13 @@ class MXMLPropertySpecifierNode extends MXMLSpecifierNodeBase implements IMXMLPr
                     instanceNode.setClassReference(project, (ClassDefinition)definition); // TODO Move this logic to initializeFromTag().
                     instanceNode.initializeFromTag(builder, childTag);
                 }
+                else if (childTag.getURI().equals(IMXMLLanguageConstants.NAMESPACE_MXML_2009))
+                {
+                    instanceNode = MXMLInstanceNode.createInstanceNode(
+                            builder, childTag.getShortName(), this);
+                    instanceNode.setClassReference(project, childTag.getShortName());
+                    instanceNode.initializeFromTag(builder, childTag);
+                }
                 else
                 {
                     ICompilerProblem problem = new MXMLUnresolvedTagProblem(childTag);
@@ -495,8 +503,8 @@ class MXMLPropertySpecifierNode extends MXMLSpecifierNodeBase implements IMXMLPr
         IDefinition definition = getDefinition();
         if (definition != null && definition.getTypeAsDisplayString().equals(IASLanguageConstants.Array))
         {
-            if (instanceNode == null ||
-                !instanceNode.getClassReference(project).getQualifiedName().equals(IASLanguageConstants.Array))
+            if (instanceNode == null || ((!(instanceNode instanceof MXMLArrayNode)) &&
+                !instanceNode.getClassReference(project).getQualifiedName().equals(IASLanguageConstants.Array)))
             {
                 instanceNode = new MXMLArrayNode(this);
                 instanceNode.setClassReference(project, IASLanguageConstants.Array); // TODO Move to MXMLArrayNode