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/31 15:28:38 UTC

[1/4] git commit: [flex-falcon] [refs/heads/develop] - array's child nodes weren't being handled

Repository: flex-falcon
Updated Branches:
  refs/heads/develop 1144b7b8d -> c1a72014c


array's child nodes weren't being handled


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

Branch: refs/heads/develop
Commit: f7bde9918028af019badab4f2e926480cafc75bb
Parents: 27576a3
Author: Alex Harui <ah...@apache.org>
Authored: Thu Oct 30 21:34:39 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Thu Oct 30 21:36:35 2014 -0700

----------------------------------------------------------------------
 .../org/apache/flex/compiler/internal/tree/mxml/MXMLArrayNode.java  | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/f7bde991/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 54732fc..0f37598 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
@@ -167,6 +167,7 @@ class MXMLArrayNode extends MXMLInstanceNode implements IMXMLArrayNode
                         builder, childTag.getShortName(), this);
                 instanceNode.setClassReference(project, childTag.getShortName());
                 instanceNode.initializeFromTag(builder, childTag);
+                info.addChildNode(instanceNode);
             }
             else
             {


[2/4] git commit: [flex-falcon] [refs/heads/develop] - interfaces are sealed

Posted by ah...@apache.org.
interfaces are sealed


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

Branch: refs/heads/develop
Commit: 27576a3bab35054e74a50ed3288c8a890bd7ef17
Parents: 1144b7b
Author: Alex Harui <ah...@apache.org>
Authored: Thu Oct 30 21:32:09 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Thu Oct 30 21:36:35 2014 -0700

----------------------------------------------------------------------
 .../internal/as/codegen/InterfaceDirectiveProcessor.java        | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/27576a3b/compiler/src/org/apache/flex/compiler/internal/as/codegen/InterfaceDirectiveProcessor.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/as/codegen/InterfaceDirectiveProcessor.java b/compiler/src/org/apache/flex/compiler/internal/as/codegen/InterfaceDirectiveProcessor.java
index 59c379b..b8be0ac 100644
--- a/compiler/src/org/apache/flex/compiler/internal/as/codegen/InterfaceDirectiveProcessor.java
+++ b/compiler/src/org/apache/flex/compiler/internal/as/codegen/InterfaceDirectiveProcessor.java
@@ -226,6 +226,11 @@ public class InterfaceDirectiveProcessor extends DirectiveProcessor
             }
         }
         
+        // Set the flags corresponding to 'final' and 'dynamic'.
+        if (interfDef.isFinal())
+            iinfo.flags |= ABCConstants.CLASS_FLAG_final;
+        if (!interfDef.isDynamic())
+            iinfo.flags |= ABCConstants.CLASS_FLAG_sealed;
         iinfo.flags |= ABCConstants.CLASS_FLAG_interface;
         
         this.cv = emitter.visitClass(iinfo, cinfo);


[4/4] git commit: [flex-falcon] [refs/heads/develop] - handle bad source code

Posted by ah...@apache.org.
handle bad source code


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

Branch: refs/heads/develop
Commit: c1a72014cc5b1118d04c70fa0636b4fa6442e783
Parents: 1240394
Author: Alex Harui <ah...@apache.org>
Authored: Thu Oct 30 21:35:47 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Thu Oct 30 21:36:36 2014 -0700

----------------------------------------------------------------------
 .../internal/mxml/MXMLTagAttributeData.java         | 16 +++++++++++++++-
 .../internal/tree/mxml/MXMLInstanceNode.java        |  2 ++
 2 files changed, 17 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c1a72014/compiler/src/org/apache/flex/compiler/internal/mxml/MXMLTagAttributeData.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/mxml/MXMLTagAttributeData.java b/compiler/src/org/apache/flex/compiler/internal/mxml/MXMLTagAttributeData.java
index 4b2c4ad..5e04336 100644
--- a/compiler/src/org/apache/flex/compiler/internal/mxml/MXMLTagAttributeData.java
+++ b/compiler/src/org/apache/flex/compiler/internal/mxml/MXMLTagAttributeData.java
@@ -75,6 +75,8 @@ public class MXMLTagAttributeData extends SourceLocation implements IMXMLTagAttr
 
             if (token.getType() != MXMLTokenTypes.TOKEN_EQUALS)
             {
+                if (token.getSourcePath() == null)
+                    token.setSourcePath(spec.getPath());
                 problems.add(new SyntaxProblem(token));
                 // Restore the token position for error recovery.
                 tokenIterator.previous();
@@ -86,6 +88,8 @@ public class MXMLTagAttributeData extends SourceLocation implements IMXMLTagAttr
             valueColumn = token.getColumn();
         }
 
