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 <[email protected]> Authored: Thu Sep 17 12:14:16 2015 -0700 Committer: Alex Harui <[email protected]> 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:
