flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [14/24] git commit: [flex-falcon] [refs/heads/JsToAs] - handle conditional compilation in method bodies
Date Tue, 22 Sep 2015 17:34:52 GMT
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/b8a026ee
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/b8a026ee
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/b8a026ee

Branch: refs/heads/JsToAs
Commit: b8a026ee005b57b8a29cc2e2e3a4dcb7f9093cfc
Parents: 9085281
Author: Alex Harui <aharui@apache.org>
Authored: Thu Sep 17 12:14:16 2015 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Tue Sep 22 10:35:15 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/b8a026ee/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/b8a026ee/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:


Mime
View raw message