+        Boolean firstToken = true;
+        
         // Look for value token.
         while (tokenIterator.hasNext())
         {
@@ -96,7 +100,13 @@ public class MXMLTagAttributeData extends SourceLocation implements IMXMLTagAttr
             }
             else
             {
-                if (!MXMLToken.isTagEnd(token.getType()) && token.getType() != MXMLTokenTypes.TOKEN_NAME)
+                if (firstToken)
+                {
+                    if (token.getSourcePath() == null)
+                        token.setSourcePath(spec.getPath());
+                    problems.add(new SyntaxProblem(token));
+                }
+                else if (!MXMLToken.isTagEnd(token.getType()) && token.getType() != MXMLTokenTypes.TOKEN_NAME)
                 {
                     if (token.getSourcePath() == null)
                         token.setSourcePath(spec.getPath());
@@ -106,6 +116,7 @@ public class MXMLTagAttributeData extends SourceLocation implements IMXMLTagAttr
                 tokenIterator.previous();
                 return;
             }
+            firstToken = false;
         }
     }
 
@@ -283,6 +294,9 @@ public class MXMLTagAttributeData extends SourceLocation implements IMXMLTagAttr
     public ISourceFragment[] getValueFragments(Collection<ICompilerProblem> problems)
     {
         String value = getRawValue();
+        if (value == null)
+            return new ISourceFragment[0];
+        
         ISourceLocation location = getValueLocation();
         MXMLDialect mxmlDialect = getMXMLDialect();
 

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c1a72014/compiler/src/org/apache/flex/compiler/internal/tree/mxml/MXMLInstanceNode.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/tree/mxml/MXMLInstanceNode.java b/compiler/src/org/apache/flex/compiler/internal/tree/mxml/MXMLInstanceNode.java
index 13852cf..ee5ed4a 100644
--- a/compiler/src/org/apache/flex/compiler/internal/tree/mxml/MXMLInstanceNode.java
+++ b/compiler/src/org/apache/flex/compiler/internal/tree/mxml/MXMLInstanceNode.java
@@ -193,6 +193,8 @@ class MXMLInstanceNode extends MXMLClassReferenceNodeBase implements IMXMLInstan
                                       IMXMLTagAttributeData attribute)
     {
         String value = attribute.getRawValue();
+        if (value == null)
+            value = "";
 
         // Falcon trims this attribute even though the old compiler didn't.
         MXMLDialect mxmlDialect = builder.getMXMLDialect();


[3/4] git commit: [flex-falcon] [refs/heads/develop] - fix state output to share instances between addItems in different states but same stategroup

Posted by ah...@apache.org.
fix state output to share instances between addItems in different states but same stategroup


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

Branch: refs/heads/develop
Commit: 12403948376afe4a12b360707133723a4b2355c2
Parents: f7bde99
Author: Alex Harui <ah...@apache.org>
Authored: Thu Oct 30 21:35:21 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Thu Oct 30 21:36:36 2014 -0700

----------------------------------------------------------------------
 .../as/codegen/MXMLClassDirectiveProcessor.java | 43 +++++++++++++++++---
 1 file changed, 37 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/12403948/compiler/src/org/apache/flex/compiler/internal/as/codegen/MXMLClassDirectiveProcessor.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/as/codegen/MXMLClassDirectiveProcessor.java b/compiler/src/org/apache/flex/compiler/internal/as/codegen/MXMLClassDirectiveProcessor.java
index 50fe14a..5064326 100644
--- a/compiler/src/org/apache/flex/compiler/internal/as/codegen/MXMLClassDirectiveProcessor.java
+++ b/compiler/src/org/apache/flex/compiler/internal/as/codegen/MXMLClassDirectiveProcessor.java
@@ -339,6 +339,7 @@ public class MXMLClassDirectiveProcessor extends ClassDirectiveProcessor
     private static Name NAME_MXML_DESCRIPTOR = createMXMLPrivateName("mxmldd");
     private static Name NAME_MXML_DESCRIPTOR_GETTER = new Name("MXMLDescriptor");
     private static Name NAME_MXML_PROPERTIES = createMXMLPrivateName("mxmldp");
+    private static Name NAME_MXML_STATE_DESCRIPTOR = new Name("mxmlsd");
     private static Name NAME_GENERATE_CSSSTYLEDECLARATIONS = new Name("generateCSSStyleDeclarations");
 
     /**
@@ -617,6 +618,7 @@ public class MXMLClassDirectiveProcessor extends ClassDirectiveProcessor
     protected Map<IMXMLNode, Integer> nodeToIndexMap;
     
     protected Map<IMXMLNode, InstructionList> nodeToInstanceDescriptorMap;
+    protected Map<Integer, IMXMLNode> indexToNodeMap;
     
     /**
      * This method is called by the {@code GlobalDirectiveProcessor}
@@ -659,6 +661,7 @@ public class MXMLClassDirectiveProcessor extends ClassDirectiveProcessor
         {
             addVariableTrait(NAME_MXML_DESCRIPTOR, IMXMLTypeConstants.NAME_ARRAY);
             addVariableTrait(NAME_MXML_PROPERTIES, IMXMLTypeConstants.NAME_ARRAY);
+            addVariableTrait(NAME_MXML_STATE_DESCRIPTOR, IMXMLTypeConstants.NAME_ARRAY);
         }
         
         // Set the document for the class.
@@ -753,9 +756,13 @@ public class MXMLClassDirectiveProcessor extends ClassDirectiveProcessor
                 // Generate a map that tell for each state dependent instance node, what slot
                 // it corresponds to in the array of 
                 // deferredInstanceFromFunction's
-                if (nodeToIndexMap==null)      
+                if (nodeToIndexMap==null)
+                {
                     nodeToIndexMap = new HashMap<IMXMLNode, Integer>();
+                    indexToNodeMap = new HashMap<Integer, IMXMLNode>();
+                }
                 nodeToIndexMap.put(node, instanceNodeCounter);
+                indexToNodeMap.put(instanceNodeCounter, node);
                 ++instanceNodeCounter;  
                 
                 InstructionList il;
@@ -1225,6 +1232,22 @@ public class MXMLClassDirectiveProcessor extends ClassDirectiveProcessor
             // call the Binding helper to get all the data binding setup code
             addBindingCodeForCtor(ctor_insns);
 
+            // if we have state dependent instance nodes add descriptors for them
+            if (indexToNodeMap!=null && indexToNodeMap.size() > 0)
+            {
+                ctor_insns.addInstruction(OP_getlocal0);           
+                int numNodes = indexToNodeMap.size();
+                for (int i = 0; i < numNodes; i++)
+                {
+                    IMXMLNode node = indexToNodeMap.get(Integer.valueOf(i));
+                    InstructionList il = nodeToInstanceDescriptorMap.get(node);
+                    ctor_insns.addAll(il);
+                }
+                ctor_insns.addInstruction(OP_newarray, numNodes);           
+                
+                ctor_insns.addInstruction(OP_setproperty, NAME_MXML_STATE_DESCRIPTOR);
+            }
+
             // add call to MXMLAttributes
             if (getProject().getTargetSettings().getMxmlChildrenAsData() && numElements > 0)
             {
@@ -3627,7 +3650,17 @@ public class MXMLClassDirectiveProcessor extends ClassDirectiveProcessor
                 if (!isDataboundProp(propertyNode))
                 {
                     IDefinition propDef = propertyNode.getDefinition();
-                    if (propDef.isPublic())
+                    if (propDef == null && propertyNode.getParent() instanceof IMXMLObjectNode)
+                    {
+                        context.startUsing(IL.PROPERTIES);
+                        
+                        context.addInstruction(OP_pushstring, propertyName);
+                        
+                        traverse(propertyNode, context);
+                        
+                        context.stopUsing(IL.PROPERTIES, 1);                        
+                    }
+                    else if (propDef.isPublic())
                     {
                         context.startUsing(IL.PROPERTIES);
                         
@@ -4607,11 +4640,9 @@ public class MXMLClassDirectiveProcessor extends ClassDirectiveProcessor
         if (getProject().getTargetSettings().getMxmlChildrenAsData())
         {
             
-            addItemsIL.addInstruction(OP_pushstring, "itemsDescriptor");
+            addItemsIL.addInstruction(OP_pushstring, "itemsDescriptorIndex");
             addItemsIL.addInstruction(OP_pushtrue);  // the value is an array of descriptor data that will be parsed later
-            InstructionList il = nodeToInstanceDescriptorMap.get(instanceNode);
-            InstructionList ilCopy = (InstructionList)il.clone();
-            addItemsIL.addAll(ilCopy);
+            addItemsIL.pushNumericConstant(index);     // stack: ..., addItems, addItems, instanceFuncs[], index
             addItemsCounter++;
         }
         else