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 2015/09/17 22:58:14 UTC

[1/2] git commit: [flex-falcon] [refs/heads/develop] - handle conditional compilation in method bodies

Repository: flex-falcon
Updated Branches:
  refs/heads/develop 0cbb5ae00 -> 41b211628


handle conditional compilation in method bodies


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

Branch: refs/heads/develop
Commit: 4b448f59182819e279d2a495c9a4d13379bb55bc
Parents: 0cbb5ae
Author: Alex Harui <ah...@apache.org>
Authored: Thu Sep 17 12:14:16 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Thu Sep 17 12:14:16 2015 -0700

----------------------------------------------------------------------
 .../org/apache/flex/compiler/internal/codegen/as/ASEmitter.java | 1 +
 .../apache/flex/compiler/internal/visitor/as/ASNodeSwitch.java  | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/4b448f59/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASEmitter.java b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASEmitter.java
index fa743c2..5150917 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASEmitter.java
@@ -820,6 +820,7 @@ public class ASEmitter implements IASEmitter, IEmitter
         getWalker().walk(node);
         // XXX (mschmalle) this should be in the after handler?
         if (node.getParent().getNodeID() != ASTNodeID.LabledStatementID
+        		&& node.getNodeID() != ASTNodeID.ConfigBlockID
                 && !(node instanceof IStatementNode))
         {
             write(ASEmitterTokens.SEMICOLON);

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/4b448f59/compiler.jx/src/org/apache/flex/compiler/internal/visitor/as/ASNodeSwitch.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/visitor/as/ASNodeSwitch.java b/compiler.jx/src/org/apache/flex/compiler/internal/visitor/as/ASNodeSwitch.java
index cd75f31..d925b6d 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/visitor/as/ASNodeSwitch.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/visitor/as/ASNodeSwitch.java
@@ -21,6 +21,7 @@ package org.apache.flex.compiler.internal.visitor.as;
 
 import org.apache.flex.compiler.internal.tree.as.BinaryOperatorAsNode;
 import org.apache.flex.compiler.internal.tree.as.BinaryOperatorIsNode;
+import org.apache.flex.compiler.internal.tree.as.ConfigConditionBlockNode;
 import org.apache.flex.compiler.internal.tree.as.LabeledStatementNode;
 import org.apache.flex.compiler.internal.tree.as.NamespaceAccessExpressionNode;
 import org.apache.flex.compiler.tree.ASTNodeID;
@@ -115,7 +116,9 @@ public class ASNodeSwitch implements IASNodeStrategy
             return;
 
         case ConfigBlockID:
-            // ToDo (erikdebruin): implement handler
+        	ConfigConditionBlockNode condcomp = (ConfigConditionBlockNode)node;
+        	if (condcomp.getChildCount() > 0) // will be 0 if conditional compile variable is false
+                visitor.visitBlock((IBlockNode) node);
             return;
 
         case E4XFilterID:


[2/2] git commit: [flex-falcon] [refs/heads/develop] - handle externs when filtering output

Posted by ah...@apache.org.
handle externs when filtering output


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

Branch: refs/heads/develop
Commit: 41b2116285599ecb787e96724457767c4955f8b6
Parents: 4b448f5
Author: Alex Harui <ah...@apache.org>
Authored: Thu Sep 17 13:58:46 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Thu Sep 17 13:58:46 2015 -0700

----------------------------------------------------------------------
 .../src/org/apache/flex/compiler/clients/COMPJSC.java        | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/41b21162/compiler.jx/src/org/apache/flex/compiler/clients/COMPJSC.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/clients/COMPJSC.java b/compiler.jx/src/org/apache/flex/compiler/clients/COMPJSC.java
index ea075c6..caf6577 100644
--- a/compiler.jx/src/org/apache/flex/compiler/clients/COMPJSC.java
+++ b/compiler.jx/src/org/apache/flex/compiler/clients/COMPJSC.java
@@ -45,6 +45,7 @@ import org.apache.flex.compiler.internal.driver.mxml.flexjs.MXMLFlexJSSWCBackend
 import org.apache.flex.compiler.internal.driver.mxml.jsc.MXMLJSCJSSWCBackend;
 import org.apache.flex.compiler.internal.driver.mxml.vf2js.MXMLVF2JSSWCBackend;
 import org.apache.flex.compiler.internal.projects.CompilerProject;
+import org.apache.flex.compiler.internal.targets.FlexJSSWCTarget;
 import org.apache.flex.compiler.internal.targets.JSTarget;
 import org.apache.flex.compiler.problems.ICompilerProblem;
 import org.apache.flex.compiler.problems.InternalCompilerProblem;
@@ -198,7 +199,9 @@ public class COMPJSC extends MXMLJSC
 
                 File outputFolder = new File(getOutputFilePath());
 
-                Collection<ICompilationUnit> reachableCompilationUnits = project.getCompilationUnits();
+                Set<String> externs = config.getExterns();
+                Collection<ICompilationUnit> roots = ((FlexJSSWCTarget)target).getReachableCompilationUnits(errors);
+                Collection<ICompilationUnit> reachableCompilationUnits = project.getReachableCompilationUnitsInSWFOrder(roots);
                 for (final ICompilationUnit cu : reachableCompilationUnits)
                 {
                     ICompilationUnit.UnitType cuType = cu.getCompilationUnitType();
@@ -206,6 +209,9 @@ public class COMPJSC extends MXMLJSC
                     if (cuType == ICompilationUnit.UnitType.AS_UNIT
                             || cuType == ICompilationUnit.UnitType.MXML_UNIT)
                     {
+                    	String symbol = cu.getQualifiedNames().get(0);
+                    	if (externs.contains(symbol)) continue;
+                    	
                         final File outputClassFile = getOutputClassFile(
                                 cu.getQualifiedNames().get(0), outputFolder